View source: R/find_path.R View source: R/extendr-wrappers.R View source: R/extendr-wrappers.R
find_path | R Documentation |
Finds a path between two nodes in a graph.
Different types of graphs use different algorithms to
find the paths. a DirectedGraph
uses breadth-first search
while an DirectedAcyclicGraph
uses topological sort.
The path is represented as a character vector with the node ids of the nodes that make up the path.
find_path(graph, from, to)
graph |
A graph object |
from |
The starting node of the path |
to |
The ending node of the path |
A character vector
Other analyze graphs:
find_all_paths()
,
find_path_one_to_many()
,
get_all_leaves()
,
get_all_roots()
,
get_leaves_under()
,
get_roots_over()
,
least_common_parents()
graph <- graph_builder() |>
add_path(c("A", "B", "C")) |>
build_directed()
find_path(graph, "A", "C")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.