functionMap (version 1.0.0)

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

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

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.