 
Summary: CMPSCI 611: Advanced Algorithms
Micah Adler
Problem Set 5 Out: December 1, 2003
Due: December 9, 2003
1. In this problem we consider an approximation algorithm for the knapsack problem that only has a
constant performance ratio (i.e., not as good as the FPTAS considered in class), but runs much more
quickly.
(a) Let the density of item i be v i
=w i
(i.e., the value divided by the weight). Consider the following
algorithm, where W is the knapsack capacity:
Let S = ;.
Current weight = 0
For each item i in order from largest density to smallest density,
If Current weight + w i W then
S = S + i.
Current weight = Current weight + w i .
Return S.
Show that for any positive integer t, there is an input where this algorithm returns a solution that
is a factor of t worse than the optimal solution.
