Scalable Neighborhood Sketching and Distance Distribution Estimation in Graph Datasets: Revisited, Unified, and Improved

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) 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. This paper provides a unified exposition of ADS algorithms and applications, introducing the Historic Inverse Probability (HIP) estimators. For the important special cases of neighborhood cardinalities and closeness centralities, HIP estimators have at most half the variance of previous estimators, which is shown to be essentially optimal. Moreover, HIP obtains a polynomial improvement for more general statistics and outperforms the state-of-the-art HyperLogLog algorithm for distinct counting on data streams.

Introduction

In the era of massive social and web graphs, calculating exact statistics—such as neighborhood cardinality (the number of nodes within a certain distance) or closeness centrality—is computationally prohibitive. To address this, researchers utilize sketches: small, lossy summaries of a node's distance relationships. These sketches allow for nearly linear computation time while providing accurate approximations for properties that would otherwise require exhaustive graph traversals.

The All-Distances Sketch (ADS)

The All-Distances Sketch (ADS) is a coordinated sample of reachable nodes that favors those closer to the source. It provides a powerful framework for estimating statistics across large-scale networks by maintaining a small set of representative nodes and their distances.

Example of a weighted directed graph used for neighborhood sketching.

The ADS framework encompasses several flavors, including $k$-mins, $k$-partition, and bottom-$k$ sketches. As illustrated in the figure above, nodes are assigned random ranks (blue values), and the graph structure is defined by weighted edges (red values). The sketch for a node $u$ consists of pairs $(v, d(u,v))$ for a subset of nodes $v$, where the selection is based on both the distance $d(u,v)$ and the random rank of $v$.

Historic Inverse Probability (HIP) Estimators

The core innovation of this work is the Historic Inverse Probability (HIP) estimator. Standard estimators typically only consider the final state of a sketch. In contrast, the HIP estimator leverages the "history" of the sketch construction.

As a sketch is built—for instance, during a Dijkstra-like traversal—the HIP estimator calculates an adjusted weight for each node as it is added. This weight is the inverse of the node's "inclusion probability," conditioned on the nodes already processed (those closer to the source). By observing when and why a sketch changes during its construction, HIP captures significantly more information than a static snapshot of the final sketch.

Algorithms for Sketch Computation

The paper details two primary algorithms for computing these sketches efficiently:

  1. PRUNEDDIJKSTRA: An optimized version of Dijkstra’s algorithm that "prunes" search branches once they are unlikely to update a node's sketch, significantly reducing the total number of edges explored.
  2. LOCALUPDATES: A node-centric, dynamic programming approach suitable for distributed environments like MapReduce, allowing for parallelized sketch construction.

Key Results and Performance

The HIP estimator demonstrates significant theoretical and practical advantages over previous methods:

  • Variance Reduction: For common graph statistics like neighborhood cardinality, HIP estimators achieve at most half the variance of previous methods. This translates to a $\sqrt{2}$ improvement in Mean Relative Error (MRE), allowing for smaller sketches to achieve the same accuracy.
  • Optimality: The paper proves that HIP estimators are essentially optimal for ADS-based neighborhood estimation.
  • Beating HyperLogLog: When applied to the MinHash structure used in HyperLogLog (HLL), HIP outperforms HLL's own estimators. Simulations show that to match HIP's accuracy, a standard HLL estimator would require approximately 56% more memory (registers).
  • Unbiasedness: Unlike many practical estimators that require complex "bias correction" patches for small or large cardinalities, HIP is naturally unbiased across the entire range of values.

Conclusion

The introduction of HIP estimators represents a significant advancement in scalable graph analysis. By utilizing the construction history of All-Distances Sketches, HIP provides a simple, flexible, and mathematically optimal way to estimate neighborhood statistics. Its superior performance over industry standards like HyperLogLog and its natural unbiasedness make it a vital tool for processing the massive datasets of the modern web.

Summary updated

BibTeX
@article{cohen2013scalable,
  author = {Edith Cohen},
  title = {{Scalable Neighborhood Sketching and Distance Distribution Estimation in Graph Datasets: Revisited, Unified, and Improved}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2013},
  url = {https://openreview.net/forum?id=R-XXn6xBHc},
}
Figure