Let r[i][j]r[i][j] be the maximum value we can carry using only items 1 to i given a knapsack of сарacity j. Suppose there are 4 items in the shop. The values of the items are [5, 7, 10, 6] and the weights of the items are [3, 2, 4, 1]. 1. If our knapsack has capacity 1, compute r[i][1] for each 1<=i<=4. Which items should we take?

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter2: Basic Linear Algebra
Section: Chapter Questions
Problem 15RP
icon
Related questions
Question
Let r[i][j]r[i][j] be the maximum value we can
carry using only items 1 to i given a knapsack of
сарacity ij.
Suppose there are 4 items in the shop. The
values of the items are [5, 7, 10, 6] and the
weights of the items are [3, 2, 4, 1].
1. If our knapsack has capacity 1, compute r[i][1]
for each 1<=i<=4. Which items should we take?
Transcribed Image Text:Let r[i][j]r[i][j] be the maximum value we can carry using only items 1 to i given a knapsack of сарacity ij. Suppose there are 4 items in the shop. The values of the items are [5, 7, 10, 6] and the weights of the items are [3, 2, 4, 1]. 1. If our knapsack has capacity 1, compute r[i][1] for each 1<=i<=4. Which items should we take?
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Heuristic Path Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole