NetworkX

Previous topic

networkx.algorithms.centrality.load.edge_load

Next topic

networkx.in_degree_centrality

networkx.degree_centrality

degree_centrality(G)

Compute the degree centrality for nodes.

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

Parameters:

G : graph

A networkx graph

Returns:

nodes : dictionary

Dictionary of nodes with degree centrality as the value.

See also

betweenness_centrality, load_centrality, eigenvector_centrality

Notes

The degree centrality values are normalized by dividing by the maximum possible degree in a simple graph n-1 where n is the number of nodes in G.

For multigraphs or graphs with self loops the maximum degree might be higher than n-1 and values of degree centrality greater than 1 are possible.