Dip  0.92.4
cnrp_lp.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_LP_H
17 #define _CNRP_LP_H
18 
19 #define COMPILING_FOR_LP
20 
21 /* SYMPHONY include files */
22 #include "sym_types.h"
23 
24 /* CNRP include files */
25 #include "cnrp_lp_params.h"
26 #include "cnrp_common_types.h"
27 #include "network.h"
28 
29 #define BEST_K 0
30 #define VARS_CLOSEST_TO_HALF 1
31 #define DEPOTS_CLOSEST_TO_HALF 2
32 #define DEPOTS_CLOSEST_TO_HALF_BRANCH_RIGHT 3
33 #define VARS_CLOSEST_TO_HALF_PREFER_DEPOT 4
34 #define DEPOTS_AT_HALF_BRANCH_RIGHT 5
35 #define DEPOTS_AT_HALF 6
36 #define VARS_AT_HALF_PREFER_DEPOT_BRANCH_RIGHT 7
37 #define VARS_AT_HALF_PREFER_DEPOT 8
38 #define VARS_CLOSEST_TO_HALF_PREFER_DEPOT_BRANCH_RIGHT 9
39 #define VARS_AT_HALF 10
40 
41 typedef struct POS_WEIGHT_LHS{
42  int position;
43  double lhs;
44 }p_w_l;
45 
46 /*---------------------------------------------------------------------------*\
47 | This is the data structure used to store the edges in the 1-edges graph |
48 | used the logical fixing routine |
49 \*---------------------------------------------------------------------------*/
50 
51 typedef struct LP_NET_EDGE{
52  struct LP_NET_EDGE *next;
53  int other_end;
55 
56 /*---------------------------------------------------------------------------*\
57 | Another data structure used to store the 1-edges graph |
58 \*---------------------------------------------------------------------------*/
59 
60 typedef struct LP_NET_NODE{
62  int degree;
63  int comp;
64  double demand;
65  char scanned;
67 
68 /*---------------------------------------------------------------------------*\
69 | This is where the 1-edges graph is actually stored |
70 \*---------------------------------------------------------------------------*/
71 
72 typedef struct LP_NET{
75  int vertnum;
76  int edgenum;
77 }lp_net;
78 
79 /*---------------------------------------------------------------------------*\
80 | Here we store the specific data needed to process each node of the tree |
81 \*---------------------------------------------------------------------------*/
82 
83 typedef struct CNRP_SPEC{
85  int window; /*contains the tid of the graphics window*/
86  int vertnum; /*the number of nodes in the problem,
87  including the depot */
88  double *demand; /*a list of the customer demands*/
89  double capacity; /*the capacity of the trucks*/
90  int numroutes; /*contains the number of routes that the problem
91  is to be solved with. can be prespecified. */
92  double utopia_fixed;
94  int *edges; /*contains a list of the edges in the current
95  subproblem*/
96  int *costs; /*contains the objective function values*/
99  double variable_cost;
100  double fixed_cost;
101  double ub;
102 }cnrp_spec;
103 
104 /*---------------------------------------------------------------------------*\
105 | Routines entirely specific to main_lp |
106 \*---------------------------------------------------------------------------*/
107 
108 lp_net *create_lp_net PROTO((cnrp_spec *cnrp, char *status, int edgenum,
109  var_desc **vars));
110 int cnrp_lp_connected PROTO((lp_net *n, double *compdemands));
111 void free_lp_net PROTO((lp_net *n));
112 char construct_feasible_solution PROTO((cnrp_spec *cnrp, network *n,
113  double *objval, double etol,
114  char branch));
115 double compute_lhs PROTO((int number, int *indices, double *values,
116  cut_data *cut, int vertnum));
117 
118 #endif
double variable_cost
Definition: cnrp_lp.h:99
struct POS_WEIGHT_LHS p_w_l
double lhs
Definition: cnrp_lp.h:43
#define PROTO(x)
Definition: sym_proto.h:27
Definition: cnrp_lp.h:72
int comp
Definition: cnrp_lp.h:63
struct LP_NET_NODE lp_net_node
struct LP_NET_EDGE * next
Definition: cnrp_lp.h:52
struct LP_NET lp_net
int other_end
Definition: cnrp_lp.h:53
int window
Definition: cnrp_lp.h:85
int vertnum
Definition: cnrp_lp.h:86
cnrp_lp_params par
Definition: cnrp_lp.h:84
int degree
Definition: cnrp_lp.h:62
char scanned
Definition: cnrp_lp.h:65
int position
Definition: cnrp_lp.h:42
struct LP_NET_EDGE lp_net_edge
int * costs
Definition: cnrp_lp.h:96
int * edges
Definition: cnrp_lp.h:94
double demand
Definition: cnrp_lp.h:64
double utopia_fixed
Definition: cnrp_lp.h:92
lp_net_edge * adjlist
Definition: cnrp_lp.h:74
int vertnum
Definition: cnrp_lp.h:75
double * demand
Definition: cnrp_lp.h:88
lp_net_edge * first
Definition: cnrp_lp.h:61
int numroutes
Definition: cnrp_lp.h:90
double ub
Definition: cnrp_lp.h:101
_node * cur_sol
Definition: cnrp_lp.h:97
double capacity
Definition: cnrp_lp.h:89
double fixed_cost
Definition: cnrp_lp.h:100
lp_net_node * verts
Definition: cnrp_lp.h:73
double utopia_variable
Definition: cnrp_lp.h:93
struct CNRP_SPEC cnrp_spec
int edgenum
Definition: cnrp_lp.h:76
int * cur_sol_tree
Definition: cnrp_lp.h:98