Dip
0.92.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
tmp
Dip-0.92.4
SYMPHONY
Applications
CNRP
include
cnrp_common_types.h
Go to the documentation of this file.
1
/*===========================================================================*/
2
/* */
3
/* This file is part of a demonstration application for use with the */
4
/* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */
5
/* Capacitated Network Routing Problems. */
6
/* */
7
/* (c) Copyright 2000-2013 Ted Ralphs. All Rights Reserved. */
8
/* */
9
/* This application was developed by Ted Ralphs (ted@lehigh.edu) */
10
/* */
11
/* This software is licensed under the Eclipse Public License. Please see */
12
/* accompanying file for terms. */
13
/* */
14
/*===========================================================================*/
15
16
#ifndef _CNRP_COMMON_TYPES_H
17
#define _CNRP_COMMON_TYPES_H
18
19
/*---------------------------------------------------------------------*\
20
| This _node data structure holds information about a customer node in |
21
| a tour. The next field contains the index of the node that is next |
22
| on the current route or if the current node is the last on eon its |
23
| route, it contains the index of the first node on the next route. |
24
| The route number field contains the number of the route that the |
25
| node is on. This information is maintained to make reconstruction of |
26
| the route and calculation of the route cost possible |
27
\*---------------------------------------------------------------------*/
28
29
typedef
struct
_NODE
{
30
int
next
;
31
int
route
;
32
}
_node
;
33
34
/*--------------------------------------------------------------------*\
35
| This data structure contains information about a tour's route |
36
| structure. Specifically, first and last are the first and last nodes |
37
| on a particular route, numcust is the number of customers on the |
38
| route and cost is the cost of that route. The routes are always |
39
| numbered starting at 1 for convenience in certain calculations so |
40
| route_info[0] always contains 0 in all fields. |
41
\*--------------------------------------------------------------------*/
42
43
typedef
struct
ROUTE_DATA
{
44
int
first
;
45
int
last
;
46
int
numcust
;
47
double
weight
;
48
int
cost
;
49
}
route_data
;
50
51
/*--------------------------------------------------------------------*\
52
| The best_tours data structure is for storing tours for later use. The|
53
| cost field contains the total cost of the tour. The numroutes field |
54
| contains the number of trucks used in the tour and the tour field is |
55
| a pointer to an array which specifies the order of each of the |
56
| routes as explained above. The field route_info contains |
57
| information about the tour's routes as explained above |
58
\*--------------------------------------------------------------------*/
59
typedef
struct
BEST_TOURS
{
60
int
algorithm
;
61
double
solve_time
;
62
int
cost
;
63
int
numroutes
;
64
route_data
*
route_info
;
65
_node
*
tour
;
66
}
best_tours
;
67
68
/*--------------------------------------------------------------------*\
69
| Stores the method by which distances should be calculated |
70
\*--------------------------------------------------------------------*/
71
72
typedef
struct
DISTANCES
{
73
int
wtype
;
74
int
*
cost
;
75
double
*
coordx
;
76
double
*
coordy
;
77
double
*
coordz
;
78
}
distances
;
79
80
/*--------------------------------------------------------------------*\
81
| This structure contains information about a particular edge |
82
\*--------------------------------------------------------------------*/
83
84
typedef
struct
EDGE_DATA
{
85
int
v0
;
86
int
v1
;
87
int
cost
;
88
}
edge_data
;
89
90
typedef
struct
DBL_EDGE_DATA
{
91
int
v0
;
92
int
v1
;
93
double
cost
;
94
}
dbl_edge_data
;
95
96
#endif
DISTANCES::coordy
double * coordy
Definition:
cnrp_common_types.h:76
DISTANCES::coordx
double * coordx
Definition:
cnrp_common_types.h:75
distances
struct DISTANCES distances
ROUTE_DATA::first
int first
Definition:
cnrp_common_types.h:44
BEST_TOURS::numroutes
int numroutes
Definition:
cnrp_common_types.h:63
EDGE_DATA
Definition:
cnrp_common_types.h:84
DISTANCES
Definition:
cnrp_common_types.h:72
DBL_EDGE_DATA
Definition:
cnrp_common_types.h:90
_NODE::route
int route
Definition:
cnrp_common_types.h:31
DBL_EDGE_DATA::v1
int v1
Definition:
cnrp_common_types.h:92
route_data
struct ROUTE_DATA route_data
BEST_TOURS::cost
int cost
Definition:
cnrp_common_types.h:62
DBL_EDGE_DATA::cost
double cost
Definition:
cnrp_common_types.h:93
_NODE::next
int next
Definition:
cnrp_common_types.h:30
BEST_TOURS::solve_time
double solve_time
Definition:
cnrp_common_types.h:61
ROUTE_DATA::last
int last
Definition:
cnrp_common_types.h:45
DISTANCES::cost
int * cost
Definition:
cnrp_common_types.h:74
ROUTE_DATA::numcust
int numcust
Definition:
cnrp_common_types.h:46
ROUTE_DATA::weight
double weight
Definition:
cnrp_common_types.h:47
ROUTE_DATA
Definition:
cnrp_common_types.h:43
_NODE
Definition:
cnrp_common_types.h:29
BEST_TOURS::route_info
route_data * route_info
Definition:
cnrp_common_types.h:64
EDGE_DATA::cost
int cost
Definition:
cnrp_common_types.h:87
dbl_edge_data
struct DBL_EDGE_DATA dbl_edge_data
BEST_TOURS
Definition:
cnrp_common_types.h:59
EDGE_DATA::v0
int v0
Definition:
cnrp_common_types.h:85
best_tours
struct BEST_TOURS best_tours
DBL_EDGE_DATA::v0
int v0
Definition:
cnrp_common_types.h:91
BEST_TOURS::tour
_node * tour
Definition:
cnrp_common_types.h:65
edge_data
struct EDGE_DATA edge_data
_node
struct _NODE _node
DISTANCES::coordz
double * coordz
Definition:
cnrp_common_types.h:77
EDGE_DATA::v1
int v1
Definition:
cnrp_common_types.h:86
ROUTE_DATA::cost
int cost
Definition:
cnrp_common_types.h:48
DISTANCES::wtype
int wtype
Definition:
cnrp_common_types.h:73
BEST_TOURS::algorithm
int algorithm
Definition:
cnrp_common_types.h:60
Generated by
1.8.5