Download presentation
Presentation is loading. Please wait.
1
Bin Packing Optimization
Rachel Jackson Kirklyn Fields
2
Overview Introduction Algorithms Results Q/A What is bin packing?
Why 380? Applications Algorithms Exhaustive Search First Fit Decreasing Genetic Algorithm Results Q/A Overview
3
Introduction Bin Packing Problem:
Objects of different sizes must be packed into a finite number of containers, or βbinsβ Each bin has a finite volume. Must minimize the number of bins used Computational complexity NP-Hard Problem. Decision problem of deicing if a certain number of bins is optimal, is NP-Complete Two Versions Online: items arrive one at a time Offline: all items are given up front Introduction
4
Problem with lots of applications, that requires us to design our own implementations of common algorithms we will study. Applications: Loading files into memory Job scheduling TV advertisement slots Packing by cost/weight Why 380?
5
Formal Problem Statement
Given a set of bins , B with the same size S, and a list of j items each with sizes π π .. π π to pack inside of those bins, find the minimum number of bins ,K ,such that the sum of items within each bin is <= S. Mixed Integer Programming formulation: Minimize π= π=π π π© π Subject to π=π π π©(π π ) β€πΊ Where K is the sum of bins B, needed to pack j items, subject to the sum of j items must be less than the size of each bin S. Formal Problem Statement
6
Brute Force Brute Force Approach to Combinational Logic
Focused on constraint Satisfaction Selects the Solutions that user asks for Algorithm Take a Set of Items Find all possible combinations Check If each combinations passes the constraint check Pass the solutions to the User
7
Brute Force
8
First Fit Decreasing Greedy Approximation Time complexity O(n log n)
Algorithm: Initially all bins empty beginning with 0 bins Sort items to be packed in to decreasing order. For each item: Attempt to place the item in the first bin that can accommodate the item If no bin is found: Create a new bin First Fit Decreasing uses at most (4M + 1)/3 bins if the optimal is M. First Fit Decreasing
9
First Fit Decreasing Results
Example with bin size = 30 First Fit Decreasing Results First Fit Decreasing Total Bins 10 20 8 28 7 Full 1 6 13 3 16 19 2 21 22 Done 2 Bins
10
First Fit Decreasing Results
11
Hybrid Grouping Genetic Algorithm
Overview Initialize a population of possible solutions (50) using first fit For a specified amount of time(in our case 50 generations): Select two parents Generate offspring through crossover Mutation Grade fitness Hybrid Grouping Genetic Algorithm
12
Hybrid GA (cont) π π = sum of the ith bin
Fitness = π=1 π ( π π π ) π π N = number of bins π π = sum of the ith bin c = capacity of the bin k = 2 (can be any constant greater than1) Should maximize fitness score. Hybrid GA (cont)
13
Crossover Select random parents Clone parents
Hybrid GA (cont) Crossover Select random parents Clone parents Chose two cross over points Swap bins between parents and clones Remove duplicates and add any unused elements from parents into children
14
Hybrid GA (Cont) Mutation - 50% Select bins at random to be destroyed.
This allows for reinsertion of items within those bins
15
GA Results
16
First Fit Decreasing, and Genetic Algorithms are as expected faster than brute force
However they do not always find the optimal solution Many variations of problem that can be applied to many real world situations. Results/ Conclusion
17
Q&A Q:What is the bin packing problem?
A: Given a set of items pack them into the smallest amount of bins possible. Q: Describe the Frist Fit Decreasing Algorithm A: given a set of n items, sort them in decreasing order. Until all items are packed: Attempt to pack each item into the first available bin, if the item will not fit, create a new bin and pack that item. Q: What is the time of complexity of First Fit Decreasing/? A: O(nLogn) Q&A
18
Fin Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.