35-1 Bin packing

Suppose that we are given a set of nn objects, where the size sis_i of the iith object satisfies 0<si<10 < s_i < 1. 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 11.

a. Prove that the problem of determining the minimum number of bins required is NP-hard\text{NP-hard}. (Hint:\textit{Hint:} 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 S=โˆ‘i=1nsiS = \sum_{i = 1}^n s_i.

b. Argue that the optimal number of bins required is at least โŒˆSโŒ‰\lceil S \rceil.

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 โŒˆ2SโŒ‰\lceil 2S \rceil.

e. Prove an approximation ratio of 22 for the first-fit heuristic.

f. Give an efficient implementation of the first-fit heuristic, and analyze its running time.

(Omit!)