Csirik, Frenk, Lebbe and Zhang6: 16–19 present the following simple algorithm for 2/3 approximation. Suppose the bin size is 1 and there are n items.
For any instance I, denote by O P T ( I ) {\displaystyle \mathrm {OPT} (I)} the number of bins in the optimal solution, and by B D F ( I ) {\displaystyle \mathrm {BDF} (I)} the number of full bins in the bidirectional filling algorithm. Then B D F ( I ) ≥ ( 2 / 3 ) O P T ( I ) − ( 2 / 3 ) {\displaystyle \mathrm {BDF} (I)\geq (2/3)\mathrm {OPT} (I)-(2/3)} , or equivalently, O P T ( I ) ≤ ( 3 / 2 ) B D F ( I ) + 1 {\displaystyle \mathrm {OPT} (I)\leq (3/2)\mathrm {BDF} (I)+1} .
For the proof, the following terminology is used.
The sum of each bin B 1 , … , B t {\displaystyle 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 {\displaystyle w} bins B 1 , … , B w {\displaystyle B_{1},\ldots ,B_{w}} contains an initial item, possibly some middle items, and a final item. Each of the last t − w {\displaystyle t-w} bins B w + 1 , … , B t {\displaystyle B_{w+1},\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 {\displaystyle w=t} , that is, all final items are smaller than 1/2. Then, the sum of every filled B i {\displaystyle 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 3 t / 2 + 1 {\displaystyle 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 O P T ( I ) {\displaystyle \mathrm {OPT} (I)} . Therefore, O P T ( I ) ≤ 3 t / 2 + 1 {\displaystyle \mathrm {OPT} (I)\leq 3t/2+1} as required.
The hard case is w < t {\displaystyle w<t} , that is, some final items are larger than 1/2. We now prove an upper bound on O P T ( I ) {\displaystyle \mathrm {OPT} (I)} by presenting it as a sum O P T ( I ) = | K 0 | + | K 1 | + | K 2 | {\displaystyle \mathrm {OPT} (I)=|K_{0}|+|K_{1}|+|K_{2}|} where:
We focus first on the optimal bins in K 0 {\displaystyle K_{0}} and K 1 {\displaystyle K_{1}} . We present a bijection between the items in each such bin to some items in B 1 , … , B t {\displaystyle B_{1},\ldots ,B_{t}} which are at least as valuable.
We now focus on the optimal bins in K 1 {\displaystyle K_{1}} and K 2 {\displaystyle K_{2}} .
The 2/3 factor is tight for BDF. Consider the following instance (where ϵ > 0 {\displaystyle \epsilon >0} is sufficiently small): 1 − 6 k ϵ , 1 2 − ϵ , … , 1 2 − ϵ , ϵ , … , ϵ { ⋯ 6 k units ⋯ } { ⋯ 6 k units ⋯ } {\displaystyle {\begin{aligned}1-6k\epsilon ,~&~{\tfrac {1}{2}}-\epsilon ,\ldots ,{\tfrac {1}{2}}-\epsilon ,~&~\epsilon ,\ldots ,\epsilon \\~&~\{\cdots 6k~{\text{units}}\cdots \}~&~\{\cdots 6k~{\text{units}}\cdots \}\end{aligned}}} BDF initializes the first bin with the largest item and fills it with the 6 k {\displaystyle 6k} smallest items. Then, the remaining 6 k {\displaystyle 6k} items can cover bins only in triplets, so all in all 2 k + 1 {\displaystyle 2k+1} bins are filled. But in OPT one can fill 3 k {\displaystyle 3k} bins, each of which contains two of the middle-sized items and two small items.
Csirik, Frenk, Lebbe and Zhang7: 19–24 present another algorithm that attains a 3/4 approximation. The algorithm orders the items from large to small, and partitions them into three classes:
The algorithm works in two phases. Phase 1:
Phase 2:
In the above example, showing the tightness of BDF, the sets are: 1 − 6 k ϵ , 1 2 − ϵ , … , 1 2 − ϵ , ϵ , … , ϵ { | X | = 1 } { ⋯ | Y | = 6 k ⋯ } { ⋯ | Z | = 6 k ⋯ } {\displaystyle {\begin{aligned}1-6k\epsilon ,~&~{\tfrac {1}{2}}-\epsilon ,\ldots ,{\tfrac {1}{2}}-\epsilon ,~&~\epsilon ,\ldots ,\epsilon \\\{|X|=1\}~&~\{\cdots |Y|=6k\cdots \}~&~\{\cdots |Z|=6k\cdots \}\end{aligned}}} TCF attains the optimal outcome, since it initializes all 3 k {\displaystyle 3k} bins with pairs of items from Y, and fills them with pairs of items from Z.
For any instance I, denote by O P T ( I ) {\displaystyle \mathrm {OPT} (I)} the number of bins in the optimal solution, and by T C F ( I ) {\displaystyle \mathrm {TCF} (I)} the number of full bins in the three-classes filling algorithm. Then T C F ( I ) ≥ ( 3 / 4 ) ( O P T ( I ) − 4 ) {\displaystyle \mathrm {TCF} (I)\geq (3/4)(\mathrm {OPT} (I)-4)} .
The 3/4 factor is tight for TCF. Consider the following instance (where ϵ > 0 {\displaystyle \epsilon >0} is sufficiently small):
1 2 − 6 k ϵ , 1 2 − 6 k ϵ , 1 3 − ϵ , … , 1 3 − ϵ , ϵ , … , ϵ { ⋯ 12 k units ⋯ } { ⋯ 12 k units ⋯ } {\displaystyle {\begin{aligned}{\tfrac {1}{2}}-6k\epsilon ,{\tfrac {1}{2}}-6k\epsilon ,~&~{\tfrac {1}{3}}-\epsilon ,\ldots ,{\tfrac {1}{3}}-\epsilon ,~&~\epsilon ,\ldots ,\epsilon \\~&~\{\cdots 12k~{\text{units}}\cdots \}~&~\{\cdots 12k~{\text{units}}\cdots \}\end{aligned}}}
TCF initializes the first bin with the largest two items, and fills it with the 12 k {\displaystyle 12k} smallest items. Then, the remaining 12 k {\displaystyle 12k} items can cover bins only in groups of four, so all in all 3 k + 1 {\displaystyle 3k+1} bins are filled. But in OPT one can fill 4 k {\displaystyle 4k} bins, each of which contains 3 middle-sized items and 3 small items.
Csirik, Johnson and Kenyon8 present an asymptotic PTAS. It is an algorithm that, for every ε>0, fills at least ( 1 − 5 ε ) ⋅ O P T ( I ) − 4 {\displaystyle (1-5\varepsilon )\cdot \mathrm {OPT} (I)-4} bins if the sum of all items is more than 13 B / ϵ 3 {\displaystyle 13B/\epsilon ^{3}} , and at least ( 1 − 2 ε ) ⋅ O P T ( I ) − 1 {\displaystyle (1-2\varepsilon )\cdot \mathrm {OPT} (I)-1} otherwise. It runs in time O ( n 1 / ε 2 ) {\displaystyle O(n^{1/\varepsilon ^{2}})} . The algorithm solves a variant of the configuration linear program, with n 1 / ε 2 {\displaystyle n^{1/\varepsilon ^{2}}} variables and 1 + 1 / ε 2 {\displaystyle 1+1/\varepsilon ^{2}} constraints. This algorithm is only theoretically interesting, since in order to get better than 3/4 approximation, we must take ε < 1 / 20 {\displaystyle \varepsilon <1/20} , and then the number of variables is more than n 400 {\displaystyle n^{400}} .
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-Oba9 present an asymptotic FPTAS. It is an algorithm that, for every ε>0, fills at least ( 1 − ε ) ⋅ O P T ( I ) − 1 {\displaystyle (1-\varepsilon )\cdot \mathrm {OPT} (I)-1} bins if the sum of all items is more than 13 B / ϵ 3 {\displaystyle 13B/\epsilon ^{3}} (if the sum of items is less than that, then the optimum is at most 13 / ϵ 3 ∈ O ( 1 / ϵ 3 ) {\displaystyle 13/\epsilon ^{3}\in O(1/\epsilon ^{3})} anyway). It runs in time O ( 1 ϵ 5 ⋅ ln n ε ⋅ max ( n 2 , 1 ε ln ln 1 ε 3 ) + 1 ε 4 T M ( 1 ε 2 ) ) {\displaystyle O\left({\frac {1}{\epsilon ^{5}}}\cdot \ln {\frac {n}{\varepsilon }}\cdot \max {(n^{2},{\frac {1}{\varepsilon }}\ln \ln {\frac {1}{\varepsilon ^{3}}})}+{\frac {1}{\varepsilon ^{4}}}{\mathcal {T_{M}}}({\frac {1}{\varepsilon ^{2}}})\right)} , where T M ( n ) {\displaystyle {\mathcal {T_{M}}}(n)} is the runtime complexity of the best available algorithm for matrix inversion (currently, around O ( n 2.38 ) {\displaystyle O(n^{2.38})} ). This algorithm becomes better than the 3/4 approximation already when ε < 1 / 4 {\displaystyle \varepsilon <1/4} , and in this case the constants are reasonable - about 2 10 n 2 + 2 18 {\displaystyle 2^{10}n^{2}+2^{18}} .
An important special case of bin covering is that the item sizes form a divisible sequence (also called factored). A special case of divisible item sizes occurs in memory allocation in computer systems, where the item sizes are all powers of 2. If the item sizes are divisible, then some of the heuristic algorithms for bin covering find an optimal solution.10: Sec.5
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.
Assmann, S. F.; Johnson, D. S; Kleitman, D. J; Leung, J. Y. -T (1984-12-01). "On a dual version of the one-dimensional bin packing problem". Journal of Algorithms. 5 (4): 502–525. doi:10.1016/0196-6774(84)90004-X. ISSN 0196-6774. /wiki/Susan_Assmann ↩
Csirik, János; J. B. G. Frenk and M. Labbé and S. Zhang (1999-01-01). "Two simple algorithms for bin covering". Acta Cybernetica. 14 (1): 13–25. ISSN 2676-993X. https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3507 ↩
Csirik, Janos; Johnson, David S.; Kenyon, Claire (2001-01-09). "Better approximation algorithms for bin covering". Proceedings of the Twelfth Annual ACM-SIAM Symposium on Discrete Algorithms. SODA '01. Washington, D.C., USA: Society for Industrial and Applied Mathematics: 557–566. ISBN 978-0-89871-490-6. 978-0-89871-490-6 ↩
Jansen, Klaus; Solis-Oba, Roberto (2003). "An asymptotic fully polynomial time approximation scheme for bin covering". Theoretical Computer Science. 306 (1–3): 543–551. doi:10.1016/S0304-3975(03)00363-3. MR 2000192. /wiki/Theoretical_Computer_Science_(journal) ↩
Coffman, E. G; Garey, M. R; Johnson, D. S (1987-12-01). "Bin packing with divisible item sizes". Journal of Complexity. 3 (4): 406–428. doi:10.1016/0885-064X(87)90009-4. ISSN 0885-064X. https://dx.doi.org/10.1016/0885-064X%2887%2990009-4 ↩