centrality_harmonic: Harmonic Centrality

View source: R/centrality.R

centrality_harmonicR Documentation

Harmonic Centrality

Description

Harmonic centrality (Marchiori and Latora 2000) sums the inverse shortest-path distances from a node to the other nodes:

H(i) = \sum_{j \ne i} \frac{1}{d_{ij}},

with 1/\infty = 0, so the score is defined on disconnected networks (Boldi and Vigna 2014). centrality_inharmonic() and centrality_outharmonic() are the mode = "in" and mode = "out" forms.

Usage

centrality_harmonic(x, mode = "all", ...)

centrality_inharmonic(x, ...)

centrality_outharmonic(x, ...)

Arguments

x

Network input accepted by centrality.

mode

Direction for directed networks: "all" (default), "out" or "in".

...

Further arguments to centrality. The measure uses invert_weights (default NULL, which inverts for tna input only), alpha (inversion exponent, default 1), cutoff (largest distance counted, default -1 for no limit) and normalized (default FALSE).

Details

Edge weights are read as distances, and invert_weights = TRUE converts a weight w to the distance 1/w^\alpha. weighted = FALSE uses hop counts. mode = "all" treats edges as undirected, "out" uses distances from the node and "in" distances to it. The scores equal igraph::harmonic_centrality() on the weighted graph. normalized = TRUE divides the scores by n - 1, as igraph::harmonic_centrality(normalized = TRUE) does.

Value

A named numeric vector with one score per node, in input node order.

References

Marchiori, M., & Latora, V. (2000). Harmony in the small-world. Physica A, 285(3-4), 539-546. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/S0378-4371(00)00311-3")}.

Boldi, P., & Vigna, S. (2014). Axioms for centrality. Internet Mathematics, 10(3-4), 222-262. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/15427951.2013.865686")}.

See Also

centrality_closeness, centrality_reaching_local, centrality.

Examples

centrality_harmonic(regulation_net)

cograph documentation built on Nov. 19, 2026, 5:07 p.m.