logo

Crowdly

Consider the weights and values of items listed below. Note that there is only ...

βœ… The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Consider the weights and values of items listed below. Note that there is only one unit of each item.

Item

Weight

Value

1

10

60

2

7

28

3

4

20

4

2

24

The task is to pick a subset of these items such that their total weight is no more thanΒ 

11 Kgs and their total value is maximized. Moreover, no item may be split. The total value of items picked by an optimal algorithm is denoted by π‘‰π‘œπ‘π‘‘. A greedy algorithm sorts the items by their value-to-weight ratios in descending order and packs them greedily, starting from the first item in the ordered list. The total value of items picked by the greedy algorithm is denoted by π‘‰π‘”π‘Ÿπ‘’π‘’π‘‘π‘¦.

The value of π‘‰π‘œπ‘π‘‘βˆ’π‘‰π‘”π‘Ÿπ‘’π‘’π‘‘π‘¦ is ____

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.spit.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!