cds2.spectral
Spectral graph theory - Laplacians, Fiedler vectors, algebraic connectivity and spectral clustering.
Spectral graph theory: Laplacians, Fiedler vectors, spectral clustering.
laplacian(adj, normalized=False)
Graph Laplacian L = D - W (combinatorial or symmetric-normalized).
Source code in src/cds2/spectral.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
fiedler_vector(adj, seed=None)
Eigenvector of the second-smallest Laplacian eigenvalue.
Signs separate the two sides of the best bipartition. The Lanczos start
vector is derived from seed, so equal seeds give identical vectors.
Source code in src/cds2/spectral.py
55 56 57 58 59 60 61 62 63 64 65 66 67 | |
algebraic_connectivity(adj)
Second-smallest Laplacian eigenvalue - global connectivity measure.
Source code in src/cds2/spectral.py
70 71 72 73 74 75 76 77 78 | |
spectral_cluster(adj, n_clusters, seed=None, normalized=True)
Cluster graph nodes by k-means on the bottom Laplacian eigenvectors.
Source code in src/cds2/spectral.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |