networkx.algorithms.centrality.group_degree_centrality

group_degree_centrality(G, S)[source]

Compute the group degree centrality for a group of nodes.

Group degree centrality of a group of nodes \(S\) is the fraction of non-group members connected to group members.

Parameters
  • G (graph) – A NetworkX graph.

  • S (list or set) – S is a group of nodes which belong to G, for which group degree centrality is to be calculated.

Raises

NetworkXError – If node(s) in S are not in G.

Returns

centrality – Group degree centrality of the group S.

Return type

float

Notes

The measure was introduced in 1.

The number of nodes in the group must be a maximum of n - 1 where n is the total number of nodes in the graph.

References

1

M G Everett and S P Borgatti: The Centrality of Groups and Classes. Journal of Mathematical Sociology. 23(3): 181-201. 1999. http://www.analytictech.com/borgatti/group_centrality.htm