The Network Solver

Input Data for the Network Solver

This section describes how you can import and export node, link, and problem data from and to SAS data sets and how you can solve problems over a subgraph without changing your original sets. The section Graph Input Data describes how to load node and link data in some common formats. The section Solving over Subsets of Nodes and Links (Filters) describes subgraphs and how to access the objective value of a network problem.

Graph Input Data

This section describes how to input a graph for analysis by the network solver. Because PROC OPTMODEL uses node and link attributes that are indexed over the sets of nodes and links, you need to provide only node and link attributes. PROC OPTMODEL infers the graph from the attributes you provide. When a documented default value exists for the attribute of a link or a node, you need to provide only the values that differ from the default. For example, the section Minimum-Cost Network Flow assumes that the link flow upper bound is $\infty $. You need to specify only the finite upper bounds.

Consider the directed graph shown in Figure 9.5.

Figure 9.5: A Simple Directed Graph

A Simple Directed Graph


Each node and link has associated attributes: a node label and a link weight.

None of the algorithms in PROC OPTMODEL support Null Graphs, i.e., graphs with 0 nodes. PROC OPTMODEL will usually raise a semantic error and stop processing any remaining statements in a block if after processing its inputs it determines that the graph is null. If the graph definition itself is not null, but the graph to be passed to the solver after applying the SUBGRAPH= option is null, then the predeclared parameter _SOLUTION_STATUS_ will be set to NULL_GRAPH. For more information, see Solving over Subsets of Nodes and Links (Filters).

Matrix Input Data

The contents of a table can be represented as a graph. The relationships between two sets of nodes, $N_1$ and $N_2$, can be represented by a $|N_1|$ by $|N_2|$ incidence matrix A, in which $N_1$ is the set of rows and $N_2$ is the set of columns.

To read a matrix that is stored in a data set into PROC OPTMODEL, you need to take two extra steps:

  1. Determine the name of each numeric variable that you want to use. PROC CONTENTS can be useful for this task.

  2. Use an iterated READ DATA statement.

For more information, see Example 9.3: Linear Assignment Problem for Minimizing Swim Times.