optNetwork connectedComponents

Detection of Money Laundering Rings (Standard Analysis)

Scénario de test & Cas d'usage

Business Context

A retail bank needs to identify potential money laundering rings. The goal is to detect groups of accounts that frequently transact with each other but are isolated from the rest of the banking network. These 'islands' of transactions often indicate circular trading or mule networks.
About the Set : optNetwork

Network analysis and graph algorithms.

Discover all actions of optNetwork
Data Preparation

Creation of a transaction table representing transfers between accounts, forming two distinct suspicious rings and one isolated pair.

Copied!
1 
2DATA mycas.transactions;
3LENGTH from_acc $10 to_acc $10;
4INPUT from_acc $ to_acc $ amount;
5DATALINES;
6ACC_A01 ACC_A02 5000 ACC_A02 ACC_A03 4500 ACC_A03 ACC_A01 4000 ACC_B01 ACC_B02 9000 ACC_B02 ACC_B03 8500 ACC_B03 ACC_B04 2000 ACC_B04 ACC_B01 1500 ACC_X99 ACC_X98 100 ;
7 
8RUN;
9 

Étapes de réalisation

1
Load the transaction data into CAS and define it as the input graph.
Copied!
1 
2PROC CAS;
3loadtable caslib='casuser' path='transactions.sashdat';
4 
5RUN;
6 
2
Execute the connectedComponents action to assign a Group ID to every account.
Copied!
1 
2PROC CAS;
3optNetwork.connectedComponents links={name='transactions', vars={from='from_acc', to='to_acc'}} outNodes={name='account_groups', replace=true} out={name='group_stats', replace=true};
4 
5RUN;
6 

Expected Result


The action should generate two output tables. 'account_groups' will map every account (e.g., ACC_A01) to a specific component ID (e.g., 1). 'group_stats' will summarize these components, revealing that there are 3 distinct groups (The 'A' ring, the 'B' ring, and the 'X' pair) and providing the number of nodes (accounts) in each.