Skip to main content

Module bfs

Module bfs 

Source
Expand description

Breadth-First Search (BFS) algorithm implementation.

Provides functions for graph traversal, distance calculation, and path reconstruction.

Functionsยง

bfs_distances
Returns distances from the start node to all reachable nodes.
bfs_predecessors
Returns predecessor map for path reconstruction.
bfs_traverse
Returns nodes in BFS visit order from the start node.