Registry Synced

Spectral Graph Theory

164 words
1 min read

Reading compass

Now · 3.1 Graph Laplacian

Spectral Graph Theory

3.1 Graph Laplacian

For graph G=(V,E)G = (V, E) with adjacency matrix AA and degree matrix D=diag(d1,…,dn)D = \text{diag}(d_1, \dots, d_n):
L=D−A\mathbf{L} = \mathbf{D} - \mathbf{A}

Properties

  • L\mathbf{L} is symmetric positive semidefinite
  • Smallest eigenvalue λ1=0\lambda_1 = 0 (eigenvector = 1\mathbf{1})
  • Multiplicity of 0 equals number of connected components
  • xTLx=∑(i,j)∈E(xi−xj)2\mathbf{x}^T\mathbf{L}\mathbf{x} = \sum_{(i,j) \in E} (x_i - x_j)^2

3.2 Spectral Clustering

python
from sklearn.cluster import KMeans
import numpy as np
# Affinity matrix
A = np.random.randn(100, 100)
A = A @ A.T  # make symmetric
# Graph Laplacian
D = np.diag(np.sum(A, axis=1))
L = D - A
# Eigendecomposition
eigvals, eigvecs = np.linalg.eigh(L)
# Use bottom k eigenvectors for clustering
k = 3
X = eigvecs[:, :k]
kmeans = KMeans(n_clusters=k).fit(X)
labels = kmeans.labels_

3.3 Cheeger's Inequality

λ22≤ϕ(G)≤2λ2\frac{\lambda_2}{2} \leq \phi(G) \leq \sqrt{2\lambda_2}
Where ϕ(G)\phi(G) is the conductance and λ2\lambda_2 is the second smallest eigenvalue of L\mathbf{L}. Join Discord PreviousRandomized SVDNextJohnson-Lindenstrauss
Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.