Best-fit bin packing explained

Best-fit is an online algorithm for bin packing. Its input is a list of items of different sizes. Its output is a packing - a partition of the items into bins of fixed capacity, such that the sum of sizes of items in each bin is at most the capacity. Ideally, we would like to use as few bins as possible, but minimizing the number of bins is an NP-hard problem. The best-fit algorithm uses the following heuristic:

Approximation ratio

Denote by BF(L) the number of bins used by Best-Fit, and by OPT(L) the optimal number of bins possible for the list L. The analysis of BF(L) was done in several steps.

BF(L)\leq1.7OPT+3

was proven by Ullman[1] in 1971.

BF(L)\leq1.7OPT+2

was proved by Garey, Graham and Ullman,[2] Johnson and Demers.[3]

BF(L)\leq\lceil1.7OPT\rceil

.

FF(L)\leq\lfloor1.7OPT\rfloor

by Dósa and Sgall.[5] They also present an example input list

L

, for that

BF(L)

matches this bound.

Worst-fit

Worst-Fit is a "dual" algorithm to best-fit: it tries to put the next item in the bin with minimum load.

This algorithm can behave as badly as Next-Fit, and will do so on the worst-case list for that

NF(L)=2OPT(L)-2

.[6] Furthermore, it holds that
infty
R
WF

(size\leq\alpha)=

infty
R
NF

(size\leq\alpha)

.

Since Worst-Fit is an AnyFit-algorithm, there exists an AnyFit-algorithm such that

infty
R
AF

(\alpha)=

infty
R
NF

(\alpha)

.

References

  1. Ullman. J. D.. 1971. The performance of a memory allocation algorithm. Technical Report 100 Princeton Univ..
  2. Book: Garey. M. R. Graham. R. L. Ullman. J. D.. Proceedings of the fourth annual ACM symposium on Theory of computing - STOC '72 . Worst-case analysis of memory allocation algorithms . 1972. EN. 143–150. 10.1145/800152.804907. 26654056.
  3. David S. Johnson, Alan J. Demers, Jeffrey D. Ullman, M. R. Garey, Ronald L. Graham. Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms. SICOMP, Volume 3, Issue 4. 1974.
  4. Garey. M. R. Graham. R. L. Johnson. D. S. Yao. Andrew Chi-Chih. 1976. Resource constrained scheduling as generalized bin packing. Journal of Combinatorial Theory, Series A. en. 21. 3. 257–298. 10.1016/0097-3165(76)90001-7. 0097-3165. free.
  5. Book: György. Dósa. Sgall. Jirí. Automata, Languages, and Programming . Optimal Analysis of Best Fit Bin Packing . 2014. Lecture Notes in Computer Science. 8572. 429–441. 10.1007/978-3-662-43948-7_36. 978-3-662-43947-0.
  6. Johnson. David S. 1973. Near-optimal bin packing algorithms. Massachusetts Institute of Technology.