Skip to main content

bfs_predecessors

Function bfs_predecessors 

Source
pub fn bfs_predecessors(
    graph: &Graph,
    start_node: NodeId,
) -> HashMap<NodeId, NodeId>
Expand description

Returns predecessor map for path reconstruction.

§Arguments

  • graph - The graph
  • start_node - The starting node

§Returns

HashMap mapping each reachable node to its predecessor in the BFS tree