The NETFLOW Procedure |
In some models, you may want a node to be either a supply or demand node but you want the node to supply or demand the optimal number of flow units. To indicate that a node is such a supply node, use a missing S value in the SUPPLY list variable in the ARCDATA= data set or the SUPDEM list variable in the NODEDATA= data set. To indicate that a node is such a demand node, use a missing D value in the DEMAND list variable in the ARCDATA= data set or the SUPDEM list variable in the NODEDATA= data set.
Suppose the oil example in the section "Introductory Example" is changed so that crude oil can be obtained from either the Middle East or U.S.A. in any amounts. You should specify that the node "middle east" is a supply node, but you do not want to stipulate that it supplies 100 units, as before. The node "u.s.a." should also remain a supply node, but you do not want to stipulate that it supplies 80 units. You must specify that these nodes have missing S supply capabilities.
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 section "Introductory Example".
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: Of these, 2 have unspecified (.S) supply capability. 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 5.14. The amount of crude obtained from the
Middle East and U.S.A. is 30 and 150 units, respectively.
The CONOUT= data set is shown in Figure 5.15.
The optimal supplies of nodes "middle east" and "u.s.a." are 30 and 150 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 0.
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 0 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.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.