Best-fit bin packing

Best-fit is an online algorithm for bin packing.

Its input is a list of items of different sizes.

Its output is a packing - a partition of the items into bins of fixed capacity, such that the sum of sizes of items in each bin is at most the capacity.

The best-fit algorithm uses the following heuristic: Denote by BF(L) the number of bins used by Best-Fit, and by OPT(L) the optimal number of bins possible for the list L. The analysis of BF(L) was done in several steps.

Worst-Fit is a "dual" algorithm to best-fit: it tries to put the next item in the bin with minimum load.

This algorithm can behave as badly as Next-Fit, and will do so on the worst-case list for that