The NETWORK Procedure

COMMUNITY Statement

  • COMMUNITY < options >;

The COMMUNITY statement invokes an algorithm that detects communities in the input graph. For more information about community detection, see the section Community Detection.

You can specify the following options:

ALGORITHM=LABELPROPAGATION | LOUVAIN

specifies the algorithm to use for community detection. You can specify the following values:

LABELPROPAGATION

uses the label propagation algorithm proposed by Raghavan, Albert, and Kumara (2007).

LOUVAIN

uses the Louvain algorithm proposed by Blondel et al. (2008).

By default, ALGORITHM=LOUVAIN.

FIX=column

specifies which data variable defines groups of nodes to fix together in a community. Each value of the variable must be a 32-bit integer greater than or equal to 0 or missing. You cannot use this option when ALGORITHM=LABELPROPAGATION unless LABELUPDATEMODE=ASYNCHRONOUS.

LABELUPDATEMODE=ASYNCHRONOUS | SYNCHRONOUS

specifies whether nodes update their labels according to the labels of their neighbors at the current iteration (asynchronous) or the previous iteration (synchronous). This option is ignored unless you specify ALGORITHM=LABELPROPAGATION. By default, LABELUPDATEMODE=SYNCHRONOUS.

LINKREMOVALRATIO=number

specifies the percentage of small-weight links to be removed around each node neighborhood. A link is usually removed if its weight is relatively smaller than the weights of the neighboring links. Suppose that node A links to node B and to node C, link upper A right-arrow upper B has a weight of 100, and link upper A right-arrow upper C has a weight of 1. When nodes are grouped into communities, link upper A right-arrow upper B is much more important than link upper A right-arrow upper C because it contributes much more to the overall modularity value. If you specify this option, then the algorithm ignores any link whose weight is less than (number/100)*max_link_weight, where max_link_weight is the maximum link weight among all links incident to the same node. This option can often dramatically improve the running time for large graphs. The valid range is between 0 and 100. By default, LINKREMOVALRATIO=10.

MAXITERS=number

specifies the maximum number of iterations that the algorithm can run. By default, MAXITERS=20 when ALGORITHM=LOUVAIN or MAXITERS=100 when ALGORITHM=LABELPROPAGATION.

OUTCOMMLINKS=CAS-libref.data-table

specifies the output data table to describe the links between communities. If you also specify the RECURSIVE option, PROC NETWORK ignores the OUTCOMMLINKS= option. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, 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.

OUTCOMMUNITY=CAS-libref.data-table

specifies the output data table to contain properties about each community. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, 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.

OUTLEVEL=CAS-libref.data-table

specifies the output data table to contain community information at different resolution levels. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, 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.

OUTOVERLAP=CAS-libref.data-table

specifies the output data table to describe the intensity of each node. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, 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.

RANDOMFACTOR=number

specifies the random factor for the parallel label propagation algorithm. At each iteration, number times 100% of the nodes are randomly selected to skip the label propagation step. Specify a number between 0 and 1. The default is 0.15, which means that 15% of nodes skip the label propagation step at each iteration.

RANDOMSEED=number

specifies the random seed for the parallel label propagation algorithm. At each iteration, some nodes are randomly selected to skip the label propagation step, based on the value that you specify in the RANDOMFACTOR= option. To choose a different set of random samples, specify a number in the RANDOMSEED= option. By default, RANDOMSEED=1234.

RECURSIVE (options)

breaks down large communities into smaller ones until the specified conditions are satisfied. This option starts with the keyword RECURSIVE followed by any combination of three suboptions enclosed in parentheses—for example, RECURSIVE (MAXCOMMSIZE=500) or RECURSIVE (MAXCOMMSIZE=1000 MAXDIAMETER=3 RELATION=AND).

You can specify the following options:

MAXCOMMSIZE=

specifies the maximum number of nodes to be contained in any community. The default is the largest number that can be represented by a 32-bit integer.

MAXDIAMETER=

specifies the maximum number of links on the shortest paths between any pair of nodes in any community. This option is ignored when you specify ALGORITHM=LABELPROPAGATION and LABELUPDATEMODE=SYNCHRONOUS. The default is the largest number that can be represented by a 32-bit integer.

RELATION=

the relationship between the values of MAXCOMMSIZE= and MAXDIAMETER= options. If RELATION=AND, then recursive splitting continues until both of the MAXCOMMSIZE and MAXDIAMETER conditions are satisfied. If RELATION=OR, then recursive splitting continues until either the MAXCOMMSIZE or the MAXDIAMETER condition is satisfied.

RESOLUTIONLIST=num_list

specifies a list of resolution values (nonnegative numbers) that are separated by spaces (for example, 4.3 2.1 1.0 0.6 0.2). The NETWORK procedure interprets the RESOLUTIONLIST= option differently depending on the value of the ALGORITHM= option:

  • When ALGORITHM=LABELPROPAGATION, if LABELUPDATEMODE=ASYNCHRONOUS, then PROC NETWORK ignores the RESOLUTIONLIST= option and uses the default value of 0. If LABELUPDATEMODE=SYNCHRONOUS, then RESOLUTIONLIST=0.001 by default. In this case, specifying multiple resolution values causes PROC NETWORK to perform community detection multiple times, each time with a different resolution value, and the RESOLUTIONLIST= option is fully compatible with the RECURSIVE option.

  • When ALGORITHM=LOUVAIN, specifying multiple resolution values enables you to see how communities are merged at various resolution levels. A larger parameter value indicates a higher resolution. For example, resolution 4.3 produces more communities than resolution 0.2. If you also specify the RECURSIVE option, PROC NETWORK ignores the RESOLUTIONLIST= option and uses the default value of 1.0.

For more information about the use of the RESOLUTIONLIST= option, see the section Large Communities.

TOLERANCE=number
MODULARITY=number

specifies the tolerance value for when to stop iterations. When ALGORITHM=LOUVAIN, the algorithm stops iterations when the fraction of modularity gain between two consecutive iterations is less than number. When ALGORITHM=LABELPROPAGATION, the algorithm stops iterations when the fraction of label changes for all nodes in the graph is less than number. The valid range is strictly between 0 and 1. By default, TOLERANCE=0.05 if ALGORITHM=LABELPROPAGATION and LABELUPDATEMODE=SYNCHRONOUS; otherwise TOLERANCE=0.001.

WARMSTART=column

specifies which data variable defines the initial node partition for warm starting community detection. Each value of the variable must be a 32-bit integer greater than or equal to 0 or missing.

Last updated: November 22, 2022