#include <OSDecompSolver.h>
Public Member Functions | |
virtual OSInstance * | getInitialRestrictedMaster ()=0 |
virtual void | getCutsTheta (const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB)=0 |
RETURN VALUES:. | |
virtual void | getCutsMultiCommod (const double *thetaVar, const int numThetaVar, int &numNewRows, int *&numNonz, int **&colIdx, double **&values, double *&rowLB, double *&rowUB)=0 |
This is the routine that generates the multi-item cuts. | |
virtual 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)=0 |
RETURN VALUES:. | |
virtual void | getBranchingCut (const double *thetaVar, const int numThetaVar, const std::map< int, int > &varConMap, int &varIdx, int &numNonz, int *&indexes, double *&values)=0 |
Dense Version. | |
virtual void | getBranchingCut (const int *thetaIdx, const double *theta, const int numThetaVar, const std::map< int, int > &varConMap, int &varIdx, int &numNonz, int *&indexes, double *&values)=0 |
Sparse Version. | |
virtual void | pauHana (std::vector< int > &m_zOptIndexes, std::vector< double > &m_zRootLPx_vals, int numNodes, int numColsGen, std::string message)=0 |
virtual void | resetMaster (std::map< int, int > &inVars, OsiSolverInterface *si)=0 |
INPUT:. | |
virtual void | initializeDataStructures ()=0 |
allocate memory and initialize arrays | |
OSDecompSolver () | |
Default Constructor. | |
OSDecompSolver (OSOption *osoption) | |
Constructor with OSOption Arg. | |
virtual | ~OSDecompSolver ()=0 |
Default destructor. | |
Public Attributes | |
OSInstance * | m_osinstanceMaster |
int | m_multiCommodCutLimit |
int | m_numMultCuts |
OSDecompParam | m_osDecompParam |
share the parameters with the decomposition solver | |
double | m_bestIPValue |
double | m_bestLPValue |
double | m_rootLPValue |
int * | m_thetaPnt |
int * | m_thetaIndex |
int | m_numThetaVar |
int | m_numThetaNonz |
int * | m_pntBmatrix |
int * | m_BmatrixIdx |
double * | m_BmatrixVal |
std::set< std::pair< int, double > > | intVarSet |
intVarSet holds and std::pair where the first element is the index of an integer variable and the second is the variable upper bound | |
int | m_numHubs |
m_numHubs is the number of hubs/routes | |
int | m_numNodes |
m_numNodes is the number of nodes (both pickup and hub) in the model | |
int * | m_pntAmatrix |
int * | m_Amatrix |
int | m_numBmatrixCon |
m_numBmatrixCon is the number of constraints in B - 1, we have the -1 because: m_pntBmatrix[ k] points to the start of constraint k and m_pntBmatrix[ m_numBmatrixCon ] is equal to m_numBmatrixNonz | |
int | m_numBmatrixNonz |
int | m_maxBmatrixNonz |
m_maxBmatrixNonz is the maximum number of nonzero elements in the B matrix constraints | |
int | m_maxBmatrixCon |
m_maxBmatrixCon is the maximum number of B matrix constraints it is the number of tour breaking constraints plus variable branch constraints | |
int | m_maxMasterColumns |
m_maxMasterColumns is the maximumn number of columns we allow in the master | |
int | m_maxMasterRows |
m_maxMasterColumns is the maximumn number of rows we allow in the master, in this application it is equal to m_maxBmatrixCon plus m_numNodes -- we therefore do not need to read this from an option file as we might for other problems | |
std::string * | m_variableNames |
OSOption * | m_osoption |
Definition at line 40 of file OSDecompSolver.h.
OSDecompSolver::OSDecompSolver | ( | ) |
Default Constructor.
Definition at line 16 of file OSDecompSolver.cpp.
OSDecompSolver::~OSDecompSolver | ( | ) | [pure virtual] |
Default destructor.
Definition at line 19 of file OSDecompSolver.cpp.
virtual OSInstance* OSDecompSolver::getInitialRestrictedMaster | ( | ) | [pure virtual] |
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::getCutsTheta | ( | const double * | thetaVar, | |
const int | numThetaVar, | |||
int & | numNewRows, | |||
int *& | numNonz, | |||
int **& | colIdx, | |||
double **& | values, | |||
double *& | rowLB, | |||
double *& | rowUB | |||
) | [pure virtual] |
RETURN VALUES:.
int | numNewRows -- number of new rows generated | |
int* | numNonz -- number of nonzeros in each row | |
int** | 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 |
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::getCutsMultiCommod | ( | const double * | thetaVar, | |
const int | numThetaVar, | |||
int & | numNewRows, | |||
int *& | numNonz, | |||
int **& | colIdx, | |||
double **& | values, | |||
double *& | rowLB, | |||
double *& | rowUB | |||
) | [pure virtual] |
This is the routine that generates the multi-item cuts.
RETURN VALUES: int numNewRows -- number of new rows generated int* numNonz -- number of nonzeros in each row int** 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
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::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 | |||
) | [pure virtual] |
RETURN VALUES:.
iny | 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 lowerBound -- the lowerBound |
INPUT:
double* | yA -- the vector of dual values on the coupling constraints | |
int | numARows -- size of the yA dual vector * yB -- the vector of dual values on the tour breaking constaints | |
int | numBRows -- size of the yA dual vector |
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::getBranchingCut | ( | const double * | thetaVar, | |
const int | numThetaVar, | |||
const std::map< int, int > & | varConMap, | |||
int & | varIdx, | |||
int & | numNonz, | |||
int *& | indexes, | |||
double *& | values | |||
) | [pure virtual] |
Dense Version.
RETURN VALUES:
varIdx | -- the variable number x_{ij} for branching | |
numNonz | -- number of theta indexes in the cut | |
indexes | -- the indexes of the theta variables | |
values | -- the number of times the theta indexed in indexes appears in the cut note -- set numNonz to zero if the generated cut variable already appears in varConMap |
INPUT: double* thetaVar -- the vector of primal master values int numThetaVar -- size of master primal vector varConMap -- the map of variables in x_{ij} space to a consraint number
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::getBranchingCut | ( | const int * | thetaIdx, | |
const double * | theta, | |||
const int | numThetaVar, | |||
const std::map< int, int > & | varConMap, | |||
int & | varIdx, | |||
int & | numNonz, | |||
int *& | indexes, | |||
double *& | values | |||
) | [pure virtual] |
Sparse Version.
RETURN VALUES:
varIdx | -- the variable number x_{ij} for branching Nonz -- number of theta indexes in the cut | |
indexes | -- the indexes of the theta variables | |
values | -- the number of times the theta indexed in indexes appears in the cut note -- set numNonz to zero if the generated cut variable already appears in varConMap |
INPUT:
double* | theta -- the vector of primal master values | |
int | numThetaVar -- size of master primal vector -- the map of variables in x_{ij} space to a consraint number |
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::pauHana | ( | std::vector< int > & | m_zOptIndexes, | |
std::vector< double > & | m_zRootLPx_vals, | |||
int | numNodes, | |||
int | numColsGen, | |||
std::string | message | |||
) | [pure virtual] |
Implemented in OSBearcatSolverXij.
virtual void OSDecompSolver::resetMaster | ( | std::map< int, int > & | inVars, | |
OsiSolverInterface * | si | |||
) | [pure virtual] |
INPUT:.
dstd::map<int,int> | &inVars -- the mapping of variables, the first index is the variable number before resetting, the second index is the variable number after the reset | |
OsiSolverInterface | *si -- the solver interface that corresponds to the master this is what gets rebuilt |
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
virtual void OSDecompSolver::initializeDataStructures | ( | ) | [pure virtual] |
allocate memory and initialize arrays
Implemented in OSBearcatSolverXij, and OSBearcatSolverXkij.
Definition at line 44 of file OSDecompSolver.h.
Definition at line 46 of file OSDecompSolver.h.
Definition at line 47 of file OSDecompSolver.h.
share the parameters with the decomposition solver
Definition at line 53 of file OSDecompSolver.h.
Definition at line 55 of file OSDecompSolver.h.
Definition at line 56 of file OSDecompSolver.h.
Definition at line 57 of file OSDecompSolver.h.
Definition at line 62 of file OSDecompSolver.h.
Definition at line 63 of file OSDecompSolver.h.
Definition at line 64 of file OSDecompSolver.h.
Definition at line 65 of file OSDecompSolver.h.
Definition at line 73 of file OSDecompSolver.h.
Definition at line 75 of file OSDecompSolver.h.
double* OSDecompSolver::m_BmatrixVal |
Definition at line 77 of file OSDecompSolver.h.
std::set<std::pair<int, double> > OSDecompSolver::intVarSet |
intVarSet holds and std::pair where the first element is the index of an integer variable and the second is the variable upper bound
Definition at line 84 of file OSDecompSolver.h.
m_numHubs is the number of hubs/routes
Definition at line 87 of file OSDecompSolver.h.
m_numNodes is the number of nodes (both pickup and hub) in the model
Definition at line 92 of file OSDecompSolver.h.
Definition at line 100 of file OSDecompSolver.h.
Definition at line 102 of file OSDecompSolver.h.
m_numBmatrixCon is the number of constraints in B - 1, we have the -1 because: m_pntBmatrix[ k] points to the start of constraint k and m_pntBmatrix[ m_numBmatrixCon ] is equal to m_numBmatrixNonz
Definition at line 112 of file OSDecompSolver.h.
Definition at line 113 of file OSDecompSolver.h.
m_maxBmatrixNonz is the maximum number of nonzero elements in the B matrix constraints
Definition at line 119 of file OSDecompSolver.h.
m_maxBmatrixCon is the maximum number of B matrix constraints it is the number of tour breaking constraints plus variable branch constraints
Definition at line 128 of file OSDecompSolver.h.
m_maxMasterColumns is the maximumn number of columns we allow in the master
Definition at line 134 of file OSDecompSolver.h.
m_maxMasterColumns is the maximumn number of rows we allow in the master, in this application it is equal to m_maxBmatrixCon plus m_numNodes -- we therefore do not need to read this from an option file as we might for other problems
Definition at line 143 of file OSDecompSolver.h.
std::string* OSDecompSolver::m_variableNames |
Definition at line 148 of file OSDecompSolver.h.
Definition at line 151 of file OSDecompSolver.h.