centrality_average_distance: Average Distance

View source: R/centrality.R

centrality_average_distanceR Documentation

Average Distance

Description

Average distance is the sum of the shortest-path distances from a node to every node, divided by n + 1 as in the centiserve package:

AD(v) = \frac{1}{n + 1} \sum_{w} d(v, w).

Lower values mark more central nodes.

Usage

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

Arguments

x

Network input accepted by centrality.

mode

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

...

Further arguments to centrality. The measure uses weighted (default TRUE), invert_weights (default NULL, which is TRUE for tna input), alpha (inversion exponent, default 1) and cutoff (largest path length considered, default -1 for no limit).

Details

Edge weights are read as path lengths. invert_weights = TRUE uses 1/w^\alpha as the length, and weighted = FALSE counts hops. mode sets the direction of the paths. A node that cannot reach every other node scores Inf, so on a disconnected network every score is Inf.

Value

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

See Also

centrality_barycenter, centrality_closeness, centrality.

Examples

centrality_average_distance(regulation_net)

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