rustworkx.group_degree_centrality

group_degree_centrality(graph, group)[source]

Compute the group degree centrality of a set of nodes.

Group degree centrality measures the fraction of non-group nodes that are connected to at least one member of the group. It is defined as:

\[C_D(S) = \frac{|N(S) \setminus S|}{|V| - |S|}\]

where \(N(S)\) is the union of neighborhoods of all nodes in \(S\).

Based on: Everett, M. G., & Borgatti, S. P. (1999). The centrality of groups and classes. Journal of Mathematical Sociology, 23(3), 181-201.

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

  • group (list) – A list of node indices representing the group.

Returns:

The group degree centrality as a float.

Return type:

float