Question
Using the dynamic programming approach, solve the following knapsack problem: The capacity of the knapsack W = 89654. The number of available items = 10.
Using the dynamic programming approach, solve the following knapsack problem: The capacity of the knapsack W = 89654. The number of available items = 10. The weights of the items w = ( 32586 16759 26071 5206 2585 43920 12768 26671 43131 8328 ). The values of the items v = ( 17307 30630 83639 35025 24495 13623 35603 33596 11755 39004 ). Construct the table and use backtracking to answer the following questions:
Was item 1 picked? (write 1 if picked and 0 otherwise) Was item 2 picked? (write 1 if picked and 0 otherwise) Was item 3 picked? (write 1 if picked and 0 otherwise) Was item 4 picked? (write 1 if picked and 0 otherwise) Was item 5 picked? (write 1 if picked and 0 otherwise) Was item 6 picked? (write 1 if picked and 0 otherwise) Was item 7 picked? (write 1 if picked and 0 otherwise) Was item 8 picked? (write 1 if picked and 0 otherwise) Was item 9 picked? (write 1 if picked and 0 otherwise) Was item 10 picked? (write 1 if picked and 0 otherwise) What is the total value of the picked items? What is the total weight of the picked items?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started