I try to solve this 0-1 integer linear program (maximize, thus the minus) with LinearOptimization:
LinearOptimization[
-(15 x + 6 y + 0 a),
{
275 a >= 0,
a <= x,
a <= y,
a >= -1 + x + y,
a >= 0,
a <= 1,
x >= 0,
x <= 1,
y >= 0,
y <= 1
}, {x, y, a}, Integers
]
This should yield the solution x = y = a = 1
. However, I get the following error:
LinearOptimization::misupp: The CLP method does not support mixed integer optimization.
I introduced a
to linearize the constraint 275 x y >= 0
. Also, I used matrix/vector notation in LinearOptimization
LinearOptimization[-{15, 6, 0}, {
-{{0, 0, -275},
{-1, 0, 1},
{0, -1, 1},
{1, 1, -1},
{-1, 0, 0},
{1, 0, 0},
{0, -1, 0},
{0, 1, 0},
{0, 0, -1},
{0, 0, 1}},
{0, 0, 0, 1, 0, 1, 0, 1, 0, 1}}]
This works and returns {1,1,1}
.
The bottom approach shows that my constraints are linear, so why does Mathematica think my program is mixed-linear?
LinearOptimization[-(15 x + 6 y + 0 a), {275 a >= 0, a <= x, a <= y, a >= -1 + x + y, a >= 0, a <= 1, x >= 0, x <= 1, y >= 0, y <= 1, {x, y, a} ∈ Integers}, {x, y, a}]
$\endgroup$