edited by
7,412 views

1 Answer

Best answer
6 votes
6 votes

Step:1  

Find the ratio of value and weights.

item weight value p=v/w
1 2 10 5
2 3 5 1.67
3 5 15 3
4 7 7 1
5 1 6 6
6 4 18 4.5
7 1 3 3

Step 2:

Arrange in order of decreasing p.

item w v p
5 1 6 6
1 2 10 5
6 4 18 4.5
7 1 3 3
3 5 15 3
2 3 5 1.66
4 7 7 1

Step:3

Go on putting items in bag until capacity becomes 15.

 put item 5,1,6.7,3 and fractional part of item 2 only weight 2 out of 3.

So value of fractional part of item 2= 2*5/3=3.33

Step 4:

Now simply add the values and you will get 6+10+18+3+15+3.33=55.33

selected by

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
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...
0 votes
0 votes
1 answer
3
Na462 asked Apr 30, 2018
647 views
Is fractional Kanpsack or knapsack problem in our GATE 2019 Syllabus
1 votes
1 votes
1 answer
4
LavTheRawkstar asked Mar 25, 2017
2,588 views
Number of Cateogires are 5, Thier total weights are w1,w2,w3,w4,w5={7,2,4,8,6}b1,b2,b3,b4,b5={5,6,4,3,2}M=6=Maximum Capacity= WI am having confusion How to solve using dy...