Recall the knapsack problem from Section 16.2. There are n items, where the i th item is

Question:

Recall the knapsack problem from Section 16.2. There are n items, where the i th item is worth νi dollars and weighs wi pounds. We are also given a knapsack that can hold at most W pounds. Here, we add the further assumptions that each weight wi is at most W and that the items are indexed in monotonically decreasing order of their values. ν≥ ν2 ≥ ··· ≥ νn.

In the 0-1 knapsack problem, we wish to find a subset of the items whose total weight is at most W and whose total value is maximum. The fractional knapsack problem is like the 0-1 knapsack problem, except that we are allowed to take a fraction of each item, rather than being restricted to taking either all or none of each item. If we take a fraction xi of item i, where 0 ≤ xi ≤ 1, we contribute xiwi to the weight of the knapsack and receive value xiνi. Our goal is to develop a polynomial-time 2-approximation algorithm for the 0-1 knapsack problem.

In order to design a polynomial-time algorithm, we consider restricted instances of the 0-1 knapsack problem. Given an instance I of the knapsack problem, we form restricted instances Ij, for j = 1, 2, . . . ,n, by removing items 1, 2, . . . ,j – 1 and requiring the solution to include item j (all of item j in both the fractional and 0-1 knapsack problems). No items are removed in instance I1. For instance Ij, let Pj denote an optimal solution to the 0-1 problem and Qj denote an optimal solution to the fractional problem.

a. Argue that an optimal solution to instance I of the 0-1 knapsack problem is one of {P1, P2, . . . ,Pn}.

b. Prove that we can find an optimal solution Qj to the fractional problem for instance Ij by including item j and then using the greedy algorithm in which at each step, we take as much as possible of the unchosen item in the set {j + 1, j + 2, . . . ,n} with maximum value per pound νi/wi.

c. Prove that we can always construct an optimal solution Qj to the fractional problem for instance Ij that includes at most one item fractionally. That is, for all items except possibly one, we either include all of the item or none of the item in the knapsack.

d. Given an optimal solution Qj to the fractional problem for instance Ij, form solution Rj from Qj by deleting any fractional items from Qj. Let ν(S) denote the total value of items taken in a solution S. Prove that ν(Rj) ≥ ν(Qj)/2 ≥ ν(Pj)/2.

e. Give a polynomial-time algorithm that returns a maximum-value solution from the set {R1, R2, . . . ,Rn}, and prove that your algorithm is a polynomial-time 2-approximation algorithm for the 0-1 knapsack problem.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Introduction to Algorithms

ISBN: 978-0262033848

3rd edition

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

Question Posted: