Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The TRANS Procedure

Example 6.1: Uncapacitated Transportation Network

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

Obs city supply Atlanta Chicago Denver Houston Los_Ange Miami New_York San_Fran Seattle Washingt _DUAL_
1 _DEMAND_ . 50 75 89 8 27 39 64 100 50 8 .
2 Atlanta 10 10 0 0 0 0 0 0 0 0 0 -51
3 Chicago 150 30 75 2 0 0 0 0 0 43 0 -13
4 Denver 90 0 0 87 0 0 0 0 3 0 0 -85
5 Houston 27 0 0 0 8 19 0 0 0 0 0 -28
6 Los_Ange 80 0 0 0 0 8 0 0 72 0 0 -145
7 Miami 26 0 0 0 0 0 26 0 0 0 0 -89
8 New_York 80 0 0 0 0 0 8 64 0 0 8 0
9 San_Fran 25 0 0 0 0 0 0 0 25 0 0 -159
10 Seattle 7 0 0 0 0 0 0 0 0 7 0 -166
11 Washingt 15 10 0 0 0 0 5 0 0 0 0 -17
12 _DUAL_ . 71 33 105 48 165 109 20 179 186 20 .


Because the first observation is associated with the demands, the TAILNODE value is _DEMAND_. If you had specified DEMAND=d, the dth observation would have contained demand information. The last observation has a TAILNODE value of _DUAL_, and the values of the HEADNODE variables are the dual variables at the destination nodes, or the marginal costs of increasing demand at a destination node.

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
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.