Classifying the Expected Waste of Best Fit Bin Packing under U{j,k}
Question
Items arrive one at a time and go into bins of capacity . Best Fit puts each item into the fullest open bin that still has room, and opens a new bin otherwise. It is the default online bin-packing rule.
Let item sizes be i.i.d. uniform on , i.e. the distribution . For the items can be packed almost perfectly, so the optimal waste (unused space) stays . The question is:
For which does Best Fit also keep the waste bounded, and for which does it waste a constant fraction, , of the space after items?
History
- 1991. Coffman, Courcoubetis, Garey, Johnson, McGeoch, Shor, Weber and Yannakakis introduce and prove that the waste is bounded when [1]. Simulations suggest Best Fit wastes linearly for many other pairs.
- 1993. Coffman, Johnson, Shor and Weber prove linear waste for and with LP-generated Lyapunov functions (about 24 hours each), settling every [2]. Their table leaves pairs with open: “All the still-open problems listed in the table appear to require solutions to LP’s that are far too big for us to store, much less solve.”
- 1998. Kenyon, Rabani and Sinclair prove bounded waste for [3].
- 2002. Kenyon and Mitzenmacher prove linear waste for when is “sufficiently large” [4]. They note that and are still the only explicit pairs with proven linear waste.
Since then, the explicit classification seems not to have moved. As far as we could find, seven non-trivial pairs with remained open, as did almost every pair with .
Results
- Solved the 7 open cases from 1993. Linear: , , , . Bounded: , , .
- Complete classification for . 144 newly settled pairs: 78 linear, 66 bounded. In this range, for , only and occur. Coffman et al. asked in 2002 whether anything in between is possible [5].
- Complete rows. For every and every , Best Fit has linear waste exactly when and , where .
- Waste rates. For the linear cases with , the long-run waste per item (liminf and limsup) is bracketed rigorously, e.g. : (simulation: ), about 0.22% more bins than optimal.
- Where the waste goes. In 26 linear cases, bins with two or more free units provably stay : all linear waste sits in bins with exactly one unit free.

An empirical law (simulation, not proof). For each , we bisected on in simulation to find the largest with linear waste. For up to 40 the boundary fits (residual ), and it agrees exactly with the certified rows . The proven bounded region, , corresponds to . The theorem has the right order but is off by a factor of about 3 in .

Methods
The chain. The state is the vector of gap counts: is the number of open bins with units free. Best Fit’s move depends only on which are positive. Two invariants mean that only small gaps can have many bins:
- any two open bins have gaps summing to less than ;
- at most one open bin has a gap larger than .
The certificate. We look for a Lyapunov function of the form
that is, a linear part plus an arbitrary correction on counts truncated at levels . The expected one-step change of depends only on the finite “pattern” . So finitely many checks cover the infinite state space.
- If the drift is at least on every reachable pattern, the waste grows linearly.
- If all and the drift is at most whenever some count exceeds its truncation level, the waste is bounded (Hajek’s drift theorem [6]).
The search. For a fixed linear part , the best solves a linear program. That LP is the Bellman inequality of an average-reward Markov decision process, in which an adversary chooses which truncated counts are “really” large. So instead of solving huge LPs, which was the 1993 bottleneck, we:
- run value iteration (multi-threaded C++);
- optimise by a cutting-plane method, warm-started from neighbouring cases.
The largest certificate has 15.7 million patterns. , the 24-hour computation of 1993, now takes seconds.
Reproduce
git clone https://github.com/CHHC-L/bestfit-ujk
cd bestfit-ujk
make && make test
# might be slow:
make verify
Code, certificates and proofs (notes/method.md): github.com/CHHC-L/bestfit-ujk
Note
Most of the code was written by Claude Opus 5.5.
References
- E. G. Coffman Jr., C. Courcoubetis, M. R. Garey, D. S. Johnson, L. A. McGeoch, P. W. Shor, R. R. Weber, M. Yannakakis. Fundamental discrepancies between average-case analyses under discrete and continuous distributions: a bin packing case study. STOC, 1991.
- E. G. Coffman Jr., D. S. Johnson, P. W. Shor, R. R. Weber. Markov chains, computer proofs, and average-case analysis of Best Fit bin packing. STOC, 1993.
- C. Kenyon, Y. Rabani, A. Sinclair. Biased random walks, Lyapunov functions, and stochastic analysis of Best Fit bin packing. J. Algorithms 27, 1998.
- C. Kenyon, M. Mitzenmacher. Linear waste of Best Fit bin packing on skewed distributions. Random Structures & Algorithms 20, 2002.
- E. G. Coffman Jr. et al. Perfect packing theorems and the average-case behavior of optimal and online bin packing. SIAM Review 44, 2002.
- B. Hajek. Hitting-time and occupation-time bounds implied by drift analysis with applications. Adv. Appl. Prob. 14, 1982.