Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

XIl. (continued) Using the same items, determine the maximum value in the knapsac repetitions: i.e., if there are an unlimited number of each item so that item can be chosern Find the missing values in the following linear array. P(w) is the maximum obtainable for a knapsack of capacity w k if we allow more than one such profit 0 1 2 3 4 5 6 7 8 9 P(w): 0 0 1 6 12 12 13 18 ? P(8) P(9) 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.

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

Step: 1

Answer Formula miw maxmi1w m1iwwi pi where i is number of items w is column numberweight wi weight o... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

South Western Federal Taxation 2016 Corporations Partnerships Estates And Trusts

Authors: James Boyd, William Hoffman, Raabe, David Maloney, Young

39th Edition

978-1305399884

More Books

Students also viewed these Programming questions