View on GitHub

The PBBS Benchmarks

New version of pbbs benchmarks

Breadth First Search (BFS)

Run a breadth first search on a directed graph starting at a specified source vertex and return a bfs-tree. Duplicate input edges are allowed. The input is in adjacency array format with an ordering among the outgoing edges. If the graph is not connected then only the tree over the vertices reachable from the source should be returned.

The input graph can be represented as desired (probably some form of adjacenty list or adjacency array). The graph can be directed. The search will start at a specified start vertex and search everything reachable from the start.

For a graph with n verticels the output is an integer sequence of lenght n representing a valid BFS tree from the start. In particular each location will be the index of its parent in a BFS tree resulting from the search. The root will point to itself, and any unvisted vertices will have -1 as their entry.

Default Input Distributions

The default input graphs are as follows:

Input and Output File Formats

The input is a graph in the in the adjacency graph format The output will be in be an integer sequence format