bfs: Perform a breadth first search (BFS) on a graph

Description Usage Arguments Value

View source: R/graphs.R

Description

Perform a BFS on a graph, from a set of seed vertices. Once all vertices reachable from the seeds are visited, the search terminates.

Usage

1
bfs(graph, seeds)

Arguments

graph

The input graph, an adjacency list.

seeds

The seed vertices, a character vector.

Value

A character vector of vertex names, the visited vertices in the order of their visit.


MangoTheCat/functionMap documentation built on May 7, 2019, 2:10 p.m.