meanClustering

meanClustering()
Returns the mean clustering coefficient of the network as a float.

Notes

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:

\binom{n}{3}^{-1}
\sum\limits_{i=1}^n
\sum\limits_{j=1}^{i-1}
\sum\limits_{k=1}^{j-1}
{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 = co.network()

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


N.clear()
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.clear();
N.torus(10, 10, 1.5, roessler(), edge());
print "Should be 12 / 28 (0.4286): "+N.meanClustering() + newline;

Table Of Contents

Previous topic

isConnected

Next topic

meanDegree