Each explicit LP solving function takes four arguments to represent an LP problem in n variables with m constraints:
The vector maximising the LP problem, with an integer describing the state of the solution.
The vector minimising the LP problem, with an integer describing the state of the solution.
The integer vector maximising the LP problem, with an integer describing the state of the solution.
The integer vector minimising the LP problem, with an integer describing the state of the solution.
The vector with each entry either zero or one maximising the LP problem, with an integer describing the state of the solution.
The vector with each entry either zero or one minimising the LP problem, with an integer describing the state of the solution.
> R := RealField( ); > lhs := Matrix(R, 2, 2, [10, 21, 2, 1]); > rhs := Matrix(R, 2, 1, [156, 22]); > rel := Matrix(R, 2, 1, [-1, -1]); // negative values - less-or-equal relation > obj := Matrix(R, 1, 2, [8, 15]); > MaximalSolution(lhs, rel, rhs, obj); [9.562500000000000000 2.875000000000000888] 0
> R := RealField( ); > lhs := Matrix(R, 1, 7, [3534, 2356, 2767, 589, 528, 451, 304]); > rhs := Matrix(R, 1, 1, [119567]); > rel := Matrix(R, 1, 1, [-1]); > obj := Matrix(R, 1, 7, [592, 381, 273, 55, 48, 37, 23]); > MaximalSolution(lhs, rel, rhs, obj); [33.83333333333333570 0.E-92 0.E-92 0.E-92 0.E-92 0.E-92 0.E-92] 0 > MaximalIntegerSolution(lhs, rel, rhs, obj); [33.00000000000000000 1.000000000000000000 0.E-92 1.000000000000000000 0.E-92 0.E-92 0.E-92] 0 > MaximalZeroOneSolution(lhs, rel, rhs, obj); [1.000000000000000000 1.000000000000000000 1.000000000000000000 1.000000000000000000 1.000000000000000000 1.000000000000000000 1.000000000000000000] 0