Find a valid path from one node to many
See also
Other analyze graphs:
find_all_paths(),
find_path(),
get_all_leaves(),
get_all_roots(),
get_leaves_under(),
get_roots_over(),
least_common_parents()
Examples
edges <- data.frame(
parent = c("A", "A", "B", "Z"),
child = c("B", "Z", "Z", "F")
)
graph <- graph_builder() |>
populate_edges(edges, parent, child) |>
build_acyclic()
find_path_one_to_many(graph, "A", edges$child)
#> [[1]]
#> # of nodes: 2
#> | Nodes |
#> | A |
#> | B |
#>
#>
#> [[2]]
#> # of nodes: 2
#> | Nodes |
#> | A |
#> | Z |
#>
#>
#> [[3]]
#> # of nodes: 2
#> | Nodes |
#> | A |
#> | Z |
#>
#>
#> [[4]]
#> # of nodes: 3
#> | Nodes |
#> | A |
#> | Z |
#> | F |
#>
#>