My Project
OSColGenApp Class Reference

#include <OSColGenApp.h>

Public Member Functions

void solveRestrictedMasterRelaxation ()
 kipp – document
 
void getOptions (OSOption *osoption)
 
bool branchAndBound ()
 the method that invokes and controls branch and bound
 
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.
 
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.
 
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.
 
OSNodecreateChild (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.
 
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.
 
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.
 
void resetMaster ()
 
 OSColGenApp ()
 Default Constructor.
 
 OSColGenApp (OSOption *osption)
 Second Constructor.
 
 ~OSColGenApp ()
 Default destructor.
 

Public Attributes

OSDecompFactoryInitializerm_factoryInit
 
OSDecompSolverm_osrouteSolver
 
std::ostringstream outStr
 
OSInstancem_osinstanceMaster
 
OSOptionm_osoption
 
OSResultm_osresult
 
std::vector< double > m_zRootLPx_vals
 m_zRootLPx_vals holds root node optimal LP solution nonzero values
 
std::vector< int > m_zRootLPx_idx
 m_zRootLPx_idxs holds root node optimal LP solution nonzero indexes
 
bool m_calledBranchAndBound
 this variable is true if we have called the branchAndBound() method
 
std::map< int, int > m_rowIdxVarMap
 map the variable generated at a node with a variable
 
CoinSolverm_solver
 
OsiSolverInterface * m_si
 
OSDecompParam m_osDecompParam
 Application specific parameters.
 
int m_numNodesGenerated
 kount the nodes generated
 
int m_numColumnsGenerated
 kount the columns generated
 
int m_numColumnsOld
 when m_numColumnsGenerated - m_numColumnsOld hits masterColumnResetValue we do a reset
 
std::string m_message
 m_message is the message to the pauHana routine
 
double m_zUB
 m_zUB is the upper bound
 
double m_zLB
 m_zLB is the lower bound
 
double m_zRootLP
 m_zRootLP is the value of the root LP relaxation
 
std::map< int, OSNode * > m_nodeMap
 nodeMap is the map of nodes in the branch and bound tree
 
std::vector< int > m_zOptIndexes
 m_zOptIndexes is the vector theta indexes corresponding to the current m_zUB
 
std::vector< int > m_zOptRootLP
 m_zOptRootLP is the vector theta indexes corresponding to optimal LP solution at the roor tnode
 
std::map< int, int > inVars
 
double * m_yA
 m_yA is the dual values for the initial restricted constraints
 
double * m_yB
 m_yB is the dual for the cuts that get added
 
double * m_theta
 m_theta is the primal values in the master
 
int m_maxCols
 m_maxCols is the maximum number of columns we can have
 
int m_maxRows
 m_maxRows is the maximum number of rows we can have
 

Detailed Description

OSColGenApp

Definition at line 40 of file OSColGenApp.h.

Constructor & Destructor Documentation

◆ OSColGenApp() [1/2]

OSColGenApp::OSColGenApp ( )

Default Constructor.

Definition at line 51 of file OSColGenApp.cpp.

◆ OSColGenApp() [2/2]

OSColGenApp::OSColGenApp ( OSOption * osption)

Second Constructor.

Definition at line 58 of file OSColGenApp.cpp.

◆ ~OSColGenApp()

OSColGenApp::~OSColGenApp ( )

Default destructor.

Definition at line 111 of file OSColGenApp.cpp.

Member Function Documentation

◆ solveRestrictedMasterRelaxation()

void OSColGenApp::solveRestrictedMasterRelaxation ( )

kipp – document

Definition at line 499 of file OSColGenApp.cpp.

◆ getOptions()

void OSColGenApp::getOptions ( OSOption * osoption)

Definition at line 189 of file OSColGenApp.cpp.

◆ branchAndBound()

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.

◆ solve()

void OSColGenApp::solve ( )

optionally print out the corresponding x columns

end of optionally print out

Definition at line 268 of file OSColGenApp.cpp.

◆ printTreeInfo()

void OSColGenApp::printTreeInfo ( )

Definition at line 1750 of file OSColGenApp.cpp.

◆ getInitialRestrictedMaster()

void OSColGenApp::getInitialRestrictedMaster ( )

Definition at line 129 of file OSColGenApp.cpp.

◆ isInteger()

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.

◆ printDebugInfo()

void OSColGenApp::printDebugInfo ( )

Definition at line 755 of file OSColGenApp.cpp.

◆ checkNodeConsistency()

void OSColGenApp::checkNodeConsistency ( const int rowIdx,
const OSNode * osnode )

Definition at line 1784 of file OSColGenApp.cpp.

◆ getCuts()

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.

◆ getColumns()

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.

◆ createChild()

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.

◆ createBranchingCut() [1/2]

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.

◆ createBranchingCut() [2/2]

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.

◆ resetMaster()

void OSColGenApp::resetMaster ( )

now delete stuff and reset

Definition at line 1526 of file OSColGenApp.cpp.

Member Data Documentation

◆ m_factoryInit

OSDecompFactoryInitializer* OSColGenApp::m_factoryInit

Definition at line 43 of file OSColGenApp.h.

◆ m_osrouteSolver

OSDecompSolver* OSColGenApp::m_osrouteSolver

Definition at line 46 of file OSColGenApp.h.

◆ outStr

std::ostringstream OSColGenApp::outStr

Definition at line 51 of file OSColGenApp.h.

◆ m_osinstanceMaster

OSInstance* OSColGenApp::m_osinstanceMaster

Definition at line 53 of file OSColGenApp.h.

◆ m_osoption

OSOption* OSColGenApp::m_osoption

Definition at line 54 of file OSColGenApp.h.

◆ m_osresult

OSResult* OSColGenApp::m_osresult

Definition at line 55 of file OSColGenApp.h.

◆ m_zRootLPx_vals

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.

◆ m_zRootLPx_idx

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.

◆ m_calledBranchAndBound

bool OSColGenApp::m_calledBranchAndBound

this variable is true if we have called the branchAndBound() method

Definition at line 73 of file OSColGenApp.h.

◆ m_rowIdxVarMap

std::map<int, int> OSColGenApp::m_rowIdxVarMap

map the variable generated at a node with a variable

Definition at line 78 of file OSColGenApp.h.

◆ m_solver

CoinSolver* OSColGenApp::m_solver

Definition at line 82 of file OSColGenApp.h.

◆ m_si

OsiSolverInterface* OSColGenApp::m_si

Definition at line 84 of file OSColGenApp.h.

◆ m_osDecompParam

OSDecompParam OSColGenApp::m_osDecompParam

Application specific parameters.

Definition at line 88 of file OSColGenApp.h.

◆ m_numNodesGenerated

int OSColGenApp::m_numNodesGenerated

kount the nodes generated

Definition at line 91 of file OSColGenApp.h.

◆ m_numColumnsGenerated

int OSColGenApp::m_numColumnsGenerated

kount the columns generated

Definition at line 94 of file OSColGenApp.h.

◆ m_numColumnsOld

int OSColGenApp::m_numColumnsOld

when m_numColumnsGenerated - m_numColumnsOld hits masterColumnResetValue we do a reset

Definition at line 102 of file OSColGenApp.h.

◆ m_message

std::string OSColGenApp::m_message

m_message is the message to the pauHana routine

Definition at line 105 of file OSColGenApp.h.

◆ m_zUB

double OSColGenApp::m_zUB

m_zUB is the upper bound

Definition at line 108 of file OSColGenApp.h.

◆ m_zLB

double OSColGenApp::m_zLB

m_zLB is the lower bound

Definition at line 111 of file OSColGenApp.h.

◆ m_zRootLP

double OSColGenApp::m_zRootLP

m_zRootLP is the value of the root LP relaxation

Definition at line 114 of file OSColGenApp.h.

◆ m_nodeMap

std::map<int, OSNode*> OSColGenApp::m_nodeMap

nodeMap is the map of nodes in the branch and bound tree

Definition at line 119 of file OSColGenApp.h.

◆ m_zOptIndexes

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.

◆ m_zOptRootLP

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.

◆ inVars

std::map<int, int> OSColGenApp::inVars

Definition at line 135 of file OSColGenApp.h.

◆ m_yA

double* OSColGenApp::m_yA

m_yA is the dual values for the initial restricted constraints

Definition at line 141 of file OSColGenApp.h.

◆ m_yB

double* OSColGenApp::m_yB

m_yB is the dual for the cuts that get added

Definition at line 144 of file OSColGenApp.h.

◆ m_theta

double* OSColGenApp::m_theta

m_theta is the primal values in the master

Definition at line 147 of file OSColGenApp.h.

◆ m_maxCols

int OSColGenApp::m_maxCols

m_maxCols is the maximum number of columns we can have

Definition at line 150 of file OSColGenApp.h.

◆ m_maxRows

int OSColGenApp::m_maxRows

m_maxRows is the maximum number of rows we can have

Definition at line 153 of file OSColGenApp.h.


The documentation for this class was generated from the following files: