Our cut are always of the form linear_expression <= rhs.
More...
#include <cuts.h>
|
bool | FillFromLinearConstraint (const LinearConstraint &base_ct, const util_intops::StrongVector< IntegerVariable, double > &lp_values, IntegerTrail *integer_trail) |
|
bool | FillFromParallelVectors (IntegerValue ub, absl::Span< const IntegerVariable > vars, absl::Span< const IntegerValue > coeffs, absl::Span< const double > lp_values, absl::Span< const IntegerValue > lower_bounds, absl::Span< const IntegerValue > upper_bounds) |
|
bool | AppendOneTerm (IntegerVariable var, IntegerValue coeff, double lp_value, IntegerValue lb, IntegerValue ub) |
|
bool | AllCoefficientsArePositive () const |
| These functions transform the cut by complementation.
|
|
void | ComplementForPositiveCoefficients () |
|
void | ComplementForSmallerLpValues () |
|
double | ComputeViolation () const |
| Computes and returns the cut violation.
|
|
double | ComputeEfficacy () const |
|
std::string | DebugString () const |
|
void | Canonicalize () |
| This sorts terms and fill both num_relevant_entries and max_magnitude.
|
|
Our cut are always of the form linear_expression <= rhs.
Definition at line 110 of file cuts.h.
◆ AllCoefficientsArePositive()
bool operations_research::sat::CutData::AllCoefficientsArePositive |
( |
| ) |
const |
These functions transform the cut by complementation.
Definition at line 228 of file cuts.cc.
◆ AppendOneTerm()
bool operations_research::sat::CutData::AppendOneTerm |
( |
IntegerVariable | var, |
|
|
IntegerValue | coeff, |
|
|
double | lp_value, |
|
|
IntegerValue | lb, |
|
|
IntegerValue | ub ) |
To try to minimize the risk of overflow, we switch to the bound closer to the lp_value. Since most of our base constraint for cut are tight, hopefully this is not too bad.
Complement the variable so that it is has a positive coefficient.
See formula below, the constant term is either coeff * lb or coeff * ub.
Deal with fixed variable, no need to shift back in this case, we can just remove the term.
X = -(UB - X) + UB
C = (X - LB) + LB
Definition at line 133 of file cuts.cc.
◆ Canonicalize()
void operations_research::sat::CutData::Canonicalize |
( |
| ) |
|
This sorts terms and fill both num_relevant_entries and max_magnitude.
Sort by larger lp_value first.
Definition at line 235 of file cuts.cc.
◆ ComplementForPositiveCoefficients()
void operations_research::sat::CutData::ComplementForPositiveCoefficients |
( |
| ) |
|
◆ ComplementForSmallerLpValues()
void operations_research::sat::CutData::ComplementForSmallerLpValues |
( |
| ) |
|
◆ ComputeEfficacy()
double operations_research::sat::CutData::ComputeEfficacy |
( |
| ) |
const |
◆ ComputeViolation()
double operations_research::sat::CutData::ComputeViolation |
( |
| ) |
const |
Computes and returns the cut violation.
Definition at line 254 of file cuts.cc.
◆ DebugString()
std::string operations_research::sat::CutData::DebugString |
( |
| ) |
const |
◆ FillFromLinearConstraint()
We need level zero bounds and LP relaxation values to fill a CutData. Returns false if we encounter any integer overflow.
Definition at line 170 of file cuts.cc.
◆ FillFromParallelVectors()
bool operations_research::sat::CutData::FillFromParallelVectors |
( |
IntegerValue | ub, |
|
|
absl::Span< const IntegerVariable > | vars, |
|
|
absl::Span< const IntegerValue > | coeffs, |
|
|
absl::Span< const double > | lp_values, |
|
|
absl::Span< const IntegerValue > | lower_bounds, |
|
|
absl::Span< const IntegerValue > | upper_bounds ) |
◆ max_magnitude
IntegerValue operations_research::sat::CutData::max_magnitude |
◆ num_relevant_entries
int operations_research::sat::CutData::num_relevant_entries |
◆ rhs
absl::int128 operations_research::sat::CutData::rhs |
- Note
- we use a 128 bit rhs so we can freely complement variable without running into overflow.
Definition at line 141 of file cuts.h.
◆ terms
std::vector<CutTerm> operations_research::sat::CutData::terms |
The documentation for this struct was generated from the following files: