Function bidirectional_search

Source
pub fn bidirectional_search<N, E, Ix>(
    graph: &Graph<N, E, Ix>,
    start: &N,
    goal: &N,
) -> Result<Option<Vec<N>>>
where N: Node + Debug + Clone + Hash + Eq, E: EdgeWeight, Ix: IndexType,
Expand description

Performs bidirectional breadth-first search to find a path between two nodes

This algorithm searches from both the start and goal nodes simultaneously, which can be more efficient than unidirectional search for finding paths in large graphs.

§Arguments

  • graph - The graph to search
  • start - The starting node
  • goal - The goal node

§Returns

  • Result<Option<Vec<N>>> - The path from start to goal, or None if no path exists