Dip  0.92.4
cnrp_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_TYPES_H
17 #define _CNRP_TYPES_H
18 
19 /* SYMPHONY include files */
20 #include "sym_proto.h"
21 
22 /* CNRP include files */
23 #include "cnrp_common_types.h"
24 #include "cnrp_cg_params.h"
25 #include "cnrp_lp_params.h"
26 #include "cnrp_cp_params.h"
27 
28 /*---------------------------------------------------------------------------*\
29  * The "small_graph" data structure is used to store the subset of the
30  * edges that will be used initially in actually solving the problem.
31  * These edges usually consist of any edges found among the ones used in
32  * the heuristics solutions and the set of shortest edges adjacent to
33  * each node in the graph
34 \*---------------------------------------------------------------------------*/
35 
36 typedef struct SMALL_GRAPH{ /* this gets passed eg. to lin-kerninghan */
37  int vertnum; /* vertnum in the restricted (small) graph */
38  int edgenum; /* edgenum in the restricted (small) graph */
41  edge_data *edges; /* The data for these edges */
43 
44 typedef struct CLOSENODE{ /*close node to a particular one */
45  int node;
46  int cost;
47 }closenode;
48 
49 typedef struct CNRP_PARAMS{
51  int verbosity;
52  char prob_type;
53  int k_closest;
61  int colgen_strat[2];
62 #ifdef MULTI_CRITERIA
63  double binary_search_tolerance;
64  double compare_solution_tolerance;
65 #endif
66  int test;
67  char test_dir[MAX_FILE_NAME_LENGTH +1]; /* Test files directory */
69 
70 /*---------------------------------------------------------------------------*\
71  * The problem data structure contains the data for a problem instance, as
72  * well as some of the tours that have been generated.
73 \*---------------------------------------------------------------------------*/
74 
75 typedef struct CNRP_PROBLEM{
76  char name[100]; /* the name of the problem instance */
81  int dg_id; /* drawgraph process id */
82  int vertnum; /* the number of nodes in the problem, including
83  the depot */
84  int edgenum; /* number of edges in the problem */
85  int *edges;
86  int numroutes; /* contains the number of routes that the problem
87  is to be solved with. can be prespecified. */
88  int depot; /* the index of the depot, usually 1 */
89  double capacity; /* the capacity of a truck */
90  double *demand; /* an array containing the demands for each node.
91  node i's demand is p->demand[i-1] */
92  int *posx; /* x coordinate for display purposes */
93  int *posy; /* y coordinate for display purposes */
94 
95  distances dist; /* the data about the distances in the problem */
96 
97  best_tours *cur_tour; /* temporary tour storage */
99  double fixed_cost;
101  double utopia_fixed;
103  double ub;
104  small_graph *g; /* contains the edge data for the reduced graph*/
105 #if defined(CHECK_CUT_VALIDITY) || defined(TRACE_PATH)
106  int feas_sol_size;
107  int *feas_sol;
108 #endif
110  int *basevars;
112  int *extravars;
114  int *zero_vars;
116 }cnrp_problem;
117 
118 #endif
int colgen_strat[2]
Definition: cnrp_types.h:61
int add_depot_edges
Definition: cnrp_types.h:57
cnrp_lp_params lp_par
Definition: cnrp_types.h:79
int * zero_vars
Definition: cnrp_types.h:114
int allocated_edgenum
Definition: cnrp_types.h:39
double utopia_fixed
Definition: cnrp_types.h:101
int node
Definition: cnrp_types.h:45
small_graph * g
Definition: cnrp_types.h:104
int base_variable_selection
Definition: cnrp_types.h:58
double fixed_cost
Definition: cnrp_types.h:99
int * posy
Definition: cnrp_types.h:93
double variable_cost
Definition: cnrp_types.h:100
char name[100]
Definition: cnrp_types.h:76
int max_closest
Definition: cnrp_types.h:55
int use_small_graph
Definition: cnrp_types.h:59
int k_closest
Definition: cnrp_types.h:53
double utopia_variable
Definition: cnrp_types.h:102
double capacity
Definition: cnrp_types.h:89
double * demand
Definition: cnrp_types.h:90
#define MAX_FILE_NAME_LENGTH
Definition: sym_proto.h:18
int * edges
Definition: cnrp_types.h:85
cnrp_params par
Definition: cnrp_types.h:77
edge_data * edges
Definition: cnrp_types.h:41
int * cur_sol_tree
Definition: cnrp_types.h:98
char prob_type
Definition: cnrp_types.h:52
struct CNRP_PROBLEM cnrp_problem
struct CNRP_PARAMS cnrp_params
struct CLOSENODE closenode
int verbosity
Definition: cnrp_types.h:51
int add_all_edges
Definition: cnrp_types.h:56
int del_edgenum
Definition: cnrp_types.h:40
int * extravars
Definition: cnrp_types.h:112
cnrp_cp_params cp_par
Definition: cnrp_types.h:80
distances dist
Definition: cnrp_types.h:95
struct SMALL_GRAPH small_graph
char test_dir[MAX_FILE_NAME_LENGTH+1]
Definition: cnrp_types.h:67
best_tours * cur_tour
Definition: cnrp_types.h:97
cnrp_cg_params cg_par
Definition: cnrp_types.h:78
char infile[MAX_FILE_NAME_LENGTH+1]
Definition: cnrp_types.h:50
int min_closest
Definition: cnrp_types.h:54
int cost
Definition: cnrp_types.h:46
char small_graph_file[MAX_FILE_NAME_LENGTH]
Definition: cnrp_types.h:60
int * basevars
Definition: cnrp_types.h:110
int * posx
Definition: cnrp_types.h:92