Chapter Contents
Chapter Contents
The NETFLOW Procedure

Network Models: Interior Point Algorithm

The data required by PROC NETFLOW for a network problem is identical whether the Simplex algorithm or the Interior Point algorithm is used as the optimizer. By default, the Simplex algorithm is used for problems with a network component. To use the Interior Point algorithm, all you need to do is specify the INTPOINT option in the PROC NETFLOW statement. You can optionally specify some options that control the Interior Point algorithm, of which there are only a few. The Interior Point algorithm is remarkedly robust when reasonable choices are made during the design and implementation, so it does not need to be tuned to the same extent as the Simplex algorithm.

When to Use INTPOINT: Network Models: Interior Point algorithm

PROC NETFLOW uses the Primal Simplex Network algorithm and the Primal Partitioning Algorithm to solve constrained network problems. These algorithms are fast, since they take advantage of algebraic properties of the network component of the problem.

If the network component of the model is large compared to the side constraint component, PROC NETFLOW's optimizer can store what would otherwise be a large matrix as a spanning tree computer data structure. Computations involving the spanning tree data structure can be performed much faster than those using matrices. Only the nonnetwork part of the problem, hopefully quite small, needs to be manipulated by PROC NETFLOW as matrices.

In contrast, LP optimizers must contend with matrices that can be large for large problems. Arithmetic operations on matrices often accumulate rounding errors that cause difficulties for the algorithm. So in addition to the performance improvements, network optimization is generally more numerically stable than LP optimization.

The nodal flow conservation constraints do not need to be specified in the network model. They are implied by the network structure. However, flow conservation constraints do make up the data for the equivalent LP model. If you have an LP that is small after the flow conservation constraints are removed, that problem is a definite candidate for solution by PROC NETFLOW specialized Simplex method.

However, some constrained network problems are solved more quickly by the Interior Point algorithm than the network optimizer in PROC NETFLOW. Usually, they have a large number of side constraints or nonarc variables. These models are more like LPs than network problems. The network component of the problem is so small that PROC NETFLOW's Network Simplex method cannot recoup the effort to exploit that component rather than treat the whole problem as an LP. If this is the case, it is worthwhile to get PROC NETFLOW to convert a constrained network problem to the equivalent LP and use it's Interior Point algorithm. This conversion must be done before any optimization has been performed (specify the INTPOINT option in the PROC NETFLOW statement) Even though some network problems are better solved by converting them to an LP, the input data and the output solution are more conveniently maintained as networks. You retain the advantages of casting problems as networks: ease of problem generation and expansion when more detail is required. The model and optimal solutions are easy to understand, as a network can be drawn.

Getting Started: Network Models: Interior Point algorithm

To solve network programming problems with side constraints using PROC NETFLOW, you save a representation of the network and the side constraints in three SAS data sets. These data sets are then passed to PROC NETFLOW for solution. There are various forms that a problem's data can take. You can use any one or a combination of several of these forms.

The NODEDATA= data set contains the names of the supply and demand nodes and the supply or demand associated with each. These are the elements in the column vector b in problem (NPSC).

The ARCDATA= data set contains information about the variables of the problem. Usually these are arcs, but there can be data related to nonarc variables in the ARCDATA= data set as well. If there are no arcs, this is a Linear Programming problem.

An arc is identified by the names of its tail node (where it originates) and head node (where it is directed). Each observation can be used to identify an arc in the network and, optionally, the cost per flow unit across the arc, the arc's capacity, lower flow bound, and name. These data are associated with the matrix F and the vectors c, l, and u in problem (LPSC).

Note: although F is a node-arc incidence matrix, it is specified in the ARCDATA= data set by arc definitions. Do not explicitly specify these flow conservation constraints as constraints of the problem. In addition, the ARCDATA= data set can be used to specify information about nonarc variables, including objective function coefficients, lower and upper value bounds, and names. These data are the elements of the vectors d, m, and v in problem (NPSC). Data for an arc or nonarc variable can be given in more than one observation.

Supply and demand data also can be specified in the ARCDATA= data set. In such a case, the NODEDATA= data set may not be needed.

The CONDATA= data set describes the side constraints and their right-hand-sides. These data are elements of the matrices H and Q and the vector r. Constraint types are also specified in the CONDATA= data set. You can include in this data set upper bound values or capacities, lower flow or value bounds, and costs or objective function coefficients. It is possible to give all information about some or all nonarc variables in the CONDATA= data set.

