The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.

Slides:



Advertisements
Similar presentations
Truthful Mechanisms for Combinatorial Auctions with Subadditive Bidders Speaker: Shahar Dobzinski Based on joint works with Noam Nisan & Michael Schapira.
Advertisements

Math for Liberal Studies. There is a list of numbers called weights These numbers represent objects that need to be packed into bins with a particular.
1 Chapter 8 Approximation Algorithms (Part II). 2 Outline Scheduling Independent tasks Bin packing.
NP-Completeness.
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
 Review: The Greedy Method
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Algorithm Design Techniques: Greedy Algorithms. Introduction Algorithm Design Techniques –Design of algorithms –Algorithms commonly used to solve problems.
Greedy Algorithms Greed is good. (Some of the time)
Approximation, Chance and Networks Lecture Notes BISS 2005, Bertinoro March Alessandro Panconesi University La Sapienza of Rome.
Sorting Comparison-based algorithm review –You should know most of the algorithms –We will concentrate on their analyses –Special emphasis: Heapsort Lower.
Combinatorial Algorithms
Dividing a Cake Fairly among n players Thomas Yeo
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Greedy vs Dynamic Programming Approach
Sorting Heapsort Quick review of basic sorting methods Lower bounds for comparison-based methods Non-comparison based sorting.
Parameterized Approximation Scheme for the Multiple Knapsack Problem by Klaus Jansen (SODA’09) Speaker: Yue Wang 04/14/2009.
Polynomial time approximation scheme Lecture 17: Mar 13.
Cache Performance Analysis of Traversals and Random Accesses R. E. Ladner, J. D. Fix, and A. LaMarca Presented by Tomer Shiran.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Approximation Algorithms
A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Ch. 8 & 9 – Linear Sorting and Order Statistics What do you trade for speed?
Bold Stroke January 13, 2003 Advanced Algorithms CS 539/441 OR In Search Of Efficient General Solutions Joe Hoffert
ALGORITHM TYPES Divide and Conquer, Dynamic Programming, Backtracking, and Greedy. Note the general strategy from the examples. The classification is neither.
Round and Approx: A technique for packing problems Nikhil Bansal (IBM Watson) Maxim Sviridenko (IBM Watson) Alberto Caprara (U. Bologna, Italy)
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Spring 2015 Mathematics in Management Science Bin Packing The Problem The Algorithms.
Design Techniques for Approximation Algorithms and Approximation Classes.
© 2009 IBM Corporation 1 Improving Consolidation of Virtual Machines with Risk-aware Bandwidth Oversubscription in Compute Clouds Amir Epstein Joint work.
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Case Studies: Bin Packing.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Packing Rectangles into Bins Nikhil Bansal (CMU) Joint with Maxim Sviridenko (IBM)
Genome Rearrangements [1] Ch Types of Rearrangements Reversal Translocation
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Algorithmics - Lecture 101 LECTURE 10: Greedy technique.
Random Sampling Approximations of E(X), p.m.f, and p.d.f.
On the Approximability of Geometric and Geographic Generalization and the Min- Max Bin Covering Problem Michael T. Goodrich Dept. of Computer Science joint.
A Membrane Algorithm for the Min Storage problem Dipartimento di Informatica, Sistemistica e Comunicazione Università degli Studi di Milano – Bicocca WMC.
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
Linear Sorting. Comparison based sorting Any sorting algorithm which is based on comparing the input elements has a lower bound of Proof, since there.
Bin Packing. 2 Background: Suppose you plan to build a wall system for your books, records, and stereo set in your dorm room. The wall system requires.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
Ch. 4 Memory Mangement Parkinson’s law: “Programs expand to fill the memory available to hold them.”
Approximating Set Cover
8.3.2 Constant Distance Approximations
Approximation Algorithms
Algorithm Design Methods
Chart Packing Heuristic
Presented by Po-Chuan & Chen-Chen 2016/03/08
Objective of This Course
Coverage Approximation Algorithms
PTAS for Bin-Packing.
Polynomial time approximation scheme
Approximation Algorithms
ICS 353: Design and Analysis of Algorithms
Algorithm Design Methods
CENG 351 Data Management and File Structures
Quicksort and Randomized Algs
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Approximation Algorithm
Algorithm Design Methods
Presentation transcript:

The bin packing problem

For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects can be packed into bins. or find a minimum set partition such that the sum of objects in every set is less than 1. Can we partition n objects into two sets such the sum of objects in one set is equal to that of objects in another set?

The First Fit Strategy Place the next object in the list S into the first bin which has not been completely filled into which it will fit. When bins are filled completely they are closed and if an object will not fit into any currently open bin, a new bin is opened. The First Fit Decreasing Strategy First sort the objects in decreasing order of sizes and then run the FF algorithm

