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

#include <preprocessor.h>

Inheritance diagram for operations_research::glop::SingletonPreprocessor:
operations_research::glop::Preprocessor

Public Member Functions

 SingletonPreprocessor (const GlopParameters *parameters)
 
 SingletonPreprocessor (const SingletonPreprocessor &)=delete
 
SingletonPreprocessoroperator= (const SingletonPreprocessor &)=delete
 
 ~SingletonPreprocessor () final=default
 
bool Run (LinearProgram *lp) final
 
void RecoverSolution (ProblemSolution *solution) const final
 
- Public Member Functions inherited from operations_research::glop::Preprocessor
 Preprocessor (const GlopParameters *parameters)
 
 Preprocessor (const Preprocessor &)=delete
 
Preprocessoroperator= (const Preprocessor &)=delete
 
virtual ~Preprocessor ()
 
ProblemStatus status () const
 
virtual void UseInMipContext ()
 
void SetTimeLimit (TimeLimit *time_limit)
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::glop::Preprocessor
bool IsSmallerWithinFeasibilityTolerance (Fractional a, Fractional b) const
 
bool IsSmallerWithinPreprocessorZeroTolerance (Fractional a, Fractional b) const
 
- Protected Attributes inherited from operations_research::glop::Preprocessor
ProblemStatus status_
 
const GlopParameters & parameters_
 
bool in_mip_context_
 
std::unique_ptr< TimeLimitinfinite_time_limit_
 
TimeLimittime_limit_
 

Detailed Description

Deletes as many singleton rows or singleton columns as possible. Note that each time we delete a row or a column, new singletons may be created.

Definition at line 452 of file preprocessor.h.

Constructor & Destructor Documentation

◆ SingletonPreprocessor() [1/2]

operations_research::glop::SingletonPreprocessor::SingletonPreprocessor ( const GlopParameters * parameters)
inlineexplicit

Definition at line 454 of file preprocessor.h.

◆ SingletonPreprocessor() [2/2]

operations_research::glop::SingletonPreprocessor::SingletonPreprocessor ( const SingletonPreprocessor & )
delete

◆ ~SingletonPreprocessor()

operations_research::glop::SingletonPreprocessor::~SingletonPreprocessor ( )
finaldefault

Member Function Documentation

◆ operator=()

SingletonPreprocessor & operations_research::glop::SingletonPreprocessor::operator= ( const SingletonPreprocessor & )
delete

◆ RecoverSolution()

void operations_research::glop::SingletonPreprocessor::RecoverSolution ( ProblemSolution * solution) const
finalvirtual

Stores the optimal solution of the linear program that was passed to Run(). The given solution needs to be set to the optimal solution of the linear program "modified" by Run().

Note
the two deletion helpers must restore 0.0 values in the positions that will be used during Undo(). That is, all the calls done by this class to MarkColumnForDeletion() should be done with 0.0 as the value to restore (which is already the case when using MarkRowForDeletion()). This is important because the various Undo() functions assume that a primal/dual variable value which isn't restored yet has the value of 0.0.

It is important to undo the operations in the correct order, i.e. in the reverse order in which they were done.

Implements operations_research::glop::Preprocessor.

Definition at line 2942 of file preprocessor.cc.

◆ Run()

bool operations_research::glop::SingletonPreprocessor::Run ( LinearProgram * lp)
finalvirtual

Runs the preprocessor by modifying the given linear program. Returns true if a postsolve step will be needed (i.e. RecoverSolution() is not the identity function). Also updates status_ to something different from ProblemStatus::INIT if the problem was solved (including bad statuses like ProblemStatus::ABNORMAL, ProblemStatus::INFEASIBLE, etc.).

Initialize column_to_process with the current singleton columns.

Initialize row_to_process with the current singleton rows.

Process current singleton rows/columns and enqueue new ones.

Todo
(user): It seems better to process all the singleton columns with a cost of zero first.

We don't want to do a substitution if the entry is too small and should be probably set to zero.

Todo
(user): We should be able to restrict the variable bounds with the ones of the constraint all the time. However, some situation currently break the presolve, and it seems hard to fix in a 100% safe way.

Implements operations_research::glop::Preprocessor.

Definition at line 2852 of file preprocessor.cc.


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