pub fn find_undirected_path<'a, G, D, W>(
    g: &'a G,
    src: G::Node<'a>,
    snk: G::Node<'a>,
    weights: W
) -> Option<(Vec<G::Edge<'a>>, D)>where
    G: Graph,
    G::Node<'a>: Hash,
    D: 'a + Copy + PartialOrd + Zero + Add<D, Output = D> + Sub<D, Output = D>,
    W: Fn(G::Edge<'a>) -> D,
Expand description

Run a Dijkstra-search on an undirected graph and return the path.

Each edge can be traversed in both directions with the same weight.

This is a convenience wrapper to run the search on an undirected graph with the default data structures and return the resulting path from src to snk.

Parameter

  • g: the graph
  • weights: the (non-negative) edge weights
  • src: the source node
  • snk: the sink node

The function returns the edges on the path and its length.