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