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

The degree centrality for a node :None:None:`v` is the fraction of nodes connected to it.

Notes

The nodes input parameter must contain all nodes in one bipartite node set, but the dictionary returned contains all nodes from both bipartite node sets. See bipartite documentation <networkx.algorithms.bipartite> for further details on how bipartite graphs are handled in NetworkX.

For unipartite networks, the degree centrality values are normalized by dividing by the maximum possible degree (which is :None:None:`n-1` where n is the number of nodes in G).

In the bipartite case, the maximum possible degree of a node in a bipartite node set is the number of nodes in the opposite node set . The degree centrality for a node :None:None:`v` in the bipartite sets :None:None:`U` with n nodes and :None:None:`V` with :None:None:`m` nodes is

$$d_{v} = \frac{deg(v)}{m}, \mbox{for} v \in U , d_{v} = \frac{deg(v)}{n}, \mbox{for} v \in V ,$$

where :None:None:`deg(v)` is the degree of node :None:None:`v`.

Parameters

G : graph

A bipartite network

nodes : list or container

Container with all nodes in one bipartite node set.

Returns

centrality : dictionary

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

Compute the degree centrality for nodes in a bipartite network.

See Also

betweenness_centrality
closeness_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.betweenness_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#6
type: <class 'function'>
Commit: