networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
betweenness_centrality(G, nodes)

Betweenness centrality of a node :None:None:`v` is the sum of the fraction of all-pairs shortest paths that pass through :None:None:`v`.

Values of betweenness are normalized by the maximum possible value which for bipartite graphs is limited by the relative size of the two node sets .

Let n be the number of nodes in the node set :None:None:`U` and :None:None:`m` be the number of nodes in the node set :None:None:`V`, then nodes in :None:None:`U` are normalized by dividing by

$$\frac{1}{2} [m^2 (s + 1)^2 + m (s + 1)(2t - s - 1) - t (2s - t + 3)] ,$$

where

$$s = (n - 1) \div m , t = (n - 1) \mod m ,$$

and nodes in :None:None:`V` are normalized by dividing by

$$\frac{1}{2} [n^2 (p + 1)^2 + n (p + 1)(2r - p - 1) - r (2p - r + 3)] ,$$

where,

$$p = (m - 1) \div n , r = (m - 1) \mod n .$$

Notes

The nodes input parameter must contain all nodes in one bipartite node set, but the dictionary returned contains all nodes from both node sets. 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 container

Container with all nodes in one bipartite node set.

Returns

betweenness : dictionary

Dictionary keyed by node with bipartite betweenness centrality as the value.

Compute betweenness centrality for nodes in a bipartite network.

See Also

closeness_centrality
degree_centrality
~networkx.algorithms.bipartite.basic.is_bipartite

func

~networkx.algorithms.bipartite.basic.sets

func

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.bipartite.centrality.closeness_centrality networkx.algorithms.bipartite.centrality.degree_centrality

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/centrality.py#73
type: <class 'function'>
Commit: