Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

rustworkx.degree_centrality#

degree_centrality(graph)[source]#

Compute the degree centrality of each node in a graph object.

Parameters:

graph – The input graph. Can either be a PyGraph or PyDiGraph.

Returns:

a read-only dict-like object whose keys are edges and values are the degree centrality score for each node.

Return type:

CentralityMapping