Dip-All  0.91.0
VRP_ConcordeI.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the Decomp Solver Framework. //
3 // //
4 // Decomp is distributed under the Common Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, Lehigh University //
8 // //
9 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
10 // All Rights Reserved. //
11 //===========================================================================//
12 
13 #ifndef VRP_CONCORDEI_INCLUDED
14 #define VRP_CONCORDEI_INCLUDED
15 
16 //---
17 //--- Interface class to Concorde (TSP solver)
18 //--- those prototypes from concorde lib that we use
19 //---
20 #define CC_TINYTSP_MINIMIZE (1)
21 #define CC_TINYTSP_ERROR -1
22 #define CC_TINYTSP_SEARCHLIMITEXCEEDED 1
23 #define CC_TINYTSP_INFEASIBLE 2
24 #define CCutil_MAXINT (2147483647)
25 
26 extern "C"{
27  typedef struct CCrandstate {
28  int a;
29  int b;
30  int arr[55];
31  } CCrandstate;
32 
33  typedef struct CCdata_user {
34  double *x;
35  double *y;
36  } CCdata_user;
37 
38  typedef struct CCdata_rhvector {
39  int dist_00;
40  int dist_01;
41  int dist_02;
42  int dist_12;
43  int dist_22;
44  double p;
45  int rhlength;
46  char *space;
47  char **vectors;
49 
50  typedef struct CCdatagroup {
51  int (*edgelen) (int i, int j, struct CCdatagroup *dat);
52  double *x;
53  double *y;
54  double *z;
55  int **adj;
56  int *adjspace;
57  int **len;
58  int *lenspace;
59  int *degree;
60  int norm;
62  int default_len; /* for edges not in sparse graph */
63  int sparse_ecount; /* number of edges in sparse graph */
64  double gridsize; /* for toroidal norm */
68  int ndepot; /* used with the subdivision code */
69  int orig_ncount; /* just ncount-ndepot */
70  int *depotcost; /* cost from each node to the depot */
71  int *orig_names; /* the nodes names from full problem */
72  } CCdatagroup;
73 
74  void CCutil_sprand (int seed, CCrandstate *r);
75 
76  int CCtsp_solve_sparse (int ncount,
77  int ecount,
78  int * elist,
79  int * elen,
80  int * in_tour,
81  int * out_tour,
82  double * in_val,
83  double * optval,
84  int * success,
85  int * foundtour,
86  char * name,
87  double * timebound,
88  int * hit_timebound,
89  int silent,
90  CCrandstate * rstate);
91 
92  int CCtsp_solve_dat (int ncount,
93  CCdatagroup * indat,
94  int * in_tour,
95  int * out_tour,
96  double * in_val,
97  double * optval,
98  int * success,
99  int * foundtour,
100  char * name,
101  double * timebound,
102  int * hit_timebound,
103  int silent,
104  CCrandstate * rstate);
105 
106  int CCutil_graph2dat_matrix (int ncount,
107  int ecount,
108  int * elist,
109  int * elen,
110  int defaultlen,
111  CCdatagroup * dat);
112 
113  int CCtiny_bnc_tsp (int ncount,
114  CCdatagroup * dat,
115  double * upbound,
116  double * optval,
117  int nodelimit);
118 
119  int CCtiny_bnc_msp (int ncount, int ecount, int *elist, int *elen, int depot,
120  int *lower, int *upper, double *upperbound, int objsense,
121  double *optval, int *xsol, int checkresult, int searchlimit);
122 
123 
124 
125 }
126 #endif
int CCtiny_bnc_tsp(int ncount, CCdatagroup *dat, double *upbound, double *optval, int nodelimit)
int CCtsp_solve_sparse(int ncount, int ecount, int *elist, int *elen, int *in_tour, int *out_tour, double *in_val, double *optval, int *success, int *foundtour, char *name, double *timebound, int *hit_timebound, int silent, CCrandstate *rstate)
CCdata_rhvector rhdat
Definition: VRP_ConcordeI.h:66
struct CCdata_user CCdata_user
int * adjspace
Definition: VRP_ConcordeI.h:56
double * z
Definition: VRP_ConcordeI.h:54
double * y
Definition: VRP_ConcordeI.h:53
struct CCrandstate CCrandstate
double * x
Definition: VRP_ConcordeI.h:34
double gridsize
Definition: VRP_ConcordeI.h:64
int CCtsp_solve_dat(int ncount, CCdatagroup *indat, int *in_tour, int *out_tour, double *in_val, double *optval, int *success, int *foundtour, char *name, double *timebound, int *hit_timebound, int silent, CCrandstate *rstate)
struct CCdatagroup CCdatagroup
int * lenspace
Definition: VRP_ConcordeI.h:58
double * x
Definition: VRP_ConcordeI.h:52
double * y
Definition: VRP_ConcordeI.h:35
int CCutil_graph2dat_matrix(int ncount, int ecount, int *elist, int *elen, int defaultlen, CCdatagroup *dat)
int * orig_names
Definition: VRP_ConcordeI.h:71
struct CCdata_rhvector CCdata_rhvector
int(* edgelen)(int i, int j, struct CCdatagroup *dat)
Definition: VRP_ConcordeI.h:51
int * depotcost
Definition: VRP_ConcordeI.h:70
CCdata_user userdat
Definition: VRP_ConcordeI.h:67
double dsjrand_factor
Definition: VRP_ConcordeI.h:65
void CCutil_sprand(int seed, CCrandstate *r)
int CCtiny_bnc_msp(int ncount, int ecount, int *elist, int *elen, int depot, int *lower, int *upper, double *upperbound, int objsense, double *optval, int *xsol, int checkresult, int searchlimit)
int arr[55]
Definition: VRP_ConcordeI.h:30