heuristic-search
Explicit-state heuristic graph search: A*, weighted and anytime, bounded-suboptimal, bidirectional, incremental and real-time search
cargo add heuristic-search Who it is for
Anyone who has a graph, or a problem that can be phrased as one, and needs a path through it: a planner that generates its states on the fly, a robot or a game character on a grid. The graph stays in your code; you describe it through small traits (Successors, and Predecessors for the bidirectional searches), pass the goal test and the heuristic as separate values, and get back a path, an outcome and the expansion counters. The crate knows nothing about PDDL, SAS+ or any other model, so domain-specific representations sit on top of it rather than in it.
It is also meant for comparing algorithms on the same problem: every search uses the same traits, budgets and statistics, so trying IDA* or Weighted A* instead of A* changes the call, not the problem description. Symbolic (BDD), multi-objective, stochastic and width-based search are out of scope.
Algorithms 40
- A* A star
Best-first search ordered by g + h, optimal with an admissible heuristic.
- AD* Anytime Dynamic A*
Anytime Dynamic A*: D* Lite with anytime weighted repair.
- ANA* Anytime Nonparametric A*
Anytime Nonparametric A*: anytime search without a weight schedule.
- ARA* Anytime Repairing A*
Anytime Repairing A*: anytime weighted search that improves its solution as the weight decreases.
- BAE* Bidirectional A* with error · Bidirectional A* with Error
Bidirectional A* with error.
-
Incomplete beam search with a fixed width; reports a cutoff when the width pruned.
- Beam-stack search Beam stack search
Complete and anytime beam search, optimal once it completes, with a fixed beam width.
- Bidirectional BFS Bidirectional breadth-first search · bidirectional breadth-first search · bibfs-uc
Bidirectional breadth-first search that meets by a user relation between states and backward nodes.
- Bidirectional Dijkstra BiDij
Bidirectional Dijkstra's algorithm with path replay at the meeting point.
-
Breadth-first search over a user-described graph.
- D* Lite D star Lite
Incremental search towards a fixed goal from a moving start, with start moves keyed by km.
- Depth-limited DFS Depth-limited search
Depth-first search with a depth limit; depth cutoffs are reported apart from budget stops.
- DFS Depth-first search
Depth-first search.
- DIBBS Dynamically Improved Bounds Bidirectional Search
Dynamically Improved Bounds Bidirectional Search.
- Dijkstra's algorithm Dijkstra · Uniform-cost search · UCS
Uniform-cost search returning the cheapest path, the path, outcome and expansion counters.
- DPS Dynamic Potential Search
Dynamic Potential Search, a bounded-suboptimal search.
- EES Explicit Estimation Search
Explicit Estimation Search, a bounded-suboptimal search.
-
D* Lite over the corners of a cost grid with per-cell costs, interpolated any-angle paths through cell edges, cell-change repair and a moving start.
- Focal search A*ε · A* epsilon
Bounded-suboptimal search with a public focal list and tie-breaking, finding a solution within weight times the optimum.
-
Optimal with an admissible heuristic, threshold iterations over a cache of g per state, no priority queue.
- Greedy best-first search GBFS · symbolic greedy best-first search
Greedy best-first search ordered by the heuristic alone.
- IDA* Iterative Deepening A*
Iterative deepening A*: cheapest path with an admissible heuristic in memory linear in the depth.
- IDA* with transposition table IDA*-TT
IDA* with a bounded transposition table.
- IDDFS Iterative deepening DFS · Iterative deepening depth-first search
Iterative deepening depth-first search.
-
Jump Point Search on any uniform 8-connected grid without corner cutting, with exact octile costs.
-
Any-angle search on a line-of-sight grid that defers line-of-sight checks.
- LazySP Lazy Shortest Path
Lazy shortest path for expensive edge evaluation, with an edge evaluator for the true costs.
-
The limited-horizon Bellman update, offline or inside the LSS-LRTA* agent.
- LPA* Lifelong Planning A*
Lifelong Planning A*: A* that repairs its search after edge cost changes.
- LRTA* Learning Real-Time A*
Learning Real-Time A*, with a learned heuristic table that persists across trials.
- LSS-LRTA* Local Search Space LRTA*
Real-time search with an A* lookahead and a Dijkstra update of the learned table.
- MHA* Multi-heuristic A* · Shared MHA*
Shared multi-heuristic A*: one consistent anchor heuristic for the bound, any number of inadmissible ones for guidance.
- NBS Near-Optimal Bidirectional Search
Near-Optimal Bidirectional Search.
- Octile distance Octile heuristic
Octile distance heuristic for 8-connected grids, with the exact octile cost a + b√2 compared without rounding.
- RBFS Recursive best-first search
Recursive best-first search, optimal with an admissible heuristic in memory linear in the depth, iterative so deep paths cannot overflow the stack.
- RTA* Real-Time A*
Real-Time A*, with a learned heuristic table that persists across trials.
- RTAA* Real-Time Adaptive A*
Real-Time Adaptive A*, learning in a table that persists across trials.
- SMA* Simplified memory-bounded A*
A* within a node budget, forgetting and regenerating leaves; finds the cheapest path that fits in memory.
-
Any-angle search on a line-of-sight grid.
- Weighted A* WA*
A* ordered by g + w * h with a rational weight, trading solution quality for speed within factor w.