All-Distances Sketches, Revisited: Scalable Estimation of the Distance Distribution and Centralities in Massive Graphs

Edith Cohen

Abstract

Graph datasets with billions of edges, such as social and Web graphs, are prevalent, and scalable computation is critical. All-distances sketches (ADS) [Cohen 1997], are a powerful tool for scalable approximation of statistics. The sketch is a small size sample of the distance relation of a node which emphasizes closer nodes. Sketches for all nodes are computed using a nearly linear computation and estimators are applied to sketches of nodes to estimate their properties. We provide, for the first time, a unified exposition of ADS algorithms and applications. We present the Historic Inverse Probability (HIP) estimators which are applied to the ADS of a node to estimate a large natural class of statistics. For the important special cases of neighborhood cardinalities (the number of nodes within some query distance) and closeness centralities, HIP estimators have at most half the variance of previous estimators and we show that this is essentially optimal. Moreover, HIP obtains a polynomial improvement for more general statistics and the estimators are simple, flexible, unbiased, and elegant. For approximate distinct counting on data streams, HIP outperforms the original estimators for the HyperLogLog MinHash sketches (Flajolet et al. 2007), obtaining significantly improved estimation quality for this state-of-the-art practical algorithm.

Introduction

In the era of massive social networks and web graphs, calculating exact statistics—such as neighborhood cardinality (the number of nodes within $k$ hops) or closeness centrality—is computationally prohibitive for graphs with billions of edges. To address this, researchers utilize All-Distances Sketches (ADS), which provide compressed summaries of a node’s distance relationships. While ADS algorithms have been available since the late 1990s, the estimators used to derive metrics from these sketches often underutilized the data generated during sketch construction. This work introduces Historic Inverse Probability (HIP) estimators, which significantly improve estimation accuracy by leveraging the "history" of sketch formation.

Methodology

The core innovation of this research is the HIP estimator. Unlike traditional estimators that only consider the final state of a $k$-element sketch, HIP utilizes the entire construction process.

The Historic Inverse Probability (HIP) Estimator

As a sketch is built, nodes are added based on their distance and a randomly assigned rank. HIP tracks the "inclusion probability" of each node at the exact moment it is added to the sketch. By assigning an adjusted weight equal to the inverse of this inclusion probability, the final estimate becomes a simple, unbiased sum of these weights. This approach treats the sketch's evolution as a sequence of informative random events.

Figure 1: A directed graph with edge weights (red) and node ranks (blue), illustrating the input for All-Distances Sketch (ADS) computation.

Computational Frameworks

The paper details two primary algorithms for computing these sketches:

  1. PRUNEDDIJKSTRA: An optimized version of Dijkstra’s algorithm that prunes the search space once a node's sketch reaches capacity, ideal for single-processor environments.
  2. LOCALUPDATES: A dynamic programming approach designed for distributed systems like MapReduce.

The framework provides a unified view of various sketch types, including k-mins, bottom-k, and k-partitioning (the foundation of the HyperLogLog algorithm).

Key Insights and Results

The transition from static to historic estimation yields several critical advantages:

  • Variance Reduction: HIP estimators achieve a factor-of-2 reduction in variance for neighborhood cardinality and closeness centrality compared to previous state-of-the-art methods. This effectively doubles the information density of each sketch for a given memory footprint.
  • Mathematical Optimality: For many common statistics, HIP is proven to be the Uniform Minimum Variance Unbiased Estimator (UMVUE), representing the theoretical limit of accuracy for the information provided.
  • Superiority over HyperLogLog: When applied to distinct counting on data streams, HIP outperforms the standard HyperLogLog (HLL) estimator. To match HIP's accuracy, an HLL estimator would require approximately 56% more registers.
  • Polynomial Improvement: For complex statistics where weights decay with distance, HIP offers polynomial improvements in estimation quality over traditional MinHash-based sampling.

Conclusion and Future Work

HIP estimators provide a simple, flexible, and mathematically elegant solution for graph analysis at scale. While highly effective, some limitations remain, such as potential bias when registers in HLL-style sketches become saturated. Additionally, while sketches are mergeable, maintaining perfect HIP count accuracy in fully distributed settings requires further investigation. Future research will explore applying HIP to "closeness similarity" and "timed-influence" models to further expand the utility of All-Distances Sketches.

Summary updated

BibTeX
@article{cohen2013all,
  author = {Edith Cohen},
  title = {{All-Distances Sketches, Revisited: Scalable Estimation of the Distance Distribution and Centralities in Massive Graphs}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2013},
  url = {https://openreview.net/forum?id=R-XXn6xBHc},
}
Figure