Learn R Programming

cograph (version 2.0.0)

centrality_kreach: Geodesic K-Path Centrality

Description

Count of nodes reachable within shortest path distance k. Measures how many nodes a given node can reach quickly.

Usage

centrality_kreach(x, mode = "all", k = 3, ...)

Value

Named numeric vector of k-reach centrality values.

Arguments

x

Network input (matrix, igraph, network, cograph_network, tna object).

mode

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

k

Maximum path length. Default 3.

...

Additional arguments passed to centrality (e.g., weighted, directed, invert_weights).

See Also

centrality for computing multiple measures at once.

Examples

Run this code
adj <- matrix(c(0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0), 4, 4)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
centrality_kreach(adj, k = 2)

Run the code above in your browser using DataLab