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

#include <feasibility_pump.h>

Public Types

typedef glop::RowIndex ConstraintIndex
 

Public Member Functions

 FeasibilityPump (Model *model)
 
 ~FeasibilityPump ()
 
void SetMaxFPIterations (int max_iter)
 
void AddLinearConstraint (const LinearConstraint &ct)
 Add a new linear constraint to this LP.
 
void SetObjectiveCoefficient (IntegerVariable ivar, IntegerValue coeff)
 
bool HasLPSolution () const
 
double LPSolutionObjectiveValue () const
 
double GetLPSolutionValue (IntegerVariable variable) const
 
bool LPSolutionIsInteger () const
 
double LPSolutionFractionality () const
 
bool HasIntegerSolution () const
 
int64_t IntegerSolutionObjectiveValue () const
 
bool IntegerSolutionIsFeasible () const
 
int64_t GetIntegerSolutionValue (IntegerVariable variable) const
 
bool Solve ()
 Returns false if the model is proven to be infeasible.
 

Detailed Description

Definition at line 42 of file feasibility_pump.h.

Member Typedef Documentation

◆ ConstraintIndex

Constructor & Destructor Documentation

◆ FeasibilityPump()

operations_research::sat::FeasibilityPump::FeasibilityPump ( Model * model)
explicit

Tweak the default parameters to make the solve incremental.

Note(user): Primal simplex does better here since we have a limit on simplex iterations. So dual simplex sometimes fails to find a LP feasible solution.

Definition at line 58 of file feasibility_pump.cc.

◆ ~FeasibilityPump()

operations_research::sat::FeasibilityPump::~FeasibilityPump ( )

Definition at line 80 of file feasibility_pump.cc.

Member Function Documentation

◆ AddLinearConstraint()

void operations_research::sat::FeasibilityPump::AddLinearConstraint ( const LinearConstraint & ct)

Add a new linear constraint to this LP.

We still create the mirror variable right away though.

We only use positive variable inside this class.

Important to keep lp_data_ "clean".

Definition at line 85 of file feasibility_pump.cc.

◆ GetIntegerSolutionValue()

int64_t operations_research::sat::FeasibilityPump::GetIntegerSolutionValue ( IntegerVariable variable) const

----------------—Rounding----------------------------------—

Definition at line 452 of file feasibility_pump.cc.

◆ GetLPSolutionValue()

double operations_research::sat::FeasibilityPump::GetLPSolutionValue ( IntegerVariable variable) const

Definition at line 438 of file feasibility_pump.cc.

◆ HasIntegerSolution()

bool operations_research::sat::FeasibilityPump::HasIntegerSolution ( ) const
inline

Returns the Integer solution value of a variable in the current rounded solution. These functions should only be called when HasIntegerSolution() is true.

Definition at line 73 of file feasibility_pump.h.

◆ HasLPSolution()

bool operations_research::sat::FeasibilityPump::HasLPSolution ( ) const
inline

Returns the LP value of a variable in the current solution. These functions should only be called when HasSolution() is true.

Definition at line 64 of file feasibility_pump.h.

◆ IntegerSolutionIsFeasible()

bool operations_research::sat::FeasibilityPump::IntegerSolutionIsFeasible ( ) const
inline

Definition at line 77 of file feasibility_pump.h.

◆ IntegerSolutionObjectiveValue()

int64_t operations_research::sat::FeasibilityPump::IntegerSolutionObjectiveValue ( ) const
inline

Definition at line 74 of file feasibility_pump.h.

◆ LPSolutionFractionality()

double operations_research::sat::FeasibilityPump::LPSolutionFractionality ( ) const
inline

Definition at line 68 of file feasibility_pump.h.

◆ LPSolutionIsInteger()

bool operations_research::sat::FeasibilityPump::LPSolutionIsInteger ( ) const
inline

Definition at line 67 of file feasibility_pump.h.

◆ LPSolutionObjectiveValue()

double operations_research::sat::FeasibilityPump::LPSolutionObjectiveValue ( ) const
inline

Definition at line 65 of file feasibility_pump.h.

◆ SetMaxFPIterations()

void operations_research::sat::FeasibilityPump::SetMaxFPIterations ( int max_iter)
inline

Definition at line 49 of file feasibility_pump.h.

◆ SetObjectiveCoefficient()

void operations_research::sat::FeasibilityPump::SetObjectiveCoefficient ( IntegerVariable ivar,
IntegerValue coeff )

Set the coefficient of the variable in the objective. Calling it twice will overwrite the previous value. Note that this doesn't set the objective coefficient if the variable doesn't appear in any constraints. So this has to be called after all the constraints are added.

Definition at line 110 of file feasibility_pump.cc.

◆ Solve()

bool operations_research::sat::FeasibilityPump::Solve ( )

Returns false if the model is proven to be infeasible.

Restore the original objective

We don't end this loop if the integer solutions is feasible in hope to get better solution.

Definition at line 163 of file feasibility_pump.cc.


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