Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

# betweenness_centrality¶

betweenness_centrality(G, nodes)[source]

Compute betweenness centrality for nodes in a bipartite network.

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

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 [1].

Let be the number of nodes in the node set and be the number of nodes in the node set , then nodes in are normalized by dividing by

where

and nodes in are normalized by dividing by

where,

Parameters: G (graph) – A bipartite graph nodes (list or container) – Container with all nodes in one bipartite node set. betweenness – Dictionary keyed by node with bipartite betweenness centrality as the value. dictionary

degree_centrality(), closeness_centrality(), sets(), is_bipartite()