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