00001
00018 #ifndef OSROUTESOLVER_H
00019 #define OSROUTESOLVER_H
00020
00021 #include "OSInstance.h"
00022 #include "OSOption.h"
00023
00030
00031 class OSRouteSolver {
00032 public:
00033
00034
00035
00036
00037 std::string m_initOSiLFile;
00038 std::map<int, std::map<int, std::vector<int> > > m_initSolMap;
00039
00040
00041 int m_numberOfVar;
00042 int m_numHubs;
00043 int m_numNodes;
00044 int m_routeCapacity;
00045 int m_minDemand;
00046 int* m_demand;
00047
00051 double** m_cost;
00052
00056 double* m_rc;
00061 double* m_psi;
00065 double* m_phi;
00066
00067
00068 double* m_optValHub;
00069
00070
00071
00072 double** m_u;
00073 double** m_v;
00074 int** m_px;
00075 int** m_tx;
00076 double** m_g;
00077 int* m_varIdx;
00078
00079
00080
00081
00082 int* m_optL;
00083 int* m_optD;
00084 double** m_vv;
00085 int** m_vvpnt;
00086
00087
00088
00089 int m_totalDemand;
00090 int m_upperBoundL;
00091 int m_numberOfSolutions;
00092
00093
00094
00095
00096 std::string* m_variableNames;
00097
00098
00099 int* m_pntAmatrix;
00100 int* m_Amatrix;
00101
00102
00103
00104 int* m_tmpScatterArray;
00105
00106
00107 double m_lowerBnd;
00108 int* m_nonzVec;
00109 double* m_costVec;
00110
00111 int** m_newColumnRowIdx;
00112 double** m_newColumnRowValue;
00113
00114
00115 int* m_thetaPnt;
00116 int* m_thetaIndex;
00117 int m_numThetaVar;
00118 int m_numThetaNonz;
00119 double* m_thetaCost;
00120
00121
00122
00123
00124 OSInstance *m_osinstanceMaster;
00125 OSInstance *m_osinstanceSeparation;
00126
00127
00128 OSInstance* getInitialRestrictedMaster( );
00129
00130
00131 OSInstance* getSeparationInstance();
00132
00134
00135 double qrouteCost(const int& k, const int& l, const double* c, int* kountVar) ;
00136
00137
00138 void getOptL(const double* c) ;
00139
00140
00141 void getCuts(const double* x) ;
00142
00157 void getColumns(const double* y, const int numRows,
00158 int &numColumns, int* numNonz, double* cost, double* rcost,
00159 int** rowIdx, double** values, double &lowerBound) ;
00160
00161
00162 void getOptions( OSOption *osoption);
00163
00164
00170 void calcReducedCost( double** c, double* phi, double* d);
00171
00172
00173 void createVariableNames( );
00174
00175
00176
00177 void createAmatrix();
00178
00179
00180 void pauHana(const double* theta);
00181
00182
00183
00188 OSRouteSolver();
00189
00194 OSRouteSolver(OSOption* osoption);
00195
00196
00201 ~OSRouteSolver();
00202
00203
00204 };
00205
00206 #endif
00207