In the binary knapsack problem, the goal is to solve the optimization problem: [ max _{boldsymbol{x} in{0,1}^{n}}
Question:
In the binary knapsack problem, the goal is to solve the optimization problem:
\[ \max _{\boldsymbol{x} \in\{0,1\}^{n}} \boldsymbol{p}^{\top} \boldsymbol{x} \]
subject to the constraints \[ \mathbf{A} \boldsymbol{x} \leqslant \boldsymbol{c} \]
where \(\boldsymbol{p}\) and \(\boldsymbol{w}\) are \(n \times 1\) vectors of non-negative numbers, \(\mathbf{A}=\left(a_{i j}\right)\) is an \(m \times n\) matrix, and \(\boldsymbol{c}\) is an \(m \times 1\) vector. The interpretation is that \(x_{j}=1\) or 0 depending on whether item \(j\) with value \(p_{j}\) is packed into the knapsack or not, \(j=1, \ldots, n\); The variable \(a_{i j}\) represents the \(i\)-th attribute (e.g., volume, weight) of the \(j\)-th item. Associated with each attribute is a maximal capacity, e.g., \(c_{1}\) could be the maximum volume of the knapsack, \(c_{2}\) the maximum weight, etc.
Write a CE program to solve the Sento1.dat knapsack problem at http://people.brunel.ac.uk/ mastjjb/jeb/orlib/files/mknap2.txt, as described in [16].
Step by Step Answer:
Data Science And Machine Learning Mathematical And Statistical Methods
ISBN: 9781118710852
1st Edition
Authors: Dirk P. Kroese, Thomas Taimre, Radislav Vaisman, Zdravko Botev