space-search
A library providing basic utilities for performing generic depth-first, breadth-first, and heuristic-guided search space exploration algorithms.
Implement Searchable to perform breadth-first or depth-first searching, and implement ScoredSearchable to perform heuristically guided search space exploration. Pass them to the Searcher and ScoredSearcher structs respectively to create iterators that will search the space for a solution.
Implement Eq + Hash + Clone for your search space state type to benefit from prior explored state checking optimization; if youre unable to, then use the UnhashableSearcher or ScoredUnhashableSearcher iterators, which do not require these additional bounds, but will likely explore the space much less efficiently.
When implementing ScoredSearchable, make sure that higher scoring states are closer to a solution.
use *;
use ;
;
let mut searcher = new;
assert_eq!;
Todo
- search path memorization
- A* shortest path algorithm implementation