Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

IDA* with transposition table

Also known as IDA*-TT

search heuristic-search

IDA* with a transposition table is IDA* that searches below a state at most once per iteration and path cost. A transposition is a state that more than one path reaches; plain IDA* searches below it again along each of those paths. The table stores, for the current iteration, the smallest g from which each recorded state was searched, and the search skips a state that it reaches again from a g that is not smaller, because the earlier visit had at least as much of the threshold left. Solutions stay optimal with an admissible heuristic. The table has a fixed number of slots and a new entry overwrites an old one, so memory stays bounded and a lost entry only repeats work; use it on graphs with many transpositions, such as grids and permutation puzzles.

Pseudocode

algorithm IDA*-TT(s₀, goal, h, capacity)input: start state s₀, goal test goal, admissible heuristic h, number of table slots capacityoutput: a cheapest path to a goal, or failureTT ← a direct-mapped table with capacity slotsθ ← h(s₀)P ← ⟨s₀⟩while true doforget-all(TT)                             ▷ a new iterationt ← search(P, 0, θ)if t = found thenreturn Pif t = ∞ thenreturn failureθ ← tfunction search(P, g, θ)s ← last(P)if TT[s] ≤ g then                            ▷ searched below already, from no larger greturn ∞if g + h(s) > θ thenreturn g + h(s)TT[s] ← g                                    ▷ overwrites the slot of sif goal(s) thenreturn foundt-min ← ∞for each (s′, c) in successors(s) doif s′ ∉ P thenappend(P, s′)t ← search(P, g + c, θ)if t = found thenreturn foundt-min ← min(t-min, t)remove-last(P)return t-min

In the crates

Lineage

Comes from

builds on IDA*

Led to

Nothing on this site.