1,627 views
0 votes
0 votes

Consider the following items with their associated weights and values.
 

If a knapsack of capacity 25 units of weight is available and we are allowed to take either the item completely or leave it the maximum possible profit if we follow the greedy approach by being greedy about profit is _____

1 Answer

Best answer
3 votes
3 votes

As in question it is asked to use greedy approach, hence we will first calculate profit per unit  (Value / weight )

Item Value / Weight
1 11
2 2.57
3 3.4
4 4.33
5 2.7
6 8
7 12

Now we have to select items in decreasing order of value per unit such that they doesn’t exceed the max capacity of 25 unit.

Items we choose are ITEM7 (1kg) + ITEM1 (2kg) + ITEM6(2kg) + ITEM4(3kg) + ITEM3(5kg) + ITEM5(10kg)

Maximum possible weight= 23kg

Maximum possible profit = 107 

selected by

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3
Parshu gate asked Nov 16, 2017
8,259 views
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. PQRSTUVWWeight1812161416201015Profit341522161722...
0 votes
0 votes
1 answer
4
LavTheRawkstar asked Apr 15, 2017
3,950 views
Consider the following instance of the knapsack problem: n=3 , W=50 , (v1,v2,v3) = (60,100,120) and weight (w1,w2,w3) = (10,20,30) .solve the given knapsack problem apply...