View source: R/centrality-batch42.R
| centrality_neighbor_distance | R Documentation |
Neighborhood centrality adds to a node's own benchmark centrality the
benchmark centrality of the nodes its walks reach, discounted once per
step:
C^n_i(\theta)=\theta_i+a\sum_{j\in\Gamma_i}\theta_j
+a^2\sum_{l\in\Gamma_j\setminus i}\theta_l+\dots
+a^n\sum_{s\in\Gamma_{s-1}\setminus x}\theta_s.
The sums are nested and each level excludes only the node the walk just
came from, so the k-th term sums \theta over the endpoints of
the non-backtracking walks of length k that start at i,
once per walk. A walk may revisit a node it passed earlier, including
i itself; only immediate backtracking is barred. The Zoo calls the
setting nd_mass = "degree", nd_order = 2,
nd_decay = 0.2 the neighbor distance centrality, and that is the
default here; it is the configuration the source recommends.
centrality_neighbor_distance(
x,
nd_order = 2,
nd_decay = 0.2,
nd_mass = "degree",
...
)
x |
Network input accepted by |
nd_order |
Number of steps |
nd_decay |
Per-step decay |
nd_mass |
Benchmark centrality |
... |
Additional arguments to |
This is not the same as summing over distance shells. The
Centrality Zoo (section 2.279, equation 2.1) paraphrases the measure with
sums over N^{(k)}(i), "the set of k-hop neighbors", which
visits each node at most once per level and never revisits a closer one.
The two readings agree on trees and disagree on any graph carrying a
triangle or a cycle of length at most 2n, and the difference is a
per-node offset, not a rescaling. On the triangle-plus-pendant
A-B, A-C, B-C, A-D with the defaults, the walk sums of the source
give 4.16, 3.24, 3.24, 1.76 while distance shells would give
4.00, 3.04, 3.04, 1.76. cograph implements the source equation.
No shell variant is offered: the shell form appears only in a secondary
paraphrase, which also attributes the measure to a different paper whose
text does not contain it.
The source states no normalization, so raw scores grow with
nd_decay and nd_order; normalized = TRUE max-scales
the finished vector and is a cograph convention. nd_decay is
a\in[0,1] in the source, which sweeps 0.1 to 0.5; cograph accepts
any finite value, and a negative or larger one leaves the source's
domain. nd_order = 0 drops every sum and returns \theta
itself, which is what the source says a=0 does.
Uses the simple undirected unweighted skeleton, which is the source
domain: either arc creates one edge, parallel edges count once, and loops
are removed, since a loop would make "the node the walk just came from"
ambiguous. Edge weights, mode, cutoff and path-weight inversion are
ignored. Isolates have every sum empty and score \theta_i, which is
zero for both benchmarks; walks never leave a component, so the raw score
of a node is unchanged by adding a disconnected component. Empty graphs
return no scores. Core numbers follow centrality's
"coreness", so an isolate sits in the zero-shell. Cost is
nd_order dense matrix-vector products, O(n^2) each. Walk counts
grow geometrically in nd_order, so a large order overflows to
infinity; the source considers one to four steps.
Numerical verification establishes agreement with the source equation as printed in the author preprint, not parity with author software, which does not exist, and not any claim about spreading performance.
Named numeric vector in input node order.
Liu, Y., Tang, M., Zhou, T. and Do, Y. (2016). Identify influential spreaders in complex networks, the role of neighborhood. Physica A: Statistical Mechanics and its Applications, 452, 289-298. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.physa.2016.02.028")}.
centrality_semilocal and
centrality_extended_coreness for other neighborhood sums,
and list_centralities for the catalogue.
# Neighbor distance centrality: degree benchmark, two steps, a = 0.2
centrality_neighbor_distance(igraph::make_ring(6))
# The source's other benchmark, and a wider neighborhood
centrality_neighbor_distance(igraph::make_star(7, mode = "undirected"),
nd_order = 3, nd_mass = "coreness")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.