Indicator constraints in the Interactive Optimizer
Contrasts indicator constraints with a Big M formulation in the Interactive Optimizer.
In the Interactive Optimizer,
you can include indicator constraints among the usual linear constraints
in LP-file format. You can also use the commands enter and add with
indicator constraints. For example, you could declare y as a binary
variable and enter the following:
constr01: y = 0 -> x1 + x2 + x3 = 0
In plain English, that indicator constraint states that
if y is 0 (zero), then
x1 + x2 + x3 must be 0 (zero). Likewise,
if x1 + x2 + x3 is not 0 (zero),
then y must be 1 (one).
That formulation of an indicator constraint is recommended instead of the following Big M formulation:
constr01: x1 + x2 + x3 - 1e+9 y <= 0 // not recommended
That Big M formulation relies on the x values
summing to less than the Big M value (in this case, one billion).
Such an assumption may cause numeric instability or undesirable solutions
in certain circumstances, whereas a model with the indicator constraint,
by contrast, introduces no new assumptions about upper bounds. In
that respect, the use of indicator constraints instead of a Big M
formulation offers a more numerically stable model, closer to the
mathematical programming issues of the problem, and thus more likely
to produce useful solutions of the problem.