Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <all_different.h>
Public Member Functions | |
AllDifferentBoundsPropagator (const std::vector< AffineExpression > &expressions, IntegerTrail *integer_trail) | |
AllDifferentBoundsPropagator (const AllDifferentBoundsPropagator &)=delete | |
This type is neither copyable nor movable. | |
AllDifferentBoundsPropagator & | operator= (const AllDifferentBoundsPropagator &)=delete |
bool | Propagate () final |
void | RegisterWith (GenericLiteralWatcher *watcher) |
Public Member Functions inherited from operations_research::sat::PropagatorInterface | |
PropagatorInterface ()=default | |
virtual | ~PropagatorInterface ()=default |
virtual bool | IncrementalPropagate (const std::vector< int > &) |
Implements the all different bound consistent propagator with explanation. That is, given n affine expressions that must take different values, this propagates the bounds of each expression as much as possible. The key is to detect the so called Hall interval which are interval of size k that contains the domain of k expressinos. Because all the variables must take different values, we can deduce that the domain of the other variables cannot contains such Hall interval.
We use a "fast" O(n log n) algorithm.
Definition at line 153 of file all_different.h.
operations_research::sat::AllDifferentBoundsPropagator::AllDifferentBoundsPropagator | ( | const std::vector< AffineExpression > & | expressions, |
IntegerTrail * | integer_trail ) |
We need +2 for sentinels.
Definition at line 441 of file all_different.cc.
|
delete |
This type is neither copyable nor movable.
|
delete |
|
finalvirtual |
This will be called after one or more literals that are watched by this propagator changed. It will also always be called on the first propagation cycle after registration.
Implements operations_research::sat::PropagatorInterface.
Definition at line 460 of file all_different.cc.
void operations_research::sat::AllDifferentBoundsPropagator::RegisterWith | ( | GenericLiteralWatcher * | watcher | ) |
Definition at line 661 of file all_different.cc.