Couenne::CouenneIterativeRounding Class Reference

#include <CouenneIterativeRounding.hpp>

Collaboration diagram for Couenne::CouenneIterativeRounding:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CouenneIterativeRounding ()
 Default constructor.
 CouenneIterativeRounding (Bonmin::OsiTMINLPInterface *nlp, OsiSolverInterface *cinlp, CouenneProblem *couenne, Ipopt::SmartPtr< Ipopt::OptionsList > options)
 Constructor with model and Couenne problems.
 CouenneIterativeRounding (const CouenneIterativeRounding &other)
 Copy constructor.
virtual ~CouenneIterativeRounding ()
 Destructor.
virtual CbcHeuristic * clone () const
 Clone.
CouenneIterativeRoundingoperator= (const CouenneIterativeRounding &rhs)
 Assignment operator.
void setNlp (Bonmin::OsiTMINLPInterface *nlp, OsiSolverInterface *cinlp)
 Set the minlp solver.
void setCouenneProblem (CouenneProblem *couenne)
 Set the couenne problem to use.
void resetModel (CbcModel *model)
 Does nothing.
int solution (double &objectiveValue, double *newSolution)
 Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.
void setMaxRoundingIter (int value)
 Set maximum number of iterations for each rounding phase.
void setMaxFirPoints (int value)
 Set maximum number of points that we try to round in F-IR.
void setMaxTime (double value)
 Set maximum CPU time for the heuristic at each node.
void setMaxTimeFirstCall (double value)
 Set maximum CPU time for the heuristic at the root node only.
void setOmega (double value)
 Set the value for omega, the multiplicative factor for the minimum log-barrier parameter mu used by F-IR whenever we need to generate a new NLP feasible point (in the interior of the feasible region).
void setBaseLbRhs (int value)
 Set the base value for the rhs of the local branching constraint in the I-IR heuristic.
void setAggressiveness (int value)
 Set aggressiveness of heuristic.

Static Public Member Functions

static void registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
 initialize options to be read later

Private Member Functions

bool areEqual (double a, double b)
 Check if two double precision numbers are equal, up to some tolerance.
int feasibilityIR (double &objectiveValue, double *newSolution)
int improvementIR (double &objectiveValue, double *newSolution, const double *startingSolution)
void setMilp ()
 Set the milp solver at the root.
int computeIntAtBound (const double *x)
 Compute number of integer variables at one of their bounds at a given point x.
int computeIntAtBound (const double *x, double &avgBoundSize)
 Compute number of integer variables at one of their bounds at a given point x and average distance between the bounds of variables at one of their bounds.
void writeLB (OsiRowCut &cut, const double *x, char sense, double rhs)
 Write down a local branching constraint, as an OsiRowCut.
int branchToCut (const double *x, OsiSolverInterface *solver, std::vector< int > &previousBranches)
 Branch on a random variable to cut given solution; returns var index.
bool solveMilp (OsiSolverInterface *milp, double maxTime)
 Solve the MILP contained in milp to feasibility, or report failure.

Private Attributes

Bonmin::OsiTMINLPInterfacenlp_
 Pointer to a dynamic nlp solver interface.
OsiSolverInterface * cinlp_
 Pointer to the original NLP solver interface.
OsiClpSolverInterface * milp_
 Pointer to a milp solver interface.
int maxRoundingIter_
 Maximum number of iterations in the main loop.
int maxFirPoints_
 Maximum number of iterations in the outer loop for feasibility.
double maxTime_
 Max CPU time to run the heuristic.
double maxTimeFirstCall_
 Max CPU time to run the heuristic when no other solution is known.
int numInitialRows_
 Number of rows in the original convexification.
int numSol_
 Number of solutions last time the heuristic was called.
int numIntegers_
 Number of integer variables in the original model.
double * colLower_
 Pointer to original column lower and upper bounds of the reformulated problem, i.e.
double * colUpper_
double * colLowerNlp_
 Pointer to column lower and upper bounds of the original problem, i.e.
