C++ Reference: class CpModelPresolver

Note: This documentation is automatically generated.

Presolves the initial content of presolved_model.

This also creates a mapping model that encode the correspondence between the two problems. This works as follow:
   - The first variables of mapping_model are in one to one correspondence with the variables of the initial model.
   - The presolved_model variables are in one to one correspondence with the variable at the indices given by postsolve_mapping in the mapping model.
   - Fixing one of the two sets of variables and solving the model will assign the other set to a feasible solution of the other problem. Moreover, the objective value of these solutions will be the same. Note that solving such problems will take little time in practice because the propagation will basically do all the work.


Note(user): an optimization model can be transformed into a decision problem, if for instance the objective is fixed, or independent from the rest of the problem.

TODO(user): Identify disconnected components and returns a vector of presolved model? If we go this route, it may be nicer to store the indices inside the model. We can add a IntegerVariableProto::initial_index;
Method
CpModelPresolver

Arguments: PresolveContext* context, std::vector<int>* postsolve_mapping

Presolve

Return type: CpSolverStatus

We returns the status of the problem after presolve: - UNKNOWN if everything was ok. - INFEASIBLE if the model was proven so during presolve - MODEL_INVALID if the model caused some issues, like if we are not able to scale a floating point objective with enough precision.

PresolveOneConstraint

Return type: bool

Arguments: int c

Executes presolve method for the given constraint. Public for testing only.

RemoveEmptyConstraints

Return type: void

Public for testing only.