9.9 An ILP model for the Multidimensional 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 Multidimensional Knapsack Problem and its reference instance (Example 2.5) are defined in Chapter 2 «Knapsack problems», Section 2.6.
-
We introduce the following \(n\) binary variables:
\[\begin{equation*} \label{BIN_VAR_MDKP} x_j = \left\{ \begin{array}{ll} 1 & \textrm{if item $j$ is selected in the knapsack}\\[1.5ex] 0 & \textrm{otherwise} \end{array} \qquad \forall j \in \mathscr{I}. \right. \tag{9.26} \end{equation*}\]
Using these variables, an Integer Linear Programming (ILP) model for the Multidimensional Knapsack Problem (MDKP) reads as follows:
This ILP model is referred to as the \(\mathrm{ILP}_{\mathrm{MDKP}}\) model.
-
Description of the objective function and constraints of the \(\mathrm{ILP}_{\mathrm{MDKP}}\) model:
-
the linear objective function \(\eqref{obj_MDKP}\) maximizes the total profit of the items selected in the knapsack;
-
constraints \(\eqref{cons1_MDKP}\) ensure that, in every dimension \(d\), the total weight of the selected items does not exceed the capacity \(c_d\) (\(k\) linear constraints, one for each dimension);
-
finally, constraints \(\eqref{cons2_MDKP}\) define the variables of the ILP model.
-
Example 9.13: \(\mathrm{ILP}_{\mathrm{MDKP}}\) model
We consider a \(2\)-dimensional knapsack (\(k = 2\)) with capacities \(c_1 = 10\) and \(c_2 = 12\), and a set \(\mathscr{I} = \{1,2,3,4\}\) of \(4\) items (\(n = 4\)), with the following profits and weights:
This is the MDKP instance of Example 2.5. The \(\mathrm{ILP}_{\mathrm{MDKP}}\) model for this MDKP instance is:
An optimal solution \(~{\tilde{\vet x}}(\mathrm{ILP}_{\mathrm{MDKP}})\) is:
The optimal value \(z(\mathrm{ILP}_{\mathrm{MDKP}})\) is \(14\). The associated optimal solution of the MDKP is \(\tilde{S} =\{3,4\}\), and it is the unique optimal solution.