/home/coin/SVN-release/CoinAll-1.1.0/SYMPHONY/Applications/CNRP/include/cnrp_lp.h

Go to the documentation of this file.
00001 /*===========================================================================*/
00002 /*                                                                           */
00003 /* This file is part of a demonstration application for use with the         */
00004 /* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */
00005 /* Capacitated Network Routing Problems.                                     */
00006 /*                                                                           */
00007 /* (c) Copyright 2000-2008 Ted Ralphs. All Rights Reserved.                  */
00008 /*                                                                           */
00009 /* This application was developed by Ted Ralphs (tkralphs@lehigh.edu)        */
00010 /*                                                                           */
00011 /* This software is licensed under the Common Public License. Please see     */
00012 /* accompanying file for terms.                                              */
00013 /*                                                                           */
00014 /*===========================================================================*/
00015 
00016 #ifndef _CNRP_LP_H
00017 #define _CNRP_LP_H
00018 
00019 #define COMPILING_FOR_LP
00020 
00021 /* SYMPHONY include files */
00022 #include "sym_types.h"
00023 
00024 /* CNRP include files */
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 | This is the data structure used to store the edges in the 1-edges graph     |
00048 | used the logical fixing routine                                             |
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 | Another data structure used to store the 1-edges graph                      |
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 | This is where the 1-edges graph is actually stored                          |
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 | Here we store the specific data needed to process each node of the tree     |
00081 \*---------------------------------------------------------------------------*/
00082 
00083 typedef struct CNRP_SPEC{
00084    cnrp_lp_params par;
00085    int            window;    /*contains the tid of the graphics window*/
00086    int            vertnum;   /*the number of nodes in the problem,
00087                                including the depot                */
00088    double        *demand;    /*a list of the customer demands*/
00089    double         capacity;  /*the capacity of the trucks*/
00090    int            numroutes; /*contains the number of routes that the problem
00091                                is to be solved with. can be prespecified.  */
00092    double         utopia_fixed;
00093    double         utopia_variable;
00094    int           *edges;     /*contains a list of the edges in the current
00095                                subproblem*/
00096    int           *costs;     /*contains the objective function values*/
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 | Routines entirely specific to main_lp                                       |
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

Generated on Sun Nov 14 14:06:41 2010 for Coin-All by  doxygen 1.4.7