in Algorithms edited by
990 views
1 vote
1 vote

Consider the following instance of the $0 -1$ Knapsack problem:

  • $\max\; 6X_{1} + 11X_{2} + 16X_{3} + 21X_{4} + 26X_{5}$
  • Subject to $4X_{1} + 8X_{2} + 12X_{3} + 16X_{4} + 20 X_{5} < 32$
  • and $X_{i}=0$ or $1$ for $i=1,\dots,5$.

It is required to find all the optimal solutions to this instance using the branch and bound technique.

  1. State what method you would use to compute bounds on the partial solutions.
  2. Using a suitable branching technique, generate the entire search tree for this instance of the problem and find all the optimal solutions. Number the nodes in the tree in the order in which they are expanded and for each node show the bound on the partial solutions and the decision which leads to that node.
in Algorithms edited by
990 views

4 Comments

Answer will be $43.$ if we doesnot use partial solution
0
0
edited by
Is it possible to use more than one unit for an item?Not possible. right??

I mean

If we take $5$ unit of $X_{1}$ then profit will be $30.$

but if we take $X_{5}$ for maximum profit, it will take $26.$

So, which one should we take?
0
0
edited by

@Arjun Sir, Can you verify my approach?How to formulate it as search tree?

As every variable has 2 possible outcomes (0 or 1),$\therefore$ Solution space is $2^{5} = 32$.
    
Feasible solution is the set of all possible values that satisfy the problem's constraints. Constraints says that maximum weight of Knapsack < 32 and $X_{i}=1,  \forall i\in{1\cdots5}$ is weight of items.

Max is calculated whenever $X_{i}=1,  \forall i\in{1\cdots5}$ and multiplying with the profit of corresponding items to be placed in Knapsack. It is required to find maximum among all the feasible solution.

For example : 1 possible Feasible solution is (0,0,0,0,0). $Max :6*0+11*0+16*0+21*0+26*0 = 0.$  Following are the other feasible solution.

\begin{array}{|c|c|c|c|c|c|}  
    \hline
    X_{1} & X_{2} & X_{3} & X_{4} & X_{5}  & Max\\
    \hline
    1 & 1 & 1 & 0 & 0 & (6+11+16)= 34 \\
    1 & 0 & 0 & 1 & 0 & (6+21)= 27 \\
    1 & 1 & 0 & 1& 0 & (6+11+21)= 38 \\
    0 & 1 & 0 & 0 & 1 & (26+11)= 37 \\
    1 & 0 & 0 & 0 & 1 & (6+26)= 32\\
    0 & 1 & 1 & 0 & 0 & (11+16)= 27\\
    0 & 1 & 0 & 1 & 0 & (11+21)= 32\\
    1 & 0 & 1 & 0 & 0 & (6+16)= 22\\
    \hline    
\end{array}

Optimal Solution is (1,1,0,1,0), for which we are getting Max = 38.

Some Infeasible solution
$\begin{array}{|c|c|c|c|c|c|}  
    \hline
    X_{1} & X_{2} & X_{3} & X_{4} & X_{5}  & Infeasible Weights\\
    \hline
    0 & 0 & 0 & 1 & 1 & 16+20>32 \\
    0 & 0 & 1 & 0 & 1 & 12+20=32 \\
    1 & 1 & 0 & 0& 1 & 4+8+20=32 \\
    0 & 1 & 1 & 1 & 0 & 8+12+16>32 \\
    \hline    
\end{array}$

Max possible nodes in search tree will be 9, as these are feasible solution and remaining 32-9=23 are infeasible solution.

Further Read: https://cs.stackexchange.com/q/1052

0
0

Please log in or register to answer this question.

Related questions