![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <integer_expr.h>
Public Member Functions | |
LinMinPropagator (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. | |
![]() | |
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 244 of file integer_expr.h.
operations_research::sat::LinMinPropagator::LinMinPropagator | ( | std::vector< LinearExpression > | exprs, |
IntegerVariable | min_var, | ||
Model * | model ) |
Definition at line 646 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 653 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 750 of file integer_expr.cc.
void operations_research::sat::LinMinPropagator::RegisterWith | ( | GenericLiteralWatcher * | watcher | ) |
Definition at line 829 of file integer_expr.cc.