Currently, the crate only supports single-goal search (dijkstra, astar, bfs) or exhaustive search (dijkstra_all, bfs_reach, etc.).
However, some real-world applications require finding paths to a set of known goal nodes, and doing so efficiently — ideally stopping the search as soon as all targets are reached.
Since I'm rather new to Rust, I don't feel like I'm in the position to propose a solution. Asking ChatGPT resulted in this function header
pub fn dijkstra_multi_goal<N, C, FN, IN>(
start: &N,
successors: FN,
goals: &HashSet<N>,
) -> HashMap<N, (Vec<N>, C)>
where
N: Eq + Hash + Clone,
C: Zero + Ord + Copy,
FN: FnMut(&N) -> IN,
IN: IntoIterator<Item = (N, C)>,
Which doesn't seem to fit your design philosophy (using a success function).