clustering coefficient


what's the difference between

graph-tool --load \
--set-local-clustering-to-property=clustering \


graph-tool --load --global-clustering-coefficient=- ?

The results are not equal:

# average vertex property (clustering):
0.400881 0.001264

# global clustering coefficient:
0.016429 0.000001

But the global clustering coefficient IS the arithmetic mean of the local
clustering coefficient of all edges, IIRC. I don't understand the divergence.



The global clustering coefficient is defined differently as the mean of
the local clustering coefficient. As stated in the documentation on the
website, the global clustering is given by

C = 3 N_t / N_c, where N_t is the total number of closed triangles in
the graph, and N_c is the number of triplets.

The average local clustering is C = \sum{C_i}/N, where C_i =
2N_c/(k(k-1)), where N is the total number of vertices, N_c is the
number of connected neighbors, and k is the degree of the vertex.

Note that the above definitions are _not_ equivalent, and that's why you
see the divergence.