Fast Query of Biharmonic Distance in Networks

Changan Liu, Ahad N. Zehmakan, Zhongzhi Zhang

TL;DR

This paper introduces a suite of local, highly efficient algorithms for estimating Biharmonic Distance (BD) in large-scale networks. By deriving a novel formulation of BD based on random walk transitions, the authors bypass the need for expensive global matrix inversions, achieving significant speedups—up to orders of magnitude—over existing state-of-the-art methods while maintaining provable accuracy guarantees.

What Problem Does This Paper Address?

Graph distance metrics are essential for understanding network structure. While geodesic distance (shortest path) and resistance distance (based on electrical flow) are common, the Biharmonic Distance (BD) has emerged as a superior alternative because it captures a unique blend of both local and global structural properties. It is widely used in machine learning, computer graphics, and measuring network robustness.

However, BD is computationally "heavy." Calculating it exactly requires inverting the Laplacian matrix, a process that scales poorly ($O(n^{2.3727})$) for modern networks with millions of nodes. Existing approximation methods often require a massive preprocessing step—constructing large, dense matrices—that makes them impractical for dynamic or extremely large graphs. The challenge is: how do we compute BD for specific node pairs quickly, using only local information, without looking at the entire graph?

Methods

The authors first derive a new formula for BD that expresses the distance as a series expansion of the random walk transition matrix. This allows them to estimate distance by looking at $i$-hop neighborhoods rather than the whole graph. Based on this, they propose several algorithms:

  • Push & Push+: Deterministic algorithms that perform a local graph traversal from the source and target nodes. They use a "truncated length" $\ell$ to decide how far to explore, ensuring the error remains within a user-defined threshold $\epsilon$.
  • STW (Sampling Truncated Walks): A stochastic approach that estimates the terms in the new BD formula by simulating random walks. This is much faster for large, dense graphs where deterministic traversal becomes slow.
  • SWF (Sampling With Feedback): The authors' "pinnacle" contribution. It improves on STW by using the Empirical Bernstein Inequality. Instead of running a fixed number of samples, SWF monitors the variance of the samples in real-time and terminates as soon as the desired accuracy is reached.
  • SNB & SNB+: Extensions of the pairwise algorithms designed to calculate Nodal BD (the sum of distances from one node to all others). SNB+ uses "summation estimation" techniques to avoid the $O(n)$ cost of querying every single node pair.

Datasets

The algorithms were evaluated on five real-world networks from the SNAP repository, representing different scales and densities:

  • Facebook: 4,039 nodes (Social circles)
  • DBLP: 317,080 nodes (Co-authorship network)
  • Youtube: 1,134,890 nodes (Social network)
  • Orkut: 3,072,441 nodes (Social network)
  • LiveJournal: 3,997,962 nodes (Social network)

Key Insights and Ideas

  • Locality is Key: The most significant insight is that BD can be approximated by looking only at a small portion of the graph. This "locality property" is what allows these algorithms to scale to millions of nodes where global methods fail.
  • Feedback-Driven Efficiency: The SWF algorithm demonstrates that you don't always need a massive number of samples. By using feedback (empirical variance), the algorithm realizes when it has "seen enough" to be accurate, leading to dramatic time savings.
  • Structural Nuance: The authors found that the "mixing time" of a node (how fast a random walk from that node stabilizes) varies. By customizing the exploration depth ($\ell_{s,t}$) based on local node degrees, they can achieve higher accuracy with less work.

Key Results

The experimental results show that the proposed algorithms dominate existing methods in both speed and memory efficiency.

  • Speedup: On the Orkut network, SWF ran up to 23 times faster than the standard sampling approach (STW) for a given error threshold. Compared to traditional random projection (RP) methods, the speedup was often several orders of magnitude.
  • Scalability: While "Exact" and "RP" methods frequently crashed or timed out on larger datasets like Orkut and LiveJournal due to memory limits, the new local algorithms handled them easily.
Running time comparison across five datasets. Note the log-scale on the y-axis, showing SWF and STW consistently outperforming competitors.
  • Accuracy: All proposed algorithms stayed strictly within the user-defined error threshold $\epsilon$. Interestingly, while sampling methods (STW/SWF) have slightly higher empirical error than deterministic ones (Push), the trade-off for speed is marginal and well worth it for large-scale applications.
Absolute error vs. epsilon. All algorithms (except the baseline RP) stay well below the target error threshold.

Limitations and Future Work

The authors acknowledge a few areas for further exploration:

  • Bipartite Graphs: The current theoretical framework assumes the graph is not bipartite (to ensure random walk ergodicity), though they note most real-world networks satisfy this.
  • Relative Error: The current guarantees are for additive error. Future work could focus on providing relative error guarantees, which are often harder to achieve for distance metrics.
  • Distributed Computing: The local nature of these algorithms makes them perfect candidates for distributed or multi-threaded implementations, which the authors plan to investigate next.

Summary updated

BibTeX
@inproceedings{liu2024fast,
  author = {Changan Liu and Ahad N. Zehmakan and Zhongzhi Zhang},
  title = {{Fast Query of Biharmonic Distance in Networks}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
}
Figure