Dip  0.92.4
cnrp_cg.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 _CUT_GEN_USER_H
17 #define _CUT_GEN_USER_H
18 
19 /* system include files */
20 #include <stdio.h>
21 
22 /* SYMPHONY include files */
23 #include "sym_types.h"
24 #include "sym_proto.h"
25 
26 /* CNRP include files */
27 #include "network.h"
28 #include "cnrp_cg_params.h"
29 
30 typedef struct CG_CNRP_SPEC{
32  int dg_id; /* contains the tid of the graphics window*/
33  int vertnum; /* the number of nodes in the problem,
34  including the depot */
35  double *demand; /* a list of the customer demands*/
36  double capacity; /* the capacity of the trucks*/
37  int numroutes;/* contains the number of routes that the problem
38  is to be solved with. can be prespecified. */
39  int *edges; /* contains a list of the edges in the current
40  subproblem*/
43  int *cost;
44  int *ref; /* the last five are for the shrinking routines; */
45  char *in_set; /* they are here to optimize/speed up things */
46  double *new_demand;
47  double *cut_val;
48  char *cut_list;
49 
50 /*__BEGIN_EXPERIMENTAL_SECTION__*/
51  int *dec_data;
53  double last_objval;
54  FILE *decomp_res;
55  /* the next four arrays pertain to storing no-columns cuts - kind of an
56  auxiliary cutpool*/
57  int **data;
58  char **indicators;
59  int *ones;
60  int *size;
62 /*___END_EXPERIMENTAL_SECTION___*/
63 
64 #ifdef CHECK_CUT_VALIDITY
65  int feas_sol_size;
66  int *feas_sol;
67 #endif
69 
70 /*===========================================================================*/
71 /*========================= Other user subroutines =========================*/
72 /*===========================================================================*/
73 
74 int check_connectivity PROTO((network *n, double etol, double capacity,
75  int numroutes, char mult, int *num_cuts,
76  int *alloc_cuts, cut_data ***cuts));
77 
78 int check_flow_connectivity PROTO((network *n, double etol, double capacity,
79  int numroutes, char mult, int *num_cuts,
80  int *alloc_cuts, cut_data ***cuts));
81 
82 /*===========================================================================*/
83 /*=============================== shrink.c ==================================*/
84 /*===========================================================================*/
85 
86 int reduce_graph PROTO((network *n, double etol, double *demand,
87  double capacity, int mult, cut_data *new_cut,
88  int *num_cuts, int *alloc_cuts, cut_data ***cuts));
89 int greedy_shrinking1 PROTO((network *n, double truck_cap, double etol,
90  int max_num_cuts, cut_data *new_cut,
91  int *compnodes, int *compmembers, int compnum,
92  char *in_set, double *cut_val,int *ref,
93  char *cut_list, double *demand, int mult,
94  int *num_cuts, int *alloc_cuts,
95  cut_data ***cuts));
96 int greedy_shrinking1_dicut PROTO((network *n, double truck_cap, double etol,
97  int max_num_cuts, cut_data *new_cut,
98  int *compnodes, int *compmembers, int compnum,
99  char *in_set, double *cut_val,int *ref,
100  char *cut_list, double *demand, int mult,
101  int *num_cuts, int *alloc_cuts,
102  cut_data ***cuts));
103 int greedy_shrinking6 PROTO((network *n, double truck_cap,
104  double etol, cut_data *new_cut,
105  int *compnodes,
106  int *compmembers, int compnum, char *in_set,
107  double *cut_val,int *ref, char *cut_list,
108  int max_num_cuts, double *demand, int trial_num,
109  double prob, int mult, int *num_cuts,
110  int *alloc_cuts, cut_data ***cuts));
111 int greedy_shrinking6_dicut PROTO((network *n, double truck_cap,
112  double etol, cut_data *new_cut,
113  int *compnodes,
114  int *compmembers, int compnum, char *in_set,
115  double *cut_val,int *ref, char *cut_list,
116  int max_num_cuts, double *demand, int trial_num,
117  double prob, int mult, int *num_cuts,
118  int *alloc_cuts, cut_data ***cuts));
119 int greedy_shrinking1_one PROTO((network *n, double truck_cap,
120  double etol, int max_num_cuts,
121  cut_data *new_cut, char *in_set,
122  double *cut_val, char *cut_list,
123  int num_routes, double *demand,
124  int mult, int *num_cuts,
125  int *alloc_cuts, cut_data ***cuts));
126 int greedy_shrinking6_one PROTO((network *n, double truck_cap,
127  double etol, cut_data *new_cut,
128  char *in_set, double *cut_val, int num_routes,
129  char *cut_list, int max_num_cuts,
130  double *demand,int trial_num, double prob,
131  int mult, int *num_cuts,
132  int *alloc_cuts, cut_data ***cuts));
133 int greedy_shrinking2_one PROTO((network *n, double truck_cap,
134  double etol, cut_data *new_cut,
135  char *in_set, double *cut_val, int num_routes,
136  double *demand, int mult, int *num_cuts,
137  int *alloc_cuts, cut_data ***cuts));
138 
139 /*===========================================================================*/
140 /*============================ biconnected.c ================================*/
141 /*===========================================================================*/
142 
143 void depth_first_search PROTO((vertex *v, int *count1, int *count2));
144 int biconnected PROTO((network *n, int *compnodes, double *compdemands,
145  double *compcuts));
146 void compute_comp_nums PROTO((vertex *v, int parent_comp, int *num_comps,
147  char parent_is_art_point));
148 int tsp_cuts PROTO((network *n, int verbosity, char tsp_prob, int which_cuts,
149  cut_data ***cuts, int *num_cuts, int *alloc_cuts));
150 
151 #endif
int vertnum
Definition: cnrp_cg.h:33
struct CG_CNRP_SPEC cg_cnrp_spec
#define PROTO(x)
Definition: sym_proto.h:27
int * size
Definition: cnrp_cg.h:60
int * edges
Definition: cnrp_cg.h:39
double * new_demand
Definition: cnrp_cg.h:46
double * cut_val
Definition: cnrp_cg.h:47
int dg_id
Definition: cnrp_cg.h:32
Definition: network.h:62
int last_decomp_index
Definition: cnrp_cg.h:52
FILE * decomp_res
Definition: cnrp_cg.h:54
double capacity
Definition: cnrp_cg.h:36
int * ref
Definition: cnrp_cg.h:44
int orig_edgenum
Definition: cnrp_cg.h:42
network * n
Definition: cnrp_cg.h:41
double last_objval
Definition: cnrp_cg.h:53
int * cost
Definition: cnrp_cg.h:43
int ** data
Definition: cnrp_cg.h:57
unsigned int verbosity
Verbosity level of unit tests.
int numroutes
Definition: cnrp_cg.h:37
double * demand
Definition: cnrp_cg.h:35
int num_nocolscuts
Definition: cnrp_cg.h:61
int * ones
Definition: cnrp_cg.h:59
char * cut_list
Definition: cnrp_cg.h:48
cnrp_cg_params par
Definition: cnrp_cg.h:31
char ** indicators
Definition: cnrp_cg.h:58
char * in_set
Definition: cnrp_cg.h:45
int * dec_data
Definition: cnrp_cg.h:51