Transposition table

Transposition table

In computer chess and other computer games, transposition tables are used to speed up the search of the game tree. Transposition tables are primarily useful in perfect information games, meaning the entire state of the game is known to all players at all times.

Game playing programs work by analyzing millions of positions that could arise in the next few moves of the game. Typically, these programs employ strategies resembling depth-first search, which means that they do not keep track of all the positions analyzed so far. In many games, it is possible to reach a given position in more than one way. These are called transpositions. [ [http://www.gamedev.net/reference/programming/features/chess2/page4.asp Transposition Tables] Gamedev.net, Francois-Dominic Laramee] In chess, for example, the sequence of moves "1. d4 Nf6 2. c4 g6" has 4 possible transpositions, since either player may swap his or her move order. In general, after "n" moves, the maximum number of possible transpositions is "(n!)²". Although many of these are illegal move sequences, it is still likely that the program will end up analyzing the same position several times.

To avoid this problem, transposition tables are used. Such a table is a hash table of each of the positions analyzed so far up to a certain depth. On encountering a new position, the program checks the table to see if the position has already been analyzed. (This can be done in constant time, without searching through the entire table.) If so, the table contains the value that was previously assigned to this position; this value is used directly. If not, the value is computed and the new position is entered into the hash table.

The computation saved by a transposition table lookup is not just the evaluation of a single position - if that were the case, it would hardly be worth the effort, since evaluation functions are designed to be very fast anyway. Instead, the evaluation of an entire subtree is avoided. Thus, transposition table entries for nodes at a shallower depth in the game tree are more valuable (since the size of the subtree rooted at such a node is larger) and are therefore given more importance when the table fills up and some entries must be discarded.

The hash table implementing the transposition table can have other uses than finding transpositions. In alpha-beta pruning, the search is fastest (in fact, optimal) when the child of a node corresponding to the best move is always considered first. Of course there is no way of knowing the best move, but when iterative deepening is used, the move which was found to be the best in a shallower search is a good approximation. Therefore this move is tried first. For storing the best child of a node, the entry corresponding to that node in the transposition table is used.

Use of a transposition table can lead to incorrect results if the Graph History Interaction problem is not studiously avoided. This problem arises in certain games because the history of a position may be important. For example, in chess a player may not castle if the king or the rook to be castled with have moved during the course of the game. A common solution to this problem is to add the castling rights as part of the Zobrist hashing key. Another example is draw by repetition: given a position, it may not be possible to determine if it has already occurred. A solution to the general problem is to store history information in each node of the transposition table, but this is inefficient and rarely done in practice.

Related techniques

* Similar techniques can be used to cache evaluations of certain features of a position. For example, a "pawn hash table" can be used to store an evaluation of the pawn structures in a position. Since the number of pawn positions examined is generally much smaller than the total number of positions searched, the pawn hash table has a very high hit rate, allowing a program to perform sophisticated pawn evaluations without significantly reducing efficiency.
* A "refutation table" can be used to store sequences of moves from the root node to leaf nodes. This includes the principal variation and responses to other lines showing that they are inferior. Refutation tables were sometimes used instead of transposition tables in the earlier years of computer chess, when memory was more limited. Some modern chess programs use refutation tables in addition to transposition tables for move ordering.

ee also

* Minimax algorithm
* Alpha-beta pruning
* Zobrist hashing

External links, references, and further reading

* [http://www.sigmachess.com/_usersmanual/ManualData/TransTables.html Transposition Tables] Sigmachess.com
* [http://web.archive.org/web/20070822204120/www.seanet.com/~brucemo/topics/hashing.htm Technical The Main Transposition Table] (information on the data structure and implementation)
* [http://www.cs.ualberta.ca/~tony/ICCA/anatomy.html The anatomy of chess programs] T.A. Marsland, University of Alberta


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Transposition driven scheduling — (TDS) is a load balancing algorithm for parallel computing. It was developed at the Vrije Universiteit in Amsterdam, The Netherlands as an algorithm to solve puzzles. The algorithm provides near linear speedup with some problems and scales… …   Wikipedia

  • Transposition — may mean: * Transposition (cardiac), a congenital heart defect with malformation of any of the major vessels. * Transposition (chess), different moves or a different move order leading to the same position, especially during the openings. *… …   Wikipedia

  • Transposition (chess) — A transposition in chess is a sequence of moves that results in a position which may also be reached by another, more common sequence of moves. Transpositions are particularly common in opening, where a given position may be reached by different… …   Wikipedia

  • Transposition cipher — In cryptography, a transposition cipher is a method of encryption by which the positions held by units of plaintext (which are commonly characters or groups of characters) are shifted according to a regular system, so that the ciphertext… …   Wikipedia

  • table — ● n. f. ● 1. ►BASDON Collection de listes d enregistrements, ceux ci correspondants à des champs. Une table est donc un tableau à deux dimensions. ● 2. Une Table de Caractères est une façon de coder l alphabet et les signes couramment utilisés.… …   Dictionnaire d'informatique francophone

  • Jeu de rôle sur table — Groupe de joueurs durant une partie privée. Les dés, feuilles de personnages, crayons, boissons et collations sont les ingrédients d une partie classique de jeu de rôle sur table. Un jeu de rôle ou JdR (de l anglais roleplaying game abrégé RPG),… …   Wikipédia en Français

  • Zobrist hashing — is a technique for creating hash codes, usually from something like a Chess position. A table of random values is created, with each position on the board having a value associated with it for every possible state it can be in (eg, Black, White… …   Wikipedia

  • Mizar chess engine — Mizar Developer(s) Nicola Rizzuti Stable release 3.0 / May 16, 2006 Written in C Operating system Windows …   Wikipedia

  • ADFGVX cipher — In cryptography, the ADFGVX cipher was a field cipher used by the German Army during World War I. ADFGVX was in fact an extension of an earlier cipher called ADFGX. Invented by Colonel Fritz Nebel and introduced in March 1918, the cipher was a… …   Wikipedia

  • Outline of chess — A game of chess, in the starting position. See also: Glossary of chess and Index of chess articles The following outline is provided as an overview of and topical guide to chess: Chess – two player board game played on a chessboard, a square …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”