The NETFLOW Procedure |
Example 5.4 through Example 5.8 use data from a company that produces two sizes of televisions in order to illustrate variations in the use the NETFLOW procedure. The company makes televisions with a diagonal screen measurement of either 19 inches or 25 inches. These televisions are made between March and May at both of the company's two factories. Each factory has a limit on the total number of televisions of each screen dimension that can be made during those months.
The televisions are distributed to one of two shops, stored at the factory where they were made and sold later, or shipped to the other factory. Some sets can be used to fill backorders from the previous months. Each shop demands a number of each type of TV for the months of March through May. The following network in Figure 5.42 illustrates the model. Arc costs can be interpreted as production costs, storage costs, backorder penalty costs, inter-factory transportation costs, and sales profits. The arcs can have capacities and lower flow bounds.
There are two similarly structured networks, one for the 19-inch
televisions and the other for the 25-inch screen TVs.
The minimum cost production, inventory, and distribution plan
for both TV types can be determined
in the same run of PROC NETFLOW.
To ensure that node names are unambiguous, the names of nodes
in the 19-inch network have suffix _1, and the node names
in the 25-inch network have suffix _2.
The FUTURE1 option is specified because further processing could be required. Information concerning an optimal solution is retained so it can be used to warm start later optimizations. Warm start information is mostly in variables named _NNUMB_, _PRED_, _TRAV_, _SCESS_, _ARCID_, and _FBQ_ and in observations for nodes named _EXCESS_ and _ROOT_, that are in the NODEOUT=NODE2 output data set. (PROC NETFLOW uses similar devices to store warm start information in the DUALOUT= data set when the FUTURE2 option is specified.) Variables _ANUMB_ and _TNUMB_ and observations for arcs directed from or toward a node called _EXCESS_ are present in ARCOUT=arc1. (PROC NETFLOW uses similar devices to store warm start information in the CONOUT= data set when the FUTURE2 option is specified.)
The following code shows how to save the problem data in data sets and solve the model with PROC NETFLOW.
title 'Minimum Cost Flow problem'; title2 'Production Planning/Inventory/Distribution'; data node0; input _node_ $ _supdem_ ; datalines; fact1_1 1000 fact2_1 850 fact1_2 1000 fact2_2 1500 shop1_1 -900 shop2_1 -900 shop1_2 -900 shop2_2 -1450 ; data arc0; input _tail_ $ _head_ $ _cost_ _capac_ _lo_ diagonal factory key_id $10. mth_made $ _name_&$17. ; datalines; fact1_1 f1_mar_1 127.9 500 50 19 1 production March prod f1 19 mar fact1_1 f1_apr_1 78.6 600 50 19 1 production April prod f1 19 apl fact1_1 f1_may_1 95.1 400 50 19 1 production May . f1_mar_1 f1_apr_1 15 50 . 19 1 storage March . f1_apr_1 f1_may_1 12 50 . 19 1 storage April . f1_apr_1 f1_mar_1 28 20 . 19 1 backorder April back f1 19 apl f1_may_1 f1_apr_1 28 20 . 19 1 backorder May back f1 19 may f1_mar_1 f2_mar_1 11 . . 19 . f1_to_2 March . f1_apr_1 f2_apr_1 11 . . 19 . f1_to_2 April . f1_may_1 f2_may_1 16 . . 19 . f1_to_2 May . f1_mar_1 shop1_1 -327.65 250 . 19 1 sales March . f1_apr_1 shop1_1 -300 250 . 19 1 sales April . f1_may_1 shop1_1 -285 250 . 19 1 sales May . f1_mar_1 shop2_1 -362.74 250 . 19 1 sales March . f1_apr_1 shop2_1 -300 250 . 19 1 sales April . f1_may_1 shop2_1 -245 250 . 19 1 sales May . fact2_1 f2_mar_1 88.0 450 35 19 2 production March prod f2 19 mar fact2_1 f2_apr_1 62.4 480 35 19 2 production April prod f2 19 apl fact2_1 f2_may_1 133.8 250 35 19 2 production May . f2_mar_1 f2_apr_1 18 30 . 19 2 storage March . f2_apr_1 f2_may_1 20 30 . 19 2 storage April . f2_apr_1 f2_mar_1 17 15 . 19 2 backorder April back f2 19 apl f2_may_1 f2_apr_1 25 15 . 19 2 backorder May back f2 19 may f2_mar_1 f1_mar_1 10 40 . 19 . f2_to_1 March . f2_apr_1 f1_apr_1 11 40 . 19 . f2_to_1 April . f2_may_1 f1_may_1 13 40 . 19 . f2_to_1 May . f2_mar_1 shop1_1 -297.4 250 . 19 2 sales March . f2_apr_1 shop1_1 -290 250 . 19 2 sales April . f2_may_1 shop1_1 -292 250 . 19 2 sales May . f2_mar_1 shop2_1 -272.7 250 . 19 2 sales March . f2_apr_1 shop2_1 -312 250 . 19 2 sales April . f2_may_1 shop2_1 -299 250 . 19 2 sales May . fact1_2 f1_mar_2 217.9 400 40 25 1 production March prod f1 25 mar fact1_2 f1_apr_2 174.5 550 50 25 1 production April prod f1 25 apl fact1_2 f1_may_2 133.3 350 40 25 1 production May . f1_mar_2 f1_apr_2 20 40 . 25 1 storage March . f1_apr_2 f1_may_2 18 40 . 25 1 storage April . f1_apr_2 f1_mar_2 32 30 . 25 1 backorder April back f1 25 apl f1_may_2 f1_apr_2 41 15 . 25 1 backorder May back f1 25 may f1_mar_2 f2_mar_2 23 . . 25 . f1_to_2 March . f1_apr_2 f2_apr_2 23 . . 25 . f1_to_2 April . f1_may_2 f2_may_2 26 . . 25 . f1_to_2 May . f1_mar_2 shop1_2 -559.76 . . 25 1 sales March . f1_apr_2 shop1_2 -524.28 . . 25 1 sales April . f1_may_2 shop1_2 -475.02 . . 25 1 sales May . f1_mar_2 shop2_2 -623.89 . . 25 1 sales March . f1_apr_2 shop2_2 -549.68 . . 25 1 sales April . f1_may_2 shop2_2 -460.00 . . 25 1 sales May . fact2_2 f2_mar_2 182.0 650 35 25 2 production March prod f2 25 mar fact2_2 f2_apr_2 196.7 680 35 25 2 production April prod f2 25 apl fact2_2 f2_may_2 201.4 550 35 25 2 production May . f2_mar_2 f2_apr_2 28 50 . 25 2 storage March . f2_apr_2 f2_may_2 38 50 . 25 2 storage April . f2_apr_2 f2_mar_2 31 15 . 25 2 backorder April back f2 25 apl f2_may_2 f2_apr_2 54 15 . 25 2 backorder May back f2 25 may f2_mar_2 f1_mar_2 20 25 . 25 . f2_to_1 March . f2_apr_2 f1_apr_2 21 25 . 25 . f2_to_1 April . f2_may_2 f1_may_2 43 25 . 25 . f2_to_1 May . f2_mar_2 shop1_2 -567.83 500 . 25 2 sales March . f2_apr_2 shop1_2 -542.19 500 . 25 2 sales April . f2_may_2 shop1_2 -461.56 500 . 25 2 sales May . f2_mar_2 shop2_2 -542.83 500 . 25 2 sales March . f2_apr_2 shop2_2 -559.19 500 . 25 2 sales April . f2_may_2 shop2_2 -489.06 500 . 25 2 sales May . ; proc netflow nodedata=node0 arcdata=arc0; set future1 nodeout=node2 arcout=arc1; proc print data=arc1; sum _fcost_; proc print data=node2; run;
The following notes appear on the SAS log:
NOTE: Number of nodes= 20 . NOTE: Number of supply nodes= 4 . NOTE: Number of demand nodes= 4 . NOTE: Total supply= 4350 , total demand= 4150 . NOTE: Number of arcs= 64 . NOTE: Number of iterations performed (neglecting any constraints)= 74 . NOTE: Of these, 1 were degenerate. NOTE: Optimum (neglecting any constraints) found. NOTE: Minimal total cost= -1281110.35 . NOTE: The data set WORK.ARC1 has 68 observations and 18 variables. NOTE: The data set WORK.NODE2 has 22 observations and 10 variables.
The solution is given in the NODEOUT=node2 and ARCOUT=arc1 data sets. In the ARCOUT= data set, shown in Output 5.4.1, the variables diagonal, factory, key_id, and mth_made form an implicit ID list. The diagonal variable has one of two values, 19 or 25. factory also has one of two values, 1 or 2, to denote the factory where either production or storage occurs, from where TVs are either sold to shops or satisfy backorders. PRODUCTION, STORAGE, SALES, and BACKORDER are values of the key_id variable.
Other values of this variable, F1_TO_2 and F2_TO_1, are used when flow through arcs represents the transportation of TVs between factories. The mth_made variable has values MARCH, APRIL, and MAY, the months when TVs that are modeled as flow through an arc were made (assuming that no televisions are stored for more than one month and none manufactured in May are used to fill March backorders).
These ID variables can be used after the PROC NETFLOW run to produce reports and perform analysis on particular parts of the company's operation. For example, reports can be generated for production numbers for each factory; optimal sales figures for each shop; and how many TVs should be stored, used to fill backorders, sent to the other factory, or any combination of these, for TVs with a particular screen, those produced in a particular month, or both.
Output 5.4.1: ARCOUT=ARC1
Output 5.4.2: NODEOUT=NODE2
|
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.