Question: Consider the knapsack problem discussed in class. We now add the requirement that x_i = 1 or x_i = 0, Forall i. That is, an

 Consider the knapsack problem discussed in class. We now add the

Consider the knapsack problem discussed in class. We now add the requirement that x_i = 1 or x_i = 0, Forall i. That is, an object is either completely included or not included into the knapsack. We call this new version of knapsack problem as 0/1 Knapsack problem, and we still want to maximize the profit subject to the total weight lessthanorequalto M. (a) One greedy strategy is: consider the objects in order of nonincreasing profit p_i, add the object into the knapsack if it fits. Show that this strategy doesn't necessarily yield optimal solutions. (b) One greedy strategy is: consider the objects in order of nonincreasing density p_i/w_i: add the object into the knapsack if it fits. Show that this strategy doesn't necessarily yield optimal solutions

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!