8. a. The first-fit decreasing algorithm (FFD) places items of sizes 0.7, 0.2,
and 0.1 in the first bin and items of sizes 0.5 and 0.4 in the second one.
Since ∗≥dP5
=1 e=2at least two bins are necessary, making the
solution obtained by FFD optimal.
b. The answer is no: if it did, FFD would be a polynomial time algo-
rithm that solves this NP-hard problem. Here is one counterexample:
c. Obviously, FFD is a polynomial time algorithm. If FFD yields
bins while the optimal number of bins is ∗we know from the properties
quoted in the hint that the number of items in the extra bins is at most
∗−1with each of the items be of size at most 1/3. Therefore the total
number of extra bins is at most d(∗−1)3e, and we have the following
upper bound on the approximation’s accuracy ratio:
d. Note the two versions of this task. The easy one would simply com-
pare which of the two greedy algorithms yields a more accurate solution
more often. It is easy because, in this form, one doesn’t need to know the
27