The community action detects communities in a graph. It is a fundamental tool for understanding the structure of a network. In a social network, for example, communities can represent groups of friends or colleagues.
| Parameter | Description |
|---|---|
| algorithm | Specifies the algorithm to use for community detection. Can be 'LABELPROPAGATION' or 'LOUVAIN'. |
| deterministic | When set to True, ensures that each invocation (with the same machine configuration and parameter settings) produces the same final result. |
| direction | Specifies whether to consider the input graph as directed or undirected. |
| display | Specifies a list of results tables to send to the client for display. |
| distributed | When set to True, uses a distributed graph for processing. |
| fix | Specifies the variable that defines groups of nodes to fix together for community detection. |
| graph | Specifies the in-memory graph to use for the analysis. |
| indexOffset | Specifies the index offset for identifiers in the log and results output data tables. |
| labelUpdateMode | Specifies whether nodes update their labels according to the labels of their neighbors at the current iteration (ASYNCHRONOUS) or the previous iteration (SYNCHRONOUS). |
| linkRemovalRatio | Specifies the percentage of small-weight links to be removed around each node neighborhood. |
| links | Specifies the input data table that contains the graph link information. |
| linksVar | Specifies the data variable names for the links table. |
| logFreqTime | Controls the frequency in seconds for displaying iteration logs. |
| logLevel | Controls the amount of information that is displayed in the SAS log. |
| maxIters | Specifies the maximum number of iterations that the algorithm can run. |
| multiLinks | When set to True, includes multilinks when an input graph is read. |
| nodes | Specifies the input data table that contains the graph node information. |
| nodesVar | Specifies the data variable names for the nodes table. |
| nThreads | Specifies the maximum number of threads to use for multithreaded processing. |
| outCommLinks | Specifies the output data table to describe the links between each community. |
| outCommunity | Specifies the output data table to contain properties about each community. |
| outGraphList | Specifies the output data table to contain summary information about in-memory graphs. |
| outLevel | Specifies the output data table to contain community information at different resolution levels. |
| outLinks | Specifies the output data table to contain the graph link information along with any results from the algorithms that calculate metrics on links. |
| outNodes | Specifies the output data table to contain the graph node information along with any results from the algorithms that calculate metrics on nodes. |
| outOverlap | Specifies the output data table to describe the intensity of each node's membership to multiple communities. |
| outputTables | Lists the names of results tables to save as CAS tables on the server. |
| recursive | Breaks down large communities into smaller ones until the specified conditions are satisfied. |
| resolutionList | Specifies a list of resolution values for community detection. |
| selfLinks | When set to True, includes self-links when an input graph is read. |
| standardizedLabels | When set to True, specifies that the input graph data are in a standardized format. |
| standardizedLabelsOut | When set to True, requests that the output graph data include standardized format. |
| tolerance | Specifies the tolerance value for when to stop iterations. |
| warmStart | Specifies the variable that defines initial community identifiers for warm starting community detection. |
This example uses the `mycas.LinkSetIn` data table to represent the links of a graph. The `from` and `to` columns define the nodes of the links, and the `weight` column provides the link weights.
| 1 | DATA mycas.LinkSetIn; |
| 2 | INFILE DATALINES delimiter=','; |
| 3 | INPUT from $ to $ weight; |
| 4 | DATALINES; |
| 5 | A,B,1 |
| 6 | A,C,1 |
| 7 | A,D,1 |
| 8 | B,C,1 |
| 9 | B,D,1 |
| 10 | C,D,1 |
| 11 | E,F,1 |
| 12 | E,G,1 |
| 13 | F,G,1 |
| 14 | ; |
| 15 | RUN; |
This example illustrates the use of the community detection algorithm on an undirected graph. It produces several output tables detailing the communities, nodes, links, and other properties.
| 1 | PROC CAS; |
| 2 | ACTION network.community / |
| 3 | links = {name = "LinkSetIn"} |
| 4 | outNodes = {name = "NodeSetOut", replace=true} |
| 5 | outLinks = {name = "LinkSetOut", replace=true} |
| 6 | outLevel = {name = "LevelSetOut", replace=true} |
| 7 | outCommunity = {name = "CommSetOut", replace=true} |
| 8 | outOverlap = {name = "OverlapSetOut", replace=true} |
| 9 | outCommLinks = {name = "CommLinkSetOut", replace=true}; |
| 10 | RUN; |
| 11 | QUIT; |
This example illustrates the use of the community detection algorithm on a directed graph. The `direction` parameter is set to 'DIRECTED'.
| 1 | PROC CAS; |
| 2 | ACTION network.community / |
| 3 | direction = "directed" |
| 4 | links = {name = "LinkSetIn", |
| 5 | vars = {"from", "to", "weight"}} |
| 6 | outNodes = {name = "NodeSetOut", replace=true}; |
| 7 | RUN; |
| 8 | QUIT; |
A financial institution wants to identify potential money laundering rings where funds circulate in a closed loop between accounts. Since money flow is directional, the analysis...
A marketing firm analyzes a large social network. The initial communities are too large to be actionable for targeted campaigns. They need to recursively break down these giant ...
An IT department maps server dependencies. Some servers (like gateways) belong to multiple subsystems. The goal is to identify these 'bridge' servers (Overlap) and analyze the n...