# meanClustering¶

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

## Notes¶

If is the number of nodes in the network and is its adjacency matrix (i.e. , if there is an edge connecting node to node , and otherwise), the mean clustering coefficient is defined as:

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;