closeness_centrality(G, nodes, normalized=True)
The closeness of a node is the distance to all other nodes in the graph or in the case that the graph is not connected to all other nodes in the connected component containing that node.
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.
Closeness centrality is normalized by the minimum distance possible. In the bipartite case the minimum distance for a node in one bipartite node set is 1 from all nodes in the other node set and 2 from all other nodes in its own set . Thus the closeness centrality for node :None:None:`v`
in the two bipartite sets :None:None:`U`
with n
nodes and :None:None:`V`
with m
nodes is
where d
is the sum of the distances from :None:None:`v`
to all other nodes.
Higher values of closeness indicate higher centrality.
As in the unipartite case, setting normalized=True causes the values to normalized further to n-1 / size(G)-1 where n is the number of nodes in the connected part of graph containing the node. If the graph is not completely connected, this algorithm computes the closeness centrality for each connected part separately.
A bipartite network
Container with all nodes in one bipartite node set.
If True (default) normalize by connected component size.
Dictionary keyed by node with bipartite closeness centrality as the value.
Compute the closeness centrality for nodes in a bipartite network.
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.bipartite.centrality.betweenness_centrality
networkx.algorithms.bipartite.centrality.degree_centrality
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