Available on crate feature
communities only.Expand description
Spectral community detection ported from xgi/communities/spectral.py.
spectral_clustering builds the normalized hypergraph Laplacian (formula from the
Phase-3 linalg/laplacian_matrix.py, inlined here for self-containment), extracts the
k smallest-eigenvalue eigenvectors via hand-rolled power iteration + Hotelling
deflation (the dependency probe found no LAPACK-free ndarray eigensolver), and runs
Forgy k-means. Exact XGI parity is impossible (RNG divergence, spec §9.4); assertions
are structural, and results are deterministic under a fixed seed.
Enums§
- Spectral
Error - Errors raised by spectral clustering.
Functions§
- kmeans
- Forgy-initialized k-means over the rows of
x. - normalized_
laplacian - The dense normalized hypergraph Laplacian and its row→node-id map.
- smallest_
k_ eigenvectors - The
ksmallest-eigenvalue eigenvectors of the symmetric matrixl, as columns. - spectral_
clustering - Spectral clustering of a hypergraph into
kpartitions.