An arc or nonarc variable is identified in this data set by it's name. If you specify an arc's name in the ARCDATA= data set, then this name is used to associate data in the CONDATA= data set with that arc. Each arc also has a default name that is the name of the tail and head node of the arc concatenated together and separated by an underscore character; tail_head, for example.

If you use the dense side constraint input format and want to use these default arc names, these arc names are names of SAS variables in the VAR list of the CONDATA= data set.

If you use the sparse side constraint input format (described later as well) and want to use these default arc names, these arc names are values of the COLUMN list SAS variable of the CONDATA= data set. When using the Interior Point algorithm, the execution of PROC NETFLOW has two stages. In the preliminary (zeroth) stage, the data are read from the NODEDATA= data set, the ARCDATA= data set, and the CONDATA= data set. Error checking is performed. The model is converted into an equivalent Linear Program

In the next stage, the Linear Program is preprocessed. This is optional but highly recommended. Preprocessing analyses the model and tries to determine before optimization whether variables can be "fixed" to their optimal values. Knowing that, the model can be modified and these variables dropped out. It can be determined that some constraints are redundant. Sometimes, preprocessing succeeds in reducing the size of the problem, thereby making the subsequent optimization easier and faster.

The optimal solution to the Linear Program is then found. The Linear Program is converted back to the original constrained network problem, and the optimum for this is derived from the optimum of the equivalent Linear Program. If the problem was preprocessed, the model is now post-processed, where fixed variables are reintroduced. The solution can be saved in the CONOUT= data set. This data set is also named in the PROC NETFLOW, RESET, and SAVE statements.

The Interior Point algorithm cannot efficiently be warm started, so options such as FUTURE1 and FUTURE2 options are irrelevant.

Introductory Example: Network Models: Interior Point algorithm

Consider the following transshipment problem for an oil company in the "Introductory Example" section. Recall that crude oil is shipped to refineries where it is processed into gasoline and diesel fuel. The gasoline and diesel fuel are then distributed to service stations. At each stage there are shipping, processing, and distribution costs. Also, there are lower flow bounds and capacities. In addition, there are side constraints to model crude mix stipulations, and model the limitations on the amount of Middle Eastern crude that can be processed by each refinery and the conversion proportions of crude to gasoline and diesel fuel. The network diagram is reproduced in Figure 4.16.

netoil.gif (3366 bytes)

Figure 4.16: Oil Industry Example

To solve this problem with PROC NETFLOW, a representation of the model is saved in three SAS data sets, that are identical to the data sets supplied to PROC NETFLOW when the Simplex algorithm was used.

To find the minimum cost flow through the network that satisfies the supplies, demands, and side constraints, invoke PROC NETFLOW as follows:

   proc netflow
      intpoint              /* <<<--- Interior Point used */
      nodedata=noded        /* the supply and demand data */
      arcdata=arcd1         /* the arc descriptions       */
      condata=cond1         /* the side constraints       */
      conout=solution;      /* the solution data set      */

The following messages, that appear on the SAS log, summarize the model as read by PROC NETFLOW and note the progress toward a solution:

NOTE: Number of nodes= 14 .
NOTE: Number of supply nodes= 2 .
NOTE: Number of demand nodes= 4 .
NOTE: Total supply= 180 , total demand= 180 .
NOTE: Number of arcs= 18 .
NOTE: Number of variables= 18 .
NOTE: Number of <= constraints= 0 .
NOTE: Number of == constraints= 16 .
NOTE: Number of >= constraints= 2 .
NOTE: Number of constraint coefficients= 44 .
NOTE: After preprocessing, number of <= constraints= 0.
NOTE: After preprocessing, number of == constraints= 6.
NOTE: After preprocessing, number of >= constraints= 2.
NOTE: The preprocessor eliminated 10 constraints from 
      the problem.
NOTE: The preprocessor eliminated 22 constraint 
      coefficients from the problem.
NOTE: After preprocessing, number of variables= 8.
NOTE: The preprocessor eliminated 10 variables from the 
NOTE: 2 columns, 0 rows and 2 coefficients were added to 
      the problem to handle unrestricted variables, 
      variables that are split, and constraint slack or 
      surplus variables.
NOTE: There are 18 nonzero elements in A * A transpose.
NOTE: Number of fill-ins=5.
NOTE: Of the 8 rows and columns, 2 are sparse.
NOTE: During factorization, 1 of the dense rows were found 
      to be completely dense and were treated as such from 
      then on. This should have saved time.
NOTE: There are 8 nonzero elements in the sparse rows of the 
      factored A * A transpose. This includes fill-ins in the 
      sparse rows.
NOTE: There are 3 operations of the form 
      to factorize the sparse rows of A * A transpose.
NOTE: Constraint feasibility, bound feasibility, and dual 
      feasibility attained by iteration 1 as a affine step 
      (mu=0) of length 1 was done.
NOTE: Primal-Dual Predictor-Corrector Interior point algorithm 
      performed 8 iterations.
NOTE: Objective = 50875.000253.
NOTE: The data set WORK.SOLUTION has 18 observations and 
      14 variables.

The first set of messages provide statistics on the size of the equivalent Linear Programming problem. The number of variables may not equal the number of arcs if the problem has nonarc variables. This example has none. To convert a network to an equivalent LP problem, a flow conservation constraint must be created for each node (including an excess or bypass node, if required). This explains why the number of equality side constraints and the number of constraint coefficients change when the Interior Point algorithm is used.

If the preprocessor was successful in decreasing the problem size, some messages will report how well it did. In this example, the model size was cut in half!

The following set of messages describe aspects of the Interior Point algorithm. Of particular interest are those concerned with the Cholesky factorization of A AT where A is the coefficient matrix of the final LP. It is crucial to preorder the rows and columns of this matrix to prevent fill-in and reduce the number of row operations to undertake the factorization. See the "Interior Point Algorithmic Details" section for more explanation.

Unlike PROC LP that displays the solution and other information as output, PROC NETFLOW saves the optimum in output SAS data sets you specify. For this example, the solution is saved in the SOLUTION data set. It can be displayed with PROC PRINT as:

   proc print data=solution;
      var _from_ _to_ _cost_ _capac_ _lo_ _name_ 
          _supply_ _demand_ _flow_ _fcost_ _rcost_;
      sum _fcost_;
      title3 'Constrained Optimum'; run;

Constrained Optimum

Obs _from_ _to_ _cost_ _capac_ _lo_ _name_ _SUPPLY_ _DEMAND_ _FLOW_ _FCOST_ _RCOST_
1 refinery 1 r1 200 175 50 thruput1 . . 145.00 29000.00 .
2 refinery 2 r2 220 100 35 thruput2 . . 35.00 7700.00 29
3 r1 ref1 diesel 0 75 0   . . 36.25 0.00 .
4 r1 ref1 gas 0 140 0 r1_gas . . 108.75 0.00 .
5 r2 ref2 diesel 0 75 0   . . 8.75 0.00 .
6 r2 ref2 gas 0 100 0 r2_gas . . 26.25 0.00 .
7 middle east refinery 1 63 95 20 m_e_ref1 100 . 80.00 5040.00 .
8 u.s.a. refinery 1 55 99999999 0   80 . 65.00 3575.00 .
9 middle east refinery 2 81 80 10 m_e_ref2 100 . 20.00 1620.00 .
10 u.s.a. refinery 2 49 99999999 0   80 . 15.00 735.00 .
11 ref1 diesel servstn1 diesel 18 99999999 0   . 30 30.00 540.00 .
12 ref2 diesel servstn1 diesel 36 99999999 0   . 30 0.00 0.00 12
13 ref1 gas servstn1 gas 15 70 0   . 95 68.75 1031.25 .
14 ref2 gas servstn1 gas 17 35 5   . 95 26.25 446.25 .
15 ref1 diesel servstn2 diesel 17 99999999 0   . 15 6.25 106.25 .
16 ref2 diesel servstn2 diesel 23 99999999 0   . 15 8.75 201.25 .
17 ref1 gas servstn2 gas 22 60 0   . 40 40.00 880.00 .
18 ref2 gas servstn2 gas 31 99999999 0   . 40 0.00 0.00 7

Figure 4.17: conout=solution

