Question: 3. Consider 0-1 knapsack problem with the capacity M = 35 and four objects with the following weights (w = 18, W = 15,
3. Consider 0-1 knapsack problem with the capacity M = 35 and four objects with the following weights (w = 18, W = 15, W3 = 10, W4 = 11) and profits (p = 25, P = 26, P3= 15, P4 = 17). a) (10 pts) Use the greedy algorithm with a strategy to choose in non-increasing order of Profit/Weight. b) (10 pts) Is this optimal/correct? Explain why.
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
a Greedy Algorithm with ProfitWeight Strategy Calculate the ProfitWeight ratio for each object Objec... View full answer
Get step-by-step solutions from verified subject matter experts
