The NETFLOW Procedure |
If you are familiar with using the NETFLOW procedure to solve pure network problems, then solving generalized network problems is fairly simple. You just need to provide the additional data for the arc multipliers. Arcs by default have a multiplier of 1.0, so you only need to provide arc multipliers that are not equal to 1.0. You can specify the arc multiplier data in either or both of the ARCDATA= and CONDATA= data sets. The procedure scans the SAS variables in the ARCDATA= data set, and if it finds a name _MULT_ (or a similar name with letters of different case), then it assumes that the SAS variable contains data for arc multipliers. CONDATA= is scanned for special type values that indicates data are arc multipliers.
The rest of this section describes the various ways in which you can specify data for the arc multipliers. The network in Figure 5.26 is used for illustration.
data nodes; input _node_ $ _sd_ ; datalines; N1 22 N4 -30 N5 -10 ; data arcs; input _from_ $ _to_ $ _cost_ _mult_; datalines; N1 N2 2 4 N1 N3 10 0.5 N2 N4 0 1 N2 N5 7 3 N3 N2 12 2 N3 N5 10 2 N5 N4 55 0.9 ;
Let us first look at the data for this problem. There is a variable named _mult_ in the ARCDATA= data set, so PROC NETFLOW assumes it represents the arc multipliers. The SAS variable _sd_ represents the supdem value of a node. A positive or missing S value indicates supply, and a negative or missing D value indicates demand.
The optimal solution can be obtained from the CONOUT= data set. Note that you need to specify the CONOUT= data set even if the network has no side constraints; you cannot use the ARCOUT= data set.
You can use the following SAS code to run PROC NETFLOW:
title1 'The NETFLOW Procedure'; proc netflow bytes = 100000 nodedata = nodes arcdata = arcs conout = solution; run;
The optimal solution is displayed in Output 5.27.
data arcs1b; input _from_ $ _to_ $ _cost_; datalines; N1 N2 2 N1 N3 10 N2 N4 0 N2 N5 7 N3 N2 12 N3 N5 10 N5 N4 55 ; data MUdense; input _type_ $ N1_N2 N1_N3 N2_N4 N2_N5 N3_N2 N3_N5 N5_N4; datalines; mult 4.0 0.5 1.0 0.3 2.0 2.0 0.9 ;
You can use the following SAS code to obtain the solution:
proc netflow gennet nodedata = nodes arcdata = arcs1b condata = MUdense conout = soln1b; run;
Note that a new option, GENNET, has been specified in the call to PROC NETFLOW. This option is necessary when the network is generalized and there are no arc multiplier data in the ARCDATA= data set. If this option is not specified, then the procedure assumes that the network is pure (without arc multipliers) and sets up the excess supply node and the excess arcs.
The sparse format representation is as follows:
data MUsparse; input _type_ $ _col_ $ _coef_; datalines; mult N1_N2 4.0 mult N1_N3 0.5 mult N2_N4 1.0 mult N2_N5 0.3 mult N3_N2 2.0 mult N3_N5 2.0 mult N5_N4 0.9 ;
You can use the following SAS code to obtain the solution:
proc netflow gennet sparsecondata nodedata = nodes arcdata = arcs1b condata = MUsparse conout = soln1c; run;
Note that you need to specify the SPARSECONDATA option in the call to PROC NETFLOW.
data arcs1c; input _from_ $ _to_ $ _cost_ _mult_; datalines; N1 N2 2 4 N1 N3 10 .5 N2 N4 0 . N2 N5 7 . N3 N2 12 . N3 N5 10 . N5 N4 55 . ; data MUdense1; input _type_ $ N2_N4 N2_N5 N3_N2 N3_N5 N5_N4; datalines; mult 1.0 0.3 2.0 2.0 0.9 ;The procedure merges the data when all the input data sets have been read.
proc netflow ... ; mult lossrate; run;You may also use MULT, GAIN, or LOSS (or similar names with letters of different case) as a value of the TYPE list SAS variable.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.