HOME

TheInfoList



OR:

Principal variation search (sometimes equated with the practically identical NegaScout) is a
negamax Negamax search is a variant form of minimax search that relies on the zero-sum property of a two-player game. This algorithm relies on the fact that to simplify the implementation of the minimax algorithm. More precisely, the value of a position ...
algorithm that can be faster than
alpha-beta pruning Alphabeta is an Israeli musical group. Alphabeta or Alpha Beta may also refer to: *The Greek alphabet, from ''Alpha'' (Αα) and ''Beta'' (Ββ), the first two letters *Alpha Beta, a former chain of Californian supermarkets *Alpha and beta anomers ...
. Like alpha-beta pruning, NegaScout is a directional search algorithm for computing the
minimax Minimax (sometimes MinMax, MM or saddle point) is a decision rule used in artificial intelligence, decision theory, game theory, statistics, and philosophy for ''mini''mizing the possible loss for a worst case (''max''imum loss) scenario. When de ...
value of a node in a
tree In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are ...
. It dominates alpha-beta pruning in the sense that it will never examine a node that can be pruned by alpha-beta; however, it relies on accurate node ordering to capitalize on this advantage. NegaScout works best when there is a good move ordering. In practice, the move ordering is often determined by previous shallower searches. It produces more cutoffs than alpha-beta by assuming that the first explored node is the best. In other words, it supposes the first node is in the
principal variation A variation can refer to a specific sequence of successive moves in a turn-based game, often used to specify a hypothetical future state of a game that is being played. Although the term is most commonly used in the context of Chess analysis, it has ...
. Then, it can check whether that is true by searching the remaining nodes with a null window (also known as a scout window; when alpha and beta are equal), which is faster than searching with the regular alpha-beta window. If the proof fails, then the first node was not in the principal variation, and the search continues as normal alpha-beta. Hence, NegaScout works best when the move ordering is good. With a random move ordering, NegaScout will take more time than regular alpha-beta; although it will not explore any nodes alpha-beta did not, it will have to re-search many nodes.
Alexander Reinefeld Alexander Reinefeld (born 1957) is a German computer scientist and games researcher. He is the head of computer science at Zuse Institute Berlin. His contributions to the field include the NegaScout algorithm. Biography Alexander Reinefeld st ...
invented NegaScout several decades after the invention of alpha-beta pruning. He gives a proof of correctness of NegaScout in his book. Another search algorithm called SSS* can theoretically result in fewer nodes searched. However, its original formulation has practical issues (in particular, it relies heavily on an OPEN list for storage) and nowadays most chess engines still use a form of NegaScout in their search. Most chess engines use a transposition table in which the relevant part of the search tree is stored. This part of the tree has the same size as SSS*'s OPEN list would have. A reformulation called MT-SSS* allowed it to be implemented as a series of null window calls to Alpha-Beta (or NegaScout) that use a transposition table, and direct comparisons using game playing programs could be made. It did not outperform NegaScout in practice. Yet another search algorithm, which does tend to do better than NegaScout in practice, is the best-first algorithm called
MTD(f) MTD(f) is an alpha-beta game tree search algorithm modified to use ‘zero-window’ initial search bounds, and memory (usually a transposition table) to reuse intermediate search results. MTD(f) is a shortened form of MTD(n,f) which stands for Me ...
, although neither algorithm dominates the other. There are trees in which NegaScout searches fewer nodes than SSS* or MTD(f) and vice versa. NegaScout takes after SCOUT, invented by
Judea Pearl Judea Pearl (born September 4, 1936) is an Israeli-American computer scientist and philosopher, best known for championing the probabilistic approach to artificial intelligence and the development of Bayesian networks (see the article on belief ...
in 1980, which was the first algorithm to outperform alpha-beta and to be proven asymptotically optimal. Null windows, with β=α+1 in a negamax setting, were invented independently by J.P. Fishburn and used in an algorithm similar to SCOUT in an appendix to his Ph.D. thesis, in a parallel alpha-beta algorithm, and on the last subtree of a search tree root node.


The Idea

Most of the moves are not acceptable for both players, so we do not need to fully search every node to get the exact score. The exact score is only needed in principal variation (a sequence of moves acceptable for both players) which is expected to propagate down to the root. In iterative deepening search, the previous iteration has already established such a sequence. In a node that has a score that ends up being inside the window, which is called PV-node, we search the first move, which is deemed best, in a full window to establish a bound. That is needed to prove other moves are unacceptable. We conducted a zero window search to test if a move can be better. Since a zero window search is much cheaper, it can save a lot of effort. If we find that a move can raise alpha, we do a re-search with the full window to get the exact score. Murray Campbell, Tony Marsland (1983). A Comparison of Minimax Tree Search Algorithms. Artificial Intelligence, Vol. 20, No. 4, pp. 347-367. ISSN 0004-3702.


Pseudocode

function pvs(node, depth, α, β, color) is if depth = 0 or node is a terminal node then return color × the heuristic value of node for each child of node do if child is first child then score := −pvs(child, depth − 1, −β, −α, −color) else score := −pvs(child, depth − 1, −α − 1, −α, −color) ''(* search with a null window *)'' if α < score < β then score := −pvs(child, depth − 1, −β, −score, −color) ''(* if it failed high, do a full re-search *)'' α := max(α, score) if α ≥ β then break ''(* beta cut-off *)'' return α


See also

*
Killer heuristic In competitive two-player games, the killer heuristic is a move-ordering method based on the observation that a strong move or small set of such moves in a particular position may be equally strong in similar positions at the same move (ply) in t ...


References


External links


Computer Chess Programming Theory


Game artificial intelligence Articles with example pseudocode