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

#include <routing_lp_scheduling.h>

Inheritance diagram for operations_research::RoutingGlopWrapper:
operations_research::RoutingLinearSolverWrapper

Public Member Functions

 RoutingGlopWrapper (bool is_relaxation, const glop::GlopParameters &parameters)
 
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, int index, double coefficient) override
 
bool IsCPSATSolver () override
 
void AddObjectiveConstraint () override
 
void AddMaximumConstraint (int, std::vector< int >) override
 
void AddProductConstraint (int, std::vector< int >) override
 
void SetEnforcementLiteral (int, int) 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 &parameters) override
 This function is meant to override the parameters of the solver.
 
std::string PrintModel () const override
 
- Public Member Functions inherited from operations_research::RoutingLinearSolverWrapper
virtual ~RoutingLinearSolverWrapper ()
 
virtual bool ModelIsEmpty () const
 Returns if the model is empty or not.
 
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 266 of file routing_lp_scheduling.h.

Constructor & Destructor Documentation

◆ RoutingGlopWrapper()

operations_research::RoutingGlopWrapper::RoutingGlopWrapper ( bool is_relaxation,
const glop::GlopParameters & parameters )
inline

Definition at line 268 of file routing_lp_scheduling.h.

Member Function Documentation

◆ AddMaximumConstraint()

void operations_research::RoutingGlopWrapper::AddMaximumConstraint ( int ,
std::vector< int >  )
inlineoverridevirtual

◆ AddObjectiveConstraint()

void operations_research::RoutingGlopWrapper::AddObjectiveConstraint ( )
inlineoverridevirtual

There are no terms in the objective.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 353 of file routing_lp_scheduling.h.

◆ AddProductConstraint()

void operations_research::RoutingGlopWrapper::AddProductConstraint ( int ,
std::vector< int >  )
inlineoverridevirtual

◆ Clear()

void operations_research::RoutingGlopWrapper::Clear ( )
inlineoverridevirtual

◆ ClearObjective()

void operations_research::RoutingGlopWrapper::ClearObjective ( )
inlineoverridevirtual

◆ CreateNewConstraint()

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

◆ CreateNewPositiveVariable()

int operations_research::RoutingGlopWrapper::CreateNewPositiveVariable ( )
inlineoverridevirtual

◆ GetObjectiveCoefficient()

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

◆ GetObjectiveValue()

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

◆ GetValue()

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

◆ GetVariableLowerBound()

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

◆ GetVariableUpperBound()

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

◆ IsCPSATSolver()

bool operations_research::RoutingGlopWrapper::IsCPSATSolver ( )
inlineoverridevirtual

◆ NumVariables()

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

◆ PrintModel()

std::string operations_research::RoutingGlopWrapper::PrintModel ( ) const
inlineoverridevirtual

Prints an understandable view of the model

Todo
(user): Improve output readability.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 438 of file routing_lp_scheduling.h.

◆ SetCoefficient()

void operations_research::RoutingGlopWrapper::SetCoefficient ( int ct,
int index,
double coefficient )
inlineoverridevirtual

Necessary to keep the model clean (cf. glop::LinearProgram::NotifyThatColumnsAreClean).

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 345 of file routing_lp_scheduling.h.

◆ SetEnforcementLiteral()

void operations_research::RoutingGlopWrapper::SetEnforcementLiteral ( int ,
int  )
inlineoverridevirtual

◆ SetObjectiveCoefficient()

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

◆ SetParameters()

void operations_research::RoutingGlopWrapper::SetParameters ( const std::string & parameters)
inlineoverridevirtual

This function is meant to override the parameters of the solver.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 429 of file routing_lp_scheduling.h.

◆ SetVariableBounds()

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

When variable upper bounds are greater than this threshold, precision issues arise in GLOP. In this case we are just going to suppose that these high bound values are infinite and not set the upper bound.

The linear_program would not be feasible, and it cannot handle the lp_min > lp_max case, so we must detect infeasibility here.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 284 of file routing_lp_scheduling.h.

◆ SetVariableDisjointBounds()

void operations_research::RoutingGlopWrapper::SetVariableDisjointBounds ( int index,
const std::vector< int64_t > & starts,
const std::vector< int64_t > & ends )
inlineoverridevirtual
Todo
(user): Investigate if we can avoid rebuilding the interval list each time (we could keep a reference to the forbidden interval list in RoutingDimension but we would need to store cumul offsets and use them when checking intervals).

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 302 of file routing_lp_scheduling.h.

◆ SetVariableName()

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

◆ SolutionIsInteger()

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

◆ Solve()

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

Because we construct the lp one constraint at a time and we never call SetCoefficient() on the same variable twice for a constraint, we know that the columns do not contain duplicates and are already ordered by constraint so we do not need to call linear_program->CleanUp() which can be costly. Note that the assumptions are DCHECKed() in the call below.

Implements operations_research::RoutingLinearSolverWrapper.

Definition at line 384 of file routing_lp_scheduling.h.


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