Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Enforce the fact that there is no cycle in the given directed graph. More...
#include <circuit.h>
Public Member Functions | |
NoCyclePropagator (int num_nodes, const std::vector< int > &tails, const std::vector< int > &heads, const std::vector< Literal > &literals, Model *model) | |
void | SetLevel (int level) final |
bool | Propagate () final |
bool | IncrementalPropagate (const std::vector< int > &watch_indices) final |
Enforce the fact that there is no cycle in the given directed graph.
operations_research::sat::NoCyclePropagator::NoCyclePropagator | ( | int | num_nodes, |
const std::vector< int > & | tails, | ||
const std::vector< int > & | heads, | ||
const std::vector< Literal > & | literals, | ||
Model * | model ) |
Fixed arc. It will never be removed.
We have to deal with the same literal controlling more than one arc.
We register at construction.
Definition at line 359 of file circuit.cc.
|
finalvirtual |
This will only be called on a non-empty vector, otherwise Propagate() will be called. The passed vector will contain the "watch index" of all the literals that were given one at registration and that changed since the last call to Propagate(). This is only true when going down in the search tree, on backjump this list will be cleared.
Notes:
Reimplemented from operations_research::sat::PropagatorInterface.
Definition at line 433 of file circuit.cc.
|
finalvirtual |
The graph should be up to date when this is called thanks to IncrementalPropagate(). We just do a SCC on the graph.
We collect all arc from this compo.
Implements operations_research::sat::PropagatorInterface.
Definition at line 451 of file circuit.cc.
|
finalvirtual |
Initially a reversible class starts at level zero. Increasing the level saves the state of the current old level. Decreasing the level restores the state to what it was at this level and all higher levels are forgotten. Everything done at level zero cannot be backtracked over.
The level is assumed to be non-negative.
Backtrack.
Implements operations_research::ReversibleInterface.
Definition at line 415 of file circuit.cc.