On Spectral Graph Intuition
Spectral methods often look intimidating because they start with linear algebra notation. In practice, the idea is straightforward: construct a matrix that captures neighborhood relationships, then inspect directions of maximum variation.
For a graph Laplacian $L = D - A$, the second smallest eigenvalue gives a useful signal about connectivity. A small value suggests weakly connected communities.
import numpy as np
def normalized_laplacian(adj):
degree = np.diag(adj.sum(axis=1))
inv_sqrt = np.diag(1.0 / np.sqrt(np.maximum(np.diag(degree), 1e-12)))
return np.eye(adj.shape[0]) - inv_sqrt @ adj @ inv_sqrt
The practical takeaway is editorial rather than purely theoretical: start by plotting, then verify with decomposition.