NetworkX

Previous topic

networkx.clustering

Next topic

Cores

Quick search

networkx.average_clustering

average_clustering(G)

Compute average clustering coefficient.

A clustering coefficient for the whole graph is the average,

C = \frac{1}{n}\sum_{v \in G} c_v,

where n is the number of nodes in G.

Parameters:

G : graph

A networkx graph

Returns:

out : float

Average clustering

Notes

This is a space saving routine; it might be faster to use clustering to get a list and then take the average.