What is an indicator constraint?

Defines indicator constraints.

An indicator constraint is a way for a user of the Callable Library (C API) or Python API to express relationships among variables by identifying a binary variable to control whether or not a specified linear constraint is active. This feature is also available in the Interactive Optimizer, as explained in Indicator constraints in the Interactive Optimizer.

Formulations using indicator constraints can be more numerically robust and accurate than conventional formulations involving so-called Big M data if the Big M formulations use artificial data to turn on or turn off enforcement of a constraint. Such Big M formulations often exhibit trickle flow, and sometimes they behave in unstable ways. Replacement of such formulations with indicator constraints enables CPLEX either to branch explicitly on the indicator constraint, or to use MIP preprocessing to derive a tighter value of Big M that makes the formulation more stable.

In Concert Technology applications, CPLEX automatically uses indicator constraints for you when it encounters a constraint within an expression and when it encounters expressions which can be linearized, including the following:

You may recognize those expressions as logical constraints. For more information about logical constraints in the object-oriented application programming interfaces, see the topic Logical constraints in optimization in this manual.

In Callable Library applications, you can invoke the routine CPXaddindcontr yourself to introduce indicator constraints in your model. To remove an indicator constraint that you have added, use the routine CPXdelindconstr.

In the Python API, you can introduce an indicator constraint in your model by means of the method indicator_constraints.add.