Function pathfinding::directed::bfs::bfs_loop
source · pub fn bfs_loop<N, FN, IN>(start: &N, successors: FN) -> Option<Vec<N>>
Expand description
Return one of the shortest loop from start to start if it exists, None
otherwise.
start
is the starting node.successors
returns a list of successors for a given node.
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.