library(pipenostics)
# \donttest{
# Find path from A to B in trivial line topology:
flowls("A", "B")
# $B
# [1] 1
# More complex example with two terminal nodes D and E:
flowls(c("A", "B", "B"), c("B", "D", "E"))
#$D
#[1] 1 2
#
#$E
#[1] 1 3
# All possible flow paths in test bench illustrated in `?m325testbench`:
all_paths <- list(
c(12, 13, 11, 8, 4, 1), # hereinafter indexes of acceptor nodes
c(12, 13, 11, 8, 4, 2),
c(12, 13, 11, 8, 6, 5, 3),
c(12, 13, 11, 8, 6, 7),
c(12, 13, 11, 8, 6, 9),
c(12, 13, 11, 10),
c(12, 13, 14, 15),
c(12, 13, 16, 17),
c(12, 13, 16, 18, 20, 19),
c(12, 13, 16, 18, 20, 21),
c(12, 13, 16, 18, 22, 24),
c(12, 13, 16, 18, 22, 25),
c(12, 13, 16, 18, 20, 23, 26)
)
# find those paths:
path <- with(pipenostics::m325testbench, {
flowls(sender, acceptor)
})
path[[4]]
# [1] 12 13 11 8 6 7
# }
Run the code above in your browser using DataLab