Is a Knapsack solution considered infeasible if one of its values is a fraction?

85 Views Asked by At

In the realm of Linear Programming - more specifically, looking into Branch and Bound Algorithms - if finding a solution to the Knapcack problem involes using a fraction of an item to fit inside the sack, does that mean its solution is infeasible? E.g. it cannot be used.

For example, I am working on the following question: $$ maximize \quad 8x_1\ +\ 7x_2\ +\ 10x_4\ +\ 3x_5\\ subject\ to \quad 2x_1\ +\ 2x_2\ +\ 4x_3\ +\ 5x_4\ +\ 3x_5\ \leq8\\ x_1,x_2,x_3,x_4,x_5\ =\ 0\ or\ 1 $$

In terms of branch-and-bounding the problem, I have found a maximised solution for the above question, and then a solution for each of its two children.

The first solution has the most maximized value of 23, but $x_4$=0.8, so I had to branch.

For its children's solutions: one has a value of 21.5 (less than the original and it also involves a fraction); the other has a value of 22, but none of its variables are fractions. Does this mean the branch with the value of 22 is the solution to the problem?

Note: the reason I ask, even though I know that the Knapsack problem comes under Integer Programming (i.e. values must be integers) is because my course has not been explicit enough with its teachings, I feel. I just want to be sure.

1

There are 1 best solutions below

1
On BEST ANSWER

The knapsack problem states that there are discrete items numeberd by $i$, with weight $w_i$ and value $v_i$, and a knapsack of capacity $C$. What you want is to find the maximum of $\sum_i x_i v_i$ subject to $\sum_i x_i w_i \le C$ and $x_i \in \{ 0, 1\}$. It is an integer linear problem. So yes, fractional $x_i$ aren't solutions.