BFS
#
Problem Specification#
Input, an unweighted graph, and a source, . The input graph can either be undirected or directed.
#
Output, a mapping where is the parent of in the output BFS-tree rooted at , and .
#
Algorithm ImplementationsWe implement a non-deterministic parallel breadth-first search as our BFS implementation in GBBS. The implementation is based on the one from Ligra. More details about our implementation can be found in Section 6.1 of [1].
We provide a tutorial on how to implement this BFS example in our tutorial.
The code for our implemenation is available here.
#
Cost BoundsThe algorithm runs in work and
depth, which follows from our bounds on the edgeMap
primitive.
#
Compiling and RunningThe benchmark can be compiled by running:
It can then be run on a test input graph in the uncompressed format as follows:
It can then be run on a test input graph in the compressed format as follows:
#
References[1] Laxman Dhulipala, Guy Blelloch, and Julian Shun
Theoretically Efficient Parallel Graph Algorithms Can Be Fast and Scalable
Proceedings of the ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 393-404, 2018.