Function rs_graph::shortestpath::dijkstra::start_generic
source · pub fn start_generic<'a, A, D, W, M, P, Accum>(
adj: A,
src: A::Node,
weights: W,
data: (M, P)
) -> Dijkstra<'a, A, D, W, M, P, Accum>where
A: Adjacencies<'a>,
D: Copy + PartialOrd + Zero,
W: Fn(A::Edge) -> D,
M: ItemMap<A::Node, Option<P::Item>>,
P: ItemPriQueue<A::Node, Data<A::Edge, D, NoHeur>>,
Accum: Accumulator<D>,
Expand description
Start and return an Dijkstra-iterator with a custom accumulator and custom data structures.
This function differs from start_with_data
in the additional type
parameter Accum
. The type parameter is the accumulation function for
combining the length to the previous node with the weight of the current
edge. It is usually just the sum (SumAccumulator
). One possible use is
the Prim’s algorithm for the minimum spanning tree problem (see
mst::prim
).