betweenness_centrality#

betweenness_centrality(graph, k=None, normalized=True)#

Computes the betweenness centrality for nodes in a given graph.

Parameters:
  • graph (GraphView) – A reference to the graph.

  • k (int, optional) – Specifies the number of nodes to consider for the centrality computation. All nodes are considered by default.

  • normalized (bool) – Indicates whether to normalize the centrality values. Defaults to True.

Returns:

Mapping from nodes to their betweenness centrality.

Return type:

NodeStateF64