1,940 views

2 Answers

Best answer
4 votes
4 votes

the correct answer is (b)

If you go through this heuristic approach you will get the value will be:

first, find value per wt--->

ob1: 3/7=0.42

ob2: 6/3=2

ob3: 8/5=1.6

ob4: 1/1=1

ob5: 2/4=0.5

ob6: 5/2=2.5

ob7: 7/6=1.16

Then arrange in descending order:

Ob6--> ob2--> ob3--> ob7--> ob4-->ob5-->ob1

now calculate the profit: (5+6+8+7+1+2=29)

The second question it is asking whether it is optimal or not:--->

to check this we need to try for normal 0/1 knapsack hit and trial to see whether it is possible to get more than 29 in 0/1 knapsack keeping maximum wt. of 24.

Ob3             5           8

Ob7             6           7

Ob2             3           6

Ob6             2           5

Ob1             7           3

Ob4             1           1


 total           24          30


As we can see we can get profit of 30 without using that heuristic approach in 0/1 knapsack. therefore the heuristic approach is definitely not optimal.

selected by
1 votes
1 votes
i 1 2 3 4 5 6 7
v 3 6 8 1 2 5 7
w 7 3 5 1 4 2 6
v/w 0.4 2 1.6 1 0.5 2.5 1.16

After then arrange decresing order according to v/w:-

 T6----T2---T3----T7----T4----T5----T1

Profit : 5+6+8+7+1+2 = 29.

but using optimal substructure :

Profit : 5+6+8+7+1+2+3*(3/7) = 29+1.28 =30.28

hence Correct option is : B

Related questions

0 votes
0 votes
1 answer
1
LavTheRawkstar asked Apr 15, 2017
3,977 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
2
Parshu gate asked Nov 16, 2017
8,269 views
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. PQRSTUVWWeight1812161416201015Profit341522161722...
1 votes
1 votes
1 answer
3
LavTheRawkstar asked Feb 28, 2017
13,154 views
Consider the Knapsack incidence with n=3(items) with weights {w1,w2,w3}={2,3,4} and profits are {p1,p2,p3}={1,2,5}Given the capacity is 5,{W/M = 5 } Find the optimal solu...
1 votes
1 votes
1 answer
4
Aradhana Singh asked Oct 25, 2016
582 views
what is the difference between fractional knapsack and 0-1 problem . pl explain concepts with simple problems