find_all_paths: Find all paths between two nodes

View source: R/find_path.R View source: R/extendr-wrappers.R View source: R/extendr-wrappers.R

find_all_pathsR Documentation

Find all paths between two nodes

Description

Find all the paths between two nodes in a graph.

Not all graphs support this function. Currently only DirectedAcyclicGraph supports this.

Usage

find_all_paths(graph, from, to)

Arguments

graph

A graph object

from

The starting node of the path

to

The ending node of the path

Value

A list of character vectors

See Also

Other analyze graphs: find_path(), find_path_one_to_many(), get_all_leaves(), get_all_roots(), get_leaves_under(), get_roots_over(), least_common_parents()

Examples

graph <- graph_builder() |>
  add_path(c("A", "B", "C")) |>
  add_path(c("A", "Z", "C")) |>
  add_path(c("A", "B", "A")) |>
  build_directed()

find_all_paths(graph, "A", "C")

orbweaver documentation built on June 8, 2025, 11:40 a.m.