Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solveri.h>
Classes | |
struct | ExtendedInterval |
struct | Interval |
Public Member Functions | |
DimensionChecker (const PathState *path_state, std::vector< Interval > path_capacity, std::vector< int > path_class, std::vector< std::function< Interval(int64_t, int64_t)> > demand_per_path_class, std::vector< Interval > node_capacity, int min_range_size_for_riq=kOptimalMinRangeSizeForRIQ) | |
bool | Check () const |
void | Commit () |
Static Public Attributes | |
static constexpr int | kOptimalMinRangeSizeForRIQ = 4 |
This checker enforces dimension requirements. A dimension requires that there is some valuation of cumul and demand such that for all paths:
Definition at line 3693 of file constraint_solveri.h.
operations_research::DimensionChecker::DimensionChecker | ( | const PathState * | path_state, |
std::vector< Interval > | path_capacity, | ||
std::vector< int > | path_class, | ||
std::vector< std::function< Interval(int64_t, int64_t)> > | demand_per_path_class, | ||
std::vector< Interval > | node_capacity, | ||
int | min_range_size_for_riq = kOptimalMinRangeSizeForRIQ ) |
Definition at line 3166 of file local_search.cc.
bool operations_research::DimensionChecker::Check | ( | ) | const |
Given the change made in PathState, checks that the dimension constraint is still feasible.
Loop invariant: except for the first chain, cumul represents the cumul state of the last node of the previous chain, and it is nonempty.
Bring cumul state from last node of previous chain to first node of current chain.
Bring cumul state from first node to last node of the current chain.
Use a RIQ if the chain size is large enough; the optimal size was found with the associated benchmark in tests, in particular BM_DimensionChecker<ChangeSparsity::kSparse, *>.
Definition at line 3191 of file local_search.cc.
void operations_research::DimensionChecker::Commit | ( | ) |
Commits to the changes made in PathState, must be called before PathState::Commit().
Definition at line 3252 of file local_search.cc.
|
staticconstexpr |
Definition at line 3725 of file constraint_solveri.h.