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
cliqueNumberSpecifies whether to calculate the clique number of the graph.
deterministicWhen set to True, ensures that each invocation (with the same machine configuration and parameter settings) produces the same final result.
directionSpecifies whether to consider the input graph as directed or undirected.
displaySpecifies a list of results tables to send to the client for display.
distributedWhen set to True, uses a distributed graph.
graphSpecifies the in-memory graph to use.
indexOffsetSpecifies the index offset for identifiers in the log and results output data tables.
linksSpecifies the input data table that contains the graph link information.
linksVarSpecifies the data variable names for the links table.
logFreqTimeControls the frequency in seconds for displaying iteration logs.
logLevelControls the amount of information that is displayed in the SAS log.
maxCliquesSpecifies the maximum number of cliques to return.
maxLinkWeightSpecifies the maximum sum of link weights in a clique.
maxNodeWeightSpecifies the maximum sum of node weights in a clique.
maxSizeSpecifies the maximum number of nodes in a clique.
maxTimeSpecifies the maximum amount of time for the algorithm to spend.
minLinkWeightSpecifies the minimum sum of link weights in a clique.
minNodeWeightSpecifies the minimum sum of node weights in a clique.
minSizeSpecifies the minimum number of nodes in a clique.
multiLinksWhen set to True, includes multilinks when an input graph is read.
nodesSpecifies the input data table that contains the graph node information.
nodesVarSpecifies the data variable names for the nodes table.
nThreadsSpecifies the maximum number of threads to use for multithreaded processing.
outSpecifies the output data table to contain the maximal cliques.
outGraphListSpecifies the output data table to contain summary information about in-memory graphs.
outLinksSpecifies the output data table to contain the graph link information.
outNodesSpecifies the output data table to contain the graph node information.
outputTablesLists the names of results tables to save as CAS tables on the server.
selfLinksWhen set to True, includes self-links when an input graph is read.
standardizedLabelsWhen set to True, specifies that the input graph data are in a standardized format.
standardizedLabelsOutWhen set to True, requests that the output graph data include standardized format.
timeTypeSpecifies 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?