average_clustering(G, nodes=None, mode='dot')
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
.
Similar measures for the two bipartite sets can be defined
$$C_X = \frac{1}{|X|}\sum_{v \in X} c_v,$$where :None:None:`X`
is a bipartite set of G
.
The container of nodes passed to this function must contain all of the nodes in one of the bipartite sets ("top" or "bottom") in order to compute the correct average bipartite clustering coefficients. See bipartite documentation <networkx.algorithms.bipartite>
for further details on how bipartite graphs are handled in NetworkX.
a bipartite graph
A container of nodes to use in computing the average. The nodes should be either the entire graph (the default) or one of the bipartite sets.
The pariwise bipartite clustering method. It must be "dot", "max", or "min"
The average bipartite clustering for the given set of nodes or the entire graph if no nodes are specified.
Compute the average bipartite clustering coefficient.
>>> from networkx.algorithms import bipartite
... G = nx.star_graph(3) # star graphs are bipartite
... bipartite.average_clustering(G) 0.75
>>> X, Y = bipartite.sets(G)
... bipartite.average_clustering(G, X) 0.0
>>> bipartite.average_clustering(G, Y) 1.0See :
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.bipartite.cluster.average_clustering
networkx.algorithms.bipartite.cluster.latapy_clustering
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them