Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <integer_expr.h>
Public Member Functions | |
LinMinPropagator (const std::vector< LinearExpression > &exprs, IntegerVariable min_var, Model *model) | |
LinMinPropagator (const LinMinPropagator &)=delete | |
LinMinPropagator & | operator= (const LinMinPropagator &)=delete |
bool | Propagate () final |
void | RegisterWith (GenericLiteralWatcher *watcher) |
void | Explain (int id, IntegerValue propagation_slack, IntegerVariable var_to_explain, int trail_index, std::vector< Literal > *literals_reason, std::vector< int > *trail_indices_reason) final |
For LazyReasonInterface. | |
Public Member Functions inherited from operations_research::sat::PropagatorInterface | |
PropagatorInterface ()=default | |
virtual | ~PropagatorInterface ()=default |
virtual bool | IncrementalPropagate (const std::vector< int > &) |
Same as MinPropagator except this works on min = MIN(exprs) where exprs are linear expressions. It uses IntegerSumLE to propagate bounds on the exprs. Assumes Canonical expressions (all positive coefficients).
Definition at line 243 of file integer_expr.h.
operations_research::sat::LinMinPropagator::LinMinPropagator | ( | const std::vector< LinearExpression > & | exprs, |
IntegerVariable | min_var, | ||
Model * | model ) |
Definition at line 647 of file integer_expr.cc.
|
delete |
|
finalvirtual |
For LazyReasonInterface.
Now add the old integer_reason that triggered this propagation.
Implements operations_research::sat::LazyReasonInterface.
Definition at line 654 of file integer_expr.cc.
|
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.
Count the number of interval that are possible candidate for the min. Only the intervals for which lb > current_min_ub cannot.
Propagation a) lb(min) >= lb(MIN(exprs)) = MIN(lb(exprs));
Conflict will be detected by the fact that the [lb, ub] of the min is empty. In case of conflict, we just need the reason for pushing UB + 1.
Propagation b) ub(min) >= ub(MIN(exprs)) and we can't propagate anything here unless there is just one possible expression 'e' that can be the min: for all u != e, lb(u) > ub(min); In this case, ub(min) >= ub(e).
For this propagation, we only need to fill the integer reason once at the lowest level. At higher levels this reason still remains valid.
The reason is that all the other interval start after current_min_ub. And that min_ub has its current value.
Implements operations_research::sat::PropagatorInterface.
Definition at line 751 of file integer_expr.cc.
void operations_research::sat::LinMinPropagator::RegisterWith | ( | GenericLiteralWatcher * | watcher | ) |
Definition at line 830 of file integer_expr.cc.