9.7 An ILP model for the Bounded 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 Bounded Knapsack Problem and its reference instance (Example 2.3) are defined in Chapter 2 «Knapsack problems», Section 2.4.
-
We introduce the following \(n\) integer variables:
\[\begin{equation*} \label{INT_VAR_BKP} x_j = \textrm{number of copies of item $j$ inserted in the knapsack} \qquad \forall j \in \mathscr{I}. \tag{9.22} \end{equation*}\]
Using these variables, an Integer Linear Programming (ILP) model for the Bounded Knapsack Problem (BKP) reads as follows:
This ILP model is referred to as the \(\mathrm{ILP}_{\mathrm{BKP}}\) model.
-
Description of the objective function and constraints of the \(\mathrm{ILP}_{\mathrm{BKP}}\) model:
-
the linear objective function \(\eqref{obj_BKP}\) maximizes the total profit of the item copies selected in the knapsack;
-
constraint \(\eqref{cons1_BKP}\) ensures that the total weight of the selected item copies does not exceed the knapsack capacity (one linear constraint);
-
finally, constraints \(\eqref{cons2_BKP}\) define the variables of the ILP model: each item \(j\) is taken at most \(b_j\) times.
-
Example 9.11: \(\mathrm{ILP}_{\mathrm{BKP}}\) 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\)), with the following profits, weights and available copies:
This is the BKP instance of Example 2.3. The \(\mathrm{ILP}_{\mathrm{BKP}}\) model for this BKP instance is:
An optimal solution \(~{\tilde{\vet x}}(\mathrm{ILP}_{\mathrm{BKP}})\) is:
The optimal value \(z(\mathrm{ILP}_{\mathrm{BKP}})\) is \(18\). The associated optimal solution of the BKP takes two copies of item \(1\) and one copy of item \(5\), and it is the unique optimal solution.