Stay organized with collections
Save and categorize content based on your preferences.
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;
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["`CpModelPresolver` transforms an initial optimization model into a simplified, \"presolved\" version to enhance solving efficiency."],["This process involves creating a mapping model to link the original and presolved models, allowing for easy conversion between solutions."],["Presolving can detect infeasibility or model issues early on, potentially saving computation time."],["The class provides methods for presolving the entire model or individual constraints."]]],["The `CpModelPresolver` class presolves an initial model, creating a mapping to track variable correspondence between the original and presolved models. `Presolve()` method returns the problem's status (UNKNOWN, INFEASIBLE, or MODEL_INVALID) after presolving. `PresolveOneConstraint()` presolves a single constraint, and `RemoveEmptyConstraints()` is a method that can be used for testing. The mapping ensures that solving one model's fixed variable set yields a feasible solution and the same objective value in the other.\n"]]