Returns the mean clustering coefficient of the network as a float.


If n is the number of nodes in the network and A is its adjacency matrix (i.e. A_{ij} = 1, if there is an edge connecting node i to node j, and A_{ij} = 0 otherwise), the mean clustering coefficient is defined as:

{A_{ij} A_{jk} A_{ki}}

This is the mean over all nodes of the node-wise clustering coefficent, which is defined as the rate at which two neighbours of a given node are neighbours. This usually differs from the global clustering coefficient, which is the rate at which two nodes that have a common neighbour are neighbours.

Example (python-conedy)

import conedy as co

N =

print "Should be close to %f: %f" % (9./14, N.meanClustering())

N.torus (40, 40, 1.5, co.node(), co.weightedEdge(1.0))
print "Should be close to %f: %f" % (6./14, N.meanClustering())

Example (conedy)

network N;

N.cycle(100, 4, roessler());
print "Should be 18 / 28 (0.6429): "+ N.meanClustering() + newline;

N.torus(10, 10, 1.5, roessler(), edge());
print "Should be 12 / 28 (0.4286): "+N.meanClustering() + newline;

Table Of Contents

Previous topic


Next topic