Approximation ratio
Denote by FF(L) the number of bins used by First-Fit, and by OPT(L) the optimal number of bins possible for the list L. The analysis of FF(L) was done in several steps. * The first upper bound of for FF was proven by Ullman in 1971. * In 1972, this upper bound was improved to by Garey, Graham and Ullman, Johnson and Demers. * In 1976, it was improved by Garey, Graham, Johnson, Yao and Chi-Chih to , which is equivalent to due to the integrality of and . * The next improvement, by Xia and Tan in 2010, lowered the bound to . * Finally, in 2013, this bound was improved to by Dósa and Sgall. They also present an example input list , for which matches this bound.Refined first-fit
Refined-First-Fit (RFF) is another online algorithm forThe algorithm
The items are categorized in four classes, according to their sizes: * -piece - size in . * -piece - size in . * -piece - size in . * -piece - size in . Similarly, the bins are categorized into four classes: 1, 2, 3 and 4. Let be a fixed integer. The next item is assigned into a bin in - * Class 1, if is an -piece, * Class 2, if is an -piece, * Class 3, if is an -piece, but not the th -piece seen so far, for any integer . * Class 1, if is the th -piece seen so far, * Class 4, if is an -piece. Once the class of the item is selected, it is placed inside items of that class using first-fit bin packing. Note that RFF is not an Any-Fit algorithm since it may open a new bin despite the fact that the current item fits inside an open bin (from another class).Approximation ratio
RFF has an approximation guarantee of . There exists a family of lists with for .See also
* First-fit-decreasing bin packing, First-Fit-Decreasing (FFD) is the offline variant of First-Fit: it accepts all input items, orders them by descending size, and calls First-Fit. Its asymptotic approximation ratio is much better: about 1.222 instead of 1.7.Implementations
* Python: ThReferences