Worst-Case Performance Bounds for Simple One-Dimensional Packing Algorithms 4: First-Fit Decreasing Uses at Most 71/60 L* + 5 Bins When No Item Exceeds 1/2Research Paper
Motivation
Bin packing asks how to place a list of items with sizes in into as few unit-capacity bins as possible. It models the cutting of stock material, the packing of files onto tracks of a disc and the assignment of jobs to machines with a common deadline. Deciding the optimum is NP-hard, so in practice simple rules are used, and the question is how far they can stray from the optimum in the worst case.
Johnson, Demers, Ullman, Garey and Graham (SIAM J. Comput. 3(4), 1974) gave the first sharp worst-case bounds for the four classical rules. For First-Fit Decreasing (FFD), the rule that sorts the items into nonincreasing order and then places each into the first bin with room, they announced the bound , whose full proof in Johnson's thesis exceeds 75 pages. To show the method, Section 4 of the paper proves a simpler bound in detail: when no item exceeds , FFD uses at most bins. That result is the subject of this mission.
Timeline:
- 1973: D. S. Johnson's MIT thesis, Near-optimal bin packing algorithms, contains the complete proofs of the and bounds.
- 1974: Johnson, Demers, Ullman, Garey and Graham publish the bound for lists in (Theorem 4.1) with a proof that is complete except for parts of two lemmas, and show by example that cannot be lowered.
- 1985: B. S. Baker gives a shorter proof of the bound for FFD (J. Algorithms 6, 1985).
- 2007: G. Dósa determines the tight additive constant in the bound (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 in it. The optimum is the least number of bins into which the elements of can be placed with no bin level exceeding .
First-Fit places in order into bins , each initially at level : goes into the bin of least index whose level satisfies . First-Fit Decreasing first arranges into nonincreasing order and then runs First-Fit. is the number of bins it uses.
The proof uses a weight on finite sets of elements. For an integer , is a -piece if , and a -bin is a bin whose largest element is a -piece. Set . A pair obeys relation if is a -piece and ; then , and otherwise . For a partition of into one- and two-element sets, with each pair ordered (earlier, later) in the nonincreasing order,
BASIC is the set of elements of that are -pieces lying in a -bin of the FFD packing of , for some ; SURPLUS is the rest of .
Formalization targets
Goal: Theorem 4.1
The constants are those printed in the paper. The multiplicative constant is best possible.
Milestones
- Lemma 3.3 (FFD part): if with , the list of the elements of exceeding also has .
- Claim 4.2.1: for and , .
- Claim 4.2.2: for , and every partition of into one- and two-element sets, .
- Lemma 4.2: for and , .
- Subadditivity: .
- Lemma 4.3: if and , then .
A companion item states the Remark after Theorem 4.1: for every there is a list with all elements below , and .
Significance
Theorem 4.1 shows the weighting-function method in its simplest nontrivial form: a weight whose total is within a constant of the algorithm's bin count, and which no feasible bin can exceed by more than the target ratio. The same method, with more elaborate weights, gives the bound for FFD, and it is the model for later worst-case analyses of packing heuristics. The Remark shows that is exact for items in , and the Corollary on p. 322 extends the analysis to the asymptotic ratio when items are bounded by .
The source proof is partial. The billing argument behind Claim 4.2.2 is given only when two auxiliary conditions (G1) and (G2) hold ("The more intricate argument here omitted", p. 321), and Lemma 4.3 is checked in four of about seventy-four cases ("leaving the remaining 70-odd, more or less routine, cases to the ambitious reader", p. 321). Complete details are in Johnson's thesis. The theorem itself is established. A formalization therefore gives the first complete, checked proof in a single place. The finite case analysis of Lemma 4.3 is well suited to machine checking. No machine-checked proof of any FFD bound is known to exist.
Difficulty
The obvious weight alone fails. Claim 4.2.1 shows that covers the FFD bins, but many sets of elements with sum at most have , for example two -pieces, a -piece and a -piece. The pair discounts of repair Lemma 4.3, but they must then be paid for in Lemma 4.2, for every partition. That is Claim 4.2.2: a charge from each discounted pair to distinct SURPLUS elements that are no larger. The charge is straightforward only when no member of a pair obeying relation lies in a bin of type . In general a pair's larger element may already have been charged by a smaller relation, and the paper omits the argument that handles this. Lemma 4.3 is elementary but has many cases, each determined by the piece types in and the relations they obey.
Formalization scope
A list is L : List ℝ with IsList L ( for each element) in every statement. is optBins L, the least such that some map from positions to Fin b has every bin sum at most . The First-Fit run keeps the nonempty bins as a List (List ℝ), and opens a new bin at the end exactly when no existing bin fits, which is the paper's "least ". The fit test is . FFD is First-Fit on sortDesc L, the mergeSort into nonincreasing order; ties do not affect the bin count. Indices are -based.
sorts into nonincreasing order and minimises over the involutions of its positions: fixed points are singletons, and a pair is oriented (larger, smaller). The minimum is over a finite nonempty set, so it is attained. BASIC is a set of positions of sortDesc L, and each position's bin is its bin in the final FFD packing. In , is the piece type of the first element. Sums are over Finset.Icc 2 (N - 1) with .
The goal's range is . The restriction to belongs only to the proof, through Lemma 3.3. Stating the goal for , weakening or , or making an unattained infimum would each change the theorem. Only the FFD half of Lemma 3.3 is stated. Claim 4.2.1 is stated with Lemma 4.2's standing hypothesis . The Remark's printed range is a misprint: its FFD packing needs , and the companion item states only the existence claim.
Infrastructure needed: a usable API for the First-Fit run (the invariants of the fold, bin levels, the order of bins), a lemma that FFD bins receive items in nonincreasing order, and a decision procedure for Lemma 4.3's case analysis over piece types. The model file and the weight file are reusable for the bound (mission 3 of this series) and for the bounded- corollaries. Contributions of proofs of Lemma 4.3 by computer-checked case enumeration, and of the missing general case of Claim 4.2.2, are especially 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 J. Comput. 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).
- B. S. Baker, A new proof for the first-fit decreasing bin-packing algorithm, J. Algorithms 6, 1985.
- G. Dósa, The tight bound of first fit decreasing bin-packing algorithm is FFD(I) ≤ 11/9 OPT(I) + 6/9, ESCAPE 2007, Lecture Notes in Computer Science 4614, 2007.