NOTE: Log file opened at Wed, 2 Nov 2016 22:52:32.047 1 The SAS System 22:52 Wednesday, November 2, 2016 NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead. NOTE: All profile changes will be lost at the end of the session. NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M3) Licensed to FEDEX CORPORATE SERVICES INC CIA SERVER 1, Site 70024850. NOTE: This session is executing on the SunOS 5.10 (SUN 64) platform. NOTE: Updated analytical products: SAS/STAT 14.1 SAS/ETS 14.1 SAS/OR 14.1 SAS/IML 14.1 SAS/QC 14.1 NOTE: Additional host information: SUN SunOS SUN 64 5.10 Generic_150400-20 sun4v You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.14 seconds cpu time 0.10 seconds 1 2 ods html path="/mktg/cppma/data08/test/output/scenario3" file="results.html"; NOTE: Writing HTML Body file: results.html 3 proc options group=memory; run; SAS (r) Proprietary Software Release 9.4 TS1M3 Group=MEMORY SORTSIZE=1073741824 Specifies the amount of memory that is available to the SORT procedure. SUMSIZE=0 Specifies a limit on the amount of memory that is available for data summarization procedures when class variables are active. MAXMEMQUERY=268435456 For certain procedures, specifies the maximum amount of memory that can be allocated per request. 2 The SAS System 22:52 Wednesday, November 2, 2016 LOADMEMSIZE=0 Specifies a suggested amount of memory that is needed for executable programs loaded by SAS. MEMSIZE=17179869184 Specifies the limit on the amount of virtual memory that can be used during a SAS session. REALMEMSIZE=0 Specifies the amount of real memory SAS can expect to allocate. NOTE: PROCEDURE OPTIONS used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 4 option FULLSTIMER NOSYNTAXCHECK; 5 libname test '/mktg/cppma/data08/test/output/scenario3'; NOTE: Libref TEST was successfully assigned as follows: Engine: V9 Physical Name: /mktg/cppma/data08/test/output/scenario3 6 7 *Optimization model parameters; 8 %let distance_var = dist_wgtd; 9 %let location_distance_penalty = 20000; 10 %let max_orders_per_location = 10000; *No limit; 11 %let final_max_locations_on = 500; *Very high limit; 12 %let inf_dist = 1e7; *Constant larger than any valid weighted distance; 13 14 *Solver configuration; 15 %let presolver_options = FORCEPRESOLVE=1 PRESOLVER=3; 16 %let milp_config = 17 RELOBJGAP = 0.05 18 INTTOL = 1e-5 19 EMPHASIS = OPTIMAL /*BALANCE OPTIMAL FEASIBLE*/ 20 /*NODESEL = AUTOMATIC*/ /*AUTOMATIC BESTBOUND BESTESTIMATE DEPTH*/ 21 /*PROBE = AUTOMATIC*/ /*AUTOMATIC NONE MODERATE AGGRESSIVE*/ 22 /*ALLCUTS = AGGRESSIVE*/ /*AUTOMATIC NONE MODERATE AGGRESSIVE*/ 23 /*TIMETYPE = REAL */ 24 /*MAXTIME = 28800*/ 25 /*MAXSOLS = 6*/ 26 ; 27 28 29 *Define different testing scenarios for the model; 30 %let demand_formula1 = 10; *Constant demand over the entire map; 31 %let demand_formula2 = int(latitude/5 + longitude/18) 32 + 1*(mod(location_id,11)=0) 33 + 2*(mod(location_id,37)=0) 34 + 3*(mod(location_id,71)=0) 35 + 9*(mod(location_id,271)=0) 36 ; *Variable demand (increasing in NE direction and leaving some low-density spaces); 37 %let demand_formula3 = int(20000 / sqrt(400 + 38 min(geodist(latitude, longitude, 33, -110)*0.5, 39 geodist(latitude, longitude, 36, -90)*0.3, 40 geodist(latitude, longitude, 39, -100), 41 geodist(latitude, longitude, 42, -105), 42 geodist(latitude, longitude, 45, -95) 43 ))); *Demand centered on five points in the map; 44 %let demand_formula4 = 10*( not((-115 < longitude < -95) and (latitude < 40)) + 45 (latitude=30 and longitude=-105) + 46 (latitude=36 and longitude=-96) + 47 (latitude=36 and longitude=-97) + 48 (latitude=37 and longitude=-96) + 49 (latitude=37 and longitude=-100) + 3 The SAS System 22:52 Wednesday, November 2, 2016 50 (latitude=37 and longitude=-105) + 51 (latitude=38 and longitude=-98) + 52 (latitude=39 and longitude=-112) + 53 (latitude=39.5 and longitude=-101) + 54 (latitude=39.5 and longitude=-99) 55 ); *Mostly constant demand with an empty area; 56 57 58 59 ***********************************************************************************; 60 * GENERATE TEST DATA 61 * - A dataset of lat/long points (potential locations) 62 * - A dataset of orders (to be served from the aforementioned locations) 63 ***********************************************************************************; 64 65 *Generate a large grid of points in the map; 66 data test.points; 67 do latitude = 30 to 60.5 by 0.5; 68 do longitude = -120 to -75.5 by 0.5; 69 location_id + 1; 70 output; 71 end; 72 end; 73 run; NOTE: The data set TEST.POINTS has 5580 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.04 seconds user cpu time 0.02 seconds system cpu time 0.02 seconds memory 1066.96k OS Memory 12968.00k Timestamp 11/02/2016 10:52:32 PM Step Count 2 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 16 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 7 74 75 *Simulate demand on the map; 76 data test.orders; 77 set test.points; 78 order_qty = (&demand_formula3.); 79 rename location_id = order_id; 80 81 *Create some empty spots; 82 if (mod(location_id,17)>1 or order_qty>800); 83 if (mod(location_id,11)>3 or order_qty>700); 84 if (mod(location_id,7)>4 or order_qty>600); 85 86 *Save; 87 if order_qty > 0 then output; 88 run; 4 The SAS System 22:52 Wednesday, November 2, 2016 NOTE: There were 5580 observations read from the data set TEST.POINTS. NOTE: The data set TEST.ORDERS has 3615 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.08 seconds user cpu time 0.08 seconds system cpu time 0.00 seconds memory 939.06k OS Memory 13480.00k Timestamp 11/02/2016 10:52:32 PM Step Count 3 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 5 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 7 89 90 proc means data=test.orders n nmiss min p1 p5 p10 q1 median mean q3 p90 p95 p99 max std; 91 var order_qty; 92 run; NOTE: There were 3615 observations read from the data set TEST.ORDERS. NOTE: The PROCEDURE MEANS printed page 1. NOTE: PROCEDURE MEANS used (Total process time): real time 0.09 seconds user cpu time 0.06 seconds system cpu time 0.03 seconds memory 9852.92k OS Memory 22016.00k Timestamp 11/02/2016 10:52:32 PM Step Count 4 Switch Count 0 Page Faults 4 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 53 Involuntary Context Switches 4 Block Input Operations 0 Block Output Operations 5 93 94 ***********************************************************************************; 95 * CALCULATE DISTANCES BETWEEN ORDERS AND LOCATION POINTS 96 * 97 * Calculate two distances: 98 * - dist = geodesic distance in Km (e.g. distance as the crow flies) 99 * - dist_wgtd = weigted distance = geodesic distance x number of orders 100 (e.g. total Km needed to satisfy all orders); 101 * 102 * Limit valid pairs to 250 miles; 103 * In practice, geodesic distances would be replaced with driving distances or times; 104 * 105 ***********************************************************************************; 106 5 The SAS System 22:52 Wednesday, November 2, 2016 107 proc sql; 108 create table test.distances as 109 select 110 a.order_id, 111 a.latitude as order_latitude, 112 a.longitude as order_longitude, 113 b.location_id, 114 b.latitude as location_latitude, 115 b.longitude as location_longitude, 116 geodist(a.latitude, a.longitude, b.latitude, b.longitude) as dist, 117 (calculated dist)*(a.order_qty) as dist_wgtd 118 from test.orders a, test.points b 119 where (calculated dist) < 250*1.6 120 order by a.ORDER_ID, b.LOCATION_ID; NOTE: The execution of this query involves performing one or more Cartesian product joins that can not be optimized. NOTE: Table TEST.DISTANCES created, with 759868 rows and 8 columns. 121 quit; NOTE: PROCEDURE SQL used (Total process time): real time 58.62 seconds user cpu time 58.67 seconds system cpu time 0.34 seconds memory 75047.15k OS Memory 90824.00k Timestamp 11/02/2016 10:53:31 PM Step Count 5 Switch Count 0 Page Faults 1 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 3089 Involuntary Context Switches 704 Block Input Operations 0 Block Output Operations 40 122 123 124 ***********************************************************************************; 125 * GENERATE AN INITIAL SOLUTION FOR THE OPTIMIZAITON MODEL 126 * - Group orders by proximity 127 * - Map each order to the location closest to the center of its group 128 ***********************************************************************************; 129 130 *Group orders by proximity using a clustering algorithm; 131 *Note: euclidian distances are not great with coordinates, but this is just a seed solution; 132 proc fastclus 133 data = test.orders 134 out = _tmp_initial_seeds (rename=(CLUSTER=seed_nbr)) 135 maxclusters = %sysfunc(int(&final_max_locations_on./2)) 136 noprint; 137 var latitude longitude; 138 run; NOTE: The data set WORK._TMP_INITIAL_SEEDS has 3615 observations and 6 variables. NOTE: PROCEDURE FASTCLUS used (Total process time): real time 0.06 seconds user cpu time 0.06 seconds system cpu time 0.01 seconds 6 The SAS System 22:52 Wednesday, November 2, 2016 memory 601.43k OS Memory 18600.00k Timestamp 11/02/2016 10:53:31 PM Step Count 6 Switch Count 0 Page Faults 1 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 4 Involuntary Context Switches 5 Block Input Operations 0 Block Output Operations 8 139 140 *Calculate the order centroid of each cluster; 141 proc sql; 142 create table _tmp_initial_seed_centroids as 143 select seed_nbr, 144 sum(order_qty * latitude) / sum(order_qty) as SEED_latitude, 145 sum(order_qty * longitude) / sum(order_qty) as SEED_longitude 146 from _tmp_initial_seeds 147 group by 1; NOTE: Table WORK._TMP_INITIAL_SEED_CENTROIDS created, with 250 rows and 3 columns. 148 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.03 seconds user cpu time 0.02 seconds system cpu time 0.01 seconds memory 6125.82k OS Memory 23728.00k Timestamp 11/02/2016 10:53:31 PM Step Count 7 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 34 Involuntary Context Switches 4 Block Input Operations 0 Block Output Operations 10 149 150 *Pick the closest real location to each order centroid; 151 proc sql; 152 create table _tmp_initial_real_centroids as 153 select a.seed_nbr, 154 m.LOCATION_ID, 155 geodist(a.SEED_latitude, a.SEED_longitude, m.location_latitude, m.location_longitude) as corr_dist 156 from 157 _tmp_initial_seed_centroids a 158 inner join _tmp_initial_seeds p on (a.seed_nbr = p.seed_nbr) 159 inner join test.distances m on (p.ORDER_ID = m.ORDER_ID) 160 ; NOTE: Table WORK._TMP_INITIAL_REAL_CENTROIDS created, with 759868 rows and 3 columns. 161 quit; NOTE: PROCEDURE SQL used (Total process time): 7 The SAS System 22:52 Wednesday, November 2, 2016 real time 2.43 seconds user cpu time 2.24 seconds system cpu time 0.18 seconds memory 6910.98k OS Memory 23984.00k Timestamp 11/02/2016 10:53:33 PM Step Count 8 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 31 Involuntary Context Switches 200 Block Input Operations 0 Block Output Operations 33 162 163 proc sort data=_tmp_initial_real_centroids; by seed_nbr corr_dist; run; NOTE: There were 759868 observations read from the data set WORK._TMP_INITIAL_REAL_CENTROIDS. NOTE: The data set WORK._TMP_INITIAL_REAL_CENTROIDS has 759868 observations and 3 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.38 seconds user cpu time 1.11 seconds system cpu time 0.23 seconds memory 57819.73k OS Memory 75408.00k Timestamp 11/02/2016 10:53:34 PM Step Count 9 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 4751 Involuntary Context Switches 37 Block Input Operations 0 Block Output Operations 26 164 165 data _tmp_initial_real_centroids; 166 set _tmp_initial_real_centroids; 167 by seed_nbr; 168 if first.seed_nbr; 169 run; NOTE: There were 759868 observations read from the data set WORK._TMP_INITIAL_REAL_CENTROIDS. NOTE: The data set WORK._TMP_INITIAL_REAL_CENTROIDS has 250 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.23 seconds user cpu time 0.19 seconds system cpu time 0.03 seconds memory 919.84k OS Memory 19112.00k Timestamp 11/02/2016 10:53:34 PM Step Count 10 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 8 The SAS System 22:52 Wednesday, November 2, 2016 Voluntary Context Switches 7 Involuntary Context Switches 5 Block Input Operations 0 Block Output Operations 6 170 171 *Initial solution: list unique LOCATIONs that should be turned on (as seeds); 172 proc sql; 173 create table initial_locations as 174 select distinct LOCATION_ID 175 from _tmp_initial_real_centroids 176 order by LOCATION_ID; NOTE: Table WORK.INITIAL_LOCATIONS created, with 250 rows and 1 columns. 177 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.01 seconds user cpu time 0.00 seconds system cpu time 0.01 seconds memory 5318.87k OS Memory 24240.00k Timestamp 11/02/2016 10:53:34 PM Step Count 11 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 6 178 179 *Initial solution: List pair-mappings that should be turned on (between orders and their initial seeds); 180 proc sql; 181 create table initial_mappings as 182 select a.ORDER_ID, b.LOCATION_ID 183 from _tmp_initial_seeds a 184 inner join _tmp_initial_real_centroids b 185 on (a.seed_nbr = b.seed_nbr) 186 order by a.ORDER_ID, b.LOCATION_ID; NOTE: Table WORK.INITIAL_MAPPINGS created, with 3615 rows and 2 columns. 187 run; NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect. 188 NOTE: PROCEDURE SQL used (Total process time): real time 0.04 seconds user cpu time 0.02 seconds system cpu time 0.03 seconds memory 5497.87k OS Memory 24240.00k Timestamp 11/02/2016 10:53:34 PM Step Count 12 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 9 The SAS System 22:52 Wednesday, November 2, 2016 Voluntary Context Switches 23 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 12 189 proc delete data=_tmp_initial_real_centroids; run; NOTE: Deleting WORK._TMP_INITIAL_REAL_CENTROIDS (memtype=DATA). NOTE: PROCEDURE DELETE used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 20.46k OS Memory 19112.00k Timestamp 11/02/2016 10:53:34 PM Step Count 13 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 4 190 proc delete data=_tmp_initial_seeds; run; NOTE: Deleting WORK._TMP_INITIAL_SEEDS (memtype=DATA). NOTE: PROCEDURE DELETE used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 20.46k OS Memory 19112.00k Timestamp 11/02/2016 10:53:34 PM Step Count 14 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 191 proc delete data=_tmp_initial_seed_centroids; run; NOTE: Deleting WORK._TMP_INITIAL_SEED_CENTROIDS (memtype=DATA). NOTE: PROCEDURE DELETE used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 20.46k OS Memory 19112.00k Timestamp 11/02/2016 10:53:34 PM Step Count 15 Switch Count 0 Page Faults 0 10 The SAS System 22:52 Wednesday, November 2, 2016 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1 192 193 194 *Copy the initial solution into the input datasets; 195 data test.points; 196 merge test.points initial_locations (in=in1); 197 by location_id; 198 if (in1) then on=1; else on=0; 199 run; NOTE: There were 5580 observations read from the data set TEST.POINTS. NOTE: There were 250 observations read from the data set WORK.INITIAL_LOCATIONS. NOTE: The data set TEST.POINTS has 5580 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds user cpu time 0.02 seconds system cpu time 0.01 seconds memory 1125.62k OS Memory 19368.00k Timestamp 11/02/2016 10:53:34 PM Step Count 16 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 7 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 7 200 201 data test.distances; 202 merge test.distances initial_mappings (in=in1); 203 by order_id location_id; 204 if (in1) then map=1; else map=0; 205 run; NOTE: There were 759868 observations read from the data set TEST.DISTANCES. NOTE: There were 3615 observations read from the data set WORK.INITIAL_MAPPINGS. NOTE: The data set TEST.DISTANCES has 759868 observations and 9 variables. NOTE: DATA statement used (Total process time): real time 0.80 seconds user cpu time 0.54 seconds system cpu time 0.26 seconds memory 1180.25k OS Memory 19368.00k Timestamp 11/02/2016 10:53:35 PM Step Count 17 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 11 The SAS System 22:52 Wednesday, November 2, 2016 Voluntary Context Switches 15 Involuntary Context Switches 64 Block Input Operations 0 Block Output Operations 38 206 207 proc delete data=initial_locations; run; NOTE: Deleting WORK.INITIAL_LOCATIONS (memtype=DATA). NOTE: PROCEDURE DELETE used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 20.46k OS Memory 19112.00k Timestamp 11/02/2016 10:53:35 PM Step Count 18 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 2 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 5 208 proc delete data=initial_mappings; run; NOTE: Deleting WORK.INITIAL_MAPPINGS (memtype=DATA). NOTE: PROCEDURE DELETE used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 20.46k OS Memory 19112.00k Timestamp 11/02/2016 10:53:35 PM Step Count 19 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 4 209 210 211 ***********************************************************************************; 212 * CHECK FINAL INPUT DATASETS 213 ***********************************************************************************; 214 215 *Check counts in the three input datasets; 216 proc sql; 217 select 218 count(distinct order_id) as order_locaitons, 219 count(*) as records, 12 The SAS System 22:52 Wednesday, November 2, 2016 220 sum(order_qty) as order_qty 221 from test.orders; 222 quit; NOTE: The PROCEDURE SQL printed page 2. NOTE: PROCEDURE SQL used (Total process time): real time 0.02 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds memory 5338.28k OS Memory 24240.00k Timestamp 11/02/2016 10:53:35 PM Step Count 20 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 4 Involuntary Context Switches 4 Block Input Operations 0 Block Output Operations 11 223 224 proc sql; 225 select 226 count(distinct location_id) as point_locaitons, 227 sum(on) as locations_on, 228 count(*) as records 229 from test.points; 230 quit; NOTE: The PROCEDURE SQL printed page 3. NOTE: PROCEDURE SQL used (Total process time): real time 0.02 seconds user cpu time 0.02 seconds system cpu time 0.01 seconds memory 5328.37k OS Memory 24240.00k Timestamp 11/02/2016 10:53:35 PM Step Count 21 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 1 Involuntary Context Switches 1 Block Input Operations 0 Block Output Operations 8 231 232 proc sql; 233 select 234 count(distinct location_id) as point_locaitons format comma24.0, 235 count(distinct order_id) as order_locaitons format comma24.0, 236 sum(map) as mapped_locaitons format comma24.0, 237 sum(dist) as dist format comma24.0, 238 sum(dist_wgtd) as dist_wgtd format comma24.0, 239 count(*) as records format comma24.0 240 from test.distances; 241 quit; 13 The SAS System 22:52 Wednesday, November 2, 2016 NOTE: The PROCEDURE SQL printed page 4. NOTE: PROCEDURE SQL used (Total process time): real time 0.65 seconds user cpu time 0.54 seconds system cpu time 0.10 seconds memory 5358.03k OS Memory 24240.00k Timestamp 11/02/2016 10:53:36 PM Step Count 22 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 4 Involuntary Context Switches 10 Block Input Operations 0 Block Output Operations 16 242 243 *Check maps; 244 ods graphics on / width=12 in; 245 proc sgplot data=test.orders; 246 bubble x=longitude y=latitude size=order_qty / colorresponse=order_qty bradiusmin=2 bradiusmax=6; 247 run; NOTE: PROCEDURE SGPLOT used (Total process time): real time 10.11 seconds user cpu time 0.54 seconds system cpu time 0.11 seconds memory 13529.70k OS Memory 29712.00k Timestamp 11/02/2016 10:53:46 PM Step Count 23 Switch Count 0 Page Faults 29 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 462 Involuntary Context Switches 29 Block Input Operations 1 Block Output Operations 73 NOTE: Listing image output written to /mktg/cppma/data08/custom_critical_waypoint1/scripts/SGPlot.png. NOTE: There were 3615 observations read from the data set TEST.ORDERS. 248 ods graphics off; 249 250 251 ods graphics on / width=12 in; 252 proc sgplot data=test.points; 253 scatter x=longitude y=latitude / group=on; 254 run; NOTE: PROCEDURE SGPLOT used (Total process time): real time 1.65 seconds user cpu time 0.31 seconds system cpu time 0.05 seconds memory 3853.15k OS Memory 29712.00k 14 The SAS System 22:52 Wednesday, November 2, 2016 Timestamp 11/02/2016 10:53:47 PM Step Count 24 Switch Count 0 Page Faults 0 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 225 Involuntary Context Switches 5 Block Input Operations 1 Block Output Operations 65 NOTE: Marker and line antialiasing has been disabled for at least one plot because the threshold has been reached. You can set ANTIALIASMAX=5600 in the ODS GRAPHICS statement to enable antialiasing for all plots. NOTE: Listing image output written to /mktg/cppma/data08/custom_critical_waypoint1/scripts/SGPlot2.png. NOTE: Marker and line antialiasing has been disabled for at least one plot because the threshold has been reached. You can set ANTIALIASMAX=5600 in the ODS GRAPHICS statement to enable antialiasing for all plots. NOTE: There were 5580 observations read from the data set TEST.POINTS. 255 ods graphics off; 256 257 258 ***********************************************************************************; 259 * RUN OPTIMIZATION MODEL 260 ***********************************************************************************; 261 262 proc optmodel &presolver_options.; 263 264 *Define data elements; 265 put 'optmodel: Define data elements'; optmodel: Define data elements 266 set ORDERS; 267 set LOCATIONS; 268 num distance {ORDERS, LOCATIONS} init &inf_dist.; 269 270 *Define variable 1; 271 var on {LOCATIONS} binary init 0; 272 273 *Read datasets 1; 274 put 'optmodel: Read datasets 1'; optmodel: Read datasets 1 275 read data test.orders into ORDERS=[ORDER_ID]; NOTE: There were 3615 observations read from the data set TEST.ORDERS. 276 read data test.points into LOCATIONS=[LOCATION_ID] on=on; NOTE: There were 5580 observations read from the data set TEST.POINTS. 277 read data test.distances into [ORDER_ID LOCATION_ID] distance=&distance_var.; NOTE: There were 759868 observations read from the data set TEST.DISTANCES. 278 279 *Define variable 2; 280 set VALID_MAPS = {p in ORDERS, w in LOCATIONS: distance[p,w] <= (&inf_dist.-10)}; 281 var map {VALID_MAPS} binary init 0; 282 283 *Read datasets 2; 284 put 'optmodel: Read datasets 2'; optmodel: Read datasets 2 285 read data test.distances into [ORDER_ID LOCATION_ID] map=map; NOTE: There were 759868 observations read from the data set TEST.DISTANCES. 286 287 *Calculations; 288 put 'optmodel: Calculations'; 15 The SAS System 22:52 Wednesday, November 2, 2016 optmodel: Calculations 289 impvar total_LOCATIONs_on = sum{w in LOCATIONS} on[w]; 290 impvar total_maps_on = sum{ in VALID_MAPS} map[p,w]; 291 impvar total_distance = sum{ in VALID_MAPS} map[p,w]*distance[p,w]; 292 impvar total_penalty = total_LOCATIONs_on * &LOCATION_distance_penalty.; 293 294 *Mechanical constraints; 295 put 'optmodel: Mechanical constraints'; optmodel: Mechanical constraints 296 con ORDERs_mapped_correctly {p in ORDERS}: (sum{<(p),w> in VALID_MAPS} map[p,w]) = 1; 297 con LOCATIONs_mapped_correctly {w in LOCATIONS}: (sum{ in VALID_MAPS} map[p,w]) <= on[w] * 297 ! &max_ORDERs_per_LOCATION.; 298 299 *Business constraints; 300 put 'optmodel: Business constraints'; optmodel: Business constraints 301 con max_LOCATIONs_on: total_LOCATIONs_on <= &final_max_LOCATIONs_on.; 302 303 *Minimize distance; 304 put 'optmodel: Set Goals'; optmodel: Set Goals 305 min goal = total_distance + total_penalty; 306 save mps test.model_result_mps; NOTE: Problem generation will use 4 threads. NOTE: The problem has 765448 variables (0 free, 0 fixed). NOTE: The problem uses 3 implicit variables. NOTE: The problem has 765448 binary and 0 integer variables. NOTE: The problem has 9196 linear constraints (5581 LE, 3615 EQ, 0 GE, 0 range). NOTE: The problem has 1530896 linear constraint coefficients. NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range). NOTE: The data set TEST.MODEL_RESULT_MPS has 2305550 observations and 6 variables. 307 308 *Initial solution check (seed); 309 print "VALUES BEFORE SOLVING" total_LOCATIONs_on total_maps_on goal total_distance total_penalty; 310 311 *Solve problem; 312 put 'optmodel: Solve problem'; optmodel: Solve problem 313 /*solve with MILP / &milp_config.;*/ 314 save mps MPSDATA; NOTE: The data set WORK.MPSDATA has 2305550 observations and 6 variables. 315 submit; 316 proc optmilp 317 data=MPSDATA 318 primalout=PRIMALOUT 319 &milp_config.; 320 run; 321 endsubmit; 1 The SAS System 22:55 Wednesday, November 2, 2016 NOTE: The problem MPSDATA has 765448 variables (765448 binary, 0 integer, 0 free, 0 fixed). NOTE: The problem has 9196 constraints (5581 LE, 3615 EQ, 0 GE, 0 range). NOTE: The problem has 1530896 constraint coefficients. NOTE: The MILP presolver value AUTOMATIC is applied. NOTE: The MILP presolver removed 0 variables and 0 constraints. NOTE: The MILP presolver removed 0 constraint coefficients. NOTE: The MILP presolver modified 5580 constraint coefficients. NOTE: The presolved problem has 765448 variables, 9196 constraints, and 1530896 constraint coefficients. NOTE: The MILP solver is called. NOTE: The parallel Branch and Cut algorithm is used. NOTE: The Branch and Cut algorithm is using up to 4 threads. Node Active Sols BestInteger BestBound Gap Time 0 1 0 . 528901 . 24 0 1 0 . 7953514 . 166 0 1 0 . 13104952 . 364 0 1 0 . 19749170 . 512 0 1 0 . 25222138 . 682 0 1 0 . 32660214 . 855 0 1 0 . 35131300 . 907 0 1 0 . 35967361 . 989 0 1 0 . 36174765 . 996 0 1 0 . 36255566 . 1003 0 1 0 . 36343125 . 1010 0 1 0 . 36480956 . 1015 0 1 0 . 36608823 . 1021 0 1 0 . 36674932 . 1027 0 1 0 . 36714684 . 1033 0 1 0 . 36750618 . 1038 0 1 0 . 36925408 . 1044 0 1 0 . 36954886 . 1049 0 1 0 . 37051187 . 1054 0 1 0 . 37119820 . 1059 0 1 0 . 37223950 . 1064 0 1 0 . 37314347 . 1070 0 1 0 . 37459024 . 1075 0 1 0 . 37506260 . 1080 0 1 0 . 37607871 . 1086 0 1 0 . 37633233 . 1090 0 1 0 . 37967947 . 1096 0 1 0 . 38039993 . 1101 0 1 0 . 38101844 . 1106 0 1 0 . 38328215 . 1112 0 1 0 . 38416153 . 1117 0 1 0 . 38775983 . 1123 0 1 0 . 38851674 . 1128 0 1 0 . 38878283 . 1134 0 1 0 . 39132269 . 1139 0 1 0 . 39250796 . 1144 0 1 0 . 39367648 . 1150 0 1 0 . 39446727 . 1155 0 1 0 . 39573655 . 1161 0 1 0 . 39918366 . 1166 0 1 0 . 39941354 . 1172 NOTE: The MILP solver added 5317 cuts with 19466 cut coefficients at the root. 100 86 0 . 42928271 . 1957 200 186 0 . 42928271 . 1970 300 282 0 . 47283437 . 2196 2 The SAS System 22:55 Wednesday, November 2, 2016 400 382 0 . 47283437 . 2206 500 482 0 . 47283437 . 2218 600 582 0 . 47283437 . 2229 700 682 0 . 47283437 . 2240 800 28 0 . 78282834 . 3125 900 125 0 . 79004074 . 3198 1000 225 0 . 79004074 . 3207 1100 325 0 . 79004074 . 3217 1200 425 0 . 79004074 . 3229 1300 525 0 . 79004074 . 3239 1400 625 0 . 79004074 . 3251 1500 725 0 . 79004074 . 3264 1600 825 0 . 79004074 . 3278 1700 923 0 . 79026054 . 3343 1800 1023 0 . 79026054 . 3353 1900 1123 0 . 79026054 . 3364 2000 1223 0 . 79026054 . 3376 2100 1323 0 . 79026054 . 3387 2200 1423 0 . 79026054 . 3398 2300 1523 0 . 79026054 . 3408 2400 1623 0 . 79026054 . 3420 2500 1723 0 . 79026054 . 3432 2600 1823 0 . 79026054 . 3444 2700 1923 0 . 79026054 . 3460 2800 2023 0 . 79026054 . 3480 2900 2123 0 . 79026054 . 3503 3000 2223 0 . 79026054 . 3525 3100 2323 0 . 79026054 . 3558 3200 2423 0 . 79026054 . 3602 3300 2523 0 . 79026054 . 3661 3400 2623 0 . 79026054 . 3722 3500 2723 0 . 79026054 . 3737 3600 2823 0 . 79026054 . 3761 3700 2923 0 . 79026054 . 3801 3800 3023 0 . 79026054 . 3860 3900 3123 0 . 79026054 . 3932 4000 3223 0 . 79026054 . 3970 4100 3323 0 . 79026054 . 4007 4200 3423 0 . 79026054 . 4068 4300 3523 0 . 79026054 . 4106 4400 3623 0 . 79026054 . 4117 4500 3723 0 . 79026054 . 4129 4600 3823 0 . 79026054 . 4140 4700 3923 0 . 79026054 . 4149 4800 4023 0 . 79026054 . 4159 4900 4123 0 . 79026054 . 4168 5000 4223 0 . 79026054 . 4178 5100 4323 0 . 79026054 . 4190 5200 4423 0 . 79026054 . 4202 5300 4523 0 . 79026054 . 4212 5400 4623 0 . 79026054 . 4223 5500 4723 0 . 79026054 . 4234 5600 4823 0 . 79026054 . 4244 5700 4923 0 . 79026054 . 4254 5800 5023 0 . 79026054 . 4264 5900 5123 0 . 79026054 . 4274 6000 5223 0 . 79026054 . 4283 6100 5323 0 . 79026054 . 4292 3 The SAS System 22:55 Wednesday, November 2, 2016 6200 5423 0 . 79026054 . 4302 6300 5523 0 . 79026054 . 4313 6400 5623 0 . 79026054 . 4322 6500 5723 0 . 79026054 . 4331 6600 5823 0 . 79026054 . 4341 6700 5923 0 . 79026054 . 4351 6800 6023 0 . 79026054 . 4363 6900 6123 0 . 79026054 . 4373 7000 6223 0 . 79026054 . 4384 7100 6323 0 . 79026054 . 4396 7200 6423 0 . 79026054 . 4405 7300 6523 0 . 79026054 . 4414 7400 6623 0 . 79026054 . 4424 7500 6723 0 . 79026054 . 4434 7600 6823 0 . 79026054 . 4444 7700 6923 0 . 79026054 . 4453 7800 7023 0 . 79026054 . 4463 7900 7123 0 . 79026054 . 4473 8000 7223 0 . 79026054 . 4485 8100 7323 0 . 79026054 . 4495 8200 7423 0 . 79026054 . 4506 8300 7523 0 . 79026054 . 4508 8400 7623 0 . 79026054 . 4508 8500 7723 0 . 79026054 . 4508 8600 7823 0 . 79026054 . 4508 8700 7923 0 . 79026054 . 4508 8800 8023 0 . 79026054 . 4508 8900 8123 0 . 79026054 . 4512 9000 8223 0 . 79026054 . 4525 9100 8323 0 . 79026054 . 4537 9200 8423 0 . 79026054 . 4549 9300 8523 0 . 79026054 . 4562 9400 8623 0 . 79026054 . 4574 9500 8723 0 . 79026054 . 4585 9600 8823 0 . 79026054 . 4596 9700 8923 0 . 79026054 . 4608 9800 9023 0 . 79026054 . 4611 9900 9123 0 . 79026054 . 4628 10000 9221 0 . 79051862 . 4698 10100 9321 0 . 79051862 . 4709 10200 9421 0 . 79051862 . 4723 10300 9521 0 . 79051862 . 4737 10400 9621 0 . 79051862 . 4749 10500 9721 0 . 79051862 . 4763 10600 9821 0 . 79051862 . 4775 10700 9921 0 . 79051862 . 4790 10800 10021 0 . 79051862 . 4806 10900 10121 0 . 79051862 . 4828 11000 10221 0 . 79051862 . 4847 11100 10321 0 . 79051862 . 4865 11200 10421 0 . 79051862 . 4885 11300 10521 0 . 79051862 . 4916 11400 10621 0 . 79051862 . 4938 11500 10721 0 . 79051862 . 4978 11600 10821 0 . 79051862 . 5005 11700 10921 0 . 79051862 . 5024 11800 11021 0 . 79051862 . 5043 11900 11121 0 . 79051862 . 5055 4 The SAS System 22:55 Wednesday, November 2, 2016 12000 11221 0 . 79051862 . 5068 12100 11321 0 . 79051862 . 5084 12200 11421 0 . 79051862 . 5100 12300 11521 0 . 79051862 . 5118 12400 11621 0 . 79051862 . 5133 12500 11721 0 . 79051862 . 5150 12600 11821 0 . 79051862 . 5163 12700 11921 0 . 79051862 . 5177 12800 12021 0 . 79051862 . 5188 12900 12121 0 . 79051862 . 5203 13000 12221 0 . 79051862 . 5221 13100 12321 0 . 79051862 . 5251 13200 12421 0 . 79051862 . 5280 13300 12521 0 . 79051862 . 5314 13400 12621 0 . 79051862 . 5349 13500 12721 0 . 79051862 . 5446 13600 12821 0 . 79051862 . 5476 13700 12921 0 . 79051862 . 5476 13800 13021 0 . 79051862 . 5476 13900 13121 0 . 79051862 . 5476 14000 13221 0 . 79051862 . 5476 14100 13321 0 . 79051862 . 5476 14200 13421 0 . 79051862 . 5476 14300 13521 0 . 79051862 . 5476 14400 13621 0 . 79051862 . 5476 14500 13721 0 . 79051862 . 5476 14600 13821 0 . 79051862 . 5493 14700 13921 0 . 79051862 . 5511 14800 14021 0 . 79051862 . 5529 14900 14121 0 . 79051862 . 5546 15000 14221 0 . 79051862 . 5563 15036 14257 0 . 79051862 . 5571 ERROR: Out of memory. NOTE: No integer solutions found. NOTE: The data set WORK.PRIMALOUT has 765448 observations and 8 variables. 322 read data PRIMALOUT into [_N_] _VAR_[_N_]=_VALUE_; NOTE: There were 765448 observations read from the data set WORK.PRIMALOUT. 323 324 *Print results; 325 print "VALUES AFTER SOLVING" total_LOCATIONs_on total_maps_on goal total_distance total_penalty; 326 327 *Save results; 328 put 'optmodel: Save results'; optmodel: Save results 329 create data test.model_result_legs (where=(map>0.01)) from [ORDER_ID LOCATION_ID] = {ORDERS, LOCATIONS} map ; 16 The SAS System 22:52 Wednesday, November 2, 2016 NOTE: The data set TEST.MODEL_RESULT_LEGS has 0 observations and 3 variables. 330 create data test.model_result_LOCATIONs (where=(on>0.01)) from [LOCATION_ID] = {LOCATIONS} on; NOTE: The data set TEST.MODEL_RESULT_LOCATIONS has 0 observations and 2 variables. 331 create data test.model_result_ORDERs from [ORDER_ID] = {ORDERS}; NOTE: The data set TEST.MODEL_RESULT_ORDERS has 3615 observations and 1 variables. 332 run; NOTE: The RUN statement is ignored by OPTMODEL. 333 334 335 ODS HTML CLOSE; NOTE: The SAS System stopped processing this step because of errors. NOTE: The PROCEDURE OPTMODEL printed pages 5-9. NOTE: PROCEDURE OPTMODEL used (Total process time): real time 1:35:11.94 user cpu time 4:38:02.16 system cpu time 1:18.96 memory 16747221.93k OS Memory 16773280.00k Timestamp 11/03/2016 12:28:59 AM Step Count 25 Switch Count 3 Page Faults 23 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 548356 Involuntary Context Switches 283053 Block Input Operations 0 Block Output Operations 589 NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1:36:27.99 user cpu time 4:39:06.93 system cpu time 1:20.54 memory 16770542.98k OS Memory 16773280.00k Timestamp 11/03/2016 12:28:59 AM Step Count 25 Switch Count 634 Page Faults 105 Page Reclaims 0 Page Swaps 0 Voluntary Context Switches 557454 Involuntary Context Switches 284142 Block Input Operations 2 Block Output Operations 1035