VRP_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-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 #ifndef VRP_DECOMPAPP_INCLUDED
00014 #define VRP_DECOMPAPP_INCLUDED
00015 
00016 // --------------------------------------------------------------------- //
00017 #include "Decomp.h"
00018 #include "DecompApp.h"
00019 #include "VRP_Boost.h"
00020 #include "VRP_CVRPsep.h"
00021 #include "VRP_Instance.h"
00022 #include "VRP_Param.h"
00023 // --------------------------------------------------------------------- //
00024 #define VRP_DECOMPAPP_USECONCORDE
00025 #ifdef VRP_DECOMPAPP_USECONCORDE
00026 #include "VRP_Concorde.h"
00027 #endif
00028 // --------------------------------------------------------------------- //
00029 
00039 // --------------------------------------------------------------------- //
00040 class VRP_DecompApp : public DecompApp {
00041 private:
00043    const string m_classTag;
00044 
00046    VRP_Param m_appParam;  
00047 
00049    VRP_Instance    m_vrp;
00050 
00052    VRP_CVRPsep     m_cvrpSep;
00053 
00055    VRP_Boost       m_boost;
00056 
00058 #ifdef VRP_DECOMPAPP_USECONCORDE
00059    VRP_Concorde    m_concorde;
00060 #endif
00061 
00063    double * m_objective;
00064 
00066    vector<DecompConstraintSet*>   m_models;
00067    DecompConstraintSet          * m_modelESPPRC;
00068 
00069 public:
00070    /* @name Inherited (from virtual) methods. */
00071 
00073    virtual DecompSolverStatus solveRelaxed(const int          whichBlock,
00074                                            const double     * redCostX,
00075                                            const double       convexDual,
00076                                            DecompVarList    & varList);
00077 
00078 
00079    virtual int generateCuts(const double              * x, 
00080                             DecompCutList             & newCuts);
00081 
00082    //TODO: change this name... 
00083    virtual bool APPisUserFeasible(const double * x, 
00084                                   const int      n_cols,
00085                                   const double   tolZero);
00086    virtual void printOriginalColumn(const int   index, 
00087                                     ostream   * os) const;
00088    
00089       
00090    
00091 public:
00094    void initializeApp(UtilParameters & utilParam);
00095 
00096    /* Create models. */
00097    void createModels();
00098 
00099    /* Create two-degree model. */
00100    void createModelTwoDegree(DecompConstraintSet * model);
00101 
00102    /* Create ESPPCC model. */
00103    void createModelESPPCC(DecompConstraintSet * model);
00104 
00105    const int diGraphIndex(int i, int j, int numVertices){
00106       return i*numVertices + j;
00107    }
00108    const pair<int,int> diGraphBothEnds(int index, int numVertices){
00109       int i = index / numVertices;
00110       return make_pair(i, index % numVertices);
00111    }
00112 
00113 public:
00117    VRP_DecompApp(UtilParameters & utilParam) : 
00118       DecompApp(utilParam),
00119       m_classTag("VRP-APP"),
00120     m_objective(NULL),
00121     m_modelESPPRC(NULL)
00122    {
00123       initializeApp(utilParam);         
00124    }
00125    
00126    virtual ~VRP_DecompApp() {
00127       UtilDeleteVectorPtr(m_models);
00128       UTIL_DELARR(m_objective);
00129    };
00130 };
00131 
00132 #endif

Generated on 3 Jun 2015 for Dip-All by  doxygen 1.6.1