From the Knapsack DP matrix given above, what is the maximum profit earned when the Capacity = 4 weights available = [2,3,4]

icon
Related questions
Question
Knapsack 0/1 problem:
Given N items where each item has some weight and profit associated with it and also given
a bag with capacity W, [i.e., the bag can hold at most W weight in it]. The task is to put the
items into the bag such that the sum of profits associated with them is the maximum
possible.
Given the problem is solved using a dynamic programming approach and the matrix derived
is given below, answer the below set of questions by analyzing the DP matrix.
weights = [2, 3, 4, 5], profits = [1, 2, 5, 6], Capacity W = 8
Capacity
2
3
Profits weights|0
1
2
5
16
14
|->
5
10
0
O
10
1 2 3 4
0 O
0 1 1
0 1
0 1
O
10
1
2 2
2
5
2
O
15
50
1
356
6
O
1
3
6
18
00378
7
10 10
1
3
7
7
1
18
Transcribed Image Text:Knapsack 0/1 problem: Given N items where each item has some weight and profit associated with it and also given a bag with capacity W, [i.e., the bag can hold at most W weight in it]. The task is to put the items into the bag such that the sum of profits associated with them is the maximum possible. Given the problem is solved using a dynamic programming approach and the matrix derived is given below, answer the below set of questions by analyzing the DP matrix. weights = [2, 3, 4, 5], profits = [1, 2, 5, 6], Capacity W = 8 Capacity 2 3 Profits weights|0 1 2 5 16 14 |-> 5 10 0 O 10 1 2 3 4 0 O 0 1 1 0 1 0 1 O 10 1 2 2 2 5 2 O 15 50 1 356 6 O 1 3 6 18 00378 7 10 10 1 3 7 7 1 18
From the Knapsack DP matrix given above,
what is the maximum profit earned when
the
Capacity = 4
weights available = [2,3,4]
5
1
8
2
Transcribed Image Text:From the Knapsack DP matrix given above, what is the maximum profit earned when the Capacity = 4 weights available = [2,3,4] 5 1 8 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer