Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::RoutingCPSatWrapper Class Reference

#include <routing_lp_scheduling.h>

Inheritance diagram for operations_research::RoutingCPSatWrapper:
operations_research::RoutingLinearSolverWrapper

Public Member Functions

 RoutingCPSatWrapper ()
 
 ~RoutingCPSatWrapper () override
 
void Clear () override
 
int CreateNewPositiveVariable () override
 
void SetVariableName (int index, absl::string_view name) override
 
bool SetVariableBounds (int index, int64_t lower_bound, int64_t upper_bound) override
 
void SetVariableDisjointBounds (int index, const std::vector< int64_t > &starts, const std::vector< int64_t > &ends) override
 
int64_t GetVariableLowerBound (int index) const override
 
int64_t GetVariableUpperBound (int index) const override
 
void SetObjectiveCoefficient (int index, double coefficient) override
 
double GetObjectiveCoefficient (int index) const override
 
void ClearObjective () override
 
int NumVariables () const override
 
int CreateNewConstraint (int64_t lower_bound, int64_t upper_bound) override
 
void SetCoefficient (int ct_index, int index, double coefficient) override
 
bool IsCPSATSolver () override
 
void AddObjectiveConstraint () override
 
void AddMaximumConstraint (int max_var, std::vector< int > vars) override
 
void AddProductConstraint (int product_var, std::vector< int > vars) override
 
void SetEnforcementLiteral (int ct, int condition) override
 
DimensionSchedulingStatus Solve (absl::Duration duration_limit) override
 
int64_t GetObjectiveValue () const override
 
double GetValue (int index) const override
 
bool SolutionIsInteger () const override
 
void SetParameters (const std::string &) override
 
bool ModelIsEmpty () const override
 Returns if the model is empty or not.
 
std::string PrintModel () const override
 Prints an understandable view of the model.
 
- Public Member Functions inherited from operations_research::RoutingLinearSolverWrapper
virtual ~RoutingLinearSolverWrapper ()
 
int AddVariable (int64_t lower_bound, int64_t upper_bound)
 Adds a variable with bounds [lower_bound, upper_bound].
 
int AddLinearConstraint (int64_t lower_bound, int64_t upper_bound, absl::Span< const std::pair< int, double > > variable_coeffs)
 
int AddReifiedLinearConstraint (int64_t lower_bound, int64_t upper_bound, absl::Span< const std::pair< int, double > > weighted_variables)
 

Detailed Description

Definition at line 448 of file routing_lp_scheduling.h.

Constructor & Destructor Documentation

◆ RoutingCPSatWrapper()

operations_research::RoutingCPSatWrapper::RoutingCPSatWrapper ( )
inline

Keeping presolve but with 1 iteration; as of 10/2023 it is significantly faster than both full presolve and no presolve.

Definition at line 450 of file routing_lp_scheduling.h.

◆ ~RoutingCPSatWrapper()

operations_research::RoutingCPSatWrapper::~RoutingCPSatWrapper ( )
inlineoverride

Definition at line 463 of file routing_lp_scheduling.h.

Member Function Documentation

◆ AddMaximumConstraint()

void operations_research::RoutingCPSatWrapper::AddMaximumConstraint ( int max_var,
std::vector< int > vars )
inlineoverridevirtual

◆ AddObjectiveConstraint()

void operations_research::RoutingCPSatWrapper::AddObjectiveConstraint ( )
inlineoverridevirtual

◆ AddProductConstraint()

void operations_research::RoutingCPSatWrapper::AddProductConstraint ( int product_var,
std::vector< int > vars )
inlineoverridevirtual

◆ Clear()

void operations_research::RoutingCPSatWrapper::Clear ( )
inlineoverridevirtual

◆ ClearObjective()

void operations_research::RoutingCPSatWrapper::ClearObjective ( )
inlineoverridevirtual

◆ CreateNewConstraint()

int operations_research::RoutingCPSatWrapper::CreateNewConstraint ( int64_t lower_bound,
int64_t upper_bound )
inlineoverridevirtual

◆ CreateNewPositiveVariable()

int operations_research::RoutingCPSatWrapper::CreateNewPositiveVariable ( )
inlineoverridevirtual

