Bin Covering Problem
   HOME

TheInfoList



OR:

In the bin covering problem, items of different sizes must be packed into a finite number of bins or containers, each of which must contain ''at least'' a certain given total size, in a way that maximizes the number of bins used. This problem is a dual of the bin packing problem: in bin covering, the bin sizes are bounded from below and the goal is to maximize their number; in bin packing, the bin sizes are bounded ''from above'' and the goal is to ''minimize'' their number. The problem is
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
, but there are various efficient
approximation algorithm In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems (in particular NP-hard problems) with provable guarantees on the distance of the returned solu ...
s: * Algorithms covering at least 1/2, 2/3 or 3/4 of the optimum bin count asymptotically, running in time O(n), O(n \log n), O(n ^2 n) respectively. * An asymptotic PTAS, algorithms with bounded worst-case behavior whose expected behavior is asymptotically-optimal for some discrete distributions, and a learning algorithm with asymptotically optimal expected behavior for all discrete distributions. * An asymptotic
FPTAS A fully polynomial-time approximation scheme (FPTAS) is an algorithm for finding approximate solutions to function problems, especially optimization problems. An FPTAS takes as input an instance of the problem and a parameter ε > 0. It r ...
.


The bidirectional bin-filling algorithm

Csirik, Frenk, Lebbe and Zhang present the following simple algorithm for 2/3 approximation. Suppose the bin size is 1 and there are ''n'' items. * Order the items from the largest (1) to smallest (''n''). * Fill a bin with the ''largest items'': 1, 2, ..., ''m'', where ''m'' is the largest integer for which the sum of items 1, ..., ''m'' is less than 1. * Add to this bin the ''smallest items'': ''n'', ''n''-1, ..., until its value raises above 1. For any instance ''I'', denote by \mathrm(I) the number of bins in the optimal solution, and by \mathrm(I) the number of full bins in the bidirectional filling algorithm. Then \mathrm(I) \geq (2/3) \mathrm(I) - (2/3), or equivalently, \mathrm(I) \leq (3/2) \mathrm(I)+1. For the proof, the following terminology is used. * t := \mathrm(I) = the number of bins filled by the algorithm. *B_1,\ldots,B_t := the ''t'' bins filled by the algorithm. * ''Initial items'' - the ''t'' items that are inserted first into each of the ''t'' bins. * ''Final items'' - the ''t'' items that are inserted last into each of the ''t'' bins. * ''Middle items'' - all items that are neither initial nor final. *w := the number of final items that are at most 1/2 (equivalently, t-w is the number of final items larger than 1/2). The sum of each bin B_1,\ldots,B_t is at least 1, but if the final item is removed from it, then the remaining sum is smaller than 1. Each of the first ''w '' bins B_1,\ldots,B_w contains an initial item, possibly some middle items, and a final item. Each of the last t-w bins B_,\ldots,B_t contains only an initial item and a final item, since both of them are larger than 1/2 and their sum is already larger than 1. The proof considers two cases. The easy case is w = t , that is, all final items are smaller than 1/2. Then, the sum of every filled B_i is at most 3/2, and the sum of remaining items is at most 1, so the sum of all items is at most 3t/2+1. On the other hand, in the optimal solution the sum of every bin is at least 1, so the sum of all items is at least \mathrm(I). Therefore, \mathrm(I) \leq 3t/2+1 as required. The hard case is w < t , that is, some final items are larger than 1/2. We now prove an upper bound on \mathrm(I) by presenting it as a sum \mathrm(I) = , K_0, +, K_1, +, K_2, where: *K_0 := the optimal bins with no initial/final items (only middle items). * K_1 := the optimal bins with exactly one initial/final item (and some middle items). * K_2 := the optimal bins with two or more initial/final items (and some middle items). We focus first on the optimal bins in K_0 and K_1 . We present a bijection between the items in each such bin to some items in B_1,\ldots,B_t which are at least as valuable. * The single initial/final item in the K_1 bins is mapped to the initial item in B_1,\ldots,B_ . Note that these are the largest initial items. * The middle items in the K_0 and K_1 bins are mapped to the middle items in B_1,\ldots,B_ . Note that these bins contain ''all'' the middle items. * Therefore, ''all'' items in K_0 and K_1 are mapped to all non-final items in B_1,\ldots,B_ , plus all middle items in B_,\ldots,B_ . * The sum of each bin B_1,\ldots,B_ without its final item is less than 1. Moreover, the initial item is more than 1/2, so the sum of only the middle items is less than 1/2. Therefore, the sum of all non-final items in B_1,\ldots,B_ , plus all middle items in B_,\ldots,B_ , is at most , K_1, + (w-, K_1, )/2 = (, K_1, +w)/2 . *The sum of each optimal bin is at least 1. Hence: , K_0, + , K_1, \leq (, K_1, +w)/2 , which implies 2 , K_0, + , K_1, \leq w \leq t . We now focus on the optimal bins in K_1 and K_2 . * The total number of initial/final items in the K_1 and K_2 bins is at least , K_1, + 2, K_2, , but their total number is also 2 t since there are exactly two initial/final items in each bin. Therefore, , K_1, + 2, K_2, \leq 2 t . * Summing the latter two inequalities implies that 2 \mathrm(I) \leq 3 t, which implies \mathrm(I) \leq 3 t/2. The 2/3 factor is tight for BDF. Consider the following instance (where \epsilon>0 is sufficiently small):\begin 1-6 k \epsilon, ~&~ \tfrac-\epsilon, \ldots, \tfrac-\epsilon, ~&~ \epsilon,\ldots,\epsilon \\ ~&~ \ ~&~ \ \endBDF initializes the first bin with the largest item and fills it with the 6k smallest items. Then, the remaining 6k items can cover bins only in triplets, so all in all 2k+1 bins are filled. But in OPT one can fill 3k bins, each of which contains two of the middle-sized items and two small items.


