networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
latapy_clustering(G, nodes=None, mode='dot')

The bipartie clustering coefficient is a measure of local density of connections defined as :

$$c_u = \frac{\sum_{v \in N(N(u))} c_{uv} }{|N(N(u))|}$$

where :None:None:`N(N(u))` are the second order neighbors of u in G excluding u, and :None:None:`c_{uv}` is the pairwise clustering coefficient between nodes u and :None:None:`v`.

The mode selects the function for :None:None:`c_{uv}` which can be:

:None:None:`dot`:

$$c_{uv}=\frac{|N(u)\cap N(v)|}{|N(u) \cup N(v)|}$$

:None:None:`min`:

$$c_{uv}=\frac{|N(u)\cap N(v)|}{min(|N(u)|,|N(v)|)}$$

:None:None:`max`:

$$c_{uv}=\frac{|N(u)\cap N(v)|}{max(|N(u)|,|N(v)|)}$$

Parameters

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".

Returns

clustering : dictionary

A dictionary keyed by node with the clustering coefficient value.

Compute a bipartite clustering coefficient for nodes.

See Also

average_clustering
networkx.algorithms.cluster.square_clustering
robins_alexander_clustering

Examples

>>> from networkx.algorithms import bipartite
... G = nx.path_graph(4) # path graphs are bipartite
... c = bipartite.clustering(G)
... c[0] 0.5
>>> c = bipartite.clustering(G, mode="min")
... c[0] 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.latapy_clustering networkx.algorithms.bipartite.cluster.robins_alexander_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#31
type: <class 'function'>
Commit: