• edited by
1,504 views
0 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.

 

\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|}
\hline Item & a & b & c & d & e & f & g & h & i & j \\
\hline Weight & 30 & 50 & 20 & 10 & 120 & 100 & 90 & 90 & 40 & 10 \\
\hline Profit & 70 & 95 & 30 & 30 & 260 & 190 & 180 & 170 & 50 & 40 \\
\hline
\end{tabular}

1 Answer

0 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
Position:
Show:

Related questions

0 0 votes
1 1 answer
1.6k
1.6k views
ryandany07 asked Aug 18, 2022
1,639 views
int max(int a, int b) { return (a b) ? a : b; }// Returns the maximum value that can be// put in a knapsack of capacity Wint knapSack(int W, int wt[], int val[], int n){...