public class DenseLPEx3 extends Object
Solves a linear programming problem in \(5\) variables.
This example solves the following linear programming problem:$${\rm {max}} \,\, f(x) = 10x_1 + 15x_2 + 15x_3 + 13x_4 + 9x_5$$
subject to the following set of constraints,
$$ \begin{array}{cc} 100x_1 + 50x_2 + 50x_3 + 40x_4 + 120x_5 &\le& 300\\ 40x_1 + 50x_2 + 50x_3 + 15x_4 + 30x_5 &\le& 40 \end{array} $$and bounds: $$0.0 \le x_i \le 1.0, i=1,2,\ldots,5$$
Note that since DenseLP
minimizes, the sign of the
objective function must be changed to compute this solution. The signs of the
dual solution components and the optimal value must also be changed. Because
\(x_2\) and \(x_3\) are not uniquely determined within the bounds, this
problem has a convex family of solutions. DenseLP issues an exception,
MultipleSolutionsException
. A particular solution is available
and retrieved in the finally
block.
Constructor and Description |
---|
DenseLPEx3() |
Copyright © 2020 Rogue Wave Software. All rights reserved.