Consider the set of items S = {a, b, c, d, e, f, g, h}, where the items have the following (benefit, weight) values: a. (14,3) b. (5,1) c. (10,6) d. (12,4) e. (8,2) f. (10,4) g. (16,8) h. (9,9) Goal: we want to maximize our benefit by picking items, where the maximum total allowed weight for us is Wmax = 15. Can we use greedy algorithm to solve this problem or not? Why or why not? If yes, how to solve it using greedy algorithm? What is the time complexity of your solution?

icon
Related questions
Question
Consider the set of items S = {a, b, c, d, e, f, g, h}, where the items have the following
(benefit, weight) values:
a. (14,3)
b. (5, 1)
c. (10,6)
d. (12,4)
e. (8,2)
f. (10,4)
g. (16,8)
h. (9,9)
Goal: we want to maximize our benefit by picking items, where the maximum total
allowed weight for us is Wmax = 15.
Can we use greedy algorithm to solve this problem or not? Why or why not?
If yes, how to solve it using greedy algorithm? What is the time complexity of your
solution?
Transcribed Image Text:Consider the set of items S = {a, b, c, d, e, f, g, h}, where the items have the following (benefit, weight) values: a. (14,3) b. (5, 1) c. (10,6) d. (12,4) e. (8,2) f. (10,4) g. (16,8) h. (9,9) Goal: we want to maximize our benefit by picking items, where the maximum total allowed weight for us is Wmax = 15. Can we use greedy algorithm to solve this problem or not? Why or why not? If yes, how to solve it using greedy algorithm? What is the time complexity of your solution?
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer