Skip to contents

Retrieves the nodes in a graph that have no parents over a certain node or group of nodes

Usage

get_roots_over(graph, nodes)

Arguments

graph

A graph object

nodes

A character vector of nodes to find roots for

Value

A character vector of nodes

Examples

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

get_roots_over(graph, "D")
#> # of nodes: 1
#> |           Nodes           |
#> |             A             |
#>