The following code shows how to save a specific problem’s data in data sets and solve the model with PROC INTPOINT.
title 'Production Planning/Inventory/Distribution'; title2 'Minimum Cost Flow problem'; title3; 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 intpoint bytes=1000000 printlevel2=2 nodedata=node0 arcdata=arc0 conout=arc1; run;
proc print data=arc1 width=min; var _tail_ _head_ _cost_ _capac_ _lo_ _flow_ _fcost_ diagonal factory key_id mth_made; sum _fcost_; run;
The following notes appear on the SAS log:
Production Planning/Inventory/Distribution |
Minimum Cost Flow problem |
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: The following messages relate to the equivalent Linear Programming problem |
solved by the Interior Point algorithm. |
NOTE: Number of <= constraints= 0 . |
NOTE: Number of == constraints= 21 . |
NOTE: Number of >= constraints= 0 . |
NOTE: Number of constraint coefficients= 136 . |
NOTE: Number of variables= 68 . |
NOTE: After preprocessing, number of <= constraints= 0. |
NOTE: After preprocessing, number of == constraints= 20. |
NOTE: After preprocessing, number of >= constraints= 0. |
NOTE: The preprocessor eliminated 1 constraints from the problem. |
NOTE: The preprocessor eliminated 9 constraint coefficients from the problem. |
NOTE: 0 columns, 0 rows and 0 coefficients were added to the problem to handle |
unrestricted variables, variables that are split, and constraint slack or |
surplus variables. |
NOTE: There are 48 sub-diagonal nonzeroes in the unfactored A Atranspose matrix. |
NOTE: The 20 factor nodes make up 8 supernodes |
NOTE: There are 27 nonzero sub-rows or sub-columns outside the supernodal triangular |
regions along the factors leading diagonal. |
Iter Complem_aff Complem-ity Duality_gap Tot_infeasb Tot_infeasc Tot_infeasd |
0 -1.000000 192857968 0.895105 66024 25664 0 |
1 37620673 24479828 0.919312 4575.155540 1778.391068 0 |
2 4392127 1833947 0.594993 0 0 0 |
3 654204 426961 0.249790 0 0 0 |
4 161214 108340 0.075186 0 0 0 |
5 50985 43146 0.030894 0 0 0 |
6 37774 34993 0.025167 0 0 0 |
7 17695 9774.172272 0.007114 0 0 0 |
8 2421.777663 1427.435257 0.001042 0 0 0 |
9 522.394743 240.454270 0.000176 0 0 0 |
10 57.447587 7.581156 0.000005540 0 0 0 |
11 0.831035 0.007569 5.5317231E-9 0 0 0 |
NOTE: The Primal-Dual Predictor-Corrector Interior Point algorithm performed 11 |
iterations. |
NOTE: Optimum reached. |
NOTE: Objective= -1281110.338. |
NOTE: The data set WORK.ARC1 has 64 observations and 14 variables. |
NOTE: There were 64 observations read from the data set WORK.ARC0. |
NOTE: There were 8 observations read from the data set WORK.NODE0. |
The solution is given in the CONOUT=arc1 data sets. In the CONOUT= data set, shown in Output 4.1.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 used to 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 INTPOINT 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.
Production Planning/Inventory/Distribution |
Minimum Cost Flow problem |
Obs | _tail_ | _head_ | _cost_ | _capac_ | _lo_ | _FLOW_ | _FCOST_ | diagonal | factory | key_id | mth_made |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | fact1_1 | f1_apr_1 | 78.60 | 600 | 50 | 600.000 | 47160.00 | 19 | 1 | production | April |
2 | f1_mar_1 | f1_apr_1 | 15.00 | 50 | 0 | 0.000 | 0.00 | 19 | 1 | storage | March |
3 | f1_may_1 | f1_apr_1 | 28.00 | 20 | 0 | 0.000 | 0.00 | 19 | 1 | backorder | May |
4 | f2_apr_1 | f1_apr_1 | 11.00 | 40 | 0 | 0.000 | 0.00 | 19 | . | f2_to_1 | April |
5 | fact1_2 | f1_apr_2 | 174.50 | 550 | 50 | 550.000 | 95975.00 | 25 | 1 | production | April |
6 | f1_mar_2 | f1_apr_2 | 20.00 | 40 | 0 | 0.000 | 0.00 | 25 | 1 | storage | March |
7 | f1_may_2 | f1_apr_2 | 41.00 | 15 | 0 | 15.000 | 615.00 | 25 | 1 | backorder | May |
8 | f2_apr_2 | f1_apr_2 | 21.00 | 25 | 0 | 0.000 | 0.00 | 25 | . | f2_to_1 | April |
9 | fact1_1 | f1_mar_1 | 127.90 | 500 | 50 | 344.999 | 44125.43 | 19 | 1 | production | March |
10 | f1_apr_1 | f1_mar_1 | 28.00 | 20 | 0 | 20.000 | 560.00 | 19 | 1 | backorder | April |
11 | f2_mar_1 | f1_mar_1 | 10.00 | 40 | 0 | 40.000 | 400.00 | 19 | . | f2_to_1 | March |
12 | fact1_2 | f1_mar_2 | 217.90 | 400 | 40 | 400.000 | 87160.00 | 25 | 1 | production | March |
13 | f1_apr_2 | f1_mar_2 | 32.00 | 30 | 0 | 30.000 | 960.00 | 25 | 1 | backorder | April |
14 | f2_mar_2 | f1_mar_2 | 20.00 | 25 | 0 | 25.000 | 500.00 | 25 | . | f2_to_1 | March |
15 | fact1_1 | f1_may_1 | 95.10 | 400 | 50 | 50.001 | 4755.06 | 19 | 1 | production | May |
16 | f1_apr_1 | f1_may_1 | 12.00 | 50 | 0 | 50.000 | 600.00 | 19 | 1 | storage | April |
17 | f2_may_1 | f1_may_1 | 13.00 | 40 | 0 | 0.000 | 0.00 | 19 | . | f2_to_1 | May |
18 | fact1_2 | f1_may_2 | 133.30 | 350 | 40 | 40.000 | 5332.04 | 25 | 1 | production | May |
19 | f1_apr_2 | f1_may_2 | 18.00 | 40 | 0 | 0.000 | 0.00 | 25 | 1 | storage | April |
20 | f2_may_2 | f1_may_2 | 43.00 | 25 | 0 | 0.000 | 0.00 | 25 | . | f2_to_1 | May |
21 | f1_apr_1 | f2_apr_1 | 11.00 | 99999999 | 0 | 30.000 | 330.00 | 19 | . | f1_to_2 | April |
22 | fact2_1 | f2_apr_1 | 62.40 | 480 | 35 | 480.000 | 29952.00 | 19 | 2 | production | April |
23 | f2_mar_1 | f2_apr_1 | 18.00 | 30 | 0 | 0.000 | 0.00 | 19 | 2 | storage | March |
24 | f2_may_1 | f2_apr_1 | 25.00 | 15 | 0 | 0.000 | 0.00 | 19 | 2 | backorder | May |
25 | f1_apr_2 | f2_apr_2 | 23.00 | 99999999 | 0 | 0.000 | 0.00 | 25 | . | f1_to_2 | April |
26 | fact2_2 | f2_apr_2 | 196.70 | 680 | 35 | 680.000 | 133755.99 | 25 | 2 | production | April |
27 | f2_mar_2 | f2_apr_2 | 28.00 | 50 | 0 | 0.000 | 0.00 | 25 | 2 | storage | March |
28 | f2_may_2 | f2_apr_2 | 54.00 | 15 | 0 | 15.000 | 810.00 | 25 | 2 | backorder | May |
29 | f1_mar_1 | f2_mar_1 | 11.00 | 99999999 | 0 | 0.000 | 0.00 | 19 | . | f1_to_2 | March |
30 | fact2_1 | f2_mar_1 | 88.00 | 450 | 35 | 290.000 | 25520.00 | 19 | 2 | production | March |
31 | f2_apr_1 | f2_mar_1 | 17.00 | 15 | 0 | 0.000 | 0.00 | 19 | 2 | backorder | April |
32 | f1_mar_2 | f2_mar_2 | 23.00 | 99999999 | 0 | 0.000 | 0.00 | 25 | . | f1_to_2 | March |
33 | fact2_2 | f2_mar_2 | 182.00 | 650 | 35 | 645.000 | 117389.96 | 25 | 2 | production | March |
34 | f2_apr_2 | f2_mar_2 | 31.00 | 15 | 0 | 0.000 | 0.00 | 25 | 2 | backorder | April |
35 | f1_may_1 | f2_may_1 | 16.00 | 99999999 | 0 | 100.000 | 1600.01 | 19 | . | f1_to_2 | May |
36 | fact2_1 | f2_may_1 | 133.80 | 250 | 35 | 35.000 | 4683.00 | 19 | 2 | production | May |
37 | f2_apr_1 | f2_may_1 | 20.00 | 30 | 0 | 15.000 | 299.99 | 19 | 2 | storage | April |
38 | f1_may_2 | f2_may_2 | 26.00 | 99999999 | 0 | 0.000 | 0.00 | 25 | . | f1_to_2 | May |
39 | fact2_2 | f2_may_2 | 201.40 | 550 | 35 | 35.000 | 7049.00 | 25 | 2 | production | May |
40 | f2_apr_2 | f2_may_2 | 38.00 | 50 | 0 | 0.000 | 0.00 | 25 | 2 | storage | April |
41 | f1_mar_1 | shop1_1 | -327.65 | 250 | 0 | 154.999 | -50785.56 | 19 | 1 | sales | March |
42 | f1_apr_1 | shop1_1 | -300.00 | 250 | 0 | 250.000 | -75000.00 | 19 | 1 | sales | April |
43 | f1_may_1 | shop1_1 | -285.00 | 250 | 0 | 0.000 | 0.00 | 19 | 1 | sales | May |
44 | f2_mar_1 | shop1_1 | -297.40 | 250 | 0 | 250.000 | -74349.99 | 19 | 2 | sales | March |
45 | f2_apr_1 | shop1_1 | -290.00 | 250 | 0 | 245.001 | -71050.17 | 19 | 2 | sales | April |
46 | f2_may_1 | shop1_1 | -292.00 | 250 | 0 | 0.000 | 0.00 | 19 | 2 | sales | May |
47 | f1_mar_2 | shop1_2 | -559.76 | 99999999 | 0 | 0.000 | 0.00 | 25 | 1 | sales | March |
48 | f1_apr_2 | shop1_2 | -524.28 | 99999999 | 0 | 0.000 | -0.01 | 25 | 1 | sales | April |
49 | f1_may_2 | shop1_2 | -475.02 | 99999999 | 0 | 25.000 | -11875.64 | 25 | 1 | sales | May |
50 | f2_mar_2 | shop1_2 | -567.83 | 500 | 0 | 500.000 | -283915.00 | 25 | 2 | sales | March |
51 | f2_apr_2 | shop1_2 | -542.19 | 500 | 0 | 375.000 | -203321.08 | 25 | 2 | sales | April |
52 | f2_may_2 | shop1_2 | -461.56 | 500 | 0 | 0.000 | 0.00 | 25 | 2 | sales | May |
53 | f1_mar_1 | shop2_1 | -362.74 | 250 | 0 | 250.000 | -90685.00 | 19 | 1 | sales | March |
54 | f1_apr_1 | shop2_1 | -300.00 | 250 | 0 | 250.000 | -75000.00 | 19 | 1 | sales | April |
55 | f1_may_1 | shop2_1 | -245.00 | 250 | 0 | 0.000 | 0.00 | 19 | 1 | sales | May |
56 | f2_mar_1 | shop2_1 | -272.70 | 250 | 0 | 0.000 | 0.00 | 19 | 2 | sales | March |
57 | f2_apr_1 | shop2_1 | -312.00 | 250 | 0 | 250.000 | -78000.00 | 19 | 2 | sales | April |
58 | f2_may_1 | shop2_1 | -299.00 | 250 | 0 | 150.000 | -44850.00 | 19 | 2 | sales | May |
59 | f1_mar_2 | shop2_2 | -623.89 | 99999999 | 0 | 455.000 | -283869.94 | 25 | 1 | sales | March |
60 | f1_apr_2 | shop2_2 | -549.68 | 99999999 | 0 | 535.000 | -294078.78 | 25 | 1 | sales | April |
61 | f1_may_2 | shop2_2 | -460.00 | 99999999 | 0 | 0.000 | 0.00 | 25 | 1 | sales | May |
62 | f2_mar_2 | shop2_2 | -542.83 | 500 | 0 | 120.000 | -65139.47 | 25 | 2 | sales | March |
63 | f2_apr_2 | shop2_2 | -559.19 | 500 | 0 | 320.000 | -178940.96 | 25 | 2 | sales | April |
64 | f2_may_2 | shop2_2 | -489.06 | 500 | 0 | 20.000 | -9781.20 | 25 | 2 | sales | May |
-1281110.34 |