net_edge_betweenness: Edge Betweenness Network

View source: R/centrality_measures.R

net_edge_betweennessR Documentation

Edge Betweenness Network

Description

Builds a network in which each edge's weight is replaced by its betweenness: the number of shortest paths between all node pairs that traverse that edge (fractional when shortest paths tie). This is the Nestimate counterpart of tna::betweenness_network() and produces identical values for transition networks; the name differs to avoid a clash with tna::betweenness_network() and igraph::edge_betweenness().

Usage

net_edge_betweenness(x, invert = TRUE, ...)

## S3 method for class 'netobject'
net_edge_betweenness(x, invert = TRUE, ...)

## S3 method for class 'netobject_group'
net_edge_betweenness(x, invert = TRUE, ...)

## Default S3 method:
net_edge_betweenness(x, invert = TRUE, ...)

Arguments

x

A netobject or netobject_group.

invert

Logical. Invert weights to distances by 1/w before computing shortest paths? Default TRUE (correct for probability and frequency networks).

...

Additional arguments (ignored).

Details

For a probability/transition network the edge weights are transition probabilities, so they are inverted to distances (invert = TRUE) before path-finding: the geodesic between two states is then the most probable route rather than the one with the fewest hops. Pass invert = FALSE when the weights already represent distances.

Directedness is taken from the network itself. A directed network yields an asymmetric betweenness matrix; an undirected (symmetric) network yields a symmetric one.

Value

For a netobject: a new netobject (class c("netobject", "cograph_network")) whose $weights are the edge-betweenness scores, with method = "edge_betweenness". Call extract_edges() on it for a tidy per-edge table, or plot() to render it. The object preserves source-network metadata so permutation can test edge-betweenness differences by permuting the source networks. For a netobject_group: a netobject_group of such networks, one per group.

Examples

seqs <- data.frame(
  V1 = c("A","B","A","C"), V2 = c("B","C","B","A"),
  V3 = c("C","A","C","B"))
net <- build_network(seqs, method = "relative")
eb  <- net_edge_betweenness(net)
extract_edges(eb)


Nestimate documentation built on July 11, 2026, 1:09 a.m.