Learn R Programming

cograph (version 2.0.0)

network_bridges: 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, ...)

Value

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

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

Examples

Run this code
# 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

Run the code above in your browser using DataLab