network centrality

Social Media: Influence in Fragmented Directed Networks

Scénario de test & Cas d'usage

Business Context

A marketing agency is analyzing a social media platform with directed 'follows'. The network is fragmented (distinct communities that don't interact). They need to calculate PageRank and Closeness without the process failing due to disconnected components.
Data Preparation

Creating a directed graph with two disconnected components (Community A and Community B).

Copied!
1 
2DATA mycas.social_graph;
3INPUT follower $ leader $;
4DATALINES;
5UserA UserB UserB UserC UserC UserA UserD UserE UserE UserD ;
6 
7RUN;
8 

Étapes de réalisation

1
Calculate Directed PageRank and Closeness handling disconnected paths harmonically.
Copied!
1PROC CAS;
2 network.centrality /
3 links={name='social_graph'}
4 direction='DIRECTED'
5 pageRank='UNWEIGHT'
6 pageRankAlpha=0.85
7 close='UNWEIGHT'
8 closeNoPath='HARMONIC'
9 outNodes={name='influencers', replace=true};
10RUN;

Expected Result


The 'influencers' table is created. Despite the graph having two separate components (A-B-C and D-E), the action runs without error. 'cent_close_unwt' is calculated using the Harmonic formula to penalize unreachable nodes rather than returning infinity or erroring out. PageRank correctly identifies local leaders in both clusters.