View source: R/network-summary.R
| group_centrality | R Documentation |
Group centrality measures the importance of a set of nodes
C \subseteq V rather than a single node. Three variants are
supported:
group_centrality(
x,
nodes,
measure = c("betweenness", "closeness", "degree"),
mode = c("all", "out", "in"),
normalized = TRUE
)
x |
Network input (matrix, igraph, network, cograph_network, tna object). |
nodes |
Integer vector of node indices (1-based) or character vector
of node names identifying the group |
measure |
One of |
mode |
For directed graphs with |
normalized |
Logical, for |
GBC(C) = \sum_{s,t \in V \setminus C, s \ne t}
\sigma(s, t \mid C) / \sigma(s, t), where \sigma(s, t) is the
number of shortest s-t paths and \sigma(s, t \mid C)
is the number of those paths passing through at least one node in
C. Normalized by 1 / ((|V| - |C|)(|V| - |C| - 1)).
GCC(C) = (|V| - |C|) / \sum_{v \in V \setminus C}
d(v, C), where d(v, C) = \min_{c \in C} d(v, c) is the shortest
distance from v to any group member. Unreachable nodes
contribute 0 to the denominator sum (matching NetworkX convention).
For directed graphs, cograph uses d(v, c) in the original
direction, equivalent to NetworkX's "reverse then multi-source".
GDC(C) = |N(C) \setminus C| / (|V| - |C|), the
fraction of non-group nodes adjacent to at least one group member.
mode = "in" / "out" pick the corresponding directed
neighborhood.
A single numeric scalar — the group centrality of the set
nodes.
networkx.group_betweenness_centrality uses the Puzis-Yahalom-Elovici
iterative algorithm, which produces results that diverge from the textbook
Everett-Borgatti / Puzis 2008 "at least one node in C" definition on some
graph topologies (verified via an independent Python brute-force). cograph
implements the textbook formula directly; group_closeness and group_degree
match NetworkX exactly.
Everett, M. G., & Borgatti, S. P. (1999). The centrality of groups and classes. Journal of Mathematical Sociology, 23(3), 181-201.
Puzis, R., Yahalom, R., & Elovici, Y. (2008). Augmentative data collection for betweenness centrality. In Advances in Social Networks Analysis and Mining (pp. 196-200). IEEE.
centrality for per-node measures.
g <- igraph::make_graph("Zachary")
group_centrality(g, nodes = c(1, 2, 3), measure = "betweenness")
group_centrality(g, nodes = c(1, 2, 3), measure = "closeness")
group_centrality(g, nodes = c(1, 2, 3), measure = "degree")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.