Module bfs
graph
0.1.0
Module bfs
Module Items
Structs
Functions
In graph::
prelude
graph
::
prelude
Module
bfs
Copy item path
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.