DS701 Session 24 — Mon Nov 30, 2026
The lecture defines three centrality measures — closeness, betweenness, and eigenvector centrality. For each one, state in a single phrase what makes a node score high, and name the karate-club member (0, the instructor, or 33, the president) that each measure ranked first.
The global minimum cut of the karate-club graph has cost 1: it slices off node 11, which has a single edge. Explain why this “best” cut is useless for partitioning the club, and how the isoperimetric ratio \(\alpha = E(U, V\setminus U)/\min(|U|, |V\setminus U|)\) changes the goal so that a cut like Zachary’s two factions wins instead.
Spectral clustering embeds each node as a point in \(\mathbb{R}^d\) using eigenvectors of the Laplacian \(L = D - A\), then runs \(k\)-means on those points. (a) Which eigenvectors are used, and why is the eigenvector for the smallest eigenvalue excluded? (b) Name the two earlier tools from this course this procedure combines, and say in one sentence why the Laplacian eigenvectors are a sensible set of coordinates for the nodes.
Every measure answers “which nodes matter?” — but each encodes a different notion of mattering:

Same club, three colourings. The leaders (0, 33) top everything; the rest of the ranking is where the measures part ways — closeness is nearly flat, betweenness is zero for most and large for two or three brokers, eigenvector centrality lives inside the two dense factions.
\[ x_i = \frac{1}{\lambda}\sum_{j} A_{ij}\,x_j \qquad\Longleftrightarrow\qquad A\mathbf{x} = \lambda\mathbf{x} \]
nx.eigenvector_centrality.The lecture stops at \(A\mathbf{x} = \lambda\mathbf{x}\); the Web needed two fixes. A random surfer on a page follows a random link with probability \(d\), and jumps to a uniformly random page with probability \(1-d\) (damping, \(d = 0.85\)).
\[ \text{PR}(i) \;=\; \frac{1-d}{n} \;+\; d\sum_{j \to i} \frac{\text{PR}(j)}{\deg^{\text{out}}(j)} \qquad\Longleftrightarrow\qquad \mathbf{r} = \mathbf{G}\,\mathbf{r},\quad \mathbf{G} = d\,A^{T}D^{-1} + \frac{1-d}{n}\mathbf{1}\mathbf{1}^T \]

Right panel: the sign of the Fiedler vector on the unweighted karate club — 10 edges, sides 19 / 15, \(\alpha \approx 0.67\). (The lecture’s nx.fiedler_vector call used the edge weights NetworkX ships with the karate club, which moves nodes 2 and 9 across; the story is the same.)
\[ L = D - A, \qquad \mathbf{x}^T L\mathbf{x} = \sum_{(i,j)\in E}(x_i - x_j)^2 \;\ge 0 \]

Football network: sweep \(d\), score against the real conferences with ARI → peaks near \(d \approx 6\). Two-way spectral partitioning is the \(d = 1\), \(k = 2\) special case.
Finding groups of nodes that are densely connected inside and sparsely connected between is called community detection; spectral clustering is one standard method for it, and modularity maximisation (e.g. Louvain, nx.community.louvain_communities) is the other one you will meet most often.
| you are asking … | report |
|---|---|
| who can reach everyone fastest (spread a rumour, place a depot)? | closeness |
| whose removal breaks the most shortest paths (broker, bottleneck, gatekeeper)? | betweenness |
| who is connected to the well-connected (prestige, status)? | eigenvector |
| the same, but each node’s vote is diluted by how many it gives (links, citations)? | PageRank |
| who simply has the most contacts? | degree |
On the karate club the top two agree and hide this. Today’s stretch section hands you a graph built so that they do not: a hub wins degree and eigenvector centrality, a low-degree bridge wins betweenness, and a modest connector wins closeness — then you decide which one a client asking “who is influential?” should hear about.
Goal: compute closeness, betweenness and eigenvector centrality on a real network (power iteration for the last), build PageRank with damping \(d = 0.85\) from scratch and check it against NetworkX, spectrally partition the same network with the Fiedler vector — then take a planted graph whose five centrality measures crown different nodes, tabulate and correlate the rankings, and match measures to questions.
numpy, pandas, matplotlib, networkx.The activity notebook goes live on the day of the lecture. Colab is optional — you can also open it on GitHub and run it locally.
Full lecture notes: Network Centrality and Clustering
Wed Dec 2, in class — closed notes, paper and pencil, covering lectures 14–21 (causal inference, neural networks, NLP, recommenders, networks). Today was the last content session.