#include <OSColGenApp.h>
Public Member Functions | |
void | solveRestrictedMasterRelaxation () |
kipp – document More... | |
void | getOptions (OSOption *osoption) |
bool | branchAndBound () |
the method that invokes and controls branch and bound More... | |
void | solve () |
void | printTreeInfo () |
void | getInitialRestrictedMaster () |
bool | isInteger (const double *thetaVar, const int numThetaVar, const double tol) |
INPUT: double* thetaVar – the vector of primal master values int numThetaVar – size of master primal vector tol – is the tolerance on 0/1. More... | |
void | printDebugInfo () |
void | checkNodeConsistency (const int rowIdx, const OSNode *osnode) |
void | getCuts (const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB) |
RETURN VALUES: int numNewRows – number of new rows generated int* numNonz – number of nonzeros in each row double** colIdx – vectors column indexes of new rows double** values – vectors of matrix coefficient values of new rows double* rowLB – vector of row lower bounds double* rowUB – vector of row upper bounds. More... | |
void | getColumns (const double *yA, const int numARows, const double *yB, const int numBRows, int &numNewColumns, int *&numNonz, double *&cost, int **&rowIdx, double **&values, double &lowerBound) |
RETURN VALUES: int numNewColumns – number of new columns generated int* numNonz – number of nonzeros in each column double* cost – the objective function coefficient on each new column double** rowIdx – vectors row indexes of new columns double** values – vectors of matrix coefficient values of new columns double lowerBound – the lowerBound. More... | |
OSNode * | createChild (const OSNode *osnode, std::map< int, int > &varConMap, const int rowIdx, const double rowLB, const double rowUB) |
INPUT: OSNode* osnode – the parent node for which we create a child std::map<int, int> varConMap – the variable constraint map rowIdx is the index of the branching row rowLB is the lower bound of the new branching row rowUB is the upper bound of the new branching row. More... | |
void | createBranchingCut (const int *thetaIdx, const double *theta, const int numThetaVar, std::map< int, int > &varConMap, int &rowIdx) |
INPUT: – sparse version int* thetaIdx – index vector of nonzero theta variables double* theta – the sparse vector of primal master values int numThetaVar – size of master primal vector std::map<int, int> varConMap – the variable constraint map. More... | |
void | createBranchingCut (const double *theta, const int numThetaVar, std::map< int, int > &varConMap, int &rowIdx) |
INPUT: – dense version double* theta – the dense vector of primal master values int numThetaVar – size of master primal vector std::map<int, int> varConMap – the variable constraint map. More... | |
void | resetMaster () |
OSColGenApp () | |
Default Constructor. More... | |
OSColGenApp (OSOption *osption) | |
Second Constructor. More... | |
~OSColGenApp () | |
Default destructor. More... | |
Public Attributes | |
OSDecompFactoryInitializer * | m_factoryInit |
OSDecompSolver * | m_osrouteSolver |
std::ostringstream | outStr |
OSInstance * | m_osinstanceMaster |
OSOption * | m_osoption |
OSResult * | m_osresult |
std::vector< double > | m_zRootLPx_vals |
m_zRootLPx_vals holds root node optimal LP solution nonzero values More... | |
std::vector< int > | m_zRootLPx_idx |
m_zRootLPx_idxs holds root node optimal LP solution nonzero indexes More... | |
bool | m_calledBranchAndBound |
this variable is true if we have called the branchAndBound() method More... | |
std::map< int, int > | m_rowIdxVarMap |
map the variable generated at a node with a variable More... | |
CoinSolver * | m_solver |
OsiSolverInterface * | m_si |
OSDecompParam | m_osDecompParam |
Application specific parameters. More... | |
int | m_numNodesGenerated |
kount the nodes generated More... | |
int | m_numColumnsGenerated |
kount the columns generated More... | |
int | m_numColumnsOld |
when m_numColumnsGenerated - m_numColumnsOld hits masterColumnResetValue we do a reset More... | |
std::string | m_message |
m_message is the message to the pauHana routine More... | |
double | m_zUB |
m_zUB is the upper bound More... | |
double | m_zLB |
m_zLB is the lower bound More... | |
double | m_zRootLP |
m_zRootLP is the value of the root LP relaxation More... | |
std::map< int, OSNode * > | m_nodeMap |
nodeMap is the map of nodes in the branch and bound tree More... | |
std::vector< int > | m_zOptIndexes |
m_zOptIndexes is the vector theta indexes corresponding to the current m_zUB More... | |
std::vector< int > | m_zOptRootLP |
m_zOptRootLP is the vector theta indexes corresponding to optimal LP solution at the roor tnode More... | |
std::map< int, int > | inVars |
double * | m_yA |
m_yA is the dual values for the initial restricted constraints More... | |
double * | m_yB |
m_yB is the dual for the cuts that get added More... | |
double * | m_theta |
m_theta is the primal values in the master More... | |
int | m_maxCols |
m_maxCols is the maximum number of columns we can have More... | |
int | m_maxRows |
m_maxRows is the maximum number of rows we can have More... | |
Definition at line 40 of file OSColGenApp.h.
OSColGenApp::OSColGenApp | ( | ) |
Default Constructor.
Definition at line 51 of file OSColGenApp.cpp.
OSColGenApp::OSColGenApp | ( | OSOption * | osption | ) |
Second Constructor.
Definition at line 58 of file OSColGenApp.cpp.
OSColGenApp::~OSColGenApp | ( | ) |
Default destructor.
Definition at line 111 of file OSColGenApp.cpp.
void OSColGenApp::solveRestrictedMasterRelaxation | ( | ) |
kipp – document
Definition at line 499 of file OSColGenApp.cpp.
Definition at line 189 of file OSColGenApp.cpp.
bool OSColGenApp::branchAndBound | ( | ) |
the method that invokes and controls branch and bound
return true if nothing goes wrong
varConMap is a map that maps the index of an x_{ij} variable to the corresponding branching constraint number in the master
end temp error checking
Definition at line 800 of file OSColGenApp.cpp.
void OSColGenApp::solve | ( | ) |
optionally print out the corresponding x columns
end of optionally print out
Definition at line 268 of file OSColGenApp.cpp.
void OSColGenApp::printTreeInfo | ( | ) |
Definition at line 1750 of file OSColGenApp.cpp.
void OSColGenApp::getInitialRestrictedMaster | ( | ) |
Definition at line 129 of file OSColGenApp.cpp.
bool OSColGenApp::isInteger | ( | const double * | thetaVar, |
const int | numThetaVar, | ||
const double | tol | ||
) |
INPUT: double* thetaVar – the vector of primal master values int numThetaVar – size of master primal vector tol – is the tolerance on 0/1.
return true if the solution is integer
Definition at line 722 of file OSColGenApp.cpp.
void OSColGenApp::printDebugInfo | ( | ) |
Definition at line 755 of file OSColGenApp.cpp.
Definition at line 1784 of file OSColGenApp.cpp.
void OSColGenApp::getCuts | ( | const double * | thetaVar, |
const int | numThetaVar, | ||
int & | numNewRows, | ||
int *& | numNonz, | ||
int **& | colIdx, | ||
double **& | values, | ||
double *& | rowLB, | ||
double *& | rowUB | ||
) |
RETURN VALUES: int numNewRows – number of new rows generated int* numNonz – number of nonzeros in each row double** colIdx – vectors column indexes of new rows double** values – vectors of matrix coefficient values of new rows double* rowLB – vector of row lower bounds double* rowUB – vector of row upper bounds.
INPUT: double* thetaVar – the vector of primal master values int numThetaVar – size of master primal vector
Definition at line 137 of file OSColGenApp.cpp.
void OSColGenApp::getColumns | ( | const double * | yA, |
const int | numARows, | ||
const double * | yB, | ||
const int | numBRows, | ||
int & | numNewColumns, | ||
int *& | numNonz, | ||
double *& | cost, | ||
int **& | rowIdx, | ||
double **& | values, | ||
double & | lowerBound | ||
) |
RETURN VALUES: int numNewColumns – number of new columns generated int* numNonz – number of nonzeros in each column double* cost – the objective function coefficient on each new column double** rowIdx – vectors row indexes of new columns double** values – vectors of matrix coefficient values of new columns double lowerBound – the lowerBound.
INPUT: double* yA – the vector of dual values on the coupling constraints int numARows – size of the yA dual vector double* yB – the vector of dual values on the tour breaking constaints int numBRows – size of the yA dual vector
Definition at line 175 of file OSColGenApp.cpp.
OSNode * OSColGenApp::createChild | ( | const OSNode * | osnode, |
std::map< int, int > & | varConMap, | ||
const int | rowIdx, | ||
const double | rowLB, | ||
const double | rowUB | ||
) |
INPUT: OSNode* osnode – the parent node for which we create a child std::map<int, int> varConMap – the variable constraint map rowIdx is the index of the branching row rowLB is the lower bound of the new branching row rowUB is the upper bound of the new branching row.
method returns a pointer to a child node if a new branching variable is found we may add that to the map so varConMap can gen
Definition at line 1054 of file OSColGenApp.cpp.
void OSColGenApp::createBranchingCut | ( | const int * | thetaIdx, |
const double * | theta, | ||
const int | numThetaVar, | ||
std::map< int, int > & | varConMap, | ||
int & | rowIdx | ||
) |
INPUT: – sparse version int* thetaIdx – index vector of nonzero theta variables double* theta – the sparse vector of primal master values int numThetaVar – size of master primal vector std::map<int, int> varConMap – the variable constraint map.
RETURN:
rowIdx is the row index of the row used for branching
Definition at line 1355 of file OSColGenApp.cpp.
void OSColGenApp::createBranchingCut | ( | const double * | theta, |
const int | numThetaVar, | ||
std::map< int, int > & | varConMap, | ||
int & | rowIdx | ||
) |
INPUT: – dense version double* theta – the dense vector of primal master values int numThetaVar – size of master primal vector std::map<int, int> varConMap – the variable constraint map.
RETURN:
rowIdx is the row index of the row used for branching
std::cout << m_osrouteSolver->m_variableNames[ m_osrouteSolver->m_thetaIndex[ j] ] << " = " << theta[ thetaNumNonz] << std::endl;
Definition at line 1447 of file OSColGenApp.cpp.
void OSColGenApp::resetMaster | ( | ) |
now delete stuff and reset
Definition at line 1526 of file OSColGenApp.cpp.
OSDecompFactoryInitializer* OSColGenApp::m_factoryInit |
Definition at line 43 of file OSColGenApp.h.
OSDecompSolver* OSColGenApp::m_osrouteSolver |
Definition at line 46 of file OSColGenApp.h.
std::ostringstream OSColGenApp::outStr |
Definition at line 51 of file OSColGenApp.h.
OSInstance* OSColGenApp::m_osinstanceMaster |
Definition at line 53 of file OSColGenApp.h.
OSOption* OSColGenApp::m_osoption |
Definition at line 54 of file OSColGenApp.h.
OSResult* OSColGenApp::m_osresult |
Definition at line 55 of file OSColGenApp.h.
std::vector<double> OSColGenApp::m_zRootLPx_vals |
m_zRootLPx_vals holds root node optimal LP solution nonzero values
Definition at line 60 of file OSColGenApp.h.
std::vector<int> OSColGenApp::m_zRootLPx_idx |
m_zRootLPx_idxs holds root node optimal LP solution nonzero indexes
Definition at line 66 of file OSColGenApp.h.
bool OSColGenApp::m_calledBranchAndBound |
this variable is true if we have called the branchAndBound() method
Definition at line 73 of file OSColGenApp.h.
map the variable generated at a node with a variable
Definition at line 78 of file OSColGenApp.h.
CoinSolver* OSColGenApp::m_solver |
Definition at line 82 of file OSColGenApp.h.
OsiSolverInterface* OSColGenApp::m_si |
Definition at line 84 of file OSColGenApp.h.
OSDecompParam OSColGenApp::m_osDecompParam |
Application specific parameters.
Definition at line 88 of file OSColGenApp.h.
int OSColGenApp::m_numNodesGenerated |
kount the nodes generated
Definition at line 91 of file OSColGenApp.h.
int OSColGenApp::m_numColumnsGenerated |
kount the columns generated
Definition at line 94 of file OSColGenApp.h.
int OSColGenApp::m_numColumnsOld |
when m_numColumnsGenerated - m_numColumnsOld hits masterColumnResetValue we do a reset
Definition at line 102 of file OSColGenApp.h.
std::string OSColGenApp::m_message |
m_message is the message to the pauHana routine
Definition at line 105 of file OSColGenApp.h.
double OSColGenApp::m_zUB |
m_zUB is the upper bound
Definition at line 108 of file OSColGenApp.h.
double OSColGenApp::m_zLB |
m_zLB is the lower bound
Definition at line 111 of file OSColGenApp.h.
double OSColGenApp::m_zRootLP |
m_zRootLP is the value of the root LP relaxation
Definition at line 114 of file OSColGenApp.h.
nodeMap is the map of nodes in the branch and bound tree
Definition at line 119 of file OSColGenApp.h.
std::vector<int> OSColGenApp::m_zOptIndexes |
m_zOptIndexes is the vector theta indexes corresponding to the current m_zUB
Definition at line 125 of file OSColGenApp.h.
std::vector<int> OSColGenApp::m_zOptRootLP |
m_zOptRootLP is the vector theta indexes corresponding to optimal LP solution at the roor tnode
Definition at line 132 of file OSColGenApp.h.
Definition at line 135 of file OSColGenApp.h.
double* OSColGenApp::m_yA |
m_yA is the dual values for the initial restricted constraints
Definition at line 141 of file OSColGenApp.h.
double* OSColGenApp::m_yB |
m_yB is the dual for the cuts that get added
Definition at line 144 of file OSColGenApp.h.
double* OSColGenApp::m_theta |
m_theta is the primal values in the master
Definition at line 147 of file OSColGenApp.h.
int OSColGenApp::m_maxCols |
m_maxCols is the maximum number of columns we can have
Definition at line 150 of file OSColGenApp.h.
int OSColGenApp::m_maxRows |
m_maxRows is the maximum number of rows we can have
Definition at line 153 of file OSColGenApp.h.