double * colUpperNlp_
CbcHeuristic ** heuristics_
 Heuristics for the MILP.
int numHeuristics_
double startTime_
 Starting time for the heuristics.
double endTime_
 Maximum allowed time for current run.
double omega_
 Multiplication factor for log barrier parameter in F-IR; see in the paper.
int baseLbRhs_
 Base value for the rhs of the local branching constraint it I-IR.
CouenneProblemcouenne_
 Pointer to a couenne representation of the problem.

Detailed Description

Definition at line 38 of file CouenneIterativeRounding.hpp.


Constructor & Destructor Documentation

Couenne::CouenneIterativeRounding::CouenneIterativeRounding (  ) 

Default constructor.

Definition at line 26 of file CouenneIterativeRounding.cpp.

Referenced by clone().

Couenne::CouenneIterativeRounding::CouenneIterativeRounding ( Bonmin::OsiTMINLPInterface nlp,
OsiSolverInterface *  cinlp,
CouenneProblem couenne,
Ipopt::SmartPtr< Ipopt::OptionsList >  options 
)

Constructor with model and Couenne problems.

Definition at line 39 of file CouenneIterativeRounding.cpp.

References setAggressiveness(), setBaseLbRhs(), setMaxFirPoints(), setMaxTime(), setMaxTimeFirstCall(), setNlp(), and setOmega().

Couenne::CouenneIterativeRounding::CouenneIterativeRounding ( const CouenneIterativeRounding other  ) 

Copy constructor.

Definition at line 82 of file CouenneIterativeRounding.cpp.

References Bonmin::OsiTMINLPInterface::clone(), colLower_, colLowerNlp_, colUpper_, colUpperNlp_, Bonmin::OsiTMINLPInterface::getNumCols(), milp_, and nlp_.

Couenne::CouenneIterativeRounding::~CouenneIterativeRounding (  )  [virtual]

Destructor.

Definition at line 182 of file CouenneIterativeRounding.cpp.

References colLower_, colLowerNlp_, colUpper_, colUpperNlp_, milp_, and nlp_.


Member Function Documentation

CbcHeuristic * Couenne::CouenneIterativeRounding::clone (  )  const [virtual]

Clone.

Definition at line 130 of file CouenneIterativeRounding.cpp.

References CouenneIterativeRounding().

CouenneIterativeRounding & Couenne::CouenneIterativeRounding::operator= ( const CouenneIterativeRounding rhs  ) 

Assignment operator.

Definition at line 135 of file CouenneIterativeRounding.cpp.

References baseLbRhs_, cinlp_, colLower_, colLowerNlp_, colUpper_, colUpperNlp_, couenne_, Bonmin::OsiTMINLPInterface::getNumCols(), maxFirPoints_, maxRoundingIter_, maxTime_, maxTimeFirstCall_, milp_, nlp_, numInitialRows_, numSol_, and omega_.

void Couenne::CouenneIterativeRounding::setNlp ( Bonmin::OsiTMINLPInterface nlp,
OsiSolverInterface *  cinlp 
)

Set the minlp solver.

Definition at line 199 of file CouenneIterativeRounding.cpp.

References cinlp_, Bonmin::OsiTMINLPInterface::initialize(), Bonmin::TNLPSolver::journalist(), Bonmin::OsiTMINLPInterface::model(), nlp_, Bonmin::OsiTMINLPInterface::options(), Bonmin::OsiTMINLPInterface::solver(), and Bonmin::OsiTMINLPInterface::use().

Referenced by CouenneIterativeRounding().

void Couenne::CouenneIterativeRounding::setCouenneProblem ( CouenneProblem couenne  )  [inline]

Set the couenne problem to use.

Definition at line 64 of file CouenneIterativeRounding.hpp.

References couenne_.

void Couenne::CouenneIterativeRounding::resetModel ( CbcModel *  model  )  [inline]

Does nothing.

Definition at line 69 of file CouenneIterativeRounding.hpp.

