|
Chapter Contents |
Previous |
Next |
| The TRANS Procedure |
The transportation problem described in the "Getting Started" section is solved next. The cost data are stored in the following SAS data set. The solution is stored in a SAS data set as shown in Output 6.1.1 and displayed with PROC PRINT.
title 'Uncapacitated Transportation Network';
data cst;
input Atlanta Chicago Denver Houston Los_Ange Miami
New_York San_Fran Seattle Washingt supply city$;
datalines;
50 75 89 8 27 39 64 100 50 8 . .
20 58 121 70 193 60 74 213 218 54 10 Atlanta
58 20 92 94 174 118 71 185 173 57 150 Chicago
121 92 20 87 83 172 163 94 102 149 90 Denver
70 94 87 20 137 96 142 154 189 122 27 Houston
193 174 83 137 20 223 245 34 95 230 80 Los_Ange
60 118 172 96 233 20 109 259 273 92 26 Miami
74 71 163 142 245 109 20 257 240 20 80 New_York
213 185 94 164 34 259 257 20 67 244 25 San_Fran
218 173 102 189 95 273 240 67 20 232 7 Seattle
54 59 149 122 230 92 20 244 232 20 15 Washingt
;
proc trans cost=cst;
TAILNODE city;
HEADNODE Atlanta--Washingt;
SUPPLY supply;
run;
proc print;
run;
After this program executes, the following message is written to the SAS log:
NOTE: Optimal Solution total = 22928.Output 6.1.1: Uncapacitated Transportation Network Solution
The other observations in the OUT= data set contain the optimal flows. For example, the third observation contains information associated with the Chicago source node. The values of the HEADNODE variables in this observation give the optimal flow between Chicago and each destination node. To achieve the minimum cost, the Chicago supply must be sent to four destinations: 30 units to Atlanta, 75 units to Chicago, 2 units to Denver, and 43 units to Seattle. The SUPPLY variable has the supply capability of this source node (150 units).
The _DUAL_ variable value (-13) for Chicago is the amount the total solution cost would increase (because of the negative sign; in this case, the total cost would decrease by $13) if Chicago supplies an extra unit of flow. (If you were to increase the supply of Chicago to 151 and rerun PROC TRANS, specifying the NOTHRUNET option, the total cost would change from 22928 to 22915.)
The macro variable _ORTRANS, defined by PROC TRANS, contains information regarding the termination of the procedure. This information can be useful when PROC TRANS is part of a larger SAS program. This information can be written to the log using the macro language with the statement
%put &_ORTRANS;The following message is written to the SAS log:
STATUS=SUCCESSFUL OBJECTIVE=22928
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.