walk_betweenness: Street Network Edge Betweenness Centrality

View source: R/betweenness.R

walk_betweennessR Documentation

Street Network Edge Betweenness Centrality

Description

Computes the edge betweenness centrality for all street segments in a walkable network. Betweenness measures the proportion of potential shortest paths that traverse each street segment. A high value denotes a critical bridge, connector, or structural bottleneck: if interrupted, many potential routes are forced to divert.

Usage

walk_betweenness(
  network,
  snap_tolerance_m = 0,
  radius_m = NULL,
  weights = "length_m",
  directed = FALSE,
  normalized = TRUE
)

Arguments

network

A walk_network object produced by walk_build_network.

snap_tolerance_m

Numeric. Radius in meters for network gap correction (snapping tolerance). If > 0, repairs unconnected endpoints before graph construction. Default is 0.0.

radius_m

Optional numeric. Maximum metric search radius (cutoff) for shortest paths. If NULL or <= 0, calculates global betweenness across the entire connected network.

weights

Character string naming the edge attribute used for path lengths. Default is "length_m".

directed

Logical. If TRUE, considers directed edges; default is FALSE (bidirectional pedestrian walkability).

normalized

Logical. If TRUE, adds a normalized score (0 to 100) and percentile rank. Default is TRUE.

Details

What Edge Betweenness Measures

The betweenness centrality of an edge e is defined as:

C_B(e) = \sum_{s \neq t} \frac{\sigma_{st}(e)}{\sigma_{st}}

where \sigma_{st} is the total number of shortest paths from node s to node t, and \sigma_{st}(e) is the number of those paths that pass through edge e.

Important Methodological Note: Betweenness is a purely structural topological metric. It is not a traffic volume count (aforo) nor a congestion forecast. The tool does not assume vehicle volumes, origin-destination matrices, travel schedules, one-way regulations, or actual speeds. Consequently, high-betweenness (highlighted in red) street segments represent structural network priorities, but should not be conflated with "streets carrying the most traffic".

Network Correction Radius

If snap_tolerance_m > 0, street segments with small digitization gaps or undershoots within that metric tolerance are snapped and reconciled before calculating shortest-path flow, avoiding artificial topological breaks.

Value

A walk_betweenness S3 object containing:

edges

sf LINESTRING data frame with columns betweenness, betweenness_norm, betweenness_pctl, and bottleneck_class.

summary

Summary statistics of betweenness across the network.

top_bottlenecks

Top street segments with highest betweenness.

network

The evaluated walk_network.

snap_tolerance_m

The snapping tolerance used.

radius_m

The cutoff radius used.

Examples

if (requireNamespace("igraph", quietly = TRUE)) {
  data(streets_cusco)
  net <- walk_build_network(streets_cusco, verbose = FALSE)
  bw <- walk_betweenness(net)
  print(bw)
}

walkability documentation built on Nov. 17, 2026, 5:09 p.m.