optNetwork

clique

Description

The 'clique' action finds maximal cliques in a graph. A clique is a subgraph where every two distinct vertices are adjacent. A maximal clique is a clique that cannot be extended by adding one more adjacent vertex. This is useful in social network analysis to find groups of people who all know each other, or in bioinformatics to identify functional modules in protein-protein interaction networks.

optNetwork.clique { cliqueNumber=TRUE | FALSE, deterministic=TRUE | FALSE, direction="DIRECTED" | "UNDIRECTED", display={...}, distributed=TRUE | FALSE, graph=integer, indexOffset=integer, links={...}, linksVar={...}, logFreqTime=integer, logLevel="AGGRESSIVE" | "BASIC" | "MODERATE" | "NONE", maxCliques=64-bit-integer | "ALL", maxLinkWeight=double, maxNodeWeight=double, maxSize=integer, maxTime=double, minLinkWeight=double, minNodeWeight=double, minSize=integer, multiLinks=TRUE | FALSE, nodes={...}, nodesVar={...}, nThreads=integer, out={...}, outGraphList={...}, outLinks={...}, outNodes={...}, outputTables={...}, selfLinks=TRUE | FALSE, standardizedLabels=TRUE | FALSE, standardizedLabelsOut=TRUE | FALSE, timeType="CPU" | "REAL" };
Settings
ParameterDescription
cliqueNumber Specifies whether to calculate the clique number of the graph.
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.
graph Specifies the in-memory graph to use.
indexOffset Specifies the index offset for identifiers in the log and results output data tables.
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.
maxCliques Specifies the maximum number of cliques to return.
maxLinkWeight Specifies the maximum sum of link weights in a clique.
maxNodeWeight Specifies the maximum sum of node weights in a clique.
maxSize Specifies the maximum number of nodes in a clique.
maxTime Specifies the maximum amount of time for the algorithm to spend.
minLinkWeight Specifies the minimum sum of link weights in a clique.
minNodeWeight Specifies the minimum sum of node weights in a clique.
minSize Specifies the minimum number of nodes in a clique.
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.
out Specifies the output data table to contain the maximal cliques.
outGraphList Specifies the output data table to contain summary information about in-memory graphs.
outLinks Specifies the output data table to contain the graph link information.
outNodes Specifies the output data table to contain the graph node information.
outputTables Lists the names of results tables to save as CAS tables on the server.
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.
timeType Specifies whether to use CPU time or real time for the maximum time limit.
Data Preparation View data prep sheet
Data Creation: Friendship Network

This dataset represents a friendship network where each link indicates a friendship between two people.

Copied!
1DATA mycas.LinkSetIn;
2 INPUT from $ to $ @@;
3 DATALINES;
4 A B A C A D B C B D B E C D C F D E D F E F E G F G
5 ;
6RUN;

Examples

This example finds all maximal cliques in the friendship network.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACTION optNetwork.clique /
3 links={name='LinkSetIn'}
4 maxCliques='ALL'
5 out={name='Cliques', replace=true};
6 RUN;
7 PRINT TABLE='Cliques';
8RUN;
Result :
The output table 'Cliques' will contain all the maximal cliques found in the graph, listing the clique ID and the nodes belonging to each clique.

This example finds all maximal cliques in the friendship network that have at most 3 members.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACTION optNetwork.clique /
3 links={name='LinkSetIn'}
4 maxCliques='ALL'
5 maxSize=3
6 out={name='Cliques_maxsize3', replace=true};
7 RUN;
8 PRINT TABLE='Cliques_maxsize3';
9RUN;
Result :
The output table 'Cliques_maxsize3' will contain only the maximal cliques with three or fewer nodes. Cliques larger than 3 nodes, such as {A, B, C, D}, will be excluded.

FAQ

What is the primary purpose of the clique action?
What is the clique number and how can I calculate it?
How can I limit the number of cliques found by the action?
Is it possible to filter the resulting cliques based on their size?
Can I filter cliques based on the sum of their link or node weights?
What are the main input tables required for the clique action?
What is the main output of the clique action?

Associated Scenarios

Use Case
Collusion Detection in Banking Transactions

A retail bank has detected suspicious activity where multiple accounts share common identifiers (IP addresses, device IDs) in a way that suggests a 'fraud ring'. The fraud depar...

Use Case
High-Volume Social Community Detection (Performance)

A social media platform wants to identify tight-knit communities within their user base to target specific group advertisements. Due to the large volume of data, the marketing t...

Use Case
Weighted Protein Complex Identification (Edge Case)

In bioinformatics, researchers are analyzing a protein-protein interaction network where each link has a 'confidence score' (weight). They need to identify functional modules (c...