Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#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. | |
Definition at line 42 of file feasibility_pump.h.
glop::RowIndex operations_research::sat::FeasibilityPump::ConstraintIndex |
Definition at line 47 of file feasibility_pump.h.
|
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.
operations_research::sat::FeasibilityPump::~FeasibilityPump | ( | ) |
Definition at line 80 of file feasibility_pump.cc.
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.
int64_t operations_research::sat::FeasibilityPump::GetIntegerSolutionValue | ( | IntegerVariable | variable | ) | const |
----------------—Rounding----------------------------------—
Definition at line 452 of file feasibility_pump.cc.
double operations_research::sat::FeasibilityPump::GetLPSolutionValue | ( | IntegerVariable | variable | ) | const |
Definition at line 438 of file feasibility_pump.cc.
|
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.
|
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.
|
inline |
Definition at line 77 of file feasibility_pump.h.
|
inline |
Definition at line 74 of file feasibility_pump.h.
|
inline |
Definition at line 68 of file feasibility_pump.h.
|
inline |
Definition at line 67 of file feasibility_pump.h.
|
inline |
Definition at line 65 of file feasibility_pump.h.
|
inline |
Definition at line 49 of file feasibility_pump.h.
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.
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.