int Couenne::CouenneIterativeRounding::solution ( double &  objectiveValue,
double *  newSolution 
)

Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.

objectiveValue Best known solution in input and value of solution found in output newSolution Solution found by heuristic.

Definition at line 345 of file CouenneIterativeRounding.cpp.

References baseLbRhs_, endTime_, feasibilityIR(), improvementIR(), maxFirPoints_, maxRoundingIter_, maxTime_, maxTimeFirstCall_, milp_, MILPTIME, numSol_, omega_, setMilp(), and startTime_.

void Couenne::CouenneIterativeRounding::setMaxRoundingIter ( int  value  )  [inline]

Set maximum number of iterations for each rounding phase.

Definition at line 81 of file CouenneIterativeRounding.hpp.

References maxRoundingIter_.

Referenced by setAggressiveness().

void Couenne::CouenneIterativeRounding::setMaxFirPoints ( int  value  )  [inline]

Set maximum number of points that we try to round in F-IR.

Definition at line 86 of file CouenneIterativeRounding.hpp.

References maxFirPoints_.

Referenced by CouenneIterativeRounding(), and setAggressiveness().

void Couenne::CouenneIterativeRounding::setMaxTime ( double  value  )  [inline]

Set maximum CPU time for the heuristic at each node.

Definition at line 91 of file CouenneIterativeRounding.hpp.

References maxTime_.

Referenced by CouenneIterativeRounding(), and setAggressiveness().

void Couenne::CouenneIterativeRounding::setMaxTimeFirstCall ( double  value  )  [inline]

Set maximum CPU time for the heuristic at the root node only.

Definition at line 96 of file CouenneIterativeRounding.hpp.

References maxTimeFirstCall_.

Referenced by CouenneIterativeRounding(), and setAggressiveness().

void Couenne::CouenneIterativeRounding::setOmega ( double  value  )  [inline]

Set the value for omega, the multiplicative factor for the minimum log-barrier parameter mu used by F-IR whenever we need to generate a new NLP feasible point (in the interior of the feasible region).

Definition at line 104 of file CouenneIterativeRounding.hpp.

References omega_.

Referenced by CouenneIterativeRounding().

void Couenne::CouenneIterativeRounding::setBaseLbRhs ( int  value  )  [inline]

Set the base value for the rhs of the local branching constraint in the I-IR heuristic.

The actual rhs is then computed depending on current variable bounds

Definition at line 111 of file CouenneIterativeRounding.hpp.

References baseLbRhs_.

Referenced by CouenneIterativeRounding().

void Couenne::CouenneIterativeRounding::setAggressiveness ( int  value  ) 

Set aggressiveness of heuristic.

Three levels, that sets various parameters accordingly.

The levels are: 0: maxRoundingIter = 5, maxTimeFirstCall = 300, maxFirPoints = 5, maxTime = 60 1: maxRoundingIter = 10, maxTimeFirstCall = 300, maxFirPoints = 5, maxTime = 120 2: maxRoundingIter = 20, maxTimeFirstCall = 1000, maxFirPoints = 5, maxTime = 300

Definition at line 319 of file CouenneIterativeRounding.cpp.

References setMaxFirPoints(), setMaxRoundingIter(), setMaxTime(), and setMaxTimeFirstCall().

Referenced by CouenneIterativeRounding().

void Couenne::CouenneIterativeRounding::registerOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions  )  [static]

initialize options to be read later

Definition at line 1163 of file CouenneIterativeRounding.cpp.

Referenced by Couenne::CouenneSetup::registerAllOptions().

bool Couenne::CouenneIterativeRounding::areEqual ( double  a,
double  b 
) [inline, private]

Check if two double precision numbers are equal, up to some tolerance.

Definition at line 183 of file CouenneIterativeRounding.hpp.

References COUENNE_EPS.

Referenced by computeIntAtBound(), and writeLB().

int Couenne::CouenneIterativeRounding::feasibilityIR ( double &  objectiveValue,
double *  newSolution 
) [private]

Definition at line 406 of file CouenneIterativeRounding.cpp.

References branchToCut(), Couenne::CouenneProblem::checkNLP(), Couenne::CouenneProblem::checkNLP2(), cinlp_, colLower_, colLowerNlp_, colUpper_, colUpperNlp_, computeIntAtBound(), couenne_, COUENNE_EPS, COUENNE_INFINITY, endTime_, Bonmin::OsiTMINLPInterface::getColSolution(), Couenne::CouenneProblem::getCutOff(), Couenne::CouenneProblem::getFeasTol(), Couenne::CouenneRecordBestSol::getModSol(), Couenne::CouenneRecordBestSol::getModSolVal(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::getObjValue(), Couenne::CouenneProblem::getRecordBestSol(), Couenne::CouenneRecordBestSol::getSol(), Couenne::CouenneRecordBestSol::getVal(), Bonmin::AuxInfo::infeasibleNode(), Bonmin::OsiTMINLPInterface::isAbandoned(), Bonmin::OsiTMINLPInterface::isProvenDualInfeasible(), Bonmin::OsiTMINLPInterface::isProvenPrimalInfeasible(), k, maxFirPoints_, maxRoundingIter_, milp_, MILPTIME, n, nlp_, numInitialRows_, numIntegers_, Couenne::CouenneProblem::nVars(), omega_, Bonmin::TNLPSolver::options(), Bonmin::OsiTMINLPInterface::resolve(), Bonmin::OsiTMINLPInterface::resolveForRobustness(), Bonmin::AuxInfo::setHasNlpSolution(), Bonmin::AuxInfo::setNlpSolution(), solveMilp(), Bonmin::OsiTMINLPInterface::solver(), startTime_, Couenne::CouenneRecordBestSol::update(), and writeLB().

Referenced by solution().

int Couenne::CouenneIterativeRounding::improvementIR ( double &  objectiveValue,
double *  newSolution,
const double *  startingSolution 
) [private]

Definition at line 706 of file CouenneIterativeRounding.cpp.

References baseLbRhs_, branchToCut(), Couenne::CouenneProblem::checkNLP(), Couenne::CouenneProblem::checkNLP2(), cinlp_, colLower_, colLowerNlp_, colUpper_, colUpperNlp_, computeIntAtBound(), couenne_, COUENNE_EPS, COUENNE_INFINITY, Bonmin::OsiTMINLPInterface::deleteRows(), endTime_, Bonmin::OsiTMINLPInterface::getColSolution(), Couenne::CouenneProblem::getCutOff(), Couenne::CouenneProblem::getFeasTol(), Couenne::CouenneRecordBestSol::getModSol(), Couenne::CouenneRecordBestSol::getModSolVal(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::getNumRows(), Bonmin::OsiTMINLPInterface::getObjValue(), Couenne::CouenneProblem::getRecordBestSol(), Couenne::CouenneRecordBestSol::getSol(), Couenne::CouenneRecordBestSol::getVal(), Bonmin::AuxInfo::infeasibleNode(), Bonmin::OsiTMINLPInterface::isAbandoned(), Bonmin::OsiTMINLPInterface::isInteger(), Bonmin::OsiTMINLPInterface::isProvenDualInfeasible(), Bonmin::OsiTMINLPInterface::isProvenPrimalInfeasible(), k, maxRoundingIter_, milp_, MILPTIME, n, nlp_, numInitialRows_, numIntegers_, Couenne::CouenneProblem::nVars(), Bonmin::OsiTMINLPInterface::resolve(), Bonmin::OsiTMINLPInterface::resolveForRobustness(), Bonmin::OsiTMINLPInterface::setColLower(), Bonmin::OsiTMINLPInterface::setColSolution(), Bonmin::OsiTMINLPInterface::setColUpper(), Bonmin::AuxInfo::setHasNlpSolution(), Bonmin::AuxInfo::setNlpSolution(), solveMilp(), startTime_, Couenne::CouenneRecordBestSol::update(), and writeLB().

Referenced by solution().

void Couenne::CouenneIterativeRounding::setMilp (  )  [private]

Set the milp solver at the root.

Definition at line 219 of file CouenneIterativeRounding.cpp.

References cinlp_, colLower_, colLowerNlp_, colUpper_, colUpperNlp_, COUENNE_EPS_INT, heuristics_, milp_, MILPTIME, n, numHeuristics_, numInitialRows_, and numIntegers_.

Referenced by solution().

int Couenne::CouenneIterativeRounding::computeIntAtBound ( const double *  x  )  [private]

Compute number of integer variables at one of their bounds at a given point x.

Definition at line 1007 of file CouenneIterativeRounding.cpp.

References areEqual(), colLower_, colUpper_, Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::isInteger(), and nlp_.

Referenced by feasibilityIR(), and improvementIR().

int Couenne::CouenneIterativeRounding::computeIntAtBound ( const double *  x,
double &  avgBoundSize 
) [private]

Compute number of integer variables at one of their bounds at a given point x and average distance between the bounds of variables at one of their bounds.

Definition at line 1019 of file CouenneIterativeRounding.cpp.

References areEqual(), colLower_, colUpper_, Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::isInteger(), and nlp_.

void Couenne::CouenneIterativeRounding::writeLB ( OsiRowCut &  cut,
const double *  x,
char  sense,
double  rhs 
) [private]

Write down a local branching constraint, as an OsiRowCut.

Definition at line 1035 of file CouenneIterativeRounding.cpp.

References areEqual(), colLower_, colUpper_, Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::isInteger(), and nlp_.

Referenced by feasibilityIR(), and improvementIR().

int Couenne::CouenneIterativeRounding::branchToCut ( const double *  x,
OsiSolverInterface *  solver,
std::vector< int > &  previousBranches 
) [private]

Branch on a random variable to cut given solution; returns var index.

Definition at line 1120 of file CouenneIterativeRounding.cpp.

References colLower_, colUpper_, Bonmin::OsiTMINLPInterface::getNumCols(), nlp_, and numIntegers_.

Referenced by feasibilityIR(), and improvementIR().

bool Couenne::CouenneIterativeRounding::solveMilp ( OsiSolverInterface *  milp,
double  maxTime 
) [private]

Solve the MILP contained in milp to feasibility, or report failure.

Definition at line 1065 of file CouenneIterativeRounding.cpp.

References CBCMILPTIME, heuristics_, infeasible, and numHeuristics_.

Referenced by feasibilityIR(), and improvementIR().


Member Data Documentation

Bonmin::OsiTMINLPInterface* Couenne::CouenneIterativeRounding::nlp_ [private]

Pointer to a dynamic nlp solver interface.

Definition at line 133 of file CouenneIterativeRounding.hpp.

Referenced by branchToCut(), computeIntAtBound(), CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setNlp(), writeLB(), and ~CouenneIterativeRounding().

OsiSolverInterface* Couenne::CouenneIterativeRounding::cinlp_ [private]

Pointer to the original NLP solver interface.

Definition at line 135 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), operator=(), setMilp(), and setNlp().

OsiClpSolverInterface* Couenne::CouenneIterativeRounding::milp_ [private]

Pointer to a milp solver interface.

Definition at line 140 of file CouenneIterativeRounding.hpp.

Referenced by CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setMilp(), solution(), and ~CouenneIterativeRounding().

int Couenne::CouenneIterativeRounding::maxRoundingIter_ [private]

Maximum number of iterations in the main loop.

Definition at line 143 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), operator=(), setMaxRoundingIter(), and solution().

