9.8 An ILP model for the Unbounded Knapsack Problem¶
Part 2 · Formulations and their properties · Chapter 9 · Chapter 9: Knapsack problems · Lecture notes, volume 2 (PDF) · Slides · Exercises: Knapsack problems · App: LP relaxation and upper bounds for the 0/1 KP
The Unbounded Knapsack Problem and its reference instance (Example 2.4) are defined in Chapter 2 «Knapsack problems», Section 2.5.
-
We introduce the following \(n\) integer variables:
\[\begin{equation*} \label{INT_VAR_UKP} x_j = \textrm{number of copies of item $j$ inserted in the knapsack} \qquad \forall j \in \mathscr{I}. \tag{9.24} \end{equation*}\]
Using these variables, an Integer Linear Programming (ILP) model for the Unbounded Knapsack Problem (UKP) reads as follows:
This ILP model is referred to as the \(\mathrm{ILP}_{\mathrm{UKP}}\) model.
-
Description of the objective function and constraints of the \(\mathrm{ILP}_{\mathrm{UKP}}\) model:
-
the linear objective function \(\eqref{obj_UKP}\) maximizes the total profit of the item copies selected in the knapsack;
-
constraint \(\eqref{cons1_UKP}\) ensures that the total weight of the selected item copies does not exceed the knapsack capacity (one linear constraint);
-
finally, constraints \(\eqref{cons2_UKP}\) define the variables of the ILP model; the capacity constraint already gives \(x_j \le \hat{b}_j = \lfloor c/w_j \rfloor\), for every \(j \in \mathscr{I}\).
-
Example 9.12: \(\mathrm{ILP}_{\mathrm{UKP}}\) model
We consider a knapsack of capacity \(c = 9\) and a set \(\mathscr{I} = \{1,2,3,4,5,6\}\) of \(6\) items (\(n = 6\)), each available in an unlimited number of copies, with the following profits and weights:
This is the UKP instance of Example 2.4. The \(\mathrm{ILP}_{\mathrm{UKP}}\) model for this UKP instance is:
An optimal solution \(~{\tilde{\vet x}}(\mathrm{ILP}_{\mathrm{UKP}})\) is:
The optimal value \(z(\mathrm{ILP}_{\mathrm{UKP}})\) is \(24\). The associated optimal solution of the UKP takes four copies of item \(1\), and it is the unique optimal solution.
Next: 9.9 An ILP model for the Multidimensional Knapsack Problem