Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

Pattern database

Also known as PDB, Projection, Pattern databases, projection heuristic

abstraction sas-plusplanning-heuristics

A pattern database (PDB) is a heuristic built from a smaller copy of the task. The pattern is a subset of the state variables; the projection keeps only those variables and ignores all others. Every real transition maps to a transition of the projection with the same cost, or to no move at all, so the cheapest cost to a goal in the projection never exceeds the real cost: the heuristic is admissible. The PDB computes these goal distances once, with a backward Dijkstra search from the abstract goal states, and stores them in a table; during search each state costs one table lookup. A larger pattern gives better estimates, but the table grows with the product of the variable domain sizes.

Pseudocode

algorithm PatternDatabase(task, P)input: an SAS+ task, a pattern P of state variablesoutput: a heuristic h that maps a state to a goal distance, or ∞P ← P ∖ derived-variables(task)T ← ∅                                        ▷ transitions of the projectionfor each o in operators(task) dofor each a in abstract-states(P) matching pre(o) dofor each a′ in outcomes(o, a) do         ▷ an effect with a condition outside P may or may not fireT ← T ∪ {(a, o, a′)}G ← {a ∈ abstract-states(P) : goal(task) holds in a}dist ← dijkstra(reverse(T), G, cost)         ▷ goal_distancesreturn hfunction h(s)return dist[rank(s, P)]                      ▷ ∞ for an abstract dead end

In the crates

  • sas-plus

    Projection onto a pattern of variables, the pattern-database abstraction; derived variables are left out and conditional effects are handled so projections stay admissible.

    Projection

  • planning-heuristics

    Pattern database heuristics over sas_plus projections, and any sas_plus abstraction as a heuristic.

    AbstractionHeuristic

Lineage

Comes from

builds on Dijkstra's algorithm

Led to

Canonical PDB heuristic builds on it

Merge-and-shrink generalizes it

Symbolic pattern databases builds on it

Papers

  1. Pattern Databases Joseph C. Culberson, Jonathan Schaeffer · 1998· Computational Intelligence introduces doi 10.1111/0824-7935.00065