Question: 3. Given n items {1,.., n), and each item i has a nonnegative weight wi and a distinct value v. We can carry a maximum

 3. Given n items {1,.., n), and each item i has

3. Given n items {1,.., n), and each item i has a nonnegative weight wi and a distinct value v. We can carry a maximum weight of W in a knapsack. The items are blocks of cheeses so that for each item i, we can take only a fraction xi of it, where 0 x, 1 . Then item i contributes weight X,Wi and value x v in the knapsack. The continuous knapsack problem asks you to take a fraction of each item to maximize the total value, subject to the total weight does not exceed W. The original knapsack problem is equivalent to say xi is either 0 or 1 depends whether the item is in or not. Give an O(n) algorithm for the continuous knapsack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!