VrpCutGenerator.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of a solver for the Vehicle Routing Problem *
3  * developed using the BiCePS Linear Integer Solver (BLIS). *
4  * *
5  * This solver is distributed under the Eclipse Public License as part of *
6  * the COIN-OR repository (http://www.coin-or.org). *
7  * *
8  * Authors: Yan Xu, Lehigh University *
9  * Ted Ralphs, Lehigh University *
10  * *
11  * Copyright (C) 2007 Yan Xu and Ted Ralphs. *
12  * All Rights Reserved. *
13  *===========================================================================*/
14 
15 #ifndef VrpCutGenerator_h_
16 #define VrpCutGenerator_h_
17 
18 //#############################################################################
19 
20 #include "BlisConGenerator.h"
21 #include "VrpModel.h"
22 #include "VrpNetwork.h"
23 #include "VrpMacros.h"
24 #ifdef DO_TSP_CUTS
25 extern "C"{
26  #include "concorde.h"
27 }
28 #endif
29 
30 class VrpModel;
31 
32 //#############################################################################
33 
35 {
36 private:
37 
39  char **coef_list;
40  int *ref_;
41  double *cutVal_;
42  char *cutList_;
43  char *inSet_;
44 
45 public:
46 
48  VrpCutGenerator(VrpModel *vrp=0, int vertnum = 0);
49 
51  virtual ~VrpCutGenerator() {
52  delete [] ref_; ref_ = 0;
53  delete [] cutVal_; cutVal_ = 0;
54  delete [] cutList_; cutList_ = 0;
55  delete [] inSet_; inSet_ = 0;
56  }
57 
62  virtual bool generateConstraints(BcpsConstraintPool &conPool);
63 
65 
66  int addVrpCut(BcpsConstraintPool &conPool, char *coef, int rhs,int type);
67 
68  void setModel(VrpModel *vrp){ model_ = vrp; }
69 
70  int greedyShrinking1(VrpModel *m, int max_shrink_cuts,
71  BcpsConstraintPool &conPool);
72 
73  int greedyShrinking1One(VrpModel *m, int max_shrink_cuts,
74  BcpsConstraintPool &conPool);
75 
76  int greedyShrinking6(VrpModel *m, int max_shrink_cuts, int trial_num,
77  double prob, BcpsConstraintPool &conPool);
78 
79  int greedyShrinking6One(VrpModel *m, int max_shrink_cuts, int trial_num,
80  double prob, BcpsConstraintPool &conPool);
81 
82  int greedyShrinking2One(VrpModel *m, int max_shrink_cuts,
83  BcpsConstraintPool &conPool);
84 
85 #ifdef DO_TSP_CUTS
86  int tspCuts(VrpModel *m, BcpsConstraintPool &conPool);
87  int addTspCuts(VrpModel *m, BcpsConstraintPool &conPool,
88  CCtsp_lpcut_in **tsp_cuts, CCtsp_lpgraph *g);
89 #endif
90 
91 };
92 
93 //#############################################################################
94 
95 #endif
Model class for VRP.
Definition: VrpModel.h:32
virtual ~VrpCutGenerator()
Destructor.
int greedyShrinking1(VrpModel *m, int max_shrink_cuts, BcpsConstraintPool &conPool)
VrpModel * model_
int greedyShrinking6One(VrpModel *m, int max_shrink_cuts, int trial_num, double prob, BcpsConstraintPool &conPool)
int greedyShrinking2One(VrpModel *m, int max_shrink_cuts, BcpsConstraintPool &conPool)
virtual bool generateConstraints(BcpsConstraintPool &conPool)
Generate cons for the client model.
int connectivityCuts(BcpsConstraintPool &conPool)
Interface between Blis and Cut Generation Library.
void setModel(VrpModel *vrp)
int greedyShrinking6(VrpModel *m, int max_shrink_cuts, int trial_num, double prob, BcpsConstraintPool &conPool)
int greedyShrinking1One(VrpModel *m, int max_shrink_cuts, BcpsConstraintPool &conPool)
int addVrpCut(BcpsConstraintPool &conPool, char *coef, int rhs, int type)
VrpCutGenerator(VrpModel *vrp=0, int vertnum=0)
Construtors.