Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please only answer if you are 100% sure of what you are doing. Dynamic programming algorithms and optimal solution. 1) Using Dynamic Programming You are

image text in transcribed

Please only answer if you are 100% sure of what you are doing. Dynamic programming algorithms and optimal solution.

1) Using Dynamic Programming You are given n objects which cannot be broken into smaller pieces Moreover, you have exactly one copy of each object. Each object (where 1 sis n) has weight w,> 0 and value v,> 0. You have a knapsack that can carry a total weight not exceeding W. Your goal is to fill the knapsack in a way that maximizes the total value of the included objects, while respecting the capacity constraint. For each object 1 (where 1 sisn), either you bring it or not a) Let optli, j] be the maximum value of the objects we can carry if the weight limit is j and we are only allowed to include objects numbered from 1 to i Fill the gaps in the following recursion defined for all 0 s is n and all 0 sj s W. opt i, j]- otherwise b) Consider the following input and fill the table corresponding to the recursion you found before: n-6, w-1, w2-3, w3-2, w4-5,ws -4, w,-7, v -2, v2-3, v3-5, V4-7,v5-11, vo-13 and W-10. Moreover, give all optimal solutions

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

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago