Exercise 3 A. Apply the dynamic programming algorithm discussed in Chapter 7 to fill the given table for a knapsack instance of 7 items having values 10, 5, 15, 7, 6, 18, 3 and sizes 2, 3, 5, 7, 1, 4,...


pls solve part a



Exercise 3<br>A. Apply the dynamic programming algorithm discussed in Chapter 7 to fill the given table for a<br>knapsack instance of 7 items having values 10, 5, 15, 7, 6, 18, 3 and sizes 2, 3, 5, 7, 1, 4, 1.<br>The knapsack capacity is C=13. The first row and the first column are already filled. The<br>value of the optimal solution is also given.<br>0sjsC=13<br>0 1234 5 6 78 9 10 11 12 13<br>0 0000 000000 0000<br>V=10, S;=2 |10<br>V=5, S;=3|20<br>V;=15, S;=5| 30<br>0 <is7<br>V=7, S4=7<br>40<br>V;=6, S;=1<br>50<br>V=18, S;=4 60<br>V;=3, S;=1 70<br>52<br>B. A way to find the items forming an optimal solution is to sort the items in decreasing order<br>according to '% where Vi and Si are the value and the size of item i. If there is a sequence of<br>successive items starting from the item 1 where their total size is equal to C (The knapsack<br>capacity), then they form an optimal solution. Use this method to find and optimal solution<br>(indicate its items, total yalue and total size).<br>Answer here:<br>

Extracted text: Exercise 3 A. Apply the dynamic programming algorithm discussed in Chapter 7 to fill the given table for a knapsack instance of 7 items having values 10, 5, 15, 7, 6, 18, 3 and sizes 2, 3, 5, 7, 1, 4, 1. The knapsack capacity is C=13. The first row and the first column are already filled. The value of the optimal solution is also given. 0sjsC=13 0 1234 5 6 78 9 10 11 12 13 0 0000 000000 0000 V=10, S;=2 |10 V=5, S;=3|20 V;=15, S;=5| 30 0

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here