networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
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.

Notes

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.

Parameters

G : graph

a bipartite graph

nodes : list or iterable, optional

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.

mode : string

The pariwise bipartite clustering method. It must be "dot", "max", or "min"

Returns

clustering : float

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.

See Also

clustering

Examples

>>> 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.0
See :

Back References

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

Local connectivity graph

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


GitHub : /networkx/algorithms/bipartite/cluster.py#135
type: <class 'function'>
Commit: