The OPTGRAPH Procedure

SHORTPATH Statement

  • SHORTPATH < options >;

The SHORTPATH statement invokes an algorithm that calculates shortest paths between sets of nodes on the input graph.

The shortest path algorithm is described in the section Shortest Path.

You can specify the following options in the SHORTPATH statement:

LOGFREQ=number

displays iteration logs for shortest path calculations every number nodes. The value of number can be any integer greater than or equal to 1. The default is determined automatically based on the size of the graph. Setting this value too low can hurt performance on large-scale graphs.

LOGLEVEL=number

controls the amount of information that is displayed in the SAS log. Table 1.37 describes the valid values for this option.

Table 1.37: Values for LOGLEVEL= Option

number

string

Description

0

NONE

Turns off all algorithm-related messages in the SAS log

1

BASIC

Displays a basic summary of the algorithmic processing

2

MODERATE

Displays a summary of the algorithmic processing

3

AGGRESSIVE

Displays a detailed summary of the algorithmic processing


The default is the value that is specified in the LOGLEVEL= option in the PROC OPTGRAPH statement (or BASIC if that option is not specified).

OUT_PATHS=SAS-data-set
OUT=SAS-data-set

specifies the output data set to contain the shortest paths.

OUT_WEIGHTS=SAS-data-set

specifies the output data set to contain the shortest path summaries.

PATHS=ALL | SHORTEST | LONGEST

specifies the type of output to produce in the output data set that is specified in the OUT_PATHS= option.

Table 1.38: Values for the PATHS= Option

Option Value

Description

ALL

Outputs shortest paths for all pairs of source-sinks.

LONGEST

Outputs shortest paths for the source-sink pair with the longest (finite) length. If other source-sink pairs (up to 100) have equally long length, they are also output.

SHORTEST

Outputs shortest paths for the source-sink pair with the shortest length. If other source-sink pairs (up to 100) have equally short length, they are also output.


By default, PATHS=ALL.

SINK=sink-node

specifies the sink node for shortest paths calculations. This setting overrides the use of the variable sink in the data set that is specified in the DATA_NODES_SUB= option in the PROC OPTGRAPH statement.

SOURCE=source-node

specifies the source node for shortest paths calculations. This setting overrides the use of the variable source in the data set that is specified in the DATA_NODES_SUB= option in the PROC OPTGRAPH statement.

USEWEIGHT=YES | NO

specifies whether to use link weights (if they exist) in calculating shortest paths.

Table 1.39: Values for the WEIGHT= Option

Option Value

Description

YES

Uses weights (if they exist) in shortest path calculations. This is the default.

NO

Does not use weights in shortest path calculations.


WEIGHT2=column

specifies the data set variable name for the auxiliary link weights. The value of column must be numeric.