Formulations of knapsack problems¶
Part 2 · Formulations and their properties · Chapter 9 · Lecture notes, volume 2 (PDF) · Slides · Exercises: Knapsack problems · App: LP relaxation and upper bounds for the 0/1 KP
Prerequisites
-
From the module Linear Programming, Chapter 9 «Duality theory»: the dual of an LP problem, weak and strong duality.
-
From the module Integer linear programming, Chapter 1 «Integer linear programming» and Chapter 2 «Primal and dual bounds»: ILP problems, LP relaxations and upper bounds.
-
From this module, Chapter 2 «Knapsack problems»: the 0/1 knapsack problem and its variants, their assumptions and their reference instances.
Objectives
At the end of this chapter you will be able to:
-
write the ILP model of the 0/1 Knapsack Problem and explain each of its constraints;
-
write the ILP models of the SSP, the BKP, the UKP, the MDKP, the MKP, the MCKP and the KPS, and write them on a numerical instance;
-
write the two LP relaxations and their duals, and compute their optimal solutions with closed formulas;
-
compute the split item, the residual capacity and the value \(z(\mathrm{LP}_{\mathrm{KP}})\);
-
compute the Dantzig and the Martello-Toth upper bounds, rounding them correctly;
-
explain why \(z(\mathrm{LP}_{\mathrm{KP}})\) is never larger than twice \(z(\mathrm{ILP}_{\mathrm{KP}})\).
9.1 Overview of the family¶
-
The ILP models of the knapsack problems use one variable \(x_j\) for each item \(j \in \mathscr{I}\): a binary variable when the item is selected or not, an integer variable when it counts the selected copies of the item.
-
Each capacity gives one knapsack constraint on the total weight of the selected items, and the objective function maximizes their total profit.
-
The members of the family add an index to the variables (the knapsack \(k\) of item \(j\) in the MKP), some constraints on the classes of items (MCKP, KPS) or binary setup variables \(y_h\) (KPS).
The common pattern of the knapsack models is
where the domain \(D_j\) is \(\{0,1\}\), \(\{0,1,\dots,b_j\}\) or \(\Z_{\ge 0}\). The members of the family change the domains and add capacities, knapsacks or classes.
- The table lists the members of the family, with the name of their ILP model and the section that writes it.
| Problem | Model | Variables | Section |
|---|---|---|---|
| KP | \(\mathrm{ILP}_{\mathrm{KP}}\) | binary \(x_j\) | 9.2 |
| SSP | \(\mathrm{ILP}_{\mathrm{SSP}}\) | binary \(x_j\) | 9.6 |
| BKP | \(\mathrm{ILP}_{\mathrm{BKP}}\) | integer \(x_j \in \{0,1,\dots,b_j\}\) | 9.7 |
| UKP | \(\mathrm{ILP}_{\mathrm{UKP}}\) | integer \(x_j \in \Z_{\ge 0}\) | 9.8 |
| MDKP | \(\mathrm{ILP}_{\mathrm{MDKP}}\) | binary \(x_j\), one constraint per capacity | 9.9 |
| MKP | \(\mathrm{ILP}_{\mathrm{MKP}}\) | binary \(x_{jk}\), item \(j\) in knapsack \(k\) | 9.10 |
| MCKP | \(\mathrm{ILP}_{\mathrm{MCKP}}\) | binary \(x_j\), one item per class | 9.11 |
| KPS | \(\mathrm{ILP}_{\mathrm{KPS}}\) | binary \(x_j\) and setup variables \(y_h\) | 9.12 |
-
Overview
Overview of the family
-
9.2 An ILP model for the 0/1 Knapsack Problem
Item efficiency · Split item and residual capacity · Some important theoretical properties
-
9.6 An ILP model for the Subset Sum Problem
-
9.7 An ILP model for the Bounded Knapsack Problem
-
9.8 An ILP model for the Unbounded Knapsack Problem
-
9.9 An ILP model for the Multidimensional Knapsack Problem
-
9.10 An ILP model for the Multiple Knapsack Problem
-
9.11 An ILP model for the Multiple-Choice Knapsack Problem
-
9.12 An ILP model for the Knapsack Problem with Setups
In summary
Next: 9.2 An ILP model for the 0/1 Knapsack Problem
Exercises on this chapter: Knapsack problems
In the interactive lab: LP relaxation and upper bounds for the 0/1 KP.