Link Graph Encyclopedia

Network structure

Clustering coefficient

How often two neighbours of a node are also neighbours of each other. Real networks form far more triangles than chance predicts, and unnaturally dense triangles are a classic fingerprint of link farms.

If site A links to sites B and C, how likely is it that B and C are also linked? In a random graph with the web’s density, almost never. In real link graphs, often: sites on the same topic, in the same language or run by the same people link to each other in clusters. The clustering coefficient measures this tendency to form triangles. It is one of the two statistics, with short typical distances, that define a small-world network, and it is a useful signal when hunting for link spam.

Definitions

Clustering is usually defined on the undirected version of a graph, where a link in either direction counts as a connection.

The local clustering coefficient of a node vv with kvk_v neighbours is the fraction of pairs of neighbours that are themselves connected:

Cv=links among v’s neighbours(kv2)=2 Tvkv(kv−1),C_v = \frac{\text{links among } v\text{'s neighbours}}{\binom{k_v}{2}} = \frac{2\, T_v}{k_v (k_v - 1)},

where TvT_v counts the triangles through vv. It is undefined, or set to 0, for nodes with fewer than two neighbours.

The global clustering coefficient, or transitivity, looks at the whole graph:

C=3×number of trianglesnumber of connected triples,C = \frac{3 \times \text{number of triangles}}{\text{number of connected triples}},

where a connected triple is a path of length two, u−v−wu - v - w. Each triangle contains three such paths. The average local coefficient and the transitivity are different numbers and can differ widely: the average gives every node equal weight, while transitivity is dominated by high-degree nodes, which sit at the centre of most triples.

Directed versions distinguish cycles (a→b→c→aa \to b \to c \to a) from transitive triples (a→ba \to b, b→cb \to c, a→ca \to c); Fagiolo catalogues the variants.

Worked example

Ignoring directions, the running example has three triangles: A–B–C, A–C–D and C–D–E.

Node A B C D E F G
Neighbours 3 2 5 3 3 1 1
Linked neighbour pairs 2 of 3 1 of 1 3 of 10 2 of 3 1 of 3 – –
Local coefficient 0.67 1.00 0.30 0.67 0.33 – –

C, the best-connected node, has the lowest coefficient: its five neighbours span the whole graph, and few of them know each other. B, with two neighbours who are linked, has the highest possible value. This inverse relation between degree and clustering is typical of real networks. The average over nodes with at least two neighbours is 0.59; the transitivity is 3×3/20=0.453 \times 3 / 20 = 0.45, lower because C’s ten neighbour pairs weigh heavily.

Clustering in real networks

A random graph with nn nodes and average degree kˉ\bar k has clustering about kˉ/n\bar k / n: for Common Crawl’s domain graph, around 3×10−73 \times 10^{-7}. Real social, biological and information networks have clustering coefficients many orders of magnitude higher, often 0.1 to 0.5 for the average local coefficient. Watts and Strogatz’s 1998 observation that networks combine high clustering with short distances launched the modern study of small-world networks. On the web, clustering comes from topical communities, regional webs, blogrolls and sites under common ownership. Community detection methods exploit exactly this density of links within groups.

Legitimate sites cluster moderately. Link farms cluster extremely: a set of domains created to boost each other often links every member to every other, forming a near-clique in which nearly every pair of neighbours is linked. Becchetti, Boldi, Castillo and Gionis showed in 2008 that triangle counts per node, computed approximately in a few passes, separate spam hosts from normal ones well enough to be a useful feature in spam classifiers. A domain whose referring domains are all densely linked to each other, and to little else, deserves suspicion.

Computing it

Counting triangles exactly takes, for each arc, an intersection of two neighbour lists. Processing nodes in order of degree and only counting each triangle from its lowest-degree vertex bounds the work at O(m1.5)O(m^{1.5}), which is feasible for billions of arcs on a large machine but slow. For estimates:

What it means for a domain

Clustering is not a quality score. A local business linked by a dozen local sites that also link to each other has high clustering, and so does a private blog network. What distinguishes them is everything else: whether the cluster also receives links from the wider web, whether its members have independent histories and audiences, and whether the links make sense to a reader. Use clustering as a prompt to look closer, together with spam mass and the metric audit checks.

References

Edit this entry on GitHub