English

Efficient Exact Resistance Distance Computation on Small-Treewidth Graphs: a Labelling Approach

Databases 2025-09-08 v1 Discrete Mathematics Data Structures and Algorithms Machine Learning

Abstract

Resistance distance computation is a fundamental problem in graph analysis, yet existing random walk-based methods are limited to approximate solutions and suffer from poor efficiency on small-treewidth graphs (e.g., road networks). In contrast, shortest-path distance computation achieves remarkable efficiency on such graphs by leveraging cut properties and tree decompositions. Motivated by this disparity, we first analyze the cut property of resistance distance. While a direct generalization proves impractical due to costly matrix operations, we overcome this limitation by integrating tree decompositions, revealing that the resistance distance r(s,t)r(s,t) depends only on labels along the paths from ss and tt to the root of the decomposition. This insight enables compact labelling structures. Based on this, we propose \treeindex, a novel index method that constructs a resistance distance labelling of size O(nhG)O(n \cdot h_{\mathcal{G}}) in O(nhG2dmax)O(n \cdot h_{\mathcal{G}}^2 \cdot d_{\max}) time, where hGh_{\mathcal{G}} (tree height) and dmaxd_{\max} (maximum degree) behave as small constants in many real-world small-treewidth graphs (e.g., road networks). Our labelling supports exact single-pair queries in O(hG)O(h_{\mathcal{G}}) time and single-source queries in O(nhG)O(n \cdot h_{\mathcal{G}}) time. Extensive experiments show that TreeIndex substantially outperforms state-of-the-art approaches. For instance, on the full USA road network, it constructs a 405405 GB labelling in 77 hours (single-threaded) and answers exact single-pair queries in 10310^{-3} seconds and single-source queries in 190190 seconds--the first exact method scalable to such large graphs.

Keywords

Cite

@article{arxiv.2509.05129,
  title  = {Efficient Exact Resistance Distance Computation on Small-Treewidth Graphs: a Labelling Approach},
  author = {Meihao Liao and Yueyang Pan and Rong-Hua Li and Guoren Wang},
  journal= {arXiv preprint arXiv:2509.05129},
  year   = {2025}
}

Comments

Accepted by SIGMOD 2026

R2 v1 2026-07-01T05:23:10.889Z