Function pathfinding::astar_bag_collect [] [src]

pub fn astar_bag_collect<N, C, FN, IN, FH, FS>(
    start: &N,
    neighbours: FN,
    heuristic: FH,
    success: FS
) -> Option<(Vec<Vec<N>>, C)> where
    N: Eq + Hash + Clone,
    C: Zero + Ord + Copy,
    FN: Fn(&N) -> IN,
    IN: IntoIterator<Item = (N, C)>,
    FH: Fn(&N) -> C,
    FS: Fn(&N) -> bool

Compute all shortest paths using the A* search algorithm. Whereas astar (non-deterministically) returns a single shortest path, astar_bag returns all shortest paths (in a non-deterministic order).

This is a utility function which collects the results of the astar_bag function into a vector. Most of the time, it is more appropriate to use astar_bag directly.

Warning

The number of results with the same value might be very large in some graphs. Use with caution.