00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _CNRP_LP_H
00017 #define _CNRP_LP_H
00018
00019 #define COMPILING_FOR_LP
00020
00021
00022 #include "sym_types.h"
00023
00024
00025 #include "cnrp_lp_params.h"
00026 #include "cnrp_common_types.h"
00027 #include "network.h"
00028
00029 #define BEST_K 0
00030 #define VARS_CLOSEST_TO_HALF 1
00031 #define DEPOTS_CLOSEST_TO_HALF 2
00032 #define DEPOTS_CLOSEST_TO_HALF_BRANCH_RIGHT 3
00033 #define VARS_CLOSEST_TO_HALF_PREFER_DEPOT 4
00034 #define DEPOTS_AT_HALF_BRANCH_RIGHT 5
00035 #define DEPOTS_AT_HALF 6
00036 #define VARS_AT_HALF_PREFER_DEPOT_BRANCH_RIGHT 7
00037 #define VARS_AT_HALF_PREFER_DEPOT 8
00038 #define VARS_CLOSEST_TO_HALF_PREFER_DEPOT_BRANCH_RIGHT 9
00039 #define VARS_AT_HALF 10
00040
00041 typedef struct POS_WEIGHT_LHS{
00042 int position;
00043 double lhs;
00044 }p_w_l;
00045
00046
00047
00048
00049
00050
00051 typedef struct LP_NET_EDGE{
00052 struct LP_NET_EDGE *next;
00053 int other_end;
00054 }lp_net_edge;
00055
00056
00057
00058
00059
00060 typedef struct LP_NET_NODE{
00061 lp_net_edge *first;
00062 int degree;
00063 int comp;
00064 double demand;
00065 char scanned;
00066 }lp_net_node;
00067
00068
00069
00070
00071
00072 typedef struct LP_NET{
00073 lp_net_node *verts;
00074 lp_net_edge *adjlist;
00075 int vertnum;
00076 int edgenum;
00077 }lp_net;
00078
00079
00080
00081
00082
00083 typedef struct CNRP_SPEC{
00084 cnrp_lp_params par;
00085 int window;
00086 int vertnum;
00087
00088 double *demand;
00089 double capacity;
00090 int numroutes;
00091
00092 double utopia_fixed;
00093 double utopia_variable;
00094 int *edges;
00095
00096 int *costs;
00097 _node *cur_sol;
00098 int *cur_sol_tree;
00099 double variable_cost;
00100 double fixed_cost;
00101 double ub;
00102 }cnrp_spec;
00103
00104
00105
00106
00107
00108 lp_net *create_lp_net PROTO((cnrp_spec *cnrp, char *status, int edgenum,
00109 var_desc **vars));
00110 int cnrp_lp_connected PROTO((lp_net *n, double *compdemands));
00111 void free_lp_net PROTO((lp_net *n));
00112 char construct_feasible_solution PROTO((cnrp_spec *cnrp, network *n,
00113 double *objval, double etol,
00114 char branch));
00115 double compute_lhs PROTO((int number, int *indices, double *values,
00116 cut_data *cut, int vertnum));
00117
00118 #endif