9.10 An ILP model for the Multiple 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 Multiple Knapsack Problem and its reference instance (Example 2.6) are defined in Chapter 2 «Knapsack problems», Section 2.7.
-
We introduce the following \(n \, m\) binary variables:
\[\begin{equation*} \label{BIN_VAR_MKP} x_{jk} = \left\{ \begin{array}{ll} 1 & \textrm{if item $j$ is inserted in knapsack $k$}\\[1.5ex] 0 & \textrm{otherwise} \end{array} \qquad \forall j \in \mathscr{I},~\forall k \in \mathscr{K}. \right. \tag{9.28} \end{equation*}\]
Using these variables, an Integer Linear Programming (ILP) model for the Multiple Knapsack Problem (MKP) reads as follows:
This ILP model is referred to as the \(\mathrm{ILP}_{\mathrm{MKP}}\) model.
-
Description of the objective function and constraints of the \(\mathrm{ILP}_{\mathrm{MKP}}\) model:
-
the linear objective function \(\eqref{obj_MKP}\) maximizes the total profit of the items inserted in the knapsacks;
-
constraints \(\eqref{cons1_MKP}\) ensure that, in every knapsack \(k\), the total weight of the assigned items does not exceed the capacity \(c_k\) (\(m\) linear constraints, one for each knapsack);
-
constraints \(\eqref{cons2_MKP}\) ensure that each item is inserted in at most one knapsack (\(n\) linear constraints, one for each item);
-
finally, constraints \(\eqref{cons3_MKP}\) define the variables of the ILP model.
-
Example 9.14: \(\mathrm{ILP}_{\mathrm{MKP}}\) model
We consider \(m = 2\) knapsacks with capacities \(c_1 = 10\) and \(c_2 = 12\), and a set \(\mathscr{I} = \{1,2,3,4,5\}\) of \(5\) items (\(n = 5\)), with the following profits and weights:
This is the MKP instance of Example 2.6. The model has \(10\) variables, so we write one constraint per line. The \(\mathrm{ILP}_{\mathrm{MKP}}\) model for this MKP instance is:
An optimal solution \(~{\tilde{\vet x}}(\mathrm{ILP}_{\mathrm{MKP}})\) is:
The optimal value \(z(\mathrm{ILP}_{\mathrm{MKP}})\) is \(30\). The associated optimal solution of the MKP is \((\tilde{S}_1,\tilde{S}_2) = (\{1,2\},\{4,5\})\). The optimal solution is not unique: \((\{2,4\},\{1,5\})\) and \((\{4,5\},\{1,2\})\) have the same value.
Next: 9.11 An ILP model for the Multiple-Choice Knapsack Problem