Node+Types


 * Home * Search * Node * Node Types**
 * [[image:img2725.gif link="http://www.netlib.org/utk/lsi/pcwLSI/text/node351.html"]] ||~ || **Node Types** are classifications of nodes as expected inside a minimal alpha-beta tree, or as determined by the search. These types were first formulated by Donald Knuth and Ronald Moore when describing the alpha-beta algorithm and further analyzed by Judea Pearl . While Knuth used the terms Type 1, 2, and 3, Tony Marsland and Fred Popowich introduced the more descriptive terms **PV-**, **Cut-** and **All-nodes**.

Node types as established by the search are stored inside the transposition table, indicating whether the score is either exact, lower or upper bounded. Expected node types, as determined by tree topology, probing the transposition table, or comparing scores of a static evaluation considering threats, or even a reduced search or quiescence search, with the bounds, may be considered by various (parallel) search algorithms and in decisions concerning selectivity. || toc =PV-Nodes= PV-nodes (Knuth's **Type 1**) are nodes that have a score that ends up being inside the window. So if the bounds passed are [a,b], with the score returned s, a[a,b], s>=b. A minimum of one move at a Cut-node needs to be searched. The score returned is a lower bound (might be greater) on the exact score of the node  =All-Nodes= All-nodes (Knuth's **Type 3**), otherwise known as fail-low nodes, are nodes in which no move's score exceeded alpha. With bounds [a,b], s<=a. Every move at an All-node is searched, and the score returned is an upper bound, the exact score might be less.
 * Node Types ||~ ||^ ||
 * Root Node and the Leftmost Nodes are always PV-nodes
 * In Principal Variation Search, PV-nodes are defined by beta-alpha>1
 * All Siblings of a PV-node are expected Cut-nodes
 * In Principal Variation Search Cut-nodes are searched with null windows
 * The child of a Cut-node is an All-node
 * The parent of a Cut-node is either a PV- or All-node
 * The ply distance of a Cut-node to its PV-ancestor is odd
 * In Principal Variation Search All-nodes are searched with null windows
 * The children of an All-node are Cut-nodes
 * The parent of an All-node is a Cut-node
 * The ply distance of an All-node to its PV-ancestor is even

=Node Types in PVS=

Onno
Onno by Onno Garms determines expected node types, beside other things, to perform IID not only at PV-nodes but also at expected Cut-nodes. Onno Garms gave the following rules
 * The root node is a PV-node
 * The first child of a PV-node is a PV-node
 * The further children are searched by a scout search as CUT-nodes
 * PVS re-search is done as PV-node
 * The first node of bad pruning is a CUT-node
 * The node after a null move is a CUT-node
 * The first node of null move verification is a CUT-node
 * Internal iterative deepening does not change the node type
 * The first child of a CUT-node is an ALL-node
 * Further children of a CUT-node are CUT-nodes
 * Children of ALL-nodes are CUT-nodes

Summary
Following summary was given by Pradu Kannan similar to Onno's definition as an attempt to predict the node type before searching the node by assuming reasonably good move ordering on PV-nodes and Cut-nodes :  =Number of Leaf Nodes=
 * The root node is a PV-node
 * The first child of a PV-node is a PV-node
 * Children of PV-nodes that are searched with a zero-window scout search are Cut-nodes
 * Children of PV-nodes that have to be re-searched because the scout search failed high, are PV-nodes
 * The first child of a Cut-node, and other candidate cutoff moves (nullmove, killers, captures, checks, ...) is an All-node
 * A Cut-node becomes an All-node once the first and all candidate cutoff moves are searched
 * Children of All-nodes are Cut-nodes

Formulas
As emphasized by Daniel Shawul, the formulas for the number of leaf nodes of a certain Node type with uniform depth **n** and branching factor **b**, using [|floor and ceiling] of n/2 (cut the ceiling, all the floor) ...

> math \displaystyle PV = 1 math > math \displaystyle CUT = b^{\lceil n / 2 \rceil} - 1 math > math \displaystyle ALL = b^{\lfloor n / 2 \rfloor} - 1 math

... are already the subexpressions ...

> math \displaystyle L = PV + CUT + ALL math

... in Levin's famous formula demonstrating the odd-even effect of alpha-beta

> math \displaystyle L = b^{\lceil n / 2 \rceil} + b^{\lfloor n / 2 \rfloor} - 1 math 

Table
Assuming a constant branching factor of 40, this results in following number of leaves:

