Link Graph Encyclopedia

Comparing rankings

Kendall's tau

Compare two rankings by counting pairs of items they order the same way and pairs they order oppositely. The standard measure of agreement between centralities, computable in O(n log n) time.

Two centralities rarely produce the same ranking. Kendall’s τ (tau), introduced by Maurice Kendall in 1938, measures how much two rankings agree by looking at every pair of items. A pair is concordant if both rankings put the same item first, and discordant if they disagree. τ is the excess of concordant over discordant pairs, scaled to lie between −1 (one ranking is the reverse of the other) and +1 (identical). It is the most common way to report how similar two link-based rankings are.

Definition

For nn items scored by xx and by yy, look at all n(n−1)/2n(n-1)/2 pairs (i,j)(i, j). With CC concordant pairs (the signs of xi−xjx_i - x_j and yi−yjy_i - y_j agree) and DD discordant pairs (they differ), and no ties,

τa=C−Dn(n−1)/2.\tau_a = \frac{C - D}{n(n-1)/2} .

Equivalently, τ=1−2⋅(share of discordant pairs)\tau = 1 - 2 \cdot (\text{share of discordant pairs}). A τ of 0.5 means three quarters of pairs agree and one quarter disagree.

Ties

Rankings from centralities are full of ties: equal in-degrees, PageRank floors, harmonic values shared by millions. τ_b corrects for them:

τb=C−D(C+D+Tx)(C+D+Ty),\tau_b = \frac{C - D}{\sqrt{(C + D + T_x)(C + D + T_y)}},

where TxT_x counts pairs tied in xx only and TyT_y pairs tied in yy only; pairs tied in both are left out. τ_b reaches ±1 exactly when the two rankings agree, or exactly disagree, including on their ties. Most software computes τ_b by default.

Worked example

Compare PageRank on the running example with other measures:

Compared with PageRank Concordant Discordant Tied in one only τ_b
Harmonic centrality 19 0 1 0.975
In-degree 15 0 5 0.866
HITS authority 15 5 0 0.500
Closeness 11 9 0 0.100

Harmonic centrality agrees with PageRank on every pair except one it calls a tie (A and G both score 3). In-degree never contradicts PageRank but ties five pairs that PageRank separates. Closeness, which ranks D and F first, agrees on barely more pairs than it contradicts.

On real data

For a random sample of 4,000 domains from the 2026-09-23 auction inventory that appear in Common Crawl’s graph:

Pair of rankings Kendall τ_b Spearman ρ (all 119,453 such domains)
Harmonic position, PageRank position 0.51 0.69
Harmonic centrality, in-degree 0.53 0.69
PageRank, in-degree 0.58 0.73

Kendall’s τ is typically smaller in magnitude than Spearman’s ρ on the same data, so the two are not interchangeable; always say which one you report (see Spearman’s rho). A τ of 0.51 means that for a random pair of these domains, the two Common Crawl centralities order them the same way about three times in four.

Computing it fast

Counting all pairs costs O(n2)O(n^2): about 7×10157 \times 10^{15} pairs for Common Crawl’s 119.7 million domains. William Knight’s 1966 algorithm reduces it to O(nlog⁡n)O(n \log n): sort the items by xx, then count, while merge-sorting by yy, how many inversions the merge has to perform. Each inversion is a discordant pair. Ties need extra bookkeeping, and the algorithm handles them in the same time bound. With it, τ between two full web-scale rankings takes seconds.

What τ does not say

That observation, that classical τ between two web-scale rankings is driven by the unimportant majority of nodes, is what led Vigna to design weighted tau.

References

Edit this entry on GitHub