network_bridges: Bridge Edges

View source: R/network-summary.R

network_bridgesR Documentation

Bridge Edges

Description

Finds edges whose removal would disconnect the network. These are critical edges for network connectivity.

Usage

network_bridges(x, count_only = FALSE, ...)

Arguments

x

Network input: matrix, igraph, network, cograph_network, or tna object

count_only

Logical. If TRUE, return only the count. Default FALSE.

...

Additional arguments passed to to_igraph

Value

If count_only = FALSE, data frame with from/to columns. If count_only = TRUE, integer count.

Examples

# Two triangles connected by single edge
adj <- matrix(0, 6, 6)
adj[1,2] <- adj[2,1] <- adj[1,3] <- adj[3,1] <- adj[2,3] <- adj[3,2] <- 1
adj[4,5] <- adj[5,4] <- adj[4,6] <- adj[6,4] <- adj[5,6] <- adj[6,5] <- 1
adj[3,4] <- adj[4,3] <- 1  # Bridge
network_bridges(adj)  # Edge 3-4
network_bridges(adj, count_only = TRUE)  # 1

cograph documentation built on April 1, 2026, 1:07 a.m.