Quiz 2

Spectral Graph Theory

164 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Spectral Graph Theory ## 3.1 Graph Laplacian For graph $G = (V, E)$ with adjacency matrix $A$ and degree matrix $D = \text{diag}(d_1, \dots, d_n)$: $$ \mathbf{L} = \mathbf{D} - \mathbf{A} $$ ### Properties - $\mathbf{L}$ is symmetric positive semidefinite - Smallest eigenvalue $\lambda_1 = 0$ (eigenvector = $\math...

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=DA\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(xixj)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
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.