This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
clustering(G, nodes=None, mode='dot')¶
Compute a bipartite clustering coefficient for nodes.
The bipartie clustering coefficient is a measure of local density of connections defined as :
where are the second order neighbors of in excluding , and is the pairwise clustering coefficient between nodes and .
The mode selects the function for which can be:
- G (graph) – A bipartite graph
- nodes (list or iterable (optional)) – Compute bipartite clustering for these nodes. The default is all nodes in G.
- mode (string) – The pariwise bipartite clustering method to be used in the computation. It must be “dot”, “max”, or “min”.
clustering – A dictionary keyed by node with the clustering coefficient value.
>>> from networkx.algorithms import bipartite >>> G = nx.path_graph(4) # path graphs are bipartite >>> c = bipartite.clustering(G) >>> c 0.5 >>> c = bipartite.clustering(G,mode='min') >>> c 1.0
 Latapy, Matthieu, Clémence Magnien, and Nathalie Del Vecchio (2008). Basic notions for the analysis of large two-mode networks. Social Networks 30(1), 31–48.