dfs: Depth First Search

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Finds the elements in the component of root

Usage

1
dfs(adj, root)

Arguments

adj

A named adjacency list of a decomposable grah

root

The node from which the component should be found

Value

All nodes connected to root

Examples

1
2
3
x <- list(a = c("b", "d"), b = c("a", "d"), c = c("b", "a"),
          d = c("e", "f"), e = c("d", "f"), f = c("d", "e"))
dfs(x, "a")

ess documentation built on May 31, 2021, 9:10 a.m.