An SBN river network as a downstream directed igraph object.

sbn_create(n, p)

Arguments

n

desired number of nodes.

p

branching probability, from 0 - 1. Passed to stats::rbinom(), the probability of success in two attempts at adding upstream branches.

Value

A river network as an igraph object.

Details

SBNs are generated using a stochastic branching process. The network generation process starts from an initial downstream node (the river mouth). At each iteration a random node in the network, with no upstream connections is selected, and zero, one or two nodes are added upstream of it, depending on a branching probability (p). This process is repeated until a pre-determined number of nodes across the entire network is attained (n).

Examples

sbn_create(10, 0.7)
#> IGRAPH e206a22 D--- 10 9 -- 
#> + edges from e206a22:
#> [1]  2->1  3->2  4->2  5->3  6->5  7->6  8->7  9->8 10->9