Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 [6-2 marks] A. Apply the dynamic programming algorithm discussed in Chapter 7 to fill the given table for a knapsack instance of 7

image text in transcribed

Exercise 3 [6-2 marks] 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. 0 0 7 V=18, S6=46 0 V=3, S7=1 70 52 B. A way to find the items forming an optimal solution is to sort the items in decreasing order according toys , where V; and S; are the value and the size of item . If there is a sequence of successive items starting from the item 1 where their total size is equal to C (The knapsack capacity), then they form an optimal solution. Use this method to find and optimal solution (indicate its items, total value and total size)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

110. Let X have the pdf fX(x) 2/x3, x 1. Find the pdf of .

Answered: 1 week ago

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago