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: All supply nodes have unspecified (.S) supply capability. Number of these |
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)= 15 . |
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 . |
NOTE: The data set WORK.SOLUTION has 18 observations and 14 variables. |
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.
Figure 5.14: Print Statement, Oil Example, Missing S Supplies
The CONOUT= data set is shown in Figure 5.15.
Figure 5.15: Missing S SUPDEM Values in NODEDATA
Obs | _from_ | _to_ | _cost_ | _capac_ | _lo_ | _name_ | _SUPPLY_ | _DEMAND_ | _FLOW_ | _FCOST_ | _RCOST_ | _ANUMB_ | _TNUMB_ | _STATUS_ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | refinery 1 | r1 | 200 | 175 | 50 | thruput1 | . | . | 145.00 | 29000.00 | . | 7 | 2 | KEY_ARC BASIC |
2 | refinery 2 | r2 | 220 | 100 | 35 | thruput2 | . | . | 35.00 | 7700.00 | 17 | 8 | 3 | LOWERBD NONBASIC |
3 | r1 | ref1 diesel | 0 | 75 | 0 | . | . | 36.25 | 0.00 | . | 10 | 5 | KEY_ARC BASIC | |
4 | r1 | ref1 gas | 0 | 140 | 0 | r1_gas | . | . | 108.75 | 0.00 | . | 9 | 5 | KEY_ARC BASIC |
5 | r2 | ref2 diesel | 0 | 75 | 0 | . | . | 8.75 | 0.00 | . | 12 | 6 | KEY_ARC BASIC | |
6 | r2 | ref2 gas | 0 | 100 | 0 | r2_gas | . | . | 26.25 | 0.00 | . | 11 | 6 | KEY_ARC BASIC |
7 | middle east | refinery 1 | 63 | 95 | 20 | m_e_ref1 | S | . | 20.00 | 1260.00 | 8 | 2 | 1 | LOWERBD NONBASIC |
8 | u.s.a. | refinery 1 | 55 | 99999999 | 0 | S | . | 125.00 | 6875.00 | . | 3 | 4 | KEY_ARC BASIC | |
9 | middle east | refinery 2 | 81 | 80 | 10 | m_e_ref2 | S | . | 10.00 | 810.00 | 32 | 4 | 1 | LOWERBD NONBASIC |
10 | u.s.a. | refinery 2 | 49 | 99999999 | 0 | S | . | 25.00 | 1225.00 | . | 5 | 4 | KEY_ARC BASIC | |
11 | ref1 diesel | servstn1 diesel | 18 | 99999999 | 0 | . | 30 | 30.00 | 540.00 | . | 17 | 8 | KEY_ARC BASIC | |
12 | ref2 diesel | servstn1 diesel | 36 | 99999999 | 0 | . | 30 | 0.00 | 0.00 | 12 | 18 | 10 | LOWERBD NONBASIC | |
13 | ref1 gas | servstn1 gas | 15 | 70 | 0 | . | 95 | 68.75 | 1031.25 | . | 13 | 7 | KEY_ARC BASIC | |
14 | ref2 gas | servstn1 gas | 17 | 35 | 5 | . | 95 | 26.25 | 446.25 | . | 14 | 9 | NONKEY ARC BASIC | |
15 | ref1 diesel | servstn2 diesel | 17 | 99999999 | 0 | . | 15 | 6.25 | 106.25 | . | 19 | 8 | KEY_ARC BASIC | |
16 | ref2 diesel | servstn2 diesel | 23 | 99999999 | 0 | . | 15 | 8.75 | 201.25 | . | 20 | 10 | KEY_ARC BASIC | |
17 | ref1 gas | servstn2 gas | 22 | 60 | 0 | . | 40 | 40.00 | 880.00 | . | 15 | 7 | KEY_ARC BASIC | |
18 | ref2 gas | servstn2 gas | 31 | 99999999 | 0 | . | 40 | 0.00 | 0.00 | 7 | 16 | 9 | LOWERBD NONBASIC | |
50075.00 |
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)= 20 . |
NOTE: Of these, 1 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 . |
NOTE: The data set WORK.SOLUTION has 18 observations and 14 variables. |
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.