Module bfs

Module bfs 

Source
Expand description

Breadth-first search with distances and BFS tree.

Structs§

BfsTree
BFS result containing both hop distances and the parent map for path reconstruction.

Functions§

bfs
Runs a breadth-first search from start and returns a map of NodeId → shortest hop distance from start.
bfs_tree
Runs BFS from start and returns a BfsTree with distances and parents.