Function rs_graph::search::astar::find_directed_path
source · pub fn find_directed_path<'a, G, D, W, H>(
g: &'a G,
src: G::Node<'a>,
snk: G::Node<'a>,
weights: W,
heur: H
) -> Option<(Vec<G::Edge<'a>>, D)>where
G: Digraph,
G::Node<'a>: Hash,
D: 'a + Copy + PartialOrd + Zero + Add<D, Output = D> + Sub<D, Output = D>,
W: Fn(G::Edge<'a>) -> D,
H: AStarHeuristic<G::Node<'a>>,
H::Result: Add<D, Output = D>,
Expand description
Run an A*-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 graphweights
: the (non-negative) edge weightssrc
: the source nodesnk
: the sink nodeheur
: the lower bound heuristic
The function returns the edges on the path and its length.