![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <precedences.h>
Public Member Functions | |
GreaterThanAtLeastOneOfDetector (Model *model) | |
int | AddGreaterThanAtLeastOneOfConstraints (Model *model, bool auto_detect_clauses=false) |
Detects if at least one of a subset of linear of size 2 or 1, touching the same variable, must be true. When this is the case we add a new propagator to propagate that fact.
Definition at line 535 of file precedences.h.
|
inlineexplicit |
Definition at line 537 of file precedences.h.
int operations_research::sat::GreaterThanAtLeastOneOfDetector::AddGreaterThanAtLeastOneOfConstraints | ( | Model * | model, |
bool | auto_detect_clauses = false ) |
Advanced usage. To be called once all the constraints have been added to the model. This will detect GreaterThanAtLeastOneOfConstraint(). Returns the number of added constraint.
We have two possible approaches. For now, we prefer the first one except if there is too many clauses in the problem.
It is common that there is only two alternatives to push a variable. In this case, our presolve most likely made sure that the two are controlled by a single Boolean. This allows to detect this and add the appropriate greater than at least one of.
Definition at line 1328 of file precedences.cc.