network

core

Description

The core action calculates the k-core decomposition of the graph. The k-core of a graph is a maximal subgraph that contains nodes of degree at least k. This action is useful for understanding the structure of a graph and identifying its most densely connected parts.

network.core { deterministic=TRUE | FALSE, direction="DIRECTED" | "UNDIRECTED", display={...}, distributed=TRUE | FALSE, graph=integer, indexOffset=integer, links={...}, linksVar={...}, logFreqTime=integer, logLevel="AGGRESSIVE" | "BASIC" | "MODERATE" | "NONE", maxTime=double, multiLinks=TRUE | FALSE, nodes={...}, nodesVar={...}, nThreads=integer, outGraphList={...}, outLinks={...}, outNodes={...}, outputTables={...}, selfLinks=TRUE | FALSE, standardizedLabels=TRUE | FALSE, standardizedLabelsOut=TRUE | FALSE, timeType="CPU" | "REAL" };
Settings
ParameterDescription
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 n (in seconds) for displaying iteration logs for some algorithms.
logLevelControls the amount of information that is displayed in the SAS log.
maxTimeSpecifies the maximum amount of time for the algorithm to spend.
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.
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 and the results.
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

This example creates a simple undirected graph to illustrate the core decomposition. The graph has 9 nodes and several links forming clusters with varying densities.

Copied!
1DATA mycas.Links;
2 INFILE DATALINES delimiter=',';
3 INPUT from $ to $ @@;
4 DATALINES;
5A,B, A,C, A,D, B,C, B,D, C,D
6E,F, E,G, F,G
7H,I
8;
9RUN;

Examples

This example calculates the core decomposition of the graph defined in the `mycas.Links` table. The results, including the core number for each node, are stored in the `mycas.OutNodes` table.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACTION network.core /
3 links={name='Links'}
4 outNodes={name='OutNodes', replace=true};
5 RUN;
6 ACTION TABLE.fetch / TABLE='OutNodes';
7 RUN;
8QUIT;
Result :
The output will be a table listing each node and its assigned core number. Nodes A, B, C, and D will be in the 2-core, nodes E, F, G in the 1-core, and nodes H, I in the 0-core (as they are part of a 1-core component but their degree within it is 1).

This example treats the graph as directed and calculates the core decomposition. The `direction` parameter is set to 'DIRECTED'. The core number for a node in a directed graph is based on its in-degree and out-degree.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACTION network.core /
3 direction='DIRECTED'
4 links={name='Links'}
5 outNodes={name='OutNodes_Directed', replace=true};
6 RUN;
7 ACTION TABLE.fetch / TABLE='OutNodes_Directed';
8 RUN;
9QUIT;
Result :
The resulting table `OutNodes_Directed` will show the core number for each node based on directed degrees. The interpretation of coreness changes, and the values will likely differ from the undirected case, reflecting the directional connectivity.

FAQ

What is the purpose of the network.core action?
What is a k-core in graph theory?
What does the 'direction' parameter control in the core action?
How can I handle very large graphs that do not fit into a single machine's memory?
What are the main output tables generated by the core action?
What information is provided in the 'ProblemSummary' and 'SolutionSummary' results?

Associated Scenarios

Use Case
Identification of Circular Fraud Rings in Banking Transactions

The bank's Fraud Department wants to identify 'synthetic identity' rings. These are groups of accounts that artificially inflate their creditworthiness by circulating money rapi...

Use Case
Influencer Impact Analysis on Large-Scale Social Graphs

A Marketing agency analyzes a massive social media dataset (Twitter/X style) to find 'Core Influencers'. Unlike simple follower counts, they want to find users who are followed ...

Use Case
Server Dependency Analysis with Self-Referencing Nodes

IT Operations is mapping server dependencies. Some legacy servers ping themselves (localhost loopback) for heartbeat checks. The team needs to identify critical dependency clust...