Skip to main content

dijkstra_path

Function dijkstra_path 

Source
pub fn dijkstra_path(
    graph: &Graph,
    start: NodeId,
    end: NodeId,
) -> Option<Vec<NodeId>>
Expand description

Computes the shortest path from start to end node.

§Arguments

  • graph - The graph with edge weights
  • start - The starting node
  • end - The destination node

§Returns

Some(path) if a path exists, None otherwise