shapley_centrality: Shapley Centrality

shapley_centralityR Documentation

Shapley Centrality

Description

This function computes the centrality of vertices based on their Shapley value, following the approach from the Michalak et al. (2013) paper.

Usage

shapley_centrality(x, add.vertex.names = FALSE, vids = igraph::V(x))

Arguments

x

An object of class igraph or network

add.vertex.names

logical, should the output contain vertex names. This requires a vertex attribute name to be present in the graph. It is ignored if the attributed is missing.

vids

Vertices to be considered in the calculation (numeric vector)

Value

Vector with the Shapley centrality values for each vertex

References

Michalak, T.P., Aadithya, K.V., Szczepanski, P.L., Ravindran, B. and Jennings, N.R., 2013. Efficient computation of the Shapley value for game-theoretic network centrality. Journal of Artificial Intelligence Research, 46, pp.607-650.

The code is adapted from CINNA::group_centrality and gives the same result (but our version is slightly more robust).

Examples

# Figure 1 network from Michalak et al.
g1 <- igraph::graph(c(4,1,5,1,1,6,1,7,1,8,8,11,11,12,11,13,6,2,7,2,8,2,
2,9,2,10,9,3,10,3), directed = FALSE)
igraph::V(g1)$name <- paste0("v", 1:13)
shapley_centrality(g1)
shapley_centrality(g1, add.vertex.names = TRUE)

SNAnalyst/DF21 documentation built on March 21, 2022, 12:02 a.m.