Three-classes bin-filling algorithm

Csirik, Frenk, Lebbe and Zhang present another algorithm that attains a 3/4 approximation. The algorithm orders the items from large to small, and partitions them into three classes: * X: The items with size at least 1/2; * Y: The items with size less than 1/2 and at least 1/3; * Z: The items with size less than 1/3. The algorithm works in two phases. Phase 1: * Initialize a new bin with either the largest item in X, or the two largest items in Y, whichever is larger. Note that in both cases, the initial bin sum is less than 1. *Fill the new bin with items from Z in increasing order of value. *Repeat until either X U Y or Z are empty. Phase 2: * If X U Y is empty, fill bins with items from Z by the simple next-fit rule. * If Z is empty, pack the items remaining in X by pairs, and those remaining in Y by triplets. In the above example, showing the tightness of BDF, the sets are:\begin 1-6 k \epsilon, ~&~ \tfrac-\epsilon, \ldots, \tfrac-\epsilon, ~&~ \epsilon,\ldots,\epsilon \\ \ ~&~ \ ~&~ \ \endTCF attains the optimal outcome, since it initializes all 3k bins with pairs of items from Y, and fills them with pairs of items from Z. For any instance ''I'', denote by \mathrm(I) the number of bins in the optimal solution, and by \mathrm(I) the number of full bins in the three-classes filling algorithm. Then \mathrm(I) \geq (3/4) (\mathrm(I) - 4). The 3/4 factor is tight for TCF. Consider the following instance (where \epsilon>0 is sufficiently small): \begin \tfrac-6 k \epsilon, \tfrac-6 k \epsilon, ~&~ \tfrac-\epsilon, \ldots, \tfrac-\epsilon, ~&~ \epsilon,\ldots,\epsilon \\ ~&~ \ ~&~ \ \end TCF initializes the first bin with the largest two items, and fills it with the 12k smallest items. Then, the remaining 12k items can cover bins only in groups of four, so all in all 3k+1 bins are filled. But in OPT one can fill 4k bins, each of which contains 3 middle-sized items and 3 small items.


Polynomial-time approximation schemes

Csirik, Johnson and Kenyon present an asymptotic PTAS. It is an algorithm that, for every ''ε''>0, fills at least (1 - 5 \varepsilon)\cdot \mathrm(I) - 4 bins if the sum of all items is more than 13 B/\epsilon^3, and at least (1 - 2 \varepsilon)\cdot \mathrm(I) - 1 otherwise. It runs in time O(n^). The algorithm solves a variant of the
configuration linear program The configuration linear program (configuration-LP) is a particular linear programming used for solving combinatorial optimization problems. It was introduced in the context of the cutting stock problem.Gilmore P. C., R. E. Gomory (1961). A linear ...
, with n^variables and 1 + 1/\varepsilon^2 constraints. This algorithm is only theoretically interesting, since in order to get better than 3/4 approximation, we must take \varepsilon < 1/20, and then the number of variables is more than n^. They also present algorithms for the ''online'' version of the problem. In the online setting, it is not possible to get an asymptotic worst-case approximation factor better than 1/2. However, there are algorithms that perform well in the average case. Jansen and Solis-Oba present an asymptotic FPTAS. It is an algorithm that, for every ''ε''>0, fills at least (1 - \varepsilon)\cdot \mathrm(I) -1 bins if the sum of all items is more than 13B/\epsilon^3 (if the sum of items is less than that, then the optimum is at most 13/\epsilon^3\in O(1/\epsilon^3) anyway). It runs in time O\left( \frac \cdot \ln \cdot \max + \frac\mathcal(\frac) \right), where \mathcal(n) is the runtime complexity of the best available algorithm for matrix inversion (currently, around O(n^)). This algorithm becomes better than the 3/4 approximation already when \varepsilon < 1/4, and in this case the constants are reasonable - about 2^ n^2 + 2^.


Related problems

In the fair item allocation problem, there are different people each of whom attributes a different value to each item. The goal is to allocate to each person a "bin" full of items, such that the value of each bin is at least a certain constant, and as many people as possible receive a bin. Many techniques from bin covering are used in this problem too.


Implementations

* Python: Th
prtpy package
contains an implementation of th
Csirik-Frenk-Labbe-Zhang algorithms


References

{{reflist Optimization algorithms and methods Covering problems