NETWORK Procedure

CONNECTEDCOMPONENTS Statement

  • CONNECTEDCOMPONENTS < options >;

The CONNECTEDCOMPONENTS statement invokes an algorithm that finds the connected components of the input graph. For more information about connected components, see the section Connected Components. You can specify the following options:

ALGORITHM=AUTOMATIC | AFFOREST | DFS | UNIONFIND

specifies the algorithm to use for calculating connected components. You can specify the following values:

AUTOMATIC

uses the union-find or afforest algorithm for undirected graphs and the depth-first search algorithm for directed graphs.

AFFOREST

uses the afforest algorithm for connected components. You can use this algorithm only with undirected graphs.

DFS

uses the depth-first search algorithm for connected components.

UNIONFIND

uses the union-find algorithm for connected components. You can use this algorithm only with undirected graphs. You can also execute this algorithm in a distributed manner across multiple machines by specifying DISTRIBUTED=TRUE in the PROC NETWORK statement.

By default, ALGORITHM=AUTOMATIC.

OUT=libref.data-table

specifies the output data table to contain the connected components summary results. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs in Chapter 1, Introduction.

Last updated: February 09, 2026