dfs: Depth First Search

View source: R/RcppExports.R

dfsR Documentation

Depth First Search

Description

Finds the elements in the component of root

Usage

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

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 Jan. 10, 2026, 5:06 p.m.