◆ GetObjectiveCoefficient()

double operations_research::RoutingCPSatWrapper::GetObjectiveCoefficient ( int index) const
inlineoverridevirtual

◆ GetObjectiveValue()

int64_t operations_research::RoutingCPSatWrapper::GetObjectiveValue ( ) const
inlineoverridevirtual

◆ GetValue()

double operations_research::RoutingCPSatWrapper::GetValue ( int index) const
inlineoverridevirtual

◆ GetVariableLowerBound()

int64_t operations_research::RoutingCPSatWrapper::GetVariableLowerBound ( int index) const
inlineoverridevirtual

◆ GetVariableUpperBound()

int64_t operations_research::RoutingCPSatWrapper::GetVariableUpperBound ( int index) const
inlineoverridevirtual

◆ IsCPSATSolver()

bool operations_research::RoutingCPSatWrapper::IsCPSATSolver ( )
inlineoverridevirtual

◆ ModelIsEmpty()

bool operations_research::RoutingCPSatWrapper::ModelIsEmpty ( ) const
inlineoverridevirtual

Returns if the model is empty or not.

Reimplemented from operations_research::RoutingLinearSolverWrapper.

Definition at line 622 of file routing_lp_scheduling.h.

◆ NumVariables()

int operations_research::RoutingCPSatWrapper::NumVariables ( ) const
inlineoverridevirtual

◆ PrintModel()

std::string operations_research::RoutingCPSatWrapper::PrintModel ( ) const
overridevirtual

Prints an understandable view of the model.

Constraints you want to separate.

variable_instances links the lemma of a variable to the different number of instantiation. For instance if you have in your model x(0), x(1) and x(4), the key "x" will be associated to {0,1,4}.

variable_children links a variable to its children. That is, if you have in you model x(0), then typical childs would be {"x(0)in_segment(0)", "x(0)in_segment(1)", "x(0)scaled", ...}

variables link the name of a variable to its Proto.

Preparing constraints the constraints hashmap associate enforcement to constraints. If the ket is "", then the constraint has no enforcement and if the key is "multiple", then the constraint has several enforcement. If the constraint has a single enforcement, then the key will be the variable name of the enforcement.

Constraints NOT enforced

Constraints with a SINGLE enforcement

Constraints with MULTIPLE enforcement

Constraints apart

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 3112 of file routing_lp_scheduling.cc.

◆ SetCoefficient()

void operations_research::RoutingCPSatWrapper::SetCoefficient ( int ct_index,
int index,
double coefficient )
inlineoverridevirtual

◆ SetEnforcementLiteral()

void operations_research::RoutingCPSatWrapper::SetEnforcementLiteral ( int ct,
int condition )
inlineoverridevirtual

◆ SetObjectiveCoefficient()

void operations_research::RoutingCPSatWrapper::SetObjectiveCoefficient ( int index,
double coefficient )
inlineoverridevirtual

◆ SetParameters()

void operations_research::RoutingCPSatWrapper::SetParameters ( const std::string & )
inlineoverridevirtual
Note
This function is not implemented for the CP-SAT solver.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 618 of file routing_lp_scheduling.h.

◆ SetVariableBounds()

bool operations_research::RoutingCPSatWrapper::SetVariableBounds ( int index,
int64_t lower_bound,
int64_t upper_bound )
inlineoverridevirtual

◆ SetVariableDisjointBounds()

void operations_research::RoutingCPSatWrapper::SetVariableDisjointBounds ( int index,
const std::vector< int64_t > & starts,
const std::vector< int64_t > & ends )
inlineoverridevirtual

◆ SetVariableName()

void operations_research::RoutingCPSatWrapper::SetVariableName ( int index,
absl::string_view name )
inlineoverridevirtual

◆ SolutionIsInteger()

bool operations_research::RoutingCPSatWrapper::SolutionIsInteger ( ) const
inlineoverridevirtual

◆ Solve()

DimensionSchedulingStatus operations_research::RoutingCPSatWrapper::Solve ( absl::Duration duration_limit)
inlineoverridevirtual

The documentation for this class was generated from the following files: