Go to the documentation of this file.
309 const double globalLB,
310 const double globalUB);
346 const bool resolve =
true,
347 const int maxInnerIter = COIN_INT_MAX,
348 const int maxOuterIter = COIN_INT_MAX);
394 <<
" isTight = " << (
m_relGap <= tightGap)
431 double& mostNegReducedCost);
440 int& m_cutsThisCall);
444 const bool isXSparse =
false,
445 const double feasVarTol = 1.0e-6,
446 const double feasConTol = 1.0e-5,
447 const double intTol = 1.0e-5);
450 const bool isXSparse =
false,
451 const double feasVarTol = 1.0e-6,
452 const double feasConTol = 1.0e-5);
456 const double* origCost,
458 const int n_origCols,
462 std::list<DecompVar*>& vars,
470 copy(varList.begin(), varList.end(), back_inserter(
m_vars));
481 std::vector< std::pair<int, double> >& downBranchUb,
482 std::vector< std::pair<int, double> >& upBranchLb,
483 std::vector< std::pair<int, double> >& upBranchUb);
530 const double* rowRhs,
536 const double* rowRhs,
547 const std::string baseName,
550 const int pricePass);
553 const std::string baseName,
557 const int blockId = -1,
558 const bool printMps =
true,
559 const bool printLp =
true);
564 const std::string fileName,
565 const bool printMps =
true,
566 const bool printLp =
true);
594 std::vector<std::string>& colNames);
597 std::vector<int >& colInd,
598 std::vector<double >& colVal,
611 std::vector<std::string>& colNames,
638 const double intTol = 1.0e-5);
705 std::map<int, DecompSubModel>::iterator mit;
708 return (*mit).second;
798 for (
int i = 0 ; i < nc ; i++ ) {
799 retVal += objCoef[i] * primSol[i];
830 if (nHistorySize > 0) {
871 const double thisBoundUB) {
891 #ifdef UTIL_USE_TIMERS
910 (*
m_osLog) <<
"New Global UB = "
922 objBoundIP = *objBoundLP;
927 #ifdef UTIL_USE_TIMERS
939 const double changePerLimit = 0.1);
944 std::vector<DecompRowType>::iterator vi;
947 if (*vi == rowType) {
982 bool doSetup =
true) :
1041 throw UtilException(
"Branching Implementation should be set correctly",
1042 "initSetup",
"DecompAlgo");
virtual bool chooseBranchSet(std::vector< std::pair< int, double > > &downBranchLb, std::vector< std::pair< int, double > > &downBranchUb, std::vector< std::pair< int, double > > &upBranchLb, std::vector< std::pair< int, double > > &upBranchUb)
virtual void postProcessBranch(DecompStatus decompStatus)
Do some information sending after the current node has been branched.
std::list< DecompCut * > DecompCutList
const std::vector< DecompSolution * > & getXhatIPFeas() const
DecompParam m_param
Parameters.
const double COIN_DBL_MAX
const double getCutoffUB() const
void printBasisInfo(OsiSolverInterface *si, std::ostream *os)
std::vector< double * > getDualRays(int maxNumRays)
DecompNodeStats m_nodeStats
virtual void addVarsToPool(DecompVarList &newVars)
std::vector< DecompRowType > m_masterRowType
std::map< int, int > m_masterOnlyColsMap
Map from original index to master index for master-only vars.
std::vector< double > m_reducedCost
virtual void setSubProbBounds(const double *lbs, const double *ubs)
const double * getMasterColReducedCost() const
void masterMatrixAddMOCols(CoinPackedMatrix *masterM, double *colLB, double *colUB, double *objCoeff, std::vector< std::string > &colNames)
void UtilDeleteVectorPtr(std::vector< T * > &vectorPtr, typename std::vector< T * >::iterator first, typename std::vector< T * >::iterator last)
DecompAlgo * m_decompAlgo
Pointer to the base algorithmic object.
virtual int generateInitVars(DecompVarList &initVars)
Generate initial variables for master problem (PC/DC/RC).
DecompAlgoStop m_stopCriteria
std::vector< double > m_dualSolution
OsiClpSolverInterface * m_cutgenSI
Solver interface(s) for entire problem (Q'').
int cutCallsTotal
Number of cut calls in this node in total.
double timeStamp
The time stamp (from start) when bound was recorded.
std::string m_classTag
Store the name of the class (for logging/debugging) - "who am I?".
std::pair< double, double > objBest
The global lower (.first) and upper (.second) bound.
double getRealTime()
Get wallClock time.
OsiSolverInterface * m_masterSI
Solver interface(s) for subproblems (P').
const AlpsDecompTreeNode * m_curNode
void printCurrentProblemDual(OsiSolverInterface *si, const std::string baseName, const int nodeIndex, const int cutPass, const int pricePass)
int getNumRowType(DecompRowType rowType)
const double * getOrigObjective() const
virtual int adjustColumnsEffCnt()
std::vector< int > m_masterOnlyCols
DecompSolution * m_xhatIPBest
bool isTailoffLB(const int changeLen=10, const double changePerLimit=0.1)
DecompVarList m_vars
Containers for variables (current and pool).
bool isIPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5, const double intTol=1.0e-5)
@ DecompCol_ArtForBranchL
double m_infinity
The value of "infinity".
DecompBranchingImplementation m_branchingImplementation
const double * m_objective
virtual void postProcessNode(DecompStatus decompStatus)
Do some information sending after the current node has been processed.
virtual DecompStatus solutionUpdate(const DecompPhase phase, const bool resolve=true, const int maxInnerIter=COIN_INT_MAX, const int maxOuterIter=COIN_INT_MAX)
Update of the solution vectors (primal and/or dual).
void checkBlocksColumns()
const int getCutCallsTotal() const
virtual int addCutsFromPool()
double getMasterObjValue() const
DecompAlgoType m_algo
Type of algorithm for this instance.
virtual DecompStatus processNode(const AlpsDecompTreeNode *node, const double globalLB, const double globalUB)
The main DECOMP process loop for a node.
const std::string DecompAlgoStr[5]
std::vector< DecompColType > m_masterColType
const double * getColUBNode() const
DecompApp * m_app
Pointer to current active DECOMP application.
std::map< int, std::vector< DecompSubModel > > m_modelRelaxNest
DecompParam & getMutableParam()
DecompSubModel m_modelCore
void breakOutPartial(const double *xHat, DecompVarList &newVars, const double intTol=1.0e-5)
void createOsiSubProblem(DecompSubModel &subModel)
void initSetup()
Initial setup of algorithm structures and solver interfaces.
virtual bool updateObjBound(const double mostNegRC=-DecompBigNum)
Calculate the current LB and update best/history.
std::vector< double > m_phaseIObj
@ DecompCol_ArtForConvexL
virtual int compressColumns()
virtual void phaseUpdate(DecompPhase &phase, DecompStatus &status)
Update of the phase for process loop.
static UtilTimer globalTimer
bool BranchEnforceInMaster
double bestBoundIP
The best recorded integer upper bound.
void generateVarsCalcRedCost(const double *u, double *redCostX)
Calculated reduced cost vector (over vars in compact space) for a given dual vector.
double thisBoundIP
The recorded integer upper bound.
void dumpSettings(const std::string &sec, std::ostream *os=&std::cout)
const double * getMasterPrimalSolution() const
Get current primal solution for master problem.
bool isDualRayInfProof(const double *dualRay, const CoinPackedMatrix *rowMatrix, const double *colLB, const double *colUB, const double *rowRhs, std::ostream *os)
DecompStatus m_status
The current algorithm status.
void generateVarsAdjustDuals(const double *uOld, double *uNew)
Create an adjusted dual vector with the duals from the convexity constraints removed.
const double * getColLBNode() const
DecompStats m_stats
Storage of statistics for run and node.
const double getGlobalGap() const
Get the current global (integrality) gap.
DecompStatus solveRelaxed(const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool isNested, DecompSubModel &subModel, DecompSolverResult *solveResult, std::list< DecompVar * > &vars, double timeLimit)
virtual void setMasterBounds(const double *lbs, const double *ubs)
std::string UtilDblToStr(const double x, const int precision=-1, const double tooBig=UtilSmallerThanTooBig)
int pricePass
The price pass when bound was recorded.
const double getNodeIPGap() const
Get the current node (integrality) gap.
DecompBranchingImplementation
void printVars(std::ostream *os)
double thisBoundUB
The recorded continuous upper bound.
void UtilPrintFuncBegin(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
std::vector< double > m_origColUB
virtual void adjustMasterDualSolution()
Adjust the current dual solution for master problem.
DecompParam m_param
Parameters.
std::vector< int > m_masterArtCols
Storage of solver result.
@ DecompCol_ArtForBranchG
void appendVars(DecompVar *var)
OsiSolverInterface * getMasterOSI()
OsiSolverInterface * m_auxSI
#define UTIL_MSG(param, level, x)
void appendVars(DecompVarList &varList)
int cutPass
The cut pass when bound was recorded.
const int getStopCriteria() const
const DecompParam & getDecompParam() const
void loadSIFromModel(OsiSolverInterface *si, bool doInt=false)
bool BranchEnforceInSubProb
void printCurrentProblem(const OsiSolverInterface *si, const std::string baseName, const int nodeIndex, const int cutPass, const int pricePass, const int blockId=-1, const bool printMps=true, const bool printLp=true)
const int getPriceCallsTotal() const
std::map< int, DecompSubModel > m_modelRelax
const DecompSolution * getXhatIPBest() const
UtilParameters * m_utilParam
int priceCallsTotal
Number of price calls in this node in total.
virtual void solveMasterAsMIP()
virtual int generateVars(DecompVarList &newVars, double &mostNegReducedCost)
virtual void masterMatrixAddArtCols(CoinPackedMatrix *masterM, double *colLB, double *colUB, double *objCoeff, std::vector< std::string > &colNames, int startRow, int endRow, DecompRowType rowType)
std::vector< double > m_primSolution
virtual void recomposeSolution(const double *solution, double *rsolution)
Compose solution in x-space from current space.
const double getObjBestBoundUB() const
Get the current best UB.
const double getMasterRowType(int row) const
Get a specific row type.
virtual void addVarsFromPool()
@ DecompCol_Structural_NoDelete
int phase
The phase when bound was recorded.
DecompMemPool m_memPool
Memory pool used to reduce the number of allocations needed.
bool isMasterColMasterOnly(const int index) const
double m_cutoffUB
User-defined cutoff (global UB) for B&B fathoming and LR.
int m_compressColsLastPrice
void coreMatrixAppendColBounds()
Calculate gap: |(ub-lb)|/|lb|.
void getSettings(UtilParameters ¶m)
const DecompApp * getDecompApp() const
DecompPhase m_phase
The current algorithm phase.
bool isMasterColStructural(const int index) const
DecompSubModel & getModelRelax(const int blockId)
OsiSolverInterface * getOsiIpSolverInterface()
An interface to CGL cut generator library.
const DecompParam & getParam() const
OsiSolverInterface * getOsiLpSolverInterface()
#define UtilException(msg, methodN, classN)
int varsThisCall
Number of vars generated in this particular price call.
void setCutoffUB(const double thisBound)
void checkMasterDualObj()
virtual void setObjBound(const double thisBound, const double thisBoundUB)
Set the current continuous bounds and update best/history.
const int getAlgo() const
int m_compressColsLastNumCols
std::vector< DecompObjBound > objHistoryBound
Storage of the bounds.
double bestBound
The best recorded continuous lower bound.
const double * getXhat() const
Get a ptr to the current solution (in x-space).
double getInfinity()
Return the value of infinity.
int nodeIndex
The node index (in the branch-and-bound tree).
virtual void setObjBoundIP(const double thisBound)
Set the current integer bound and update best/history.
bool checkPointFeasible(const DecompConstraintSet *modelCore, const double *x)
double m_relGap
Current node gap (bestUB-bestLB)/bestLB.
double UtilCalculateGap(const double boundLB, const double boundUB, double infinity)
Calculate gap: |(ub-lb)|/|lb|.
@ DecompCol_ArtForConvexG
bool isDualRayInfProofCpx(const double *dualRay, const CoinPackedMatrix *rowMatrix, const double *colLB, const double *colUB, const double *rowRhs, std::ostream *os)
void checkReducedCost(const double *u, const double *u_adjusted)
virtual void addCutsToPool(const double *x, DecompCutList &newCuts, int &m_cutsThisCall)
const double * m_objective
Model data: objective function.
virtual void phaseDone()
Run the done phase for processing node.
std::ostream * m_osLog
Stream for log file (default to stdout).
DecompApp * getDecompAppMutable()
void UtilDeleteListPtr(std::list< T * > &listPtr, typename std::list< T * >::iterator first, typename std::list< T * >::iterator last)
bool isLPFeasible(const double *x, const bool isXSparse=false, const double feasVarTol=1.0e-6, const double feasConTol=1.0e-5)
std::vector< DecompSolution * > m_xhatIPFeas
bool isMasterColArtificial(const int index) const
int cutsThisCall
Number of cuts generated in this particular cut call.
virtual ~DecompAlgo()
Destructor.
double thisBound
The recorded continuous lower bound.
void createFullMps(const std::string fileName)
void UtilPrintFuncEnd(std::ostream *os, const std::string &classTag, const std::string &funcName, const int logLevel, const int logLimit)
const void setStrongBranchIter(bool isStrongBranch=true)
Set the object to be in strong branching mode.
const DecompSubModel & getModelCore() const
const double getNodeLPGap() const
Get the current node (continuous) gap.
const double getObjBestBoundLB() const
Get the current best LB.
virtual void phaseInit(DecompPhase &phase)
Run the initial phase for processing node.
DecompObjBound * getLastBound()
std::vector< double * > getDualRaysCpx(int maxNumRays)
virtual DecompSolverResult * solveDirect(const DecompSolution *startSol=NULL)
Base class for DECOMP algorithms.
virtual void createMasterProblem(DecompVarList &initVars)
Create the master problem (all algorithms must define this function).
const AlpsDecompTreeNode * getCurrentNode() const
Provide the current node the algorithm is solving.
@ DecompBranchInSubproblem
virtual int generateCuts(double *xhat, DecompCutList &newCuts)
std::list< DecompVar * > DecompVarList
std::vector< double > m_origColLB
Pointer (and label) to current active model core/relax.
virtual const double * getMasterDualSolution() const
Get current dual solution for master problem.
const int getNodeIndex() const
std::vector< double * > getDualRaysOsi(int maxNumRays)
DecompAlgo(const DecompAlgoType algo, DecompApp *app, UtilParameters &utilParam, bool doSetup=true)
Default constructors.
void masterMatrixAddArtCol(std::vector< CoinBigIndex > &colBeg, std::vector< int > &colInd, std::vector< double > &colVal, char LorG, int rowIndex, int colIndex, DecompColType colType, double &colLB, double &colUB, double &objCoeff)
const double DecompBigNum
void printCuts(std::ostream *os)
virtual const double * getObjCoefficients() const=0
double * m_xhat
Storage for current solution (in x-space).
DecompStats & getDecompStats()
DecompCutList m_cuts
Containers for cuts (current and pool).
std::map< int, int > m_artColIndToRowInd
The main application class.