Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
Graph search

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.

    a_star

  • AD* Anytime Dynamic A*

    Anytime Dynamic A*: D* Lite with anytime weighted repair.

    AdStar

  • ANA* Anytime Nonparametric A*

    Anytime Nonparametric A*: anytime search without a weight schedule.

    ana_star

  • ARA* Anytime Repairing A*

    Anytime Repairing A*: anytime weighted search that improves its solution as the weight decreases.

    ara_star

  • BAE* Bidirectional A* with error · Bidirectional A* with Error

    Bidirectional A* with error.

    bae_star

  • 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_bfs

  • Bidirectional Dijkstra's algorithm with path replay at the meeting point.

    bidirectional_dijkstra

  • D* Lite D star Lite

    Incremental search towards a fixed goal from a moving start, with start moves keyed by km.

    DStarLite

  • Depth-limited DFS Depth-limited search

    Depth-first search with a depth limit; depth cutoffs are reported apart from budget stops.

    depth_limited_dfs

  • DFS Depth-first search

    Depth-first search.

    dfs

  • DIBBS Dynamically Improved Bounds Bidirectional Search

    Dynamically Improved Bounds Bidirectional Search.

    dibbs

  • Dijkstra's algorithm Dijkstra · Uniform-cost search · UCS

    Uniform-cost search returning the cheapest path, the path, outcome and expansion counters.

    dijkstra

  • DPS Dynamic Potential Search

    Dynamic Potential Search, a bounded-suboptimal search.

    dps

  • EES Explicit Estimation Search

    Explicit Estimation Search, a bounded-suboptimal search.

    ees

  • Field D* Field D star feature float

    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.

    FieldDStar

  • IDA* Iterative Deepening A*

    Iterative deepening A*: cheapest path with an admissible heuristic in memory linear in the depth.

    ida_star

  • IDA* with a bounded transposition table.

    ida_star_tt

  • IDDFS Iterative deepening DFS · Iterative deepening depth-first search

    Iterative deepening depth-first search.

    iddfs

  • Lazy Theta* Lazy Theta star feature float

    Any-angle search on a line-of-sight grid that defers line-of-sight checks.

    lazy_theta_star

  • LazySP Lazy Shortest Path

    Lazy shortest path for expensive edge evaluation, with an edge evaluator for the true costs.

    lazy_sp

  • The limited-horizon Bellman update, offline or inside the LSS-LRTA* agent.

    lhb_updatelhb_lrta_star

  • LPA* Lifelong Planning A*

    Lifelong Planning A*: A* that repairs its search after edge cost changes.

    LpaStar

  • LRTA* Learning Real-Time A*

    Learning Real-Time A*, with a learned heuristic table that persists across trials.

    lrta_star

  • LSS-LRTA* Local Search Space LRTA*

    Real-time search with an A* lookahead and a Dijkstra update of the learned table.

    lss_lrta_star

  • MHA* Multi-heuristic A* · Shared MHA*

    Shared multi-heuristic A*: one consistent anchor heuristic for the bound, any number of inadmissible ones for guidance.

    mha_star

  • NBS Near-Optimal Bidirectional Search

    Near-Optimal Bidirectional Search.

    nbs

  • Octile distance Octile heuristic

    Octile distance heuristic for 8-connected grids, with the exact octile cost a + b√2 compared without rounding.

    OctileDistance

  • 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.

    rbfs

  • RTA* Real-Time A*

    Real-Time A*, with a learned heuristic table that persists across trials.

    rta_star

  • RTAA* Real-Time Adaptive A*

    Real-Time Adaptive A*, learning in a table that persists across trials.

    rtaa_star

  • SMA* Simplified memory-bounded A*

    A* within a node budget, forgetting and regenerating leaves; finds the cheapest path that fits in memory.

    sma_star

  • Theta* Theta star feature float

    Any-angle search on a line-of-sight grid.

    theta_star

  • A* ordered by g + w * h with a rational weight, trading solution quality for speed within factor w.

    weighted_a_star