Find all headwater nodes in a network.

sbn_get_hw(g)

Arguments

g

a river network as an igraph object. Must be a downstream directed graph.

Value

A vector of headwater node id's.

Examples

g <- sbn_create(10, 0.7)
sbn_get_hw(g)
#> [1]  6  7  8  9 10