Beyond Random Walk and Metropolis-Hastings Samplers: Why You Should Not Backtrack for Unbiased Graph Sampling

Chul-Ho Lee, Xin Xu, Do Young Eun

Introduction

In the era of massive interconnected data, understanding the structure of networks like social media platforms or the World Wide Web is a significant challenge. Because these graphs are often too large to be mapped entirely, researchers rely on "crawlers"—stochastic algorithms that traverse the network to collect representative samples. These samples allow for the estimation of global properties, such as degree distributions or average clustering coefficients, without requiring global knowledge of the graph topology.

Historically, the gold standards for this task have been the Simple Random Walk with re-weighting (SRW-rw) and the Metropolis-Hastings (MH) algorithm. While mathematically sound, these methods suffer from a fundamental inefficiency: "slow diffusion." Because these walks are fully random and reversible, they frequently backtrack to the node they just visited, creating highly correlated data and increasing the asymptotic variance of the resulting estimates. This paper introduces two improved algorithms—NBRW-rw and MHDA—that eliminate backtracking to achieve higher sampling efficiency and lower estimation error.

The Problem: The Backtracking Tax

Standard graph sampling methods are typically based on reversible Markov chains. In a Simple Random Walk, a crawler at node $u$ selects a neighbor $v$ uniformly at random. If the graph has many low-degree nodes, there is a high probability that the walker will immediately return to $u$ in the next step. This backtracking behavior is essentially "wasted" movement; it keeps the crawler in a localized neighborhood for longer than necessary, leading to redundant samples and a slow exploration of the graph's state space.

The challenge in improving these walks is maintaining the "unbiased" nature of the sample. Any modification to the transition probabilities must still converge to the desired stationary distribution without requiring global information about the graph, which would be computationally prohibitive for massive networks.

Proposed Methodology: Non-Backtracking and Delayed Acceptance

The authors propose a shift from reversible to non-reversible Markov chains. By introducing a "one-state memory"—where the crawler remembers the ID of the node it just left—the walk can be designed to avoid moving backward.

1. NBRW-rw (Non-Backtracking Random Walk with re-weighting)

Unlike a standard walk, the NBRW-rw specifically excludes the previous node from its list of potential next steps. If a node has multiple neighbors, the algorithm will never backtrack. If the crawler hits a dead end (a node of degree 1), it is forced to return to the previous node, but in all other cases, it is pushed toward unvisited territory. To ensure the final estimates are unbiased, the authors apply a re-weighting scheme to account for the modified transition probabilities.

2. MHDA (Metropolis-Hastings with Delayed Acceptance)

The standard Metropolis-Hastings algorithm often results in "self-loops" where a proposed move is rejected, and the walker stays on the current node. MHDA improves this by introducing a "delayed" second proposal. If the first proposed move is rejected or would result in backtracking, the algorithm triggers a second attempt to find a different neighbor. This reduces the time spent idling at a single node and encourages faster diffusion across the network.

The "Lifting" Technique

To prove the superiority of these methods, the authors utilize a mathematical framework called "lifting." By mapping the walk onto an augmented state space (consisting of pairs of nodes rather than single nodes), they demonstrate that these non-reversible versions are theoretically guaranteed to have lower or equal asymptotic variance compared to their standard counterparts.

Empirical Evaluation

The algorithms were tested against four diverse real-world datasets from the Stanford Large Network Dataset Collection:

  • AS-733: A graph of autonomous systems (6,474 nodes).
  • HEP-TH: A collaboration network of high-energy physics authors (8,638 nodes).
  • Road-PA: A Pennsylvania road network (over 1 million nodes).
  • Web-Google: A crawl of the Google web graph (approx. 855,000 nodes).

Key Results

The experimental results confirmed the theoretical predictions, showing significant gains in efficiency across all graph types:

  • Efficiency Gains in Sparse Networks: The benefits were most pronounced in graphs with many low-degree nodes. In the Road-PA network, the standard SRW required more than twice as many samples as NBRW-rw to reach the same level of accuracy—a 60% reduction in sampling cost.
  • Reduced Variance: In the AS-733 graph, NBRW-rw achieved the same precision as standard methods using 35% fewer samples.
  • Consistent Improvement with MHDA: MHDA consistently outperformed the standard Metropolis-Hastings algorithm, typically providing a 12–15% improvement in sampling efficiency without adding significant computational overhead.

Conclusion and Future Directions

The research demonstrates that avoiding backtracking is a "zero-cost upgrade" for graph sampling. If a researcher can implement a standard random walk, they can implement NBRW-rw or MHDA with minimal additional code and virtually no extra computational power. By breaking the symmetry of reversible walks, these algorithms explore networks faster and produce more accurate estimates.

While the current work provides robust theoretical guarantees for asymptotic variance in static graphs, future research may explore how these non-backtracking methods perform in dynamic, time-varying networks where nodes and edges are constantly appearing or disappearing. Additionally, further study into the "burn-in" period—the time it takes for a walker to reach a steady state—could reveal even more advantages for non-reversible sampling techniques.

Summary updated

BibTeX
@article{lee2012beyond,
  author = {Chul-Ho Lee and Xin Xu and Do Young Eun},
  title = {{Beyond Random Walk and Metropolis-Hastings Samplers: Why You Should Not Backtrack for Unbiased Graph Sampling}},
  journal = {ACM SIGMETRICS Performance Evaluation Review},
  year = {2012},
  doi = {10.1145/2318857.2254795},
}
Figure