in Algorithms retagged by
617 views
0 votes
0 votes

Maximum profit using 0/1 Knapsack with W=200

 is there any other than brute force method to solve this??? or we have to do only with tabular method?please solve and mention the way that is efficient w.r.t time if any.

 

in Algorithms retagged by
617 views

4 Comments

in gate they give 4 or 5 elements so hit and trial works for it.
0
0
Please put total question

otherwise it cannot be solved
0
0
Give the Capacity Of Knapsack?
0
0
0
0

1 Answer

0 votes
0 votes
First of all you have to find profit by weight ratio and then according to ratio you have put this in tabular form

 according to weight= 10+10+30+120+20

then profit according to weight is= 40+30+70+260+30 = 430

 Answer is 430
edited by

4 Comments

This is dynamic one and in fractional knapsack 200 complete weight is useful but in this Weight of capacity 10 left behind.
1
1

@Rahul271996 how u did it? hit and trial? tabular method?plz see my Question note and ans accordingly.

0
0
This process is similar to that fractional knapsack but in this, you have to take either full or not means that you can not take fraction part you have to left it.
0
0