BD-Index: Scalable Biharmonic Distance Queries on Large Graphs via Divide-and-Conquer Indexing

Yueyang Pan, Meihao Liao, Rong-Hua LiarXiv 2025 · DOI

Introduction

Biharmonic Distance (BD) is a powerful metric for graph analysis, capturing global structural properties that shortest-path distances often miss. It is particularly effective for identifying critical links in transportation networks and mitigating "over-squashing" (information bottlenecks) in Graph Neural Networks (GNNs). However, computing BD exactly is computationally expensive, traditionally requiring $O(n^3)$ time for a graph with $n$ nodes. Existing Laplacian solvers and random-walk approximations struggle with large-scale graphs, especially those with bottlenecks like road networks. BD-Index addresses this by shifting the paradigm from simulation to deterministic indexing, enabling exact queries on graphs with millions of nodes.

Theoretical Foundation: Random Walks and Graph Cuts

The BD-Index approach reinterprets BD through the lens of random walk distributions. The researchers proved that the biharmonic distance between two nodes $s$ and $t$ is equivalent to the distance between two specific random walk distributions. Crucially, they demonstrated that if a graph can be partitioned by a small "cut set" of nodes, the global random walk behavior can be reconstructed from local statistics restricted to the partitioned components. This theoretical breakthrough allows the global problem of computing the pseudoinverse of the Laplacian to be decomposed into a series of local computations, which is the key to the system's scalability.

Random walk interpretation of Biharmonic Distance and the role of graph cuts in partitioning the problem.

The BD-Index Framework

BD-Index employs a deterministic divide-and-conquer strategy to build its index. The process involves three main stages:

  1. Recursive Partitioning: The graph is split into a hierarchy tree ($H$) using heuristics like METIS or minimum-degree ordering to find small cuts that separate the graph into manageable sub-components.
  2. Bottom-Up Indexing: Instead of sampling walks, the system deterministically computes and stores local random walk statistics—represented as a vector $m_u$ and a scalar $f_u$ for each node. These statistics effectively capture the rank-one updates to the Laplacian matrix caused by the cut nodes, allowing for compact storage.
  3. Efficient Querying: The query process is highly optimized. To find the distance between any two nodes $s$ and $t$, the system only needs to access the index entries for the ancestors of those nodes in the hierarchy tree. This transforms a global matrix inversion problem into a local tree-traversal task, drastically reducing query latency.
The BD-Index workflow: recursive graph partitioning, hierarchy tree construction, index building, and the query process.

Experimental Results

The authors evaluated BD-Index on 10 diverse, large-scale datasets, including social networks (Facebook), co-purchase graphs (Amazon), and massive road networks like the Full-USA network, which contains 23.9 million nodes and 28.8 million edges.

  • Massive Speedups: On the Full-USA network, BD-Index answers a single query in just 64 seconds. In comparison, the state-of-the-art exact solver (LapSolver) takes approximately 4.6 days for the same query.
  • Exactness vs. Approximation: Unlike sampling-based methods that introduce noise, BD-Index is theoretically exact. It consistently outperforms approximate methods in both speed and precision, often being 10–100x faster than competitors while providing zero-error results.
  • Practical Utility: The index was successfully used to identify critical bridges in Philadelphia more effectively than standard metrics like PageRank. It also improved GNN performance on the Chameleon dataset by identifying where to add "shortcut" edges to alleviate information bottlenecks.

Conclusion and Limitations

BD-Index represents a significant leap in graph distance computation, making exact Biharmonic Distance queries feasible for million-node graphs. While its performance is exceptional on road networks, it faces a "social graph tax" where dense networks with fewer clean cuts lead to larger index sizes and longer build times. Future work will focus on more advanced partitioning strategies to further minimize the hierarchy tree height and memory footprint for these dense datasets.

Summary updated

Abstract

Biharmonic distance (\bd) is a powerful graph distance metric with many applications, including identifying critical links in road networks and mitigating over-squashing problem in \gnn. However, computing \bd\ is extremely difficult, especially on large graphs. In this paper, we focus on the problem of \emph{single-pair} \bd\ query. Existing methods mainly rely on random walk-based approaches, which work well on some graphs but become inefficient when the random walk cannot mix rapidly.To overcome this issue, we first show that the biharmonic distance between two nodes $s,t$, denoted by $b(s,t)$, can be interpreted as the distance between two random walk distributions starting from $s$ and $t$. To estimate these distributions, the required random walk length is large when the underlying graph can be easily cut into smaller pieces. Inspired by this observation, we present novel formulas of \bd to represent $b(s,t)$ by independent random walks within two node sets $\mathcal{V}_s$, $\mathcal{V}_t$ separated by a small \emph{cut set} $\mathcal{V}_{cut}$, where $\mathcal{V}_s\cup\mathcal{V}_t\cup\mathcal{V}_{cut}=\mathcal{V}$ is the set of graph nodes. Building upon this idea, we propose \bindex, a novel index structure which follows a divide-and-conquer strategy. The graph is first cut into pieces so that each part can be processed easily. Then, all the required random walk probabilities can be deterministically computed in a bottom-top manner. When a query comes, only a small part of the index needs to be accessed. We prove that \bindex\ requires $O(n\cdot h)$ space, can be built in $O(n\cdot h\cdot (h+d_{max}))$ time, and answers each query in $O(n\cdot h)$ time, where $h$ is the height of a hierarchy partition tree and $d_{max}$ is the maximum degree, which are both usually much smaller than $n$.
BibTeX
@misc{pan2025bd,
  author = {Yueyang Pan and Meihao Liao and Rong-Hua Li},
  title = {{BD-Index: Scalable Biharmonic Distance Queries on Large Graphs via Divide-and-Conquer Indexing}},
  year = {2025},
  eprint = {2512.02929},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.02929},
}
Figure