Neural Sync Active
Spectral Graph Theory
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) with adjacency matrix A and degree matrix D=diag(d1,…,dn):
Properties
- L is symmetric positive semidefinite
- Smallest eigenvalue λ1=0 (eigenvector = 1)
- Multiplicity of 0 equals number of connected components
- xTLx=∑(i,j)∈E(xi−xj)2
3.2 Spectral Clustering
pythonfrom 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
2λ2≤ϕ(G)≤2λ2Where ϕ(G) is the conductance and λ2 is the second smallest eigenvalue of L.
Join Discord
PreviousRandomized SVDNextJohnson-Lindenstrauss