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