int Couenne::CouenneIterativeRounding::maxFirPoints_ [private]

Maximum number of iterations in the outer loop for feasibility.

Definition at line 145 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), operator=(), setMaxFirPoints(), and solution().

double Couenne::CouenneIterativeRounding::maxTime_ [private]

Max CPU time to run the heuristic.

Definition at line 147 of file CouenneIterativeRounding.hpp.

Referenced by operator=(), setMaxTime(), and solution().

double Couenne::CouenneIterativeRounding::maxTimeFirstCall_ [private]

Max CPU time to run the heuristic when no other solution is known.

Definition at line 149 of file CouenneIterativeRounding.hpp.

Referenced by operator=(), setMaxTimeFirstCall(), and solution().

int Couenne::CouenneIterativeRounding::numInitialRows_ [private]

Number of rows in the original convexification.

Definition at line 151 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), operator=(), and setMilp().

int Couenne::CouenneIterativeRounding::numSol_ [private]

Number of solutions last time the heuristic was called.

Definition at line 153 of file CouenneIterativeRounding.hpp.

Referenced by operator=(), and solution().

int Couenne::CouenneIterativeRounding::numIntegers_ [private]

Number of integer variables in the original model.

Definition at line 155 of file CouenneIterativeRounding.hpp.

Referenced by branchToCut(), feasibilityIR(), improvementIR(), and setMilp().

