[][src]Function rs_graph::shortestpath::dijkstra::find_directed_path

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

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

This is a convenience wrapper to run the search on an directed 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.