Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms 3: First-Fit Decreasing and Best-Fit Decreasing Use at Most 11/9 L* + 4 BinsResearch Paper
Motivation
Bin packing asks for the fewest unit-capacity bins that hold a given list of item sizes. It models table formatting, the placement of program segments on pages, and the allocation of files to disc tracks, and it is NP-complete, so exact solutions require search in general. Johnson, Demers, Ullman, Garey and Graham (SIAM J. Comput. 3 (1974)) therefore studied four simple placement heuristics and bounded how far each can be from the optimum in the worst case. Their paper is one of the founding results of the worst-case analysis of approximation algorithms.
This mission concerns the two decreasing heuristics, which sort the items from largest to smallest before placing them. For them the paper proves that at most of the optimum, plus an additive constant, is ever used, and that the factor cannot be improved.
Timeline.
- 1973: D. S. Johnson's MIT thesis proves ; the argument exceeds 75 pages.
- 1974: Johnson, Demers, Ullman, Garey and Graham publish the bound for FFD and BFD, with a complete proof of the reduction from BFD to FFD and an outline of the FFD argument.
- 1985: B. S. Baker gives a shorter proof of (J. Algorithms 6).
- 1991: M. Yue publishes a proof of .
- 2007: G. Dósa determines the tight additive constant, (ESCAPE 2007, LNCS 4614).
Setting
A list is a finite sequence of real numbers in ; values may repeat. A bin has capacity ; its level is the sum of the numbers placed in it. The optimum is the least number of bins into which the elements of can be distributed so that no bin has level exceeding .
The bins start empty and the elements are placed one at a time, in list order.
- First-Fit (FF) places into the bin of least index whose level satisfies .
- Best-Fit (BF) places into a bin whose level satisfies and is as large as possible, the one of least index among ties.
- First-Fit Decreasing (FFD) and Best-Fit Decreasing (BFD) first arrange into nonincreasing order and then apply FF, respectively BF.
and are the numbers of bins that receive at least one element.
Two auxiliary notions from the paper's proof also appear among the milestones. The position of an element in a packing means that it is the -th element placed into bin . The weight of a collection of elements is defined through -pieces, the elements in . Each element has the weight . A pair with a -piece and has the discounted weight , and any other pair has . is the least total weight over all ways of grouping into singletons and pairs.
Formalization targets
Goal: Theorem 3.2
For every list ,
The constants are the paper's. Both halves are part of the goal.
Milestones, in the order the argument uses them
- Lemma 3.3. If with , the list keeping only the elements exceeding also has ; the same for BFD. With this reduces the goal to lists in .
- Claims 3.4.5 and 3.4.6, two steps of the proof of Theorem 3.4 that concern only the FFD packing and the BFD run. On , BFD places every element exceeding exactly where FFD does. Among the remaining positions of , the lexicographic order of positions respects the order of the sorted list.
- Theorem 3.4. If , then . This transfers the bound from FFD to BFD on .
- Lemma 4.2. For every integer and ,
- The reduced assertion (Section 4, p. 314). If , then
- Theorem 3.1, the matching lower bound: for each there is a list with and .
Significance
The bound makes FFD and BFD, which run in time, the reference heuristics for off-line bin packing. The bound and its proof technique of weighting functions were the model for the analysis of many later packing and scheduling heuristics. Theorem 3.1 shows that the factor is exact, so together with the goal it determines , where is the largest ratio over lists with .
The result is proved, but the source proves it only in part. The paper gives complete proofs of Lemma 3.3, Theorem 3.4 and Theorem 3.1. For the reduced assertion it gives only an outline, whose central inequalities involve maps the paper never defines, and it refers to the thesis for the details. Lemma 4.2 is proved in the paper through two claims. A formal proof of the goal must therefore either formalize one of the later complete proofs (Baker 1985, Yue 1991, Dósa 2007) or reconstruct the thesis argument. No machine-checked proof of the bound is present in Mathlib or on the platform.
Difficulty
The obvious approach, used for First-Fit in Section 2 of the same paper, assigns each element a weight depending only on its size, so that every bin of the algorithm's packing weighs at least and every bin of an optimal packing weighs at most the target ratio. For FFD no weighting of single elements works at ratio . Summing over the elements overcharges the FFD packing: a set of elements fitting into one bin can carry total -weight well above . The paper's remedy is a weight defined on pairs, , which discounts elements that could share a bin with a larger one. Even with , the bins of FFD whose largest element exceeds do not fit the scheme. Handling them requires a case analysis that the paper only sketches and that runs to more than 75 pages in the thesis.
The BFD half cannot be obtained by bounding BFD by FFD in general: there are lists with . Theorem 3.4 works only because Lemma 3.3 first removes all elements below .
Formalization scope
Lists are L : List ℝ with the predicate IsList L ( for every element), assumed by every statement. is optBins L, the least b : ℕ admitting a map from the items to Fin b with every bin sum at most . A run keeps the nonempty bins as a List (List ℝ) in index order and opens a new bin at the end exactly when no nonempty bin fits, which matches the paper's "least " over infinitely many empty bins. The fit test is non-strict. FFD and BFD are FF and BF applied to sortDesc L, a stable merge sort into nonincreasing order. They are defined for every list, so the goal is stated for arbitrary, unsorted . Positions are -based pairs (bin, place in bin) read off the run.
sorts its argument into nonincreasing order, so index is the position in that order. It then minimizes over involutions of the positions, which encode the partitions into one- and two-element sets. Weights are real-valued; the paper's use of rationals is incidental. The range hypotheses are exactly the paper's: is closed in Theorem 3.4, is open at , and Lemma 4.2 has .
A weakened goal, such as with a larger , a bound for sorted lists only, or the FFD half alone, is a different theorem and does not close the mission. Claims 3.4.1–3.4.4 and 3.4.7 and the inequalities , of the outline are not stated: they concern the paper's step-by-step construction and the undefined maps , .
A complete development needs basic lemmas about FF and BF runs (levels stay at most , a new bin opens only when nothing fits, runs on prefixes). It also needs invariance of FFD and BFD under permutations of equal elements, the monotonicity of under deletion, and . These are reusable in the other missions of this series. Proofs of individual milestones, alternative complete proofs of the goal, and sharper additive constants are all welcome.
Selected references
- D. S. Johnson, A. Demers, J. D. Ullman, M. R. Garey, R. L. Graham, Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms, SIAM Journal on Computing 3(4):299–325, 1974. https://doi.org/10.1137/0203025
- D. S. Johnson, Near-Optimal Bin Packing Algorithms, Ph.D. thesis, Massachusetts Institute of Technology, 1973 (reference [8] of the paper above).
- B. S. Baker, A new proof for the first-fit decreasing bin-packing algorithm, Journal of Algorithms 6(1):49–70, 1985. https://doi.org/10.1016/0196-6774(85)90018-5
- M. Yue, A simple proof of the inequality FFD(L) ≤ 11/9 OPT(L) + 1, ∀L, for the FFD bin-packing algorithm, Acta Mathematicae Applicatae Sinica 7(4):321–331, 1991.
- G. Dósa, The tight bound of first fit decreasing bin-packing algorithm is FFD(I) ≤ 11/9 OPT(I) + 6/9, ESCAPE 2007, LNCS 4614:1–11, 2007. https://doi.org/10.1007/978-3-540-74450-4_1