35-1 Bin packing
Suppose that we are given a set of objects, where the size of the th object satisfies . We wish to pack all the objects into the minimum number of unit-size bins. Each bin can hold any subset of the objects whose total size does not exceed .
a. Prove that the problem of determining the minimum number of bins required is . ( Reduce from the subset-sum problem.)
The first-fit heuristic takes each object in turn and places it into the first bin that can accommodate it. Let .
b. Argue that the optimal number of bins required is at least .
c. Argue that the first-fit heuristic leaves at most one bin less than half full.
d. Prove that the number of bins used by the first-fit heuristic is never more than .
e. Prove an approximation ratio of for the first-fit heuristic.
f. Give an efficient implementation of the first-fit heuristic, and analyze its running time.
(Omit!)