- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/svn-release/Blis-0.93.10/Blis/examples/VRP/VrpCutGenerator.h

Go to the documentation of this file.

    00001 /*===========================================================================*
    00002  * This file is part of a solver for the Vehicle Routing Problem             *
    00003  * developed using the BiCePS Linear Integer Solver (BLIS).                  *
    00004  *                                                                           *
    00005  * This solver is distributed under the Eclipse Public License as part of    *
    00006  * the COIN-OR repository (http://www.coin-or.org).                          *
    00007  *                                                                           *
    00008  * Authors: Yan Xu, Lehigh University                                        *
    00009  *          Ted Ralphs, Lehigh University                                    *
    00010  *                                                                           *
    00011  * Copyright (C) 2007 Yan Xu and Ted Ralphs.                                 *
    00012  * All Rights Reserved.                                                      *
    00013  *===========================================================================*/
    00014
    00015 #ifndef VrpCutGenerator_h_
    00016 #define VrpCutGenerator_h_
    00017
    00018 //#############################################################################
    00019
    00020 #include "BlisConGenerator.h"
    00021 #include "VrpModel.h"
    00022 #include "VrpNetwork.h"
    00023 #include "VrpMacros.h"
    00024 #ifdef DO_TSP_CUTS
    00025 extern "C"{
    00026    #include "concorde.h"
    00027 }
    00028 #endif
    00029
    00030 class VrpModel;
    00031
    00032 //#############################################################################
    00033
    00034 class VrpCutGenerator : public BlisConGenerator
    00035 {
    00036 private:
    00037
    00038    VrpModel *model_;
    00039    char **coef_list;
    00040    int *ref_;
    00041    double *cutVal_;
    00042    char *cutList_;
    00043    char *inSet_;
    00044
    00045 public:
    00046
    00048    VrpCutGenerator(VrpModel *vrp=0, int vertnum = 0);
    00049
    00051    virtual ~VrpCutGenerator() {
    00052       delete [] ref_; ref_ = 0;
    00053       delete [] cutVal_; cutVal_ = 0;
    00054       delete [] cutList_; cutList_ = 0;
    00055       delete [] inSet_; inSet_ = 0;
    00056    }
    00057
    00062    virtual bool generateConstraints(BcpsConstraintPool &conPool);
    00063
    00064    int connectivityCuts(BcpsConstraintPool &conPool);
    00065
    00066    int addVrpCut(BcpsConstraintPool &conPool, char *coef, int rhs,int type);
    00067
    00068    void setModel(VrpModel *vrp){ model_ = vrp; }
    00069
    00070    int greedyShrinking1(VrpModel *m, int max_shrink_cuts,
    00071                         BcpsConstraintPool &conPool);
    00072
    00073    int greedyShrinking1One(VrpModel *m, int max_shrink_cuts,
    00074                            BcpsConstraintPool &conPool);
    00075
    00076    int greedyShrinking6(VrpModel *m, int max_shrink_cuts, int trial_num,
    00077                         double prob, BcpsConstraintPool &conPool);
    00078
    00079    int greedyShrinking6One(VrpModel *m, int max_shrink_cuts, int trial_num,
    00080                            double prob, BcpsConstraintPool &conPool);
    00081
    00082    int greedyShrinking2One(VrpModel *m, int max_shrink_cuts,
    00083                            BcpsConstraintPool &conPool);
    00084
    00085 #ifdef DO_TSP_CUTS
    00086    int tspCuts(VrpModel *m, BcpsConstraintPool &conPool);
    00087    int addTspCuts(VrpModel *m, BcpsConstraintPool &conPool,
    00088                   CCtsp_lpcut_in **tsp_cuts, CCtsp_lpgraph *g);
    00089 #endif
    00090
    00091 };
    00092
    00093 //#############################################################################
    00094
    00095 #endif