b^n math ||= math b^{\lceil n / 2 \rceil} + b^{\lfloor n / 2 \rfloor} - 1 math ||= ||= math b^{\lceil n / 2 \rceil} - 1 math ||= math b^{\lfloor n / 2 \rfloor} - 1 math ||
 * ~ depth ||||||||||~ number of leaves with depth n and b = 40 ||
 * ~ ||~ worst case ||~ best case ||~ PV ||~ CUT ||~ ALL ||
 * = **n** ||= math
 * = 0 ||> 1 ||> 1 ||> 1 ||> 0 ||> 0 ||
 * = 1 ||> 40 ||> 40 ||> 1 ||> 39 ||> 0 ||
 * = 2 ||> 1,600 ||> 79 ||> 1 ||> 39 ||> 39 ||
 * = 3 ||> 64,000 ||> 1,639 ||> 1 ||> 1,599 ||> 39 ||
 * = 4 ||> 2,560,000 ||> 3,199 ||> 1 ||> 1,599 ||> 1,599 ||
 * = 5 ||> 102,400,000 ||> 65,599 ||> 1 ||> 63,999 ||> 1,599 ||
 * = 6 ||> 4,096,000,000 ||> 127,999 ||> 1 ||> 63,999 ||> 63,999  ||
 * = 7 ||> 163,840,000,000 ||> 2,623,999 ||> 1 ||> 2,559,999 ||> 63,999 ||
 * = 8 ||> 6,553,600,000,000 ||> 5,119,999 ||> 1 ||> 2,559,999 ||> 2,559,999  ||

=Quotes= Robert Hyatt on the distinction between ALL- and CUT-nodes :

=See also=
 * Alpha-Beta
 * Enhanced Forward Pruning
 * Internal Iterative Deepening
 * Move Ordering
 * Odd-Even Effect
 * Principal Variation Search
 * Young Brothers Wait Concept

=Selected Publications=
 * Donald E. Knuth and Ronald W. Moore (**1975**). //An analysis of alpha-beta pruning.// Artificial Intelligence, 6:293–326, 1975. Reprinted in [|Selected Papers on Analysis of Algorithms] by Donald E. Knuth, Published 2000, by Addison-Wesley ISBN: 1-57585-211-5
 * Igor Roizen (**1981**). //On the Average Number of Terminal Nodes examined by Alpha-Beta//. Technical Report UCLA-ENG-CSL-8108, [|University of California at Los Angeles], Cognitive Systems Laboratory
 * Judea Pearl (**1982**). //The Solution for the Branching Factor of the Alpha-Beta Pruning Algorithm and its Optimality//. Communications of the ACM, Vol. 25, No. 8, pp. 559-564
 * Tony Marsland, Fred Popowich (**1985**). //Parallel Game-Tree Search.// IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 7, No. 4, pp. 442-452. [|1984 pdf] (Draft)
 * Mark Winands, Jaap van den Herik, Jos Uiterwijk, Erik van der Werf (**2003**). //Enhanced forward pruning.// [|pdf] » Enhanced Forward Pruning

=Forum Posts=

2000 ...
> [|Re: Fruit - Question for Fabien] by Fabien Letouzey, CCC, March 11, 2004
 * [|ALL node definition] by Alvaro Cardoso, CCC, February 21, 2003
 * [|Fruit - Question for Fabien] by Dan Honeycutt, CCC, March 11, 2004 » Fruit, Transposition Table, Principal variation, Principal Variation Search
 * [|Re: Attack table] by Zach Wegner, Winboard Forum, October 22, 2004 » Attack and Defend Maps

2005 ...

 * [|Move ordering at different (Knuth) node types] by Tom Likens, Winboard Forum, February 21, 2006 » Move Ordering
 * [|PV based decisions] by Mark Lefler, Winboard Forum, April 27, 2006
 * [|NMP on ALL nodes] by Onno Garms, Winboard Forum, April 15, 2007 » Null Move Pruning
 * [|Slight enhancement to PVS] by Pradu Kannan, Winboard Forum, June 10, 2007
 * [| Nodes type clarification] by Mathieu Pagé, CCC, October 05, 2008
 * [|Different handling of ALL / CUT nodes] by Gregory Strong, CCC, March 22, 2009

2010 ...

 * [|CUT" vs "ALL" nodes] by Larry Kaufman, CCC, March 7, 2011
 * [|On internal iterative deepening] by Onno Garms, CCC, March 13, 2011 » Internal Iterative Deepening, Onno
 * [|When does a cut-node became an all-node?] by Alcides Schulz, CCC, March 27, 2012
 * [|CUT/ALL nodes ratio] by Daniel Shawul, CCC, June 06, 2013
 * [|LMR at CUT nodes can be arbitrarily bad!] by Michel Van den Bergh, CCC, June 20, 2013 » Late Move Reductions, Python
 * [|Pruning in PV nodes] by Sergei S. Markoff, CCC, January 14, 2014 » Reductions, Root
 * [|Node Types and Thoughts On Their Application] by Cheney Nattress, CCC, February 26, 2014
 * [|Null move pruning on PV nodes] by Eric Oldre, CCC, July 22, 2014 » Null Move Pruning
 * [|LMP in PV nodes] by Peter Österlund, CCC, December 27, 2014 » Move Count Based Pruning, Texel

2015 ...

 * [|Recognizing PV nodes] by Martin Fierz, CCC, March 29, 2016
 * [|What is wrong with doing Nulls & ttcuts in a pv node ?] by Mahmoud Uthman, CCC, January 21, 2017 » Null Move Pruning, PV-Nodes, Transposition Table
 * [|cut nodes] by Folkert van Heusden, CCC, October 18, 2017 » Cut-Nodes

=External Links=
 * [|Analysis of Alpha-Beta Pruning] from the [|Parallel Computing Works] ebook

=References= =What links here?= include page="Node Types" component="backlinks" limit="200"
 * Up one Level**