Link Graph Encyclopedia

Computing at scale

HyperBall

Grow a probabilistic counter around every node by one link per pass over the graph. After a few dozen passes you know, for every node, roughly how many nodes lie within each distance, and with it harmonic centrality, closeness and the distance distribution.

Geometric centralities and distance statistics need, for each node xx, the number of nodes within distance tt of it, for every tt. Computing that exactly takes a breadth-first search from every node, impossible on a graph with a hundred million nodes (see paths and distance). HyperBall, by Paolo Boldi and Sebastiano Vigna, computes it approximately for all nodes at once: it keeps one HyperLogLog counter per node and grows all the counters together, one step per pass over the graph. Common Crawl computes the harmonic centrality of every host and domain with it.

The idea: balls grow by union

Let B(x,t)B(x, t) be the ball of radius tt around xx: the nodes within distance tt. Balls satisfy a simple recurrence:

B(x,0)={x},B(x,t+1)=B(x,t)∪⋃x→yB(y,t).B(x, 0) = \{x\}, \qquad B(x, t + 1) = B(x, t) \cup \bigcup_{x \to y} B(y, t) .

Everything within t+1t + 1 steps of xx is xx’s own ball plus everything within tt steps of one of its successors. Storing the balls as sets would be hopeless, but HyperLogLog counters merge by a register-wise maximum, so the union of counters is cheap. One pass over all arcs, taking maxima, turns every node’s radius-tt counter into its radius-(t+1)(t+1) counter. The size estimate ∣B(x,t)∣|B(x, t)| is read off each counter after each pass.

For centralities based on incoming distances, such as harmonic centrality on the web, the same recurrence runs on the transposed graph, so that balls collect the nodes that can reach xx. Common Crawl runs HyperBall on domain-t.graph.

From balls to centralities

The number of nodes at distance exactly tt is ∣B(x,t)∣−∣B(x,t−1)∣|B(x, t)| - |B(x, t - 1)|, so every geometric measure follows:

The passes continue until no counter changes, which takes as many passes as the longest shortest path in the graph. Real graphs have long, thin tendrils, so the last passes change few counters; HyperBall tracks which counters changed and, in later passes, only processes nodes with a changed successor.

History

HyperANF produced the most-cited distance result of its era. In 2011, Backstrom, Boldi, Rosa, Ugander and Vigna ran it on Facebook’s entire friendship graph, 721 million active users and 69 billion friendship links, and found an average distance of 4.74: “four degrees of separation”, not six.

Cost

Each pass reads the graph once, sequentially, which is fast for a graph in compressed WebGraph form, and touches every counter. Memory is dominated by the counters: nn nodes times mm registers of 5 or 6 bits, times two if the previous and current counters are kept separately. For 119.7 million domains with m=64m = 64 registers of 5 bits, one set of counters takes 4.8 GB. Halving the error means quadrupling mm, and the memory with it, which is why HyperBall’s external mode keeps only one copy of the counters in memory.

Accuracy

Each counter’s estimate has a relative standard error of about 1.04/m1.04/\sqrt{m}, and errors in successive ball sizes are correlated, so derived quantities inherit an error of the same order. HyperANF’s authors reported relative errors for the neighbourhood function in line with the counter error. Individual centralities can be noticeably off, especially for small values: in Common Crawl’s 2026 ranks, 293 domains with in-links have an estimated harmonic centrality of exactly 0, and only 5.9 million distinct values occur among 119.7 million domains. Positions near the top, where values differ by large margins, are reliable; positions among millions of near-equal values are not (see ranks and scores).

When to use something else

References

Edit this entry on GitHub