| 1 |
############################################################################## |
| 2 |
############################################################################## |
| 3 |
# # |
| 4 |
# This file is part of a demonstration application for use with the # |
| 5 |
# SYMPHONY MILP Solver Framework. This application is a solver for # |
| 6 |
# Capacitated Network Routing Problems. # |
| 7 |
# # |
| 8 |
# (c) Copyright 2000-2005 Ted Ralphs. All Rights Reserved. # |
| 9 |
# # |
| 10 |
# This application was developed by Ted Ralphs ([email protected]) # |
| 11 |
# # |
| 12 |
# This software is licensed under the Eclipse Public License. Please see # |
| 13 |
# accompanying file for terms. # |
| 14 |
# # |
| 15 |
############################################################################## |
| 16 |
############################################################################## |
| 17 |
|
| 18 |
############################################################################## |
| 19 |
# First, we have to define some variables that will be used |
| 20 |
############################################################################## |
| 21 |
|
| 22 |
############################################################################## |
| 23 |
# SYMPHONY's home directory |
| 24 |
############################################################################## |
| 25 |
|
| 26 |
SYMPHONYROOT = ../.. |
| 27 |
|
| 28 |
############################################################################## |
| 29 |
# The home directory of the user files (must be an absolute path) |
| 30 |
############################################################################## |
| 31 |
|
| 32 |
USERROOT = . |
| 33 |
|
| 34 |
############################################################################## |
| 35 |
# The customized name of the master program (if desired) |
| 36 |
############################################################################## |
| 37 |
|
| 38 |
MASTERNAME = cnrp |
| 39 |
|
| 40 |
############################################################################## |
| 41 |
# These are only needed if parallel computation is used. Please see the |
| 42 |
# explanation of these variables in SYMPHONY's configuration file. |
| 43 |
############################################################################## |
| 44 |
|
| 45 |
COMPILE_IN_TM = TRUE |
| 46 |
COMPILE_IN_LP = TRUE |
| 47 |
COMPILE_IN_CG = TRUE |
| 48 |
COMPILE_IN_CP = TRUE |
| 49 |
|
| 50 |
############################################################################## |
| 51 |
# Other variables to be set by the user |
| 52 |
############################################################################## |
| 53 |
|
| 54 |
############################################################################## |
| 55 |
#Whether to solve problem as a multi-criteria (fixed vs. variable cost) |
| 56 |
#or single-criteria problem |
| 57 |
############################################################################## |
| 58 |
|
| 59 |
MULTI_CRITERIA = FALSE |
| 60 |
|
| 61 |
############################################################################## |
| 62 |
#Whether to use the model with two oppositely oriented copies of each |
| 63 |
#fixed-chrage variable (one for each direction) or just a single undirected |
| 64 |
#copy. |
| 65 |
############################################################################## |
| 66 |
|
| 67 |
DIRECTED_X_VARS = TRUE |
| 68 |
|
| 69 |
############################################################################## |
| 70 |
#Whether to add the flow variables (these are needed to model the variable costs) |
| 71 |
############################################################################## |
| 72 |
|
| 73 |
ADD_FLOW_VARS = TRUE |
| 74 |
|
| 75 |
############################################################################## |
| 76 |
#Whether to add capacity cuts to the model |
| 77 |
############################################################################## |
| 78 |
|
| 79 |
ADD_CAP_CUTS = FALSE |
| 80 |
|
| 81 |
############################################################################## |
| 82 |
#Whether to add "X" cuts to the model |
| 83 |
############################################################################## |
| 84 |
|
| 85 |
ADD_X_CUTS = FALSE |
| 86 |
|
| 87 |
############################################################################## |
| 88 |
#Whether to save the global cut pool between iterations when using warm |
| 89 |
#starting |
| 90 |
############################################################################## |
| 91 |
|
| 92 |
SAVE_CUT_POOL = TRUE |
| 93 |
|
| 94 |
ifeq ($(MULTI_CRITERIA),TRUE) |
| 95 |
USER_BB_DEFINES += -DMULTI_CRITERIA |
| 96 |
endif |
| 97 |
|
| 98 |
ifeq ($(ADD_FLOW_VARS),TRUE) |
| 99 |
USER_BB_DEFINES += -DADD_FLOW_VARS |
| 100 |
ifeq ($(ADD_CAP_CUTS),TRUE) |
| 101 |
USER_BB_DEFINES += -DADD_CAP_CUTS |
| 102 |
endif |
| 103 |
endif |
| 104 |
|
| 105 |
ifeq ($(DIRECTED_X_VARS),TRUE) |
| 106 |
USER_BB_DEFINES += -DDIRECTED_X_VARS |
| 107 |
ifeq ($(ADD_X_CUTS),TRUE) |
| 108 |
USER_BB_DEFINES += -DADD_X_CUTS |
| 109 |
endif |
| 110 |
endif |
| 111 |
|
| 112 |
ifeq ($(SAVE_CUT_POOL),TRUE) |
| 113 |
USER_BB_DEFINES += -DSAVE_CUT_POOL |
| 114 |
endif |
| 115 |
|
| 116 |
############################################################################## |
| 117 |
# This section is for listing CNRP source file names |
| 118 |
############################################################################## |
| 119 |
|
| 120 |
MACROS_SRC = cnrp_macros.c |
| 121 |
COST_SRC = compute_cost.c |
| 122 |
NET_SRC = network.c |
| 123 |
DG_FUNC_SRC = cnrp_dg_functions.c |
| 124 |
|
| 125 |
USER_MASTER_SRC = cnrp_main.c cnrp_master.c cnrp_io.c |
| 126 |
USER_MASTER_SRC += cnrp_master_functions.c small_graph.c |
| 127 |
|
| 128 |
USER_MASTER_SRC += $(COST_SRC) |
| 129 |
ifeq ($(COMPILE_IN_TM),TRUE) |
| 130 |
USER_MASTER_SRC += $(USER_TM_SRC) |
| 131 |
ifeq ($(COMPILE_IN_LP),FALSE) |
| 132 |
USER_MASTER_SRC += $(MACROS_SRC) $(DG_FUNC_SRC) |
| 133 |
endif |
| 134 |
else |
| 135 |
USER_MASTER_SRC += $(MACROS_SRC) $(DG_FUNC_SRC) |
| 136 |
endif |
| 137 |
|
| 138 |
ifeq ($(COMPILE_IN_LP),TRUE) |
| 139 |
USER_TM_SRC = $(USER_LP_SRC) |
| 140 |
endif |
| 141 |
ifeq ($(COMPILE_IN_CP),TRUE) |
| 142 |
USER_TM_SRC += cnrp_cp.c |
| 143 |
endif |
| 144 |
|
| 145 |
USER_LP_SRC = cnrp_lp_branch.c cnrp_lp.c |
| 146 |
USER_LP_SRC += $(MACROS_SRC) $(NET_SRC) $(DG_FUNC_SRC) |
| 147 |
ifeq ($(COMPILE_IN_CG),TRUE) |
| 148 |
USER_LP_SRC += cnrp_cg.c biconnected.c shrink.c |
| 149 |
endif |
| 150 |
|
| 151 |
USER_CG_SRC = cnrp_cg.c biconnected.c |
| 152 |
USER_CG_SRC += compute_cost.c shrink.c $(DG_FUNC_SRC) |
| 153 |
USER_CG_SRC += $(MACROS_SRC) $(NET_SRC) |
| 154 |
|
| 155 |
USER_CP_SRC = cnrp_cp.c $(MACROS_SRC) |
| 156 |
|
| 157 |
USER_DG_SRC = cnrp_dg.c cnrp_dg_network.c $(MACROS_SRC) |
| 158 |
|
| 159 |
USER_SRCDIR = |
| 160 |
USER_INCDIR = |
| 161 |
|
| 162 |
############################################################################## |
| 163 |
# This section is for CONCORDE |
| 164 |
############################################################################## |
| 165 |
|
| 166 |
############################################################################## |
| 167 |
# This solver can use separation routines from CONCORDE, the |
| 168 |
# TSP solver of Applegate, Bixby, Chvatal, and Cook. To enable this option: |
| 169 |
# 1. set the variables DO_CONCORDE_CUTS to TRUE. |
| 170 |
# 2. Download the source code for CONCORDE and the qsopt LP solver from |
| 171 |
# http://www.tsp.gatech.edu. |
| 172 |
# 3. Put qsopt.a and qsopt.h in ~/lib (make the directory if it doesn't exist). |
| 173 |
# 4. Put a copy of qsopt.h in ~/include (make this directory if it doesn't |
| 174 |
# exist). |
| 175 |
#.5. Rename qsopt.a libqsopt.a (so it is detected as a library). |
| 176 |
# 6. Build concorde with qsopt as the LP solver (configure --with-qsopt=~/lib). |
| 177 |
# 7. Move the resulting library concorde.a to ~/lib and rename it |
| 178 |
# libconcorde.a (or create a soft link). |
| 179 |
# 8. Put a copy of concorde.h in ~/include (or create a soft link). |
| 180 |
# 9. Make the CNRP application as usual. |
| 181 |
############################################################################## |
| 182 |
|
| 183 |
DO_CONCORDE_CUTS = FALSE |
| 184 |
|
| 185 |
ifeq ($(DO_CONCORDE_CUTS),TRUE) |
| 186 |
USER_BB_DEFINES += -DDO_TSP_CUTS |
| 187 |
USERLIBS = -lconcorde -lqsopt |
| 188 |
USERLIBPATHS = ${HOME}/lib |
| 189 |
USER_INCDIR += -I${HOME}/include |
| 190 |
|
| 191 |
ifeq ($(COMPILE_IN_CG),TRUE) |
| 192 |
USER_LP_SRC += tsp.c # $(TSP_SRC) |
| 193 |
endif |
| 194 |
|
| 195 |
USER_CG_SRC += tsp.c # $(TSP_SRC) |
| 196 |
|
| 197 |
endif |
| 198 |
|
| 199 |
############################################################################## |
| 200 |
# This is the flag for the SYMPHONY Makefile to determine whether |
| 201 |
# SYMPHONY is being compiled by itself or as part of a user-defined |
| 202 |
# application. You shouldn't need to modify this variable. |
| 203 |
############################################################################## |
| 204 |
|
| 205 |
USE_SYM_APPL = TRUE |
| 206 |
|
| 207 |
############################################################################## |
| 208 |
# If you want to build SYMPHONY in a directory outside the source tree, |
| 209 |
# uncomment this and fill in the directory here. Setting these variables will |
| 210 |
# cause object, library, and binary files associated with SYMPHONY and the |
| 211 |
# user's application to be built and installed in the corresponding |
| 212 |
# directories. This is helpful if the user doesn't have write access to the |
| 213 |
# directory where SYMPHONY is installed. |
| 214 |
############################################################################## |
| 215 |
|
| 216 |
SYMBUILDDIR = $(SYMPHONYROOT) |
| 217 |
USERBUILDDIR = $(USERROOT) |
| 218 |
|
| 219 |
############################################################################## |
| 220 |
# Include the SYMPHONY makefile after all the source file names (and before |
| 221 |
# any used-defined targets!) |
| 222 |
############################################################################## |
| 223 |
|
| 224 |
include $(SYMPHONYROOT)/Makefile |
| 225 |
|