Given the following directed graph:
g <- make_graph(c("k","z", "x","z", "z","d", "z","a", "a","b",
"b","c", "d","e", "e","c", "c","f", "f","g"), directed = TRUE)
plot(g)
I would like to get all the paths from the two source vertices, "x" and "k", which lead to the target vertex "c", without specifying the source vertices at the beginning of the paths.
Expected result:
path 1: k -> z -> a -> b -> c
path 2: x -> z -> d -> e -> c
At the moment I have figured out how to get all the vertices to the "c" vertex by using subcomponent:
subcomponent(g, "c", mode = "in")
Which is not what I'm looking for.