TSP_DecompApp.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common Public License as part of the      //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, Lehigh University                                 //
00008 //                                                                           //
00009 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
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    /* @name Inherited (from virtual) methods. */
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 

Generated on 12 Feb 2015 for Dip-All by  doxygen 1.6.1