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