double* Couenne::CouenneIterativeRounding::colLower_ [private]

Pointer to original column lower and upper bounds of the reformulated problem, i.e.

the linearization

Definition at line 158 of file CouenneIterativeRounding.hpp.

Referenced by branchToCut(), computeIntAtBound(), CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setMilp(), writeLB(), and ~CouenneIterativeRounding().

double* Couenne::CouenneIterativeRounding::colUpper_ [private]

Definition at line 159 of file CouenneIterativeRounding.hpp.

Referenced by branchToCut(), computeIntAtBound(), CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setMilp(), writeLB(), and ~CouenneIterativeRounding().

double* Couenne::CouenneIterativeRounding::colLowerNlp_ [private]

Pointer to column lower and upper bounds of the original problem, i.e.

the MINLP

Definition at line 162 of file CouenneIterativeRounding.hpp.

Referenced by CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setMilp(), and ~CouenneIterativeRounding().

double* Couenne::CouenneIterativeRounding::colUpperNlp_ [private]

Definition at line 163 of file CouenneIterativeRounding.hpp.

Referenced by CouenneIterativeRounding(), feasibilityIR(), improvementIR(), operator=(), setMilp(), and ~CouenneIterativeRounding().

CbcHeuristic** Couenne::CouenneIterativeRounding::heuristics_ [private]

Heuristics for the MILP.

Definition at line 166 of file CouenneIterativeRounding.hpp.

Referenced by setMilp(), and solveMilp().

int Couenne::CouenneIterativeRounding::numHeuristics_ [private]

Definition at line 167 of file CouenneIterativeRounding.hpp.

Referenced by setMilp(), and solveMilp().

double Couenne::CouenneIterativeRounding::startTime_ [private]

Starting time for the heuristics.

Definition at line 170 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), and solution().

double Couenne::CouenneIterativeRounding::endTime_ [private]

Maximum allowed time for current run.

Definition at line 172 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), and solution().

double Couenne::CouenneIterativeRounding::omega_ [private]

Multiplication factor for log barrier parameter in F-IR; see in the paper.

Definition at line 175 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), operator=(), setOmega(), and solution().

int Couenne::CouenneIterativeRounding::baseLbRhs_ [private]

Base value for the rhs of the local branching constraint it I-IR.

Definition at line 177 of file CouenneIterativeRounding.hpp.

Referenced by improvementIR(), operator=(), setBaseLbRhs(), and solution().

CouenneProblem* Couenne::CouenneIterativeRounding::couenne_ [private]

Pointer to a couenne representation of the problem.

Definition at line 180 of file CouenneIterativeRounding.hpp.

Referenced by feasibilityIR(), improvementIR(), operator=(), and setCouenneProblem().


The documentation for this class was generated from the following files:
Generated on Thu Sep 22 03:15:00 2011 by  doxygen 1.4.7