centrality {wdnet} | R Documentation |
Centrality measures
Description
Computes the centrality measures of the nodes in a weighted and directed network.
Usage
centrality(
netwk,
adj,
edgelist,
edgeweight,
directed = TRUE,
measure = c("degree", "closeness", "wpr"),
degree.control = list(alpha = 1, mode = "out"),
closeness.control = list(alpha = 1, mode = "out", method = "harmonic", distance =
FALSE),
wpr.control = list(gamma = 0.85, theta = 1, prior.info = NULL)
)
Arguments
netwk |
A |
adj |
An adjacency matrix of a weighted and directed network. |
edgelist |
A two-column matrix representing edges of a directed network. |
edgeweight |
A vector representing the weight of edges. |
directed |
Logical. Indicates whether the edges in |
measure |
Which measure to use: "degree" (degree-based centrality), "closeness" (closeness centrality), or "wpr" (weighted PageRank centrality)? |
degree.control |
A list of parameters passed to the degree centrality measure:
|
closeness.control |
A list of parameters passed to the closeness centrality measure:
|
wpr.control |
A list of parameters passed to the weighted PageRank centrality measure:
|
Value
A list of node names and associated centrality measures
Note
The degree-based centrality measure is an extension of function
strength
in package igraph
and an alternative of function
degree_w
in package tnet
.
The closeness centrality measure is an extension of function
closeness
in package igraph
and function closeness_w
in package tnet
. The method of computing distances between vertices
is the Dijkstra's algorithm.
The weighted PageRank centrality measure is an extension of function
page_rank
in package igraph
.
References
Dijkstra, E.W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1, 269–271.
Newman, M.E.J. (2003). The structure and function of complex networks. SIAM review, 45(2), 167–256.
Opsahl, T., Agneessens, F., Skvoretz, J. (2010). Node centrality in weighted networks: Generalizing degree and shortest paths. Social Networks, 32, 245–251.
Zhang, P., Wang, T. and Yan, J. (2022) PageRank centrality and algorithms for weighted, directed networks with applications to World Input-Output Tables. Physica A: Statistical Mechanics and its Applications, 586, 126438.
Zhang, P., Zhao, J. and Yan, J. (2020+) Centrality measures of networks with application to world input-output tables
Examples
## Generate a network according to the Erd\"{o}s-Renyi model of order 20
## and parameter p = 0.3
edge_ER <- rbinom(400, 1, 0.3)
weight_ER <- sapply(edge_ER, function(x) x * sample(3, 1))
adj_ER <- matrix(weight_ER, 20, 20)
mydegree <- centrality(
adj = adj_ER,
measure = "degree", degree.control =
list(alpha = 0.8, mode = "in")
)
myclose <- centrality(
adj = adj_ER,
measure = "closeness", closeness.control =
list(alpha = 0.8, mode = "out", method = "harmonic", distance = FALSE)
)
mywpr <- centrality(
adj = adj_ER,
measure = "wpr", wpr.control =
list(gamma = 0.85, theta = 0.75)
)