Determinant-Preserving Sparsification of SDDM Matrices with Applications to Counting and Sampling Spanning Trees

David Durfee, John Peebles, Richard Peng, Anup B. RaoFOCS 2017

Abstract

This paper presents a novel approach to graph sparsification that preserves the determinant of Symmetric Diagonally Dominant M-matrices (SDDM), such as graph Laplacians. While traditional spectral sparsification reduces graphs to $O(n \log n)$ edges to preserve eigenvalues, it fails to preserve their product—the determinant—due to exponential error accumulation. We introduce a routine that sparsifies graphs to approximately $n^{1.5}$ edges while maintaining the determinant and the distribution of spanning trees. By integrating this technique with recursive Schur complements and approximate Cholesky factorizations, we provide algorithms for counting and sampling spanning trees in $\tilde{O}(n^2 \delta^{-2})$ time. These results represent the first routines for SDDM matrices that outperform general-purpose matrix determinant algorithms on dense graphs.

Introduction

In combinatorial optimization and network analysis, two fundamental problems are counting the total number of spanning trees in a graph and sampling a spanning tree uniformly at random. Kirchhoff’s Matrix-Tree Theorem establishes that the number of spanning trees is equal to the determinant of any minor of the graph Laplacian. For a graph with $n$ vertices and $m$ edges, the standard approach to computing this determinant involves general matrix multiplication, which requires $O(n^\omega)$ time (where $\omega \approx 2.37$).

While spectral sparsification has revolutionized many graph algorithms by reducing edge counts to near-linear levels, it is inherently ill-suited for determinant-based tasks. Because the determinant is the product of a matrix's eigenvalues, even a small $(1 \pm \epsilon)$ error in each eigenvalue compounds to a $(1 \pm \epsilon)^n$ error in the determinant. To address this, we must rethink sparsification through a combinatorial lens that prioritizes the preservation of the tree distribution.

Determinant-Preserving Sparsification

The $n^{1.5}$ Density Threshold

The core contribution of this work is the identification of a new density threshold for sparsification. Unlike spectral sparsifiers that aim for $O(n)$ edges, we demonstrate that keeping approximately $n^{1.5}$ edges is both sufficient and, in cases like the complete graph, necessary to control the variance of the determinant.

Our analysis bridges the gap between linear algebra and random graph theory. We utilize combinatorial analyses originally developed by Svante Janson (1994) to show that the number of spanning trees in a random subgraph is highly concentrated if the sampling rate is sufficiently high. By sampling edges based on their statistical leverage scores (effective resistances), we can ensure that the resulting sparse graph remains a faithful representative of the original graph's determinant.

Recursive Schur Complements and Efficiency

To achieve a nearly optimal $O(n^2)$ runtime for dense graphs, the algorithm employs a recursive framework based on Schur complements. The Schur complement is essentially the graph-theoretic equivalent of Gaussian elimination, representing the "remaining" graph after a subset of vertices has been eliminated.

Explicitly constructing Schur complements is computationally expensive for dense graphs. Our approach performs "implicit" sparsification: we eliminate vertices and sparsify the resulting intermediate objects without ever building them in their full, dense form. To maintain precision during this process, we implement a two-stage rejection sampling routine. This ensures that even when we only have crude estimates of edge resistances, the final edge distribution is accurate enough to preserve the determinant.

Key Results and Applications

1. Determinant Approximation

We provide an algorithm that computes a $(1 \pm \delta)$ approximation to the determinant of any SDDM matrix with constant probability in $\tilde{O}(n^2 \delta^{-2})$ time. This is a significant breakthrough, as it is the first routine to beat general-purpose $O(n^\omega)$ determinant calculations for this class of matrices on dense graphs.

2. Spanning Tree Sampling

Beyond counting, our method enables efficient sampling. We present a routine that generates a spanning tree from a weighted undirected graph with a total variation distance of $\delta$ from the $w$-uniform distribution in $\tilde{O}(n^2 \delta^{-2})$ time. This provides a faster alternative to traditional Markov Chain Monte Carlo (MCMC) methods for dense networks.

Discussion and Future Directions

This work establishes a fundamental limit for determinant-preserving sparsification at $n^{1.5}$ edges. While this is denser than the $O(n \log n)$ edges required for spectral properties, it enables a suite of faster algorithms for tree-related problems.

Future research may explore whether this $n^{1.5}$ limit can be further reduced for specific graph families or if these techniques can be extended beyond SDDM matrices to broader classes of numerical linear algebra problems. Additionally, while our results hold with constant probability, refining the "delicate" nature of this sparsification to achieve high-probability guarantees remains an open challenge.

Summary updated

BibTeX
@inproceedings{durfee2017determinant,
  author = {David Durfee and John Peebles and Richard Peng and Anup B. Rao},
  title = {{Determinant-Preserving Sparsification of SDDM Matrices with Applications to Counting and Sampling Spanning Trees}},
  booktitle = {FOCS},
  year = {2017},
  url = {https://openreview.net/forum?id=65AG2mAf-},
}
Figure