Notice that, in the solution data set (Figure 4.17), the optimal flow through each arc in the network is given in the variable named _FLOW_, and the cost of flow through each arc is given in the variable _FCOST_. As expected, the miminal total cost of the solution found by the Interior Point algorithm is equal to miminal total cost of the solution found by the Simplex algorithm. In this example, the solutions are the same (within several significant digits), but sometimes the solutions can be different.

netoil2.gif (3839 bytes)

Figure 4.18: Oil Industry solution

Interactivity: Network Models: Interior Point algorithm

PROC NETFLOW can be used interactively. You begin by giving the PROC NETFLOW statement with INTPOINT specified, and you must specify the ARCDATA= data set. The CONDATA= data set must also be specified if the problem has side constraints. If necessary, specify the NODEDATA= data set. The variable lists should be given next. If you have variables in the input data sets that have special names (for example, a variable in the ARCDATA= data set named _TAIL_ that has tail nodes of arcs as values), it may not be necessary to have many or any variable lists.

So far, this is the same when the Simplex algorithm is used, except the INTPOINT option is specified in the PROC NETFLOW statement. The PRINT, QUIT, SAVE, SHOW, RESET, and RUN statements follow and can be listed in any order. The QUIT statements can be used only once. The others can be used as many times as needed.

The CONOPT and PIVOT statements are not relevant to the Interior Point algorithm and should not be used. Use the RESET or SAVE statement to change the name of the output data set. There is only on output data set, the CONOUT= data set. With the RESET statement, you can also indicate the reasons why optimization should stop, (for example, you can indicate the maximum number of iterations that can be performed). PROC NETFLOW then has a chance to either execute the next statement, or, if the next statement is one that PROC NETFLOW does not recognize (the next PROC or DATA step in the SAS session), do any allowed optimization and finish. If no new statement has been submitted, you are prompted for one. Some options of the RESET statement enable you to control aspects of the Interior Point algorithm. Specifying certain values for these options can reduce the time it takes to solve a problem. Note that any of the RESET options can be specified in the PROC NETFLOW statement.

The RUN statement starts optimization. Once the optimization has started, it runs until the optimum is reached. The RUN statement should be specified at most once.

The QUIT statement immediately stops PROC NETFLOW. The SAVE statement has options that allow you to name the output data set; information about the current solution is put in this output data set. Use the SHOW statement if you want to examine the values of options of other statements. Information about the amount of optimization that has been done and the STATUS of the current solution can also be displayed using the SHOW statement.

The PRINT statement makes PROC NETFLOW display parts of the problem. The way the PRINT statements are specified are identical whether the Interior Point algorithm or the Simplex algorithm is used, however there are minor differences in what is displayed for each arc, nonarc variable or constraint coefficient.

PRINT ARCS produces information on all arcs. PRINT SOME_ARCS limits this output to a subset of arcs. There are similar PRINT statements for nonarc variables and constraints:

PRINT CON_ARCS enables you to limit constraint information that is obtained to members of a set of arcs and that have nonzero constraint coefficients in a set of constraints. PRINT CON_NONARCS is the corresponding statement for nonarc variables.

For example, an interactive PROC NETFLOW run might look something like this:

   proc netflow
          intpoint      /* use the Interior Point algorithm */
          arcdata=data set
          other options;
      variable list specifications;  /* if necessary        */
      reset options;
      print options;                 /* look at problem     */
   run;                              /* do the optimization */
      print options;    /* look at the optimal solution     */
      save options;     /* keep optimal solution            */
If you are interested only in finding the optimal solution, have used SAS variables that have special names in the input data sets, and want to use default setting for everything, then the following statement is all you need

proc netflow intpoint arcdata= data set options ;

Functional Summary: Network Models: Interior Point algorithm

The following tables outline the options available for the NETFLOW procedure when the Interior Point algorithm is being used, classified by function.

Table 4.24: Input Data Set Options
Description Statement Option
arcs input data setNETFLOWARCDATA=
nodes input data setNETFLOWNODEDATA=
constraint input data setNETFLOWCONDATA=

Table 4.25: Options for Networks
Description Statement Option
default arc costNETFLOWDEFCOST=
default arc capacityNETFLOWDEFCAPACITY=
default arc lower flow boundNETFLOWDEFMINFLOW=
network's only supply nodeNETFLOWSOURCE=
SOURCE's supply capabilityNETFLOWSUPPLY=
network's only demand nodeNETFLOWSINK=
excess supply or demand is conveyed through networkNETFLOWTHRUNET
find maximal flow between SOURCE and SINKNETFLOWMAXFLOW
cost of bypass arc when solving MAXFLOW problemNETFLOWBYPASSDIV=
find shortest path from SOURCE to SINKNETFLOWSHORTPATH

Table 4.26: Miscellaneous Options
Description Statement Option
infinity valueNETFLOWINFINITY=
do constraint row and/or nonarc variable column coefficientNETFLOWSCALE=
scaling, or neither  
maximization instead of minimizationNETFLOWMAXIMIZE

Table 4.27: Data Set Read Options
Description Statement Option
default constraint typeNETFLOWDEFCONTYPE=
special COLUMN variable valueNETFLOWTYPEOBS=
special COLUMN variable valueNETFLOWRHSOBS=
is used to interpret arc and nonarc variable namesNETFLOWNAMECTRL=
in the CONDATA  
no new nonarc variablesNETFLOWSAME_NONARC_DATA
data for an arc found in only one obs of ARCDATANETFLOWARC_SINGLE_OBS
data for an constraint found in only oneNETFLOWCON_SINGLE_OBS
obs of CONDATA  
data for a coefficient found once in CONDATANETFLOWNON_REPLIC=
data is grouped, exploited during data readNETFLOWGROUPED=

Table 4.28: Problem Size (approx.) Options
Description Statement Option
number of nodesNETFLOWNNODES=
number of arcsNETFLOWNARCS=
number of nonarc variablesNETFLOWNNAS=
number of coefficientsNETFLOWNCOEFS=
number of constraintsNETFLOWNCONS=

Table 4.29: Memory Control Options
Description Statement Option
issue memory usage messages to SASLOGNETFLOWMEMREP
number of bytes to use for main memoryNETFLOWBYTES=
proportion of memory used by frequentlyNETFLOWCOREFACTOR=
accessed arrays  
maximum bytes for a single arrayNETFLOWMAXARRAYBYTES=

Table 4.30: Output Data Set Options: RESET
Description Statement Option
constrained solution data setRESETCONOUT=

Table 4.31: PRINT Statement Options
Description Statement Option
display everythingPRINTPROBLEM
display arc informationPRINTARCS
display nonarc variable informationPRINTNONARCS
display variables informationPRINTVARIABLES
display constraint informationPRINTCONSTRAINTS
display information for some arcsPRINTSOME_ARCS
display information for some nonarc variablesPRINTSOME_NONARCS
display information for some variablesPRINTSOME_VARIABLES
display information for some constraintsPRINTSOME_CONS
display information for some constraintsPRINTCON_ARCS
associated with some arcs  
display information for some constraintsPRINTCON_NONARCS
associated with some nonarc variables  
display information for some constraintsPRINTCON_VARIABLES
associated with some variables  

Table 4.32: PRINT Statement Qualifiers
Description Statement Option
produce a short reportPRINT/ SHORT
produce a long reportPRINT/ LONG
only arcs (nonarc variables) with zero flow (value)PRINT/ ZERO
only arcs (nonarc variables) with nonzero flow (value)PRINT/ NONZERO

Table 4.33: SHOW Statement Options
Description Statement Option
show problem, optimization statusSHOWSTATUS
show network model parametersSHOWNETSTMT
show data sets that have, will be createdSHOWDATA SETS

Table 4.34: Output Data Set Options: SAVE
Description Statement Option
constrained solution data setSAVECONOUT=

Table 4.35: Interior Point algorithm Options
Description Statement Option
use Interior Point algorithmNETFLOWINTPOINT
allowed amount of dual infeasibilityRESETTOLDINF=
allowed amount of primal infeasibilityRESETTOLPINF=
cut-off tolerance for Cholesky factorizationRESETCHOLTINYTOL=
density threshold for Cholesky processingRESETDENSETHR=
maximum number of Interior Point algorithm iterationsRESETMAXITERB=
Primal-Dual (Duality) gap toleranceRESETPDGAPTOL=
step-length multiplierRESETPDSTEPMULT=
preprocessing typeRESETPRSLTYPE=

Chapter Contents
Chapter Contents

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.