Question: XII. (22 points) Consider the following items in the Knapsack Problem: 0 1 2 8 ! 0 0 0 3 40 Item 1 2
![XII. (22 points) Consider the following items in the Knapsack Problem Item weight 9. value $6 $12 $1 $4 Knapsack capacity W 2 2 4 In the Fractional Knapsack Problem, what is the maximum value that can put in the knapsack? be (a) $15 (b) $23 (c) $25 d) $20 Using the same items as in part (a), the Dynamic Programming approach outlined in the book and discussed in class produces a (n 1)x (W+ 1) table containing the maximum values P]lw] for a knapsack of capacity w, considering the first i items. w? 2 0 0 0 6 12 12 12 18 18 18 3 0 0 1 6 12 12 13 18 18 19 4 0 0 1 6 12 12 13 18?? Compute the missing values in this table using the formula outlined in the textbook and in class P[4][8] Starting from the value of Pl4]19] (the maximum profit for the 0-1 Knapsack in this case which items are placed in the knapsack to achieve this maximum value? Using the procedure discussed in class, show how you arrived at your answer.](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/6308c221be702_3696308c2215c53d.jpg)

XII. (22 points) Consider the following items in the Knapsack Problem: 0 1 2 8 ! 0 0 0 3 40 Item 1 2 3 4 (a) $15 (b) $23 (c) $25 (d) $20 In the Fractional Knapsack Problem, what is the maximum value that can be put in the knapsack? P[4][8] = P[4][9] = 0 0 0 0 Using the same items as in part (a), the Dynamic Programming approach outlined in the book and discussed in class produces a (n + 1) x (W+ 1) table containing the maximum values P[i][w] for a knapsack of capacity w, considering the first i items. w 0 0 1 1 weight 3 6 6 6 6 4 6 12 12 12 2 4 value $6 $12 $1 $4 6 12 12 12 Knapsack capacity W = 9. 6 6 18 18 19 ? 6 6 12 18. 13 18 18 13 18 ? Compute the missing values in this table using the formula outlined in the textbook and in class Starting from the value of P[4][9] (the maximum profit for the 0-1 Knapsack in this case) which items are placed in the knapsack to achieve this maximum value? Using the procedure discussed in class, show how you arrived at your answer. XII. (continued) Using the same items, determine the maximum value in the knapsack if we allow repetitions; i.e., if there are an unlimited number of each item so that more than one such item can be chosen. Find the missing values in the following linear array. P(w) is the maximum profit obtainable for a knapsack of capacity w. 0 1 P(W): 0 0 P(8) = P(9) = 2 3 1 6 W 4 5 6 7 8 9 12 12 13 18 ? ? Which items should be put in the knapsack to achieve the maximum value P(9)? Using the procedure described in class, show how you arrived at your answer.
Step by Step Solution
3.39 Rating (155 Votes )
There are 3 Steps involved in it
To solve the given photos knapsack problems well address each part stepbystep Fractional Knapsack Pr... View full answer
Get step-by-step solutions from verified subject matter experts