BinPackFirstFit(S, n, bin) 1 initialize all b[j] as 0.0 // space used up in bin j 2 for i←1 to n do 3 for j←1 to n do 4 if b[j]+s[i]≤1.0 then 5 B[i]← j 6 b[j]← b[j]+s[i] 7 break 8 j←1 9 while (b[j]!=0) do 10 j← j+1 11 return

For example, given objects 0.4, 0.2, 0.4, 0.8, 0.2, 0.2, 0.5, 0.3. FFD sorts them in decreasing order 0.8, 0.5, 0.4, 0.4, 0.3, 0.2,0.2, 0.2 and then allocates to the first bin that fits Note that this is not optimal: the objects would fit into 3 bins.

Lemma Let S = (s 1, …, s n ) be an input I, in non-increasing order, for the bin packing problem and let OPT(I) be the optimal number of bins for S. All of the objects placed by FFD in extra bins (i.e., bins with index larger than OPT(I)) have size at most 1/3.

Proof Let i be the index of the first object placed by FFD in bin OPT(I)+1. S i must be no larger than 1/3.

Suppose S i > 1/3. Then S 1, …, S i-1 > 1/3, and are placed in bins B j for 1 ≤ j ≤ OPT(I), at most two objects each bin. For some k ≥ 0,the first k bins hold one object each, and bins B k+1, …, B OPT hold two objects each. S i > 1/3 can not fit even by an optimal solution. But an optimal solution must fit object S i in one of the first OPT(I) bins. Therefore, the assumption that S i > 1/3 must be false.

Lemma For an input S = (s 1, …, s n ) the number of objects placed by FFD in extra bins is at most OPT(I) - 1. Proof Assume FFD puts OPT(I) objects with sizes t 1, …, t OPT(I) in extra bins. Let b i be the used space for each of the first OPT(I) bins. Then

However, since all the objects fit in OPT(I) bins, we must have Therefore, the assumption of OPT(I) objects being put into extra bins is not valid.

Lemma R(I) ≤ (4/3) + (1/3m) and for infinitely large S, R(I) =3/2. Proof Let S = (s 1, …, s n ) be an input I with OPT(I) =m. FFD puts at most m-1 objects, each of size at most 1/3, in extra bins, so FFD uses at most m + (m-1)/3 bins. Thus

Therefore, the worst-case ratio R(I) ≤ 4/3 + (1/3m). Regardless the size of S, the largest R(I) is achieved when m = 2. Therefore, R(I) ≤ 4/3 + (1/6) = 3/2. namely R(I) =3/2

Theorem There exists a polynomial time algorithm FFD such that for all instances S for the bin packing problem, namely

The Next Fit Strategy open a bin and place the objects into it in the order they appear in the list S. If an object on the list will not fit into the open bin, we close this bin permanently and open a new one and continue packing the remaining objects in the list.

The Best Fit Strategy One again keeps bins open even when the next object in the list will not fit in previously opened bins, in the hope that a later smaller object will fit. The criterion for placement is that we put the next object into the currently open bin (e.g. not yet full) which leaves the least room left over.

The Worst Fit Strategy One places the item into that currently open bin into which it will fit with the most room left over. The Random Fit Strategy Random Fit is a simple randomized variant of First Fit. With Random Fit, each time an item is to be placed in a bin the bins are indexed in an order determined by a permutation chosen independently and uniformly at random. Each item is sequentially placed into the lowest indexed bin into which it will t, or into an empty bin if no such bin is available.

These strategies are greedy algorithms: they make choices based on the short term, not the long term. Intuitively, you might think the best-fit strategy is better, but in reality they all work about the same. It has been proven that an FFD solution is at worst 22% of the optimum solution. In practice, FFD solutions are usually much closer to optimal than this. So, just with a simple rule-of-thumb, we can approximate the optimum solution.

Homework Experiments: Implement First Fit decreasing, Next Fit decreasing, Best Fit decreasing, Worst Fit decreasing and compare these algorithms for the bin packing problem

Problem 1. Strip packing problem In wood or glass industries, rectangular components have to be cut from large sheets of material. Given a set of rectangular objects (w i,h i ), 0≤i≤n and a large rectangular sheet with width W and unlimited height,the objective is to minimize the height (H) of sheet. For example, given 5 rectangular objects, how to cut them from large rectangular sheet such that H is minimum (see Fig. 1) and every packing rectangles have a fix direction. Please give an approximation algorithm or Tabu search to solve it. (Scores 10)

2. 2D bin packing problem Given a set of rectangular objects (w i,h i ), 0≤i≤n and finite rectangular bins with width W and height H,the objective of 2D bin packing problem is to minimize the number of the used bins such that all rectangles can be packed into the used bins and every rectangles have a fixed packing direction. Design an approximation algorithm or meta-heuristic algorithm for it(Scores 10) 21