Network and Graph Analytics

Network & Graph Analytics

Overview

Network (graph) analytics models data as nodes (vertices) connected by edges (links) and measures the resulting structure to answer questions that row/column tables cannot: who is influential, what clusters exist, what is the shortest path, what links are likely to form. It is the analytics counterpart to graph theory — the goal is insight from relationships, not just storing them.

Use a graph framing when the connections carry the signal: social networks, fraud rings, supply chains, citation/co-authorship, recommendation, knowledge graphs, dependency graphs, transaction flows. If the question is answerable with a GROUP BY, you probably do not need a graph.

This skill is the network/graph node of the data-analytics curriculum (da-1 onward).

Core Concepts

1. Graph representations

2. Connectivity & paths

3. Centrality (who matters)

4. Community detection (what clusters)

Local proximity scores for non-adjacent pairs x,y (Γ = neighbor set):

6. Network motifs & bipartite projection

7. Graph embeddings (nodes → vectors)

8. GNN basics for analytics

Tools / Frameworks

Tool Backend Best for Notes
NetworkX pure Python prototyping, graphs up to ~10⁴–10⁵ nodes richest API; 40–250× slower than C libs
igraph C (Python/R) medium-large graphs, single machine fast, mature
graph-tool C++/Boost + OpenMP large graphs, parallel centrality/PageRank fastest CPU lib when OpenMP enabled; SBM inference
cuGraph (RAPIDS) GPU/CUDA very large graphs, vertex-centric ops up to ~870× over igraph; ~0.2s PageRank where igraph takes ~60s
Neo4j GDS JVM, in-DB enterprise graphs in a graph DB 65+ algorithms (PageRank, Louvain, Leiden, node2vec, FastRP, link prediction)
PyG / DGL PyTorch GNN training (GCN, GraphSAGE) embeddings and supervised graph ML

Rule of thumb: prototype in NetworkX, move to igraph/graph-tool when slow, cuGraph when huge, Neo4j GDS when the graph already lives in Neo4j.

Methodology

  1. Frame the question as a graph — define node, edge, direction, weight. Wrong definition dooms everything downstream.
  2. Build & sanity-check — node/edge counts, degree distribution (expect heavy tails), components, density. Restrict to the giant component when appropriate.
  3. Match analytic to question: influence → centrality (PageRank default); clusters → community detection (Leiden default); reachability → components/shortest paths; missing links → link prediction or embeddings.
  4. Scale-match the tool before running O(VE) measures.
  5. Validate — compare against a null model; check modularity and stability across seeds; for link prediction use a temporal train/test split and AUC/precision@k.
  6. Communicate — layouts for small graphs only (<~1k nodes); for large graphs report metrics, ranked tables, community summaries — not hairball plots.

Practical Patterns

Anti-Patterns

Troubleshooting

References