Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <linear_propagation.h>
Public Member Functions | |
ConstraintPropagationOrder (ModelRandomGenerator *random, std::function< absl::Span< const IntegerVariable >(int)> id_to_vars) | |
void | Resize (int num_vars, int num_ids) |
void | Register (int id, IntegerVariable var, IntegerValue lb) |
void | Clear () |
int | NextId () |
void | UpdateBound (IntegerVariable var, IntegerValue lb) |
bool | IsEmpty () const |
bool | VarShouldBePushedById (IntegerVariable var, int id) |
Public Attributes | |
ModelRandomGenerator * | random_ |
std::function< absl::Span< const IntegerVariable >(int)> | id_to_vars_func_ |
Bitset64< IntegerVariable > | var_has_entry_ |
util_intops::StrongVector< IntegerVariable, int > | var_to_id_ |
util_intops::StrongVector< IntegerVariable, IntegerValue > | var_to_lb_ |
util_intops::StrongVector< IntegerVariable, int > | var_to_pos_ |
std::vector< IntegerVariable > | to_clear_ |
int | start_ = 0 |
Set/queue of constraints to be propagated. | |
Bitset64< int > | in_ids_ |
std::deque< int > | ids_ |
Helper class to decide on the constraint propagation order.
Each constraint might push some variables which might in turn make other constraint tighter. In general, it seems better to make sure we push first constraints that are not affected by other variables and delay the propagation of constraint that we know will become tigher.
Definition at line 153 of file linear_propagation.h.
|
inline |
Definition at line 155 of file linear_propagation.h.
|
inline |
Definition at line 189 of file linear_propagation.h.
|
inline |
Definition at line 267 of file linear_propagation.h.
|
inline |
Return -1 if there is none. This returns a constraint with min degree.
We select the min-degree and prefer lower constraint size. We however stop at the first degree zero.
We didn't find any degree zero, we scanned the whole queue. Extract best_id while keeping the order stable.
We tried to randomize the order, it does add more variance but also seem worse overall.
Definition at line 206 of file linear_propagation.h.
|
inline |
All new ids are likely not in a cycle, we want to test them first.
Definition at line 169 of file linear_propagation.h.
|
inline |
Definition at line 160 of file linear_propagation.h.
|
inline |
Definition at line 256 of file linear_propagation.h.
|
inline |
Definition at line 269 of file linear_propagation.h.
std::function<absl::Span<const IntegerVariable>(int)> operations_research::sat::ConstraintPropagationOrder::id_to_vars_func_ |
Definition at line 277 of file linear_propagation.h.
std::deque<int> operations_research::sat::ConstraintPropagationOrder::ids_ |
Definition at line 290 of file linear_propagation.h.
Bitset64<int> operations_research::sat::ConstraintPropagationOrder::in_ids_ |
Definition at line 289 of file linear_propagation.h.
ModelRandomGenerator* operations_research::sat::ConstraintPropagationOrder::random_ |
Definition at line 276 of file linear_propagation.h.
int operations_research::sat::ConstraintPropagationOrder::start_ = 0 |
Set/queue of constraints to be propagated.
Definition at line 288 of file linear_propagation.h.
std::vector<IntegerVariable> operations_research::sat::ConstraintPropagationOrder::to_clear_ |
Definition at line 285 of file linear_propagation.h.
Bitset64<IntegerVariable> operations_research::sat::ConstraintPropagationOrder::var_has_entry_ |
For each variable we only keep the constraint id that pushes it further. In case of tie, we only keep the first to be registered.
Definition at line 281 of file linear_propagation.h.
util_intops::StrongVector<IntegerVariable, int> operations_research::sat::ConstraintPropagationOrder::var_to_id_ |
Definition at line 282 of file linear_propagation.h.
util_intops::StrongVector<IntegerVariable, IntegerValue> operations_research::sat::ConstraintPropagationOrder::var_to_lb_ |
Definition at line 283 of file linear_propagation.h.
util_intops::StrongVector<IntegerVariable, int> operations_research::sat::ConstraintPropagationOrder::var_to_pos_ |
Definition at line 284 of file linear_propagation.h.