Function pathfinding::directed::bfs::bfs_loop[][src]

pub fn bfs_loop<N, FN, IN>(start: &N, successors: FN) -> Option<Vec<N>> where
    N: Eq + Hash + Clone,
    FN: FnMut(&N) -> IN,
    IN: IntoIterator<Item = N>, 

Return one of the shortest loop from start to start if it exists, None otherwise.

Except the start node which will be included both at the beginning and the end of the path, a node will never be included twice in the path as determined by the Eq relationship.