Centralization around several vertex measures

g_centralize(
  x,
  measure = "betweenness",
  directed = TRUE,
  mode = c("all", "out", "in"),
  k = 3,
  damping = 0.85,
  normalized = TRUE,
  method = c("freeman", "sd")
)

Arguments

x

graph

measure

character, name of which centrality index needs to be used

directed

logical, should the graph be considered to be directed (if it is undirected, this is ignored)

mode

parameter for several centrality indices

k

parameter for v_geokpath

damping

parameter for v_pagerank

normalized

Logical scalar. Whether to normalize the graph level centrality score by dividing by the theoretical maximum. Only used when method == "freeman".

method

character, either "freeman" (the default) or "sd"

Value

for method == "freeman" a list, for method == "sd" a numeric. See Details for further info.

Details

Centralization is a method for creating a graph level centralization measure from the centrality scores of the vertices.

Centralization is a general method for calculating a graph-level centrality score based on vertex-level centrality measure.

There are many ways of aggregating vertex-level centrality scores to graph-level centralization. A very common method is the Freeman method.

The formula for this is $$C(G)=\sum_v (\max_w c_w - c_v)$$ where \(c_v\) is the centrality of vertex \(v\).

This is the summed absolute deviation from the maximum of C on G. Generally, this value is normalized by the theoretical maximum centralization score, conditional on the graph and the values of the arguments (such as the choice for mode and directed).

The Freeman method is implemented in method == "freeman". This is the default. When this method is chosen, the function returns a list with the following components:

centralization

The graph level centrality index.

theoretical_max

The maximum theoretical graph level centralization score for a graph with the given number of vertices, using the same parameters. If the normalized argument was TRUE, then the result was divided by this number.

For calculating Freeman centralization with the native packages, see centralize (for igraph objects) or centralization (for network objects).

The "freeman" "method is implemented for "betweenness", "closeness", "degree", and "eigenvector".#'

An alternative way of calculating centralization is by taking the standard deviation of the vertex-level scores. This method is implemented in method == "sd".

When this method is chosen, the function returns the value of the standard deviation.

The "sd" method has been implemented for the centrality indices "betweenness", "closeness", "degree", "eccentricity", "eigenvector", "geokpath", "harmonic", "pagerank", "shapley", and "stress".

Examples

# A BA graph is quite centralized
g <- igraph::sample_pa(1000, m = 4)
g_centralize(g, "degree", method = "freeman")
#> $centralization
#> [1] 0.1534701
#> 
#> $theoretical_max
#> [1] 1994004
#> 
g_centralize(snafun::to_network(g), "degree", method = "freeman")
#> $centralization
#> [1] 0.1534701
#> 
#> $theoretical_max
#> [1] 1994004
#> 
g_centralize(g, "betweenness", method = "freeman")
#> $centralization
#> [1] 0.001418214
#> 
#> $theoretical_max
#> [1] 996004998
#> 
g_centralize(g, "betweenness", method = "freeman", directed = FALSE)
#> $centralization
#> [1] 0.2390259
#> 
#> $theoretical_max
#> [1] 498002499
#> 
g_centralize(g, "betweenness", method = "freeman")
#> $centralization
#> [1] 0.001418214
#> 
#> $theoretical_max
#> [1] 996004998
#> 
g_centralize(g, "closeness", method = "freeman")
#> $centralization
#> [1] 0.4136059
#> 
#> $theoretical_max
#> [1] 499.2499
#> 
g_centralize(g, "closeness", method = "freeman", mode = "out") # can be NaN
#> $centralization
#> [1] NaN
#> 
#> $theoretical_max
#> [1] 998.001
#> 
# eigenvector does not work for this directed graph, so make it undirected
g_centralize(g, "eigenvector", method = "freeman", directed = FALSE) 
#> $centralization
#> [1] 0.941694
#> 
#> $theoretical_max
#> [1] 998
#> 

# The most centralized graph according to eigenvector centrality
g0 <- igraph::make_graph(c(2,1), n = 10, dir = FALSE)
g1 <- igraph::make_star(10, mode = "undirected")
g_centralize(g0, "eigenvector", method = "freeman")$centralization
#> [1] 1
g_centralize(g1, "eigenvector", method = "freeman")$centralization
#> [1] 0.75

# method sd
g_centralize(g, "degree", method = "sd")
#> [1] 20.05497
g_centralize(g, "degree", method = "sd", mode = "out")
#> [1] 0.1730027
g_centralize(g, "betweenness", method = "sd")
#> [1] 81.51237
g_centralize(g, "betweenness", method = "sd", directed = FALSE)
#> [1] 6611.934
g_centralize(g, "betweenness", method = "sd")
#> [1] 81.51237
g_centralize(g, "closeness", method = "sd")
#> [1] 3.230691e-05
g_centralize(g, "closeness", method = "sd", mode = "out") 
#> [1] 0.04703194
g_centralize(g, "eccentricity", method = "sd")
#> [1] 0.402931
g_centralize(g, "eigenvector", directed = FALSE, method = "sd")
#> [1] 0.02310723
g_centralize(g, "geokpath", method = "sd", k = 4)
#> [1] 0.04469897
g_centralize(g, "geokpath", method = "sd", k = 2)
#> [1] 175.9244
g_centralize(g, "harmonic", method = "sd")
#> [1] 36.75391
g_centralize(g, "pagerank", method = "sd", damping = .9)
#> [1] 0.007685786
g_centralize(g, "pagerank", method = "sd", damping = .5)
#> [1] 0.003576802
g_centralize(g, "shapley", method = "sd")
#> [1] 3.133777
g_centralize(g, "stress", method = "sd")
#> [1] 116.0976