Learn R Programming

hydroloom (version 1.1.2)

get_bridge_flowlines: Get Bridge Flowlines

Description

Identifies bridge flowlines (cut edges) in the network. Bridge flowlines are those whose removal would disconnect the network. Flowlines are edges in the underlying node graph, so bridge detection correctly identifies the sole-path flowlines that separate parts of the network -- including flowlines within diversion systems that do not rejoin.

Usage

get_bridge_flowlines(x, quiet = FALSE)

# S3 method for data.frame get_bridge_flowlines(x, quiet = FALSE)

# S3 method for hy get_bridge_flowlines(x, quiet = FALSE)

Value

vector of flowline ids that are bridge flowlines in the network

Arguments

x

data.frame network compatible with hydroloom_names.

quiet

logical quiet messages?

Details

Required attributes: id, toid

Examples

Run this code

x <- data.frame(
  id = c(1, 2, 3, 4, 5, 6, 7, 8, 9),
  toid = c(2, 3, 4, 5, 0, 7, 8, 9, 4)
)

# 1 -> 2 -> 3 -> 4 -> 5
#               ^
#               |
# 6 -> 7 -> 8 -> 9
#
# Dendritic tree: all flowlines are bridges
get_bridge_flowlines(x)

Run the code above in your browser using DataLab