Question: Consider this Knapsack problem (without repetitions with 4 items, having weights and values as follows): The weights (in pounds) are w 1 = 9, w
Consider this Knapsack problem (without repetitions with 4 items, having weights and values as follows):
The weights (in pounds) are w1 = 9, w2 = 6, w3 = 12, and w4 = 2.
The dollar values of these items are, v1 = 5, v2 = 3, v3 = 9, and v4 = 3. The capacity of the knapsack is 13.
Consider running the dynamic programming algorithm for this problem on the above inputs. The algorithm fills in a table of entries K(w, j), where K(w, j) denotes the maximum value achievable using capacity at most w, if you are only allowed to use items 1 through j
Part 1:
When the algorithm computes K(13, 4), which two previously computed K(w, j) table entries does it access?
Part 2:
What is the maximum value that can be achieved for this problem? That is, what value will be assigned to table entry K(13, 4)?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
