Using presolve

Presolve consists in modifying the model to improve it so that it can be solved more efficiently.

CP Optimizer presolves the input model before search. Presolve consists in modifying the model to improve it so that it can be solved more efficiently.

Presolve works by

  • simplifying the model by reducing linear constraints by removing redundancies and fixed expressions and
  • strengthening the model to achieve more domain reduction by aggregating constraints or factorizing common subexpressions.

Presolve can be helpful on models that are not well formulated due to the model itself or to the model data. The activation of presolve is controlled by a parameter. In the C++ API, the parameter is IloCP::Presolve which can be set to IloCP::On (the default) or IloCP::Off. In the Java™ API, the parameter is IloCP.IntParam.Presolve. In the C# API, the parameter is CP.IntParam.Presolve.

As a consequence, the overall engine memory consumption can increase because an internal model is created to perform the improvement operations. The presolve transformations are displayed in the output log of CP Optimizer. For example the line
! Presolve      : 6942 extractables eliminated, 158 constraints generated
at the beginning of the search shows that presolve as eliminated 6942 constraints or expressions and that a subset of constraints were aggregated to 158 constraints.