TSP_DecompApp.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TSP_DECOMPAPP_INCLUDED
00014 #define TSP_DECOMPAPP_INCLUDED
00015
00016
00017 #include "Decomp.h"
00018 #include "DecompApp.h"
00019 #include "TSP_Instance.h"
00020 #include "TSP_Param.h"
00021
00022
00032
00033 class TSP_DecompApp : public DecompApp {
00034 private:
00036 const string m_classTag;
00037
00039 TSP_Param m_appParam;
00040
00042 TSP_Instance m_tsp;
00043
00045 double * m_objective;
00046
00048 vector<DecompConstraintSet*> m_models;
00049
00050 public:
00051
00052
00054 virtual DecompSolverStatus solveRelaxed(const int whichBlock,
00055 const double * redCostX,
00056 const double convexDual,
00057 DecompVarList & varList);
00058
00059 virtual int generateCuts(const double * x,
00060 DecompCutList & newCuts);
00061
00062 virtual bool APPisUserFeasible(const double * x,
00063 const int n_cols,
00064 const double tolZero);
00065 virtual void printOriginalColumn(const int index,
00066 ostream * os) const;
00067
00068
00069 private:
00073 void initializeApp(UtilParameters & utilParam);
00074
00076 void createModels();
00077
00079 void createModel2Match(DecompConstraintSet * modelCS);
00080
00082 void createModelTrivialSEC(DecompConstraintSet * modelCS);
00083
00084 int generateCutsSubtour(DecompCutList & newCuts);
00085
00086 void solveOneTree(const double * cost,
00087 const double alpha,
00088 vector< pair<int,double> > & edge_cost,
00089 DecompVarList & vars,
00090 Graph & g);
00091
00092 public:
00096 TSP_DecompApp(UtilParameters & utilParam) :
00097 DecompApp(utilParam),
00098 m_classTag("TSP-APP"),
00099 m_objective(NULL)
00100 {
00101 initializeApp(utilParam);
00102 }
00103
00104 virtual ~TSP_DecompApp() {
00105 UtilDeleteVectorPtr(m_models);
00106 UTIL_DELARR(m_objective);
00107 };
00108 };
00109
00110 #endif
00111
00112
00113