Outline |
1 Outline |
* Conclusion |
Original Bin Packing ProblemHere size(S) = ∑a∈ S size(a) and profit(S) = ∑a∈ S profit(a). |
2 Original Bin Packing Problem |
Online Algorithms for Original Bin Packing Problem |
3 On-line Algorithms for Original Bin Packing Problem |
Definitions |
In this section, we give very brief information about some naive online algorithms to warm you up.3.1 Definitions |
Next-Fit (NF) |
* p denotes the size of the largest item in the item list. * Without loss of generality, we give algorithms for scaled version of bin packing problem such that bins have a nominal capacity 1, and size of items are specified as rationals. 3.2 Next-Fit (NF) |
==Extensible Bin Packing Problem == Extensible bin packing problem is a variation of original bin packing problem. In this problem, number of bins is given as an input. The capacity of each bin is 1 and bins may be extended to hold more than their capacities. The cost of a bin is 1 if it is not extended, and the size of items in it if it is extended. The goal of this problem is to pack a set of items of given sizes into the specified number of bins in a way to minimize the total cost. In this tutorial, a fully asymptotic approximation scheme will be introduced for extensible bin packing problem. |
The disadvantage of this algorithm is that it closes a bin that can be used in the future. This algorithm packs a list of items and its reverse in the same number of bins. The asymptotic performance ratio (APR) of NF is as following
3.3 Worst-Fit (WF)# If there are no open bins in which the current item fits, pack the item into an empty bin. # Otherwise, pack the item into the bin of smallest content in which the item fits. Although WF never closes a bin, the APR of this algorithm same as the previous one. 3.4 First-Fit (FF)# Pack the current item into the lowest indexed nonempty bin in which it fits. # If there is no bin in which the current item can fit, pack the item in an empty bin. 3.5 Best-Fit (BF)# If there are some bins in which the current item can fit, pack the item into the bin of largest content in which the item fits. # Otherwise, pack the the item into an empty bin. 3.6 Conclusion on on-line algorithmsThe drawback of these on-line algorithms is their performance when size of items in the list or part of the list are in increasing order. If a list is in increasing order, the performances of the on-line algorithms suffer greatly. Even "average-case" lists that have portions in increasing order can greatly affect an on-line algorithm's approximation guarantee ratio. For example, when the bin size is 1, then following list of items will be packed into 3 bins according to all four on-line algorithms... .2, .7, .3, .8 It is easy to see that these items can be packed into two bins. We touched the approximation guarantee of some algorithms above, but in general the analysis of these algorithms are very complicated and it is out of scope of this tutorial. You can read the papers listed in references for more information. 4 Extensible Bin Packing ProblemExtensible bin packing problem is a variation of original bin packing problem. In this problem, number of bins is given as an input. The capacity of each bin is 1 and bins may be extended to hold more than their capacities. The cost of a bin is 1 if it is not extended, and the total size of items in it if it is extended. The goal of this problem is to pack a set of items of given sizes into the specified number of bins in a way to minimize the total cost. In this tutorial, a fully polynomial time asymptotic approximation scheme (FPTAAS) is introduced for extensible bin packing problem. |
* A FTPAAS for Extensible Bin Packing Problem ==Introduction === Input* xi for i=1,2,3,...,n: size of i-th item. * m: number of bins 3.2 Notations* bj for j=1,2,3,...,m: j-th bin * l(bj): level of bj (total size of items packed into bj) * c(bj): cost of bj = max(1,l(bj)) 3.3 Goalminimize ∑j=1m c(bj) Algorithm |
* The problem of assigning tasks to workers: There are a set of tasks which must be assigned to a set of identical workers which are available at a fixed cost for a given time and can be acquired for additional time at an additional cost. In this problem, the goal is to minimize the cost. * Scheduling problem: There are two machines and two types of tasks to be executed at these machines. Suppose that the tasks of first type requires only the first machine, and the tasks of second type requires both machines for some time, and then only the first machine for an additional time. The goal in this problem is the minimization of makespan. * Storage Allocation problem: In this problem, extra capacity can be obtained from a fixed set of locations with given capacity at a proportional cost. The goal is to minimize the total cost when storing a set of items in those locations. 5 A FPTAAS for Extensible Bin Packing Problem ==5.1 Introduction === Input * xi: size of i-th item. 1 ≤ i ≤ n * m: number of bins Notations * bj: j-th bin 1 ≤ j ≤ m * l(bj): level of bj (total size of items packed into bj) * c(bj) = max(1,l(bj)): cost of bj Goal * minimize ∑j=1..m c(bj) (Pack all items in bins in a way to minimize the total cost.) 5.2 Algorithm |
A(I,ε) ≤ (1 + ε)OPT(I) + O(ε-1\log{ε-1}) in time bounded by a polynomial in n and ε-1 We can make some assumptions without loss of generality. First Assumption |
A(I,ε) ≤ (1 + ε)OPT(I) + O(ε-1logε-1) in time bounded by a polynomial in n and ε-1 Before showing how this algorithm produces this approximation guarantee, we can make some assumptions without loss of generality for the sake of simplicity. For each assumption, we prove that this assumption can be made without loss of generality. 5.2.1 First Assumption |
xi > ε/(1+ε) for i=1,2,…,nSecond Assumption |
Proof Suppose we have an approximation algorithm A′ which guarantees given approximation guarantee with so small items. We can use this algorithm to pack an arbitrary list of items as following: # First, use A′ to pack items that are not small # Pack the small items greedily. There are two cases when we pack small items # Packing small items does not increase the cost. Then we clearly satisfy the approximation guarantee. # Packing small items does increase the cost. For convenience, let ε′ equal to ε/(1+ε) (maximum size of a small item). Then we can say that before packing small items the level of each bin is at least 1 - ε′. Therefore
5.2.2 Second Assumption |
xi < 1 for \(i=1,2,…,nThird Assumption |
Proof We claim that there is an optimum packing algorithm which packs big items into a bin by itself. Similar to the proof given above, we can construct an 1+ε approximation algorithm from 1+ε which packs without big items. Suppose some optimum packing placed some item x in a bin together with a big item. Then we could move x to another bin that does not contain a big item without increasing the cost. 5.2.3 Third Assumption |
∑x=1n xi < 2mFourth Assumption |
Proof When there are no big items, greedy method guarantees that as long as any bin is packed to a level of less than 1, no bin will be packed to a level of 2 or more. In other words, when a bin is packed to a level at least 2, then the cost of packing is simply the sum of items, so the packing is optimum. Thus, we can make this assumption without loss of generality. 5.2.4 Fourth Assumption |
l(bj) < 3 for j=1,2,…,m --- |
Proof Suppose, there is a bin of level 3 or more. According to the previous assumption, there will be a bin of level less than 2. Thus, we can move an item from bin that has higher level to the other level without increasing the cost. Therefore, without loss of generality, we can assume that the level of any bin is at most 3. |
<table> | |
</td></tr></table> |
In high level, this algorithm works as following: First we group the items in terms of their sizes. (We round the sizes up to specified values) Then we define different ways of packing these items in bins. Then coarsening method (dynamic programming) gives a way of packing all items at minimum cost. (We give an ILP to find the optimum result.) It is an approximation algorithm because we change the size of the items, and we relax ILP to LP. |
sj = ⌊(1+ε)j/ε⌋ε2 for \1lej<N |
<table> | |
sj = ⌊(1+ε)j/ε⌋ε2 for 1≤ j<N |
</td></tr></table> |
Increase ratio of items of size less than s1 s1/(ε/(1+ε)) ≤ (1+ε)2 Increase ratio of items of size larger than s1 sj+1/sj ≤ (1+ε)2 Rounding increases the cost of the optimum solution by a faxtor of at most \((1+\epsilon)^2) |
Increase ratio of items of size less than s1
|
nj: number of items of size sj after rounding. configuration: packing a bin to a level of at most 3 with sizes chosen from sj M: number of configurations Cij: number of items of size sj in the i-th configuration max(1,∑j=1N Cijsj: cost of packing a bin according to i-th configuration
|
Integer Program |
5.3 Integer Linear Program |
Objective function: min ∑i=1M zi.max(1,∑j=1N Cijsj) subject to ∑i=1M ziCij ≥ nj for j=1,2,…,N ∑i=1M zi ≥ m zi ∈ {0,1,2,ldots} |
Objective function: min ∑i=1..M zi.max(1,∑j=1..N Cijsj) subject to
|
When we relax this ILP to LP by allowing zi to be any nonnegative value. number of inequalities in LP = N+1 |
When we relax this ILP to LP by allowing zi to be any nonnegative value, number of inequalities in LP will be N+1. Thus, |
* Round LP to ILP increases the solution 3(N+1) because each coefficient in the objective function is at most 3. (Recall that l(bj) < 3 for j=1,2,…,m |
* Round LP to ILP increases the solution by at most 3(N+1) because each coefficient in the objective function is at most 3. (Recall that l(bj) < 3 for j=1,2,…,m) Relaxation increases the optimum solution by at most 3(N+1) = O(ε-1logε-1) which is the asymptotic part in the approximation guarantee shown in the beginning. |
3(N+1) = O(e-1logε-1) |
Thus, this algorithm gives a solution with an approximation guarantee
References* Edward G. Coffman Jr. and George S. Lueker. Approximation Algorithms for Extensible Bin Packing. Symposium on Discrete Algorithms, 586-588 2001 * P. Dell'Olmo, H. Kellerer, M. G. Speranza, and Z. Tuza. A 13/12 approximation algorithm for bin packing with extendable bins. Information Processing Letters, 65:229-233, 1998. * N. Karmarkar and R. M. Karp. An efficient approximation scheme for the one-dimensional bin-packing problem. In Proceedings of the 23rd Annual Symposium on Foundations of Computer Science, pages 312{320, 1982. * E. G. Coffman, M. R. Garey, and D. S. Johnson. Approximation algorithms for bin packing: A survey. In D. Hockbaum, editor, Approximation Algorithms for NP-Hard Problems, pages 46--93, Boston, MA, USA, 1996. PWS Publishing |
The size of i-th item ai is s(ai), where 0 < s(ai) ≤ C.
The problem is to pack the items in minimum number of bins under the constraint that the total size of items in each bin cannot exceed the capacity of the bin.
In this section, we give very brief information about some naive online algorithms to warm you up.
The disadvantage of this algorithm is that it closes a bin that can be used in the future. This algorithm packs a list of items and its reverse in the same number of bins. The asymptotic performance ratio (APR) of NF is as following
NF(I) ≤ 2*OPT(I) if 1/2 < p ≤ 1 NF(I) ≤ (1-p)-1*OPT(I) if 0 < p ≤ 1/2 |
Although WF never closes a bin, the APR of this algorithm same as the previous one.
Even "average-case" lists that have portions in increasing order can greatly affect an on-line algorithm's approximation guarantee ratio. For example, when the bin size is 1, then following list of items will be packed into 3 bins according to all four on-line algorithms...
Extensible bin packing has a number of important real world applications such as:
xi > ε/(1+ε) for i=1,2,…,n |
OPT(I) ≥ ∑j=1..m l(bj) > m(1-ε′) A′(I) ≤ ∑j=1..m max(1,l(bj)) ≤ ∑j=1..m l(bj)+ε′ ≤ mε′ + ∑j=1..m l(bj) (A′ - OPT(I))/OPT(I) ≤ mε′/m(1-ε′) = ε. |
xi < 1 for i=1,2,…,n |
∑x=1..n xi < 2m |
l(bj) < 3 for j=1,2,…,m |
A(I,ε) ≤ (1 + ε)2OPT(I) + O(ε-1log{ε-1}) |
In high level, this algorithm works as following:
First we group the items in terms of their sizes. (We round the sizes up to specified values) Then we define different ways of packing these items in bins. Then coarsening method (dynamic programming) gives a way of packing all items at minimum cost. (We give an ILP to find the optimum result.)
It is an approximation algorithm because we change the size of the items, and we relax ILP to LP.
We will round the sizes of items up to s1, s2, ..., sN where N is the smallest value for the following inequality
⌊(1+ε)j/ε⌋ε2 ≥ 1
According to the inequality above, N approximately equals to ε-1lnε{-1}
We define the value of s1,s2,…,sN according to the following equation
sj = ⌊(1+ε)j/ε⌋ε2 for 1≤ j<N sj = 1 for j=N |
Increase ratio of items of size less than s1
s1/(ε/(1+ε)) ≤ ⌊(1+ε)/ε⌋ε2/(ε/(1+ε)) ≤ (1+ε)2 |
sj+1/sj = ⌊(1+ε)j+1ε-1⌋/⌊(1+ε)jε-1⌋ ≤ (1+ε)j+1ε-1/((1+ε)jε-1-1) = (1+ε)j+1/((1+ε)j - ε) ≤ (1+ε)j+1/ (1+ε)j-1 ≤ (1+ε)2
|
The figure given above gives an intuitive explanation for the ILP we introduce in next section.
Each row in this table is a configuration. In each configuration we pack a number of items of each size (Cij) such that the level of the bin is at most 3. The number of configurations can be in terms of ε.
We can use a configuration zi times in the solution. Our goal is to pack all items and use all bins. These are the constraints in ILP given below.
∑i=1..M ziCij ≥ nj for j=1,2,…,N (We need to pack all items of each size) ∑i=1..M zi ≥ m(We need to use all bins) zi ∈ {0,1,2,ldots} (We can use a configuration any time we want) |
When we relax this ILP to LP by allowing zi to be any nonnegative value, number of inequalities in LP will be N+1.
Thus,
Relaxation increases the optimum solution by at most 3(N+1) = O(ε-1logε-1) which is the asymptotic part in the approximation guarantee shown in the beginning.
Thus, this algorithm gives a solution with an approximation guarantee
A(I,ε) ≤ (1 + ε)OPT(I) + O(ε-1logε-1) |