Transposition table
Also known as Hash table (game-tree search)
adversarial game-tree-search
A transposition table remembers what a search learned about a position: its score, whether the score is exact or a bound, and the best move. When another move order reaches the same position, the search answers from the table instead of searching again. An entry answers only at the same remaining depth, or at any depth from its reach on if its search was proven. An exact entry always answers, a bound only when it lies outside the window; the stored best move is tried first otherwise. SlotTable has a fixed number of slots and replaces on every store; MapTable (feature hashbrown) holds entries in a hash map up to a size cap.
Pseudocode
algorithm Alpha-beta-with-table(p, d, α, β, ply)input: position p, depth d, window (α, β), moves from the root ply, table Toutput: the score Alpha-beta(p, d, α, β) returns, with the same boundif d = 0 or moves(p) = ∅ thenreturn evaluate(p)e ← T[key(p)]if ply > 0 and e ≠ nil and serves(e, d) then ▷ the root is always searchedif kind(e) = exact or (kind(e) = at-least and score(e) ≥ β) or (kind(e) = at-most and score(e) ≤ α) thenreturn score(e) ▷ a bound answers only outside the window; it never narrows itif e ≠ nil and best(e) ≠ nil thenmove best(e) to the front of moves(p)v, kind, m ← search the moves of p within (α, β), as Alpha-beta doesT[key(p)] ← (d, v, kind, m, proven, reach) ▷ SlotTable replaces what the slot heldreturn vfunction serves(e, d)return depth(e) = d or (proven(e) and d ≥ reach(e)) ▷ a deeper entry would give another scoreIn the crates
game-tree-searchRemembers scores, bounds and best moves by position key, so a position reached by another move order is answered instead of searched; SlotTable is fixed-size, MapTable (feature hashbrown) grows.
Lineage
Comes from
Nothing on this site.
Papers
- The Greenblatt chess program Richard D. Greenblatt, Donald E. Eastlake, Stephen D. Crocker · 1967· AFIPS '67 (Fall): Proceedings of the November 14-16, 1967, fall joint computer conference
- A New Hashing Method with Application for Game Playing Albert L. Zobrist · 1990· ICCA Journal (reprint of the 1970 technical report)