Chapter Contents |
Previous |
Next |
The NETFLOW Procedure |
title 'Oil Industry Example'; title3 'Crude Oil can come from anywhere'; data miss_s; missing S; input _node_&$15. _sd_; datalines; middle east S u.s.a. S servstn1 gas -95 servstn1 diesel -30 servstn2 gas -40 servstn2 diesel -15 ;
The following PROC NETFLOW run uses the same ARCDATA= and CONDATA= data sets used in the "Introductory Example" section.
proc netflow nodedata=miss_s /* the supply (missing S) and */ /* demand data */ arcdata=arcd1 /* the arc descriptions */ condata=cond1 /* the side constraints */ conout=solution; /* the solution data set */ run; print some_arcs('middle east' 'u.s.a.',_all_)/short; proc print;sum _fcost_;run;
The following messages appear on the SAS log:
NOTE: Number of nodes= 14 . NOTE: Number of supply nodes= 2 . NOTE: Number of demand nodes= 4 . NOTE: Total supply= 0 , total demand= 180 . NOTE: Number of arcs= 18 . NOTE: Number of iterations performed (neglecting any constraints)= 9 . NOTE: Of these, 0 were degenerate. NOTE: Optimum (neglecting any constraints) found. NOTE: Minimal total cost= 50040 . NOTE: Number of <= side constraints= 0 . NOTE: Number of == side constraints= 2 . NOTE: Number of >= side constraints= 2 . NOTE: Number of arc and nonarc variable side constraint coefficients= 8 . NOTE: Number of iterations, optimizing with constraints= 3 . NOTE: Of these, 0 were degenerate. NOTE: Optimum reached. NOTE: Minimal total cost= 50075 .
The PRINT statement reports the arcs directed away from the supply nodes, shown in Figure 4.14. The amount of crude obtained from the Middle East and U.S.A. is 145 and 35 units.
The CONOUT= data set is shown in Figure 4.15.
|
The optimal supplies of nodes "middle east" and "u.s.a." are 145 and 35 units, respectively. For this example, the same optimal solution is obtained if these nodes had supplies less than these values (each supplies 1 unit, for example) and the THRUNET option was specified in the PROC NETFLOW statement. With the THRUNET option active, when total supply exceeds total demand, the specified nonmissing demand values are the lowest number of flow units that must be absorbed by the corresponding node. This is demonstrated in the following PROC NETFLOW run. The missing S is most useful when nodes are to supply optimal numbers of flow units and it turns out that for some nodes, the optimal supply is zero.
data miss_s_x; missing S; input _node_&$15. _sd_; datalines; middle east 1 u.s.a. 1 servstn1 gas -95 servstn1 diesel -30 servstn2 gas -40 servstn2 diesel -15 ; proc netflow thrunet nodedata=miss_s_x /* No supply (missing S) */ arcdata=arcd1 /* the arc descriptions */ condata=cond1 /* the side constraints */ conout=solution; /* the solution data set */ run; print some_arcs('middle east' 'u.s.a.',_all_)/short; proc print;sum _fcost_;run;
The following messages appear on the SAS log. Note that the Total supply= 2, not zero as in the last run.
NOTE: Number of nodes= 14 . NOTE: Number of supply nodes= 2 . NOTE: Number of demand nodes= 4 . NOTE: Total supply= 2 , total demand= 180 . NOTE: Number of arcs= 18 . NOTE: Number of iterations performed (neglecting any constraints)= 13 . NOTE: Of these, 0 were degenerate. NOTE: Optimum (neglecting any constraints) found. NOTE: Minimal total cost= 50040 . NOTE: Number of <= side constraints= 0 . NOTE: Number of == side constraints= 2 . NOTE: Number of >= side constraints= 2 . NOTE: Number of arc and nonarc variable side constraint coefficients= 8 . NOTE: Number of iterations, optimizing with constraints= 3 . NOTE: Of these, 0 were degenerate. NOTE: Optimum reached. NOTE: Minimal total cost= 50075 .
The PRINT statement and the CONDATA= data set are very similar; the supplies of the supply nodes are 1, not missing S. Otherwise, the solutions are identical.
If total supply exceeds total demand, any missing S values are ignored. If total demand exceeds total supply, any missing D values are ignored.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.