Question

3. Apply the dynamic programming algorithm discussed in class to solve the knapsack problem. (20 points) a. Show the complete

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:-

(a) The table has been constructed according to bottom up dynamic approach of 0/1 Knapsack algorithm. Along the horizontal axis you have the weights upto the capacity of the bag that is 7 and along the vertical axis you have items.

Item 1 2 3 4 5
Weight 2 3 5 2 7
Pounds 9 12 14 8 20

Knapsack table:

در ܢܬ .4 5 6 7 D o o o ☺ O O o o o CG o 9 9 q 2 o o o a بيا o 12 12 21 21 21 12 12|21|21 23 12117 21 21 29 12 17 21 2129 O 9

(b) Items included in the final configuration are Item 1 , Item 2 , Item 4.

(c) The maximum value that can fit in the knapsack using a configuration of these items is 29.

Add a comment
Know the answer?
Add Answer to:
3. Apply the dynamic programming algorithm discussed in class to solve the knapsack problem. (20 points)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT