Question: Q5. Consider a 0-1 Knapsack Problem where we have four items with weights (in Kg) [1, 5, 3, 4] and corresponding values (in euro) [15,

Q5. Consider a 0-1 Knapsack Problem where we have four items with weights (in Kg) [1, 5, 3, 4] and corresponding values (in euro) [15, 10, 9, 5]. The Knapsack capacity is K 8 Kg. Using the notation P(i,j) for the maximum value we can obtain (in euro) from a choice amongst the first i items, with knapsack capacity j, use a Dynamic Programming strategy to calculate the table of values of P(i,j) from P(0,0) to P(4,8), keeping track of which items you choose. Hence state the optimal solution to the problem. (Please do not write the PYTHON code for this problem (25 marks) - rather the calculations done by hand.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
