Truncated Non-Backtracking Spectral Distance
- TNBSD is a pseudometric that quantifies differences between graphs by comparing their leading non-backtracking eigenvalues after spectral truncation.
- The method employs 2-core extraction and efficient eigensolvers to capture key structural motifs like cycles, hubs, and triangle densities in large networks.
- Empirical studies show TNBSD effectively discriminates between synthetic and real-world graphs, though its performance relies on careful selection of the truncation parameter.
The Truncated Non-Backtracking Spectral Distance (TNBSD) is a pseudometric for quantifying the dissimilarity between undirected, unweighted graphs, grounded in the spectral properties of the non-backtracking (Hashimoto) operator. It furnishes a theoretically principled means to compare complex networks by extracting, truncating, and measuring differences between their dominant non-backtracking eigenvalues. TNBSD captures topological features such as cycles, the presence of hubs, and triangle density, and enables scalable, interpretable graph comparison for large-scale network data (Torres et al., 2018, Mellor et al., 2018).
1. The Non-Backtracking Matrix and Its Spectral Properties
Let denote a simple undirected graph with nodes and edges. Each undirected edge is replaced by two oriented edges, and , creating $2m$ oriented edges indexed as . The non-backtracking matrix is defined on this space:
or equivalently, 0, with 1 the Kronecker delta. 2 encodes the adjacency of oriented edges such that a walk proceeds without immediately retracing its last step. The spectrum of 3 consists of 4 (possibly complex) eigenvalues 5.
A key combinatorial property is that the trace of powers of 6 counts closed non-backtracking walks: 7 which connects directly to the “length spectrum” in algebraic topology via non-backtracking cycles.
The Ihara–Bass determinant formula provides efficient computational access to the non-backtracking spectrum and expresses its relation to familiar graph matrices: 8 where 9 is the adjacency and 0 the degree matrix. This allows all but 1 trivial eigenvalues 2 of 3 to be computed via the smaller 4 block matrix $B' = \begin{pmatrix} A & I_n - D \ I_n & 0 \end{pmatrix}$.
2. Definition and Computation of TNBSD
The TNBSD is defined as the Euclidean distance between the truncated vectors of dominant non-backtracking eigenvalues of two graphs 5 and 6. Consider the eigenvalues of 7 as 8 and those of 9 as 0, ordered in descending magnitude. For truncation parameter 1 (typically 2–3 for practical balance), define:
4
The feature vector for each graph is assembled by separating real and imaginary parts: 5 where 6.
No further normalization is required, though one can reweight real and imaginary parts to emphasize specific structural features such as triangle count or degree heterogeneity.
Algorithmically, TNBSD proceeds as:
- Leaf shaving: Remove all degree-1 vertices to extract the 2-core of each graph.
- Matrix construction: Form 7 on the 2-core.
- Spectral truncation: Compute the 8 eigenvalues of largest magnitude (9), typically via Arnoldi/Lanczos methods.
- Distance computation: Calculate the Euclidean distance between the truncated eigenvalue vectors.
Computational complexities are as follows:
| Step | Complexity | Note |
|---|---|---|
| Leaf shaving (2-core) | 0 | |
| Building 1 or 2 | 3 | 4: degree second moment |
| Sparse eigensolver | 5 | 6: number of eigenvalues |
3. Theoretical Properties and Interpretability
TNBSD possesses several theoretically desirable features:
- Pseudometric: TNBSD is non-negative, symmetric, and satisfies the triangle inequality; identity of indiscernibles holds only for isospectrality of the top 7 eigenvalues, so TNBSD is strictly a pseudometric.
- Koutra et al. axioms: 8; 9; 0 as 1.
- Stability: Small edge perturbations lead to small spectral changes (matrix perturbation bounds).
- Discriminative power: The non-backtracking spectrum can distinguish more graph structures than classic adjacency or Laplacian spectra (Torres et al., 2018).
Structural features are directly reflected in the spectrum:
- Hubs (degree heterogeneity): Higher degree variance increases the spread of imaginary parts of 2 and the total number of nonzero entries in 3.
- Triangles: 4. Triangles induce deviations in the eigenvalue cloud from the ideal circle in the complex plane.
- 2-core structure: Edges outside the 2-core correspond to the multiplicity of eigenvalue zero. Trees (acyclic graphs) yield 5 as the zero matrix.
Emphasis on specific motifs can be tuned: e.g., multiplying 6 by 7 to highlight hubs, or rescaling 8 and 9 to emphasize triangles.
4. Choice and Effects of the Truncation Parameter
The truncation parameter $2m$0 determines the number of largest-magnitude eigenvalues retained in the feature vector. Several considerations inform its selection:
- Recommended choices: $2m$1 for graphs $2m$2 and $2m$3; in heterogeneous datasets, $2m$4 across all graphs.
- Energy-based rule: Select the smallest $2m$5 capturing a significant fraction ($2m$6–$2m$7) of the $2m$8 energy: $2m$9.
- Truncation effects: Truncating can systematically underestimate the full spectral distance, with the omission bounded by the 0 norm of the discarded eigenvalues.
Empirical evidence indicates that while TNBSD is efficient and discriminative, the use of a fixed 1 can introduce sensitivity to graph size and loss of information; the full non-backtracking spectral density (as in d-NBD) is more robust across networks of varying sizes (Mellor et al., 2018).
5. Algorithmic Summary and Computational Aspects
The following pseudocode encapsulates TNBSD evaluation (Mellor et al., 2018):
9
In sparse networks with average degree 2, the dominant cost is 3 for the spectral computation. Leaf pruning significantly reduces computational burden without changing the relevant spectral information, as nodes outside the 2-core contribute only zero eigenvalues.
6. Empirical Behavior and Application Domains
Empirical results (Mellor et al., 2018) illustrate the following applications and properties:
- Benchmarking on synthetic and real networks: TNBSD (and NBD) effectively discriminate among Erdős–Rényi, Watts–Strogatz, and random regular graphs, and between diverse empirical datasets (Facebook, subway, AS, metabolic graphs).
- Embedding properties: For Watts–Strogatz graphs, the truncated spectral embedding forms a 2D manifold under PCA projection of TNBSD vectors, reflecting parametrized structural variation.
- Classification tasks: On real-world datasets, TNBSD-based 4-NN classifiers attain high performance, though performance is maximized using the full spectral density (d-NBD; 100% accuracy/precision/recall vs. 5–6\% for TNBSD, and 7\% for Laplacian spectral methods).
- Size sensitivity: TNBSD is sensitive to mismatch in graph size; d-NBD (distributional spectral density distance) remains robust as graph size varies.
A plausible implication is that TNBSD is well suited for situations where moderate truncation is computationally advantageous, but caution is warranted in heterogeneous-size or high-variance graph families unless 8 is selected adaptively.
7. Summary and Comparative Perspective
TNBSD offers a network distance that is:
- Topologically grounded—relating to non-backtracking cycles and free homotopy classes.
- Interpretable through its spectral statistics, with clear correspondence to key mesoscopic graph structures.
- Scalable for large sparse graphs, especially after 2-core reduction.
Compared with adjacency or Laplacian spectral distances, TNBSD provides greater discriminative power and richer interpretability via its tight connection to structural motifs, but truncation introduces trade-offs in robustness and sensitivity to size effects. Mellor & Grusovin observe that while TNBSD is computationally feasible and interpretably sound, best performance in graph classification and comparison is obtained by leveraging the full spectral density, motivating future research into adaptive truncation and distributional methods (Torres et al., 2018, Mellor et al., 2018).