Documentation

CslibFrontier.Algorithms.Lean.BinPacking.FirstFitWeight

First Fit uses at most 17/10 * OPT + 4/5 bins #

This file proves the 17/10 bound for First Fit (Cslib.Algorithms.Lean.BinPacking.firstFit) with an explicit additive constant: against any packing Q of the same items, 10 * FF ≤ 17 * Q.length + 8 (ten_mul_length_firstFit_le), that is FF ≤ 17/10 * OPT + 4/5 for the optimum OPT. As FF is an integer this implies FF ≤ ⌈17/10 * OPT⌉ (length_firstFit_le_ceil), the bound of Garey, Graham, Johnson and Yao as reported by Dósa and Sgall, Section 1.1, and the earlier FF ≤ 17/10 * OPT + 2 of Johnson, Demers, Ullman, Garey and Graham.

The proof is the amortized weighting argument of Dósa and Sgall, Section 1.2, with sizes in ℕ and bin capacity C, all weights scaled by 10 * C. An item of size a has weight 12 * a (the scaled size 6/5 * a) plus a bonus (firstFitBonus): 4 * C if C < 2 * a, C if C ≤ 3 * a ≤ 3/2 * C, 6 * a - C if C < 6 * a < 2 * C, and 0 otherwise. These are Dósa and Sgall's bonuses 0.4, 0.1, 3/5 * (a - 1/6) and 0.

Dósa and Sgall's sketch in their Section 1.2 leaves three bins unaccounted for and concludes FF ≤ 1.7 * OPT + 3; they remark that examining those bins brings the constant down to 0.6. The case analysis of the remaining bins here, which gives 0.8, is our own; the constant is not new, as Xia and Tan's FF ≤ 1.7 * OPT + 0.7, reported in Dósa and Sgall, Section 1.1, is already stronger. Dósa and Sgall's main result, the absolute bound FF ≤ ⌊1.7 * OPT⌋ (Dósa and Sgall, Theorem 3.13), is not formalized here; neither is the matching lower-bound family of their Section 4.

Main definitions #

Main results #

References #

The bonus of an item of size a in bins of capacity C, scaled by 10 * C.

The weight of an item of size a, scaled by 10 * C.

The weight of a bin is at most 17/10: the items of a bin of capacity C have total weight at most 17 * C, that is 17/10 after scaling by 10 * C.

The amortized weight of First Fit bins #

First Fit uses at most 17/10 * OPT + 4/5 bins: against any packing Q of the same items, 10 * FF ≤ 17 * Q.length + 8. This is the asymptotic 17/10 bound of Johnson, Demers, Ullman, Garey and Graham with the additive constant 4/5, by the weighting argument of Dósa and Sgall, Section 1.2. The constant is not tight: Dósa and Sgall prove FF ≤ ⌊17/10 * OPT⌋.

First Fit uses at most ⌈17/10 * OPT⌉ bins, the bound of Garey, Graham, Johnson and Yao as reported by Dósa and Sgall, Section 1.1.