View source: R/centrality-batch11.R
| centrality_gravity | R Documentation |
G(i) = \sum_j m_i m_j / d_{ij}^{2}, optionally truncated at
gravity_radius. The published members of the family differ only in
the mass and the reach:
centrality_gravity(
x,
mode = "all",
gravity_mass = "kshell",
gravity_radius = 3,
...
)
x |
Network input: matrix, igraph, network, cograph_network, or tna object. |
mode |
Direction: |
gravity_mass |
|
gravity_radius |
Largest distance to include: a number,
|
... |
Additional arguments passed to |
k-shell mass, radius 3 – the default.
gravity_mass = "degree", gravity_radius = NULL.
gravity_mass = "degree", gravity_radius = "auto",
which uses their empirical half-mean-distance heuristic (eq. 5).
cograph rounds to the nearest integer (ties to even), with minimum
1, using finite positive distances on disconnected graphs. These
rounding and disconnected-graph rules are cograph conventions.
Named numeric vector, one value per node.
Before 2.4.8 this measure computed \sum_j k_j s_j / d_{ij}^2: the
product of degree and k-shell on the partner, no mass at all on the focal
node, and no truncation. That is not the formula of Li et al. (2019) that
its help page cited, and dropping the focal mass changes the ranking
rather than the scale. The default is now Ma et al. (2016).
gravity_mass = "legacy" with gravity_radius = NULL
reproduces the earlier values exactly.
Ma, L.-L., Ma, C., Zhang, H.-F., & Wang, B.-H. (2016). Identifying influential spreaders in complex networks based on gravity formula. Physica A, 451, 205-212.
Li, Z., Ren, T., Ma, X., Liu, S., Zhang, Y., & Zhou, T. (2019). Identifying influential spreaders by gravity model. Scientific Reports, 9, 8387.
centrality_coreness,
centrality_kreach, centrality.
adj <- matrix(0, 6, 6)
adj[cbind(c(1, 1, 2, 4, 4, 5, 3), c(2, 3, 3, 5, 6, 6, 4))] <- 1
adj <- adj + t(adj)
rownames(adj) <- colnames(adj) <- LETTERS[1:6]
centrality_gravity(adj)
centrality_gravity(adj, gravity_mass = "degree", gravity_radius = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.