Solution Trees as a Basis for Game Tree Search Arie de Bruin , Wim Pijls , Aske Plaat ? Technical Report EUR-CS-94-04 , May 1994 Erasmus University , Department of Computer Science P.O.Box 1738 , 3000 DR Rotterdam , The Netherlands plaat@cs.few.eur.nl Abstract A game tree algorithm is an algorithm computing the minimax value of the root of a game tree . Many algorithms use the notion of establishing proofs that this value lies above or below some boundary value . We show that this amounts to the construction of a solution tree . We discuss the role of solution trees and critical trees in the following algorithms : Principal Variation Search , alpha-beta , and SSS-2 . A general procedure for the construction of a solution tree , based on alpha-beta and Null-Window-Search , is given . Furthermore two new examples of solution tree based-algorithms are presented , that surpass alpha-beta ? i.e. , never visit more nodes than alpha-beta , and often less . 1 Introduction Game trees are related to two person zero sum games with perfect information like TicTac-Toe , Checkers , Chess , and Go . Each node in a game tree represents a game position . The root represents a position of the game , for which we want to find the best move . The children of each node n correspond to the positions resulting from one move from that position . The leaves in the tree are positions in the game for which an integer valued evaluation function ? exists giving the so called game value , the pay-off in that position . A game tree is assumed to remain unchanged during the search for the best move , in the sense that we do not look into search enhancements like iterative deepening -LSB- Sch89 -RSB- . We assume that the two players are called MAX and MIN . A node n is marked as max-node or min-node , if in the corresponding position it is max 's or min 's turn to move respectively . We assume that MAX moves from the start position . The evaluation function can be extended to the so called minimax function , a function which determines the value for each player in any node . The definition is : ? -LRB- n -RRB- = max f ? -LRB- c -RRB- ? c is a child of ng , if n is a max node , min f ? -LRB- c -RRB- ? c is a child of ng , if n is a min node . In Figure 1 an example of a game tree is shown labeled with its ? - values . The squares represent max nodes , the circles min nodes . For a game tree G with root r , the value ? -LRB- r -RRB- is also called the minimax value of G , denoted by ? -LRB- G -RRB- . A game tree algorithm is an algorithm computing the root successor with the highest pay-off for MAX?the best move for MAX?or the minimax value of a game tree , from which we can easily infer the best move . The value ? -LRB- n -RRB- in any node n -LRB- n not necessarily a max node -RRB- indicates the highest attainable pay-off for MAX in the position n , under the condition that both players will play optimally in the sequel of the game according to the evaluation function ? . In any node n ? Tinbergen Institute , Erasmus University , and Department of Computer Science , Erasmus University . 6 6 m 6 6 m 6 LL 9 oo \ \ 2 m 2 LL 7 ???? QQQQ8 7 m 8 LL 7 LL m 8 ???????? PPPPPPPP 2 m 4 4 m 4 LL 8 oo \ \ 3 m 3 LL 7 ???? QQQQ 2 1 m 1 LL 9 LL m 2 Figure 1 : A game tree with ? - values . the move for each player to optimize the pay-off is the transition to a child node c such that ? -LRB- c -RRB- = ? -LRB- n -RRB- . In this way , MAX tries to maximize and MIN tries to minimize the profit of MAX . Therefore , an optimal play will proceed along a critical path , which is defined as a path from the root to a leaf such that ? -LRB- n -RRB- has the same value for all nodes n on the path . All nodes on this path have a game value equal to the game value of the root . A node on a critical path is called critical . Overview We conclude this section with an outline of the rest of this paper . In section 2 we will show that in order to get a bound on the minimax value of a game tree , one has to construct a solution tree . In order to prove subsequently that the game value equals a certain value , say ? , it is sufficient to find an upper bound and a lower bound with value ? . In other words , a max and a min solution tree with this value are needed . The union of two such trees is called a critical tree . In section 3 we will investigate how Principal Variation Search -LRB- PVS -RRB- -LSB- FF80 , Pea84 -RSB- and SSS-2 -LSB- PdB92 -RSB- use solution trees to construct this critical tree . The relation between solution trees and Null-Window-Search is discussed . In section 4 we introduce an alpha-beta based bounding procedure for the game value of a node n. Unlike alpha-beta , this procedure also takes into account information that has been gathered in earlier visits of the subtree of the game tree rooted in n. Viewing game tree search in terms of solution trees enables us to discover relations between two algorithms which where hitherto considered to be quite unrelated , viz . PVS and SSS * -LSB- Sto79 , PdB90 -RSB- . In section 5 we introduce two examples of algorithms that use our boundingprocedure to efficiently search game trees . By the theory developed in section 4 these algorithms search no more nodes than alpha-beta . The results of some preliminary tests on their behavior are presented . 2 Solution Trees In all game tree algorithms , the game tree is explored step by step , i.e. , in each step a new node of the tree is visited . So , at each moment during execution of a game tree algorithm , there is a set of nodes which has been visited up to that moment . This subtree of the game tree will be called the search tree . We postulate that for every node in a search tree either all children are included or none . For the leaves in the search tree that are inner nodes in the game tree two tentative values are available , ?? and + ? . Since the computation of ? -LRB- n -RRB- , n a leaf , may be expensive , the tentative values ?? and + ? are also allowed for leaves in the 2 search tree that are also leaves in the game tree . However , its game value ? -LRB- n -RRB- is allowed as well . So , in a leaf in the search tree we have either ? -LRB- n -RRB- or two tentative values . A leaf node of a search tree with tentative minimax values + ? or ?? is called open . A search tree can be viewed as a some kind of game tree , so we can apply the minimax rule to this tree . If all open nodes in a search tree rooted in a node n are given tentative values ?? , then the minimax value of the root is a lower bound to the game value . This value is denoted by ?? -LRB- n -RRB- . If the value + ? is assigned to all open nodes , then we obtain an upper bound ? + -LRB- n -RRB- . Moreover these bounds are the sharpest ones that can be derived from the search tree , cf. -LSB- Iba86 -RSB- . Suppose we have a node n in a game tree , and we want to generate a search tree which establishes a non-trivial upper bound ? + -LRB- n -RRB- < > + ? . If n is a leaf in the game tree , we can simply take ? + -LRB- n -RRB- = ? -LRB- n -RRB- . If n is a max node , we need non-trivial bounds in all children of n. Therefore the search tree should contain all children , none of which can be open . If n is a min node a non-trivial bound is needed for only one of its children , to lower ? + -LRB- n -RRB- below + ? . In summary , to have a non-trivial upper bound ? + , we have to expand all successors of max nodes , and only one successor of min nodes . By recursively applying this prescription down to the leaves of the game tree , taking in the leaves p ? + -LRB- p -RRB- = ? -LRB- p -RRB- , we get a minimal search tree generating a non-trivial upper bound . Such a tree is called a max solution tree . max solution tree min solution tree 6 all m m 6 LL m 2 , , , l ll one m all m 4 LL one m 3 % % 6 one all m m 6 LL 9 ? ? @ @ one all m 8 LL 7 oo % % Figure 2 : Bounds and Solution Trees By analogy , we get a min solution tree by expanding one successor of max nodes , and all successors of min nodes . This yields a min solution tree defining a non-trivial lower bound ?? on ? -LRB- r -RRB- . Figure 2 illustrates this idea . It features a max solution tree and a min solution tree which are subtrees from the game tree of figure 1 -LRB- open nodes are not shown -RRB- . They define respectively an upper bound and a lower bound which is by construction in both cases equal to 6 . -LRB- We have chosen the values in figure 2 to match with those in figure 3 -RRB- The notion of solution trees in game trees is analogous to solution trees in AND/OR trees -LSB- KK84 , Sto79 -RSB- . -RRB- A max solution tree corresponds to an OR solution tree ; a min solution tree to an AND solution tree . Now suppose we have a search tree S with root n for which ? + -LRB- n -RRB- is not trivial , i.e. , ?? < ? + -LRB- n -RRB- < + ? . By induction we will show that S must contain at least one subtree which is a max solution tree with value ? + -LRB- n -RRB- and that all other max solution trees in S define an upper bound ? ? + -LRB- n -RRB- . The basic case is that n is a leaf in S . Now ?? < ? + -LRB- n -RRB- < + ? indicates that n is a leaf in the game tree and that ? + -LRB- n -RRB- = ? -LRB- n -RRB- . Moreover , the only solution tree in S is S itself . We now treat the induction step . Suppose n is a max node . Then for each child c of n we have ? + -LRB- c -RRB- ? ? + -LRB- n -RRB- and there exists a child c ? with ? + -LRB- c ? -RRB- = ? + -LRB- n -RRB- . By induction it is possible for each child c to find a max solution tree rooted in c with value equal to ? + -LRB- c -RRB- . Then the tree consisting of n and all these solution trees is a max solution tree with value ? + -LRB- n -RRB- . Consider an arbitrary max solution tree through n . This tree contains for all children c of n a max solution tree rooted in c . The induction hypothesis tells us that for all these trees we have a value ? max -LRB- ? + -LRB- c -RRB- -RRB- = ? + -LRB- n -RRB- . Finally , suppose n is a min node . Then ? + -LRB- n -RRB- = minf ? + -LRB- c -RRB- ? c child of ng , so there is a child c ? with ? + -LRB- c ? -RRB- = ? + -LRB- n -RRB- . By induction there is a max solution tree rooted in c ? with value ? + -LRB- c ? -RRB- = ? + -LRB- n -RRB- . The solution tree obtained by appending n to this tree is the desired one . Consider an arbitrary max solution tree through n . This tree contains one child c of n. By induction we have that every max solution tree through c defines an upper bound ? ? + -LRB- c -RRB- ? ? + -LRB- n -RRB- . Thus every solution tree through n has the same property . Combining the above result with the observation that every game tree with value ? is also a search tree with ? + = ?? = ? , we now obtain the following result from -LSB- Sto79 -RSB- : For each game tree with value ? there exists a max solution tree defining an upper bound equal to ? . Such a max solution tree will be called optimal . -LRB- Of course , analogous results hold for lower bounds and min solution trees . -RRB- Critical Trees In -LSB- KM75 -RSB- the notion critical tree is introduced as a minimal tree that has to be searched by alpha-beta in order to find the minimax value in a best first game tree . In -LSB- PK87 , p. 462 -RSB- an intuitive explanation is given in terms of optimal strategies for MAX and MIN . In -LSB- KK84 -RSB- the link between an optimal strategy for MAX/MIN and an -LRB- optimal -RRB- min/max solution tree has been explained . All this brings us to the following definition : A critical tree is the union of an optimal max solution tree and an optimal min solution tree . Notice that , if the value of the game tree equals ? , we have that an optimal max solution tree establishes an upper bound on the game value equal to ? , and an optimal min solution tree establishes a lower bound of ? . This shows that indeed a critical tree proves that the game value is equal to ? . 1 1m 1 1m 1 6 LL2 9 oo \ \ ? 2 2m 3 2 ? ? @ @ ? 7 2 3m 2 8 LL2 7 '' '' '' '' bbbb ? 4 2m 3 ? 4 2m 3 4 ?? JJ ? 3 2m 3 3 Figure 3 : A Critical Tree with Node Types Without proof we state the property that the intersection of an optimal max solution tree and an optimal min solution tree is a critical path . Figure 3 is an example of a critical tree . It is the union of the solution trees of figure 2 . The numbers inside the nodes represent Knuth & Moore 's well known node types . For reasons of brevity we will not repeat their -LRB- quite complicated -RRB- definition . Given our solution tree view of the critical tree , Knuth & Moore 's type 1 , type 2 and type 3 nodes can be given another interpretation . Type 1 nodes are in the intersection of the optimal solution trees for the player and its opponent?the critical path . Type 2 nodes are either min nodes of the max solution tree or max nodes of the min solution tree that are not on the critical path . As was noted before , only one successor is needed at these nodes to get a non-trivial bound . Type 3 nodes are max nodes in the max solution tree or min nodes in the min solution tree , that are not on the critical path . All successors are needed at these nodes to get a non-trivial bound . 3 Hypothesis Testing in Game Tree Algorithms Principal Variation Search PVS -LSB- FF80 , CM83 , Rei89 -RSB- and SCOUT -LSB- Pea80 , Pea84 -RSB- are two well known algorithms based on the minimal window search -LSB- FF80 -RSB- or bound-test -LSB- Pea80 -RSB- idea . The following description of PVS holds just as well for SCOUT . PVS constructs a critical tree bottom up . At the start it descends via the left-most successors to the left-most leaf of the game tree . For the moment it is assumed that the path to this leaf , the principal leaf , is the critical path?the Principal Variation -LRB- PV -RRB- in PVS terms . Suppose the value of this leaf is v . Then the assumption implies that the value of the root equals v . This assumption is then tested using a bounding procedure . If the parent of the leaf is a max node , then a proof must be established that no brother of the PV has a higher value . In other words , for every brother a solution tree must be constructed yielding an upper bound on its value , which does not exceed v . If this succeeds we have built a max solution tree rooted in the parent of the leaf at the end of the PV , proving that its game value does not exceed v . If this is not possible , because some brother of the leaf at the end of the PV has a higher value , the bounding procedure generates a min solution tree defining a lower bound on the value of the brother that is higher than v , and the proof fails . In that case the path to this better brother then becomes the new PV-candidate . Since we have only a bound on its value , the game value of this PV-candidate must be found by re-searching the node . -LRB- If the parent of the leftmost leaf in the tree is a min node , then the dual procedure has to be performed . -RRB- Eventually the PV for the parent of the leftmost leaf is found . Its value is proven by the solution trees that bound the value of the brothers of the PV . PVS has realized this by constructing a critical subtree for the current level of the game tree . It then backs up one level along the backbone , to start construction of a critical tree at a higher level , i.e. , for the grandparent of the leftmost leaf in the game tree . This proceeds until the root has been reached and a critical tree below the root has finally been constructed . The bounding procedure that PVS uses is called Null-Window-Search or NWS . It is essentially a call to alpha-beta with a = b ? 1 , which , assuming integer-valued leaves , assures that no leaf value can fall within the search window of ha , bi . The fact that alphabeta not only finds the minimax value of a game tree , but can also be used for provingbounds on it , is obvious when we look at alpha-beta 's postcondition . -LRB- See e.g. -LSB- PdB92 , PdB93b -RSB- . -RRB- The postcondition of v ? alpha-beta -LRB- n , a , b -RRB- is v ? a fi a ? v = ? + -LRB- n -RRB- ? ? -LRB- n -RRB- a < v < b fi v = ? + -LRB- n -RRB- = ?? -LRB- n -RRB- = ? -LRB- n -RRB- v ? b fi b ? v = ?? -LRB- n -RRB- ? ? -LRB- n -RRB- If the first part of the postcondition holds , by the theory of the previous section , alpha-beta must have built a max solution tree . If the middle part holds a critical tree must have been built , and if the third part is established a min solution tree must have been constructed . By calling alpha-beta with a = b ? 1 only the first and last part of the postcondition can occur , which results in either an upper bound ? + -LRB- n -RRB- or a lower bound ?? -LRB- n -RRB- on n . The hypothesis that n , the current PV-candidate , is best , is thus either proven or refuted . SSS-2 SSS-2 has been introduced in -LSB- PdB90 , Pij91 , PdB92 -RSB- as an attempt to give an easier to understand , recursive description of SSS * . Bhattacharya & Bagchi 1993 have introduced another recursive version of SSS * , called RecSSS * -LSB- BB93 -RSB- . However , their aim was different , viz . to obtain an efficient data structure implementing SSS * 's OPEN list . SSS-2 works by establishing successive sharper upper bounds for the root , starting with an upper bound of + ? . The algorithm is built around two procedures , expand and diminish . A call of expand -LRB- n , g -RRB- tries to establish an upper bound to the game value of an open node n which is smaller than g . Expand realizes this by building a max solution tree with value < g . If this is not possible , a min solution tree with value ? g will have been constructed . The procedure diminish tries to refine an upper bound by transforming a max solution tree into a better one by searching for suitable open nodes in this tree and performing an expand on these nodes . The algorithm performs a sequence of calls to diminish applied to the root to obtain sharper max solution trees , until finally this is no longer possible : no lower upper bound can be found , so the optimal upper bound ? + has been established . The last diminish proves this failure because it establishes a min solution tree with lower bound ?? greater than or equal to the previous upper bound . But this means that ?? = ? + , and therefore the algorithm has generated a max solution tree as well as a min solution tree of the same value , i.e. a critical tree . Some remarks on alpha-beta , NWS and Expand In this subsection we look at the relation between alpha-beta , Null-Window-Search , and expand , the bounding procedure of SSS-2 . As was noted before , alpha-beta can be used to construct a solution tree and return a bound by having it search a window of zero size . To achieve this , the search window ha , bi is reduced to a null-window by substituting a = g ? 1 , b = g or a = g , b = g + 1 , for some g . The call to alpha-beta is in effect transformed to a one-parameter call . We will state the postconditions for these cases for convenience , although they are the result of trivial substitutions . a = g ? 1 ? b = g v < g fi g > v = ? + -LRB- n -RRB- ? ? -LRB- n -RRB- v ? g fi g ? v = ?? -LRB- n -RRB- ? ? -LRB- n -RRB- a = g ? b = g + 1 v ? g fi g ? v = ? + -LRB- n -RRB- ? ? -LRB- n -RRB- v > g fi g < v = ?? -LRB- n -RRB- ? ? -LRB- n -RRB- PVS and SCOUT are not interested in knowing whether the game value of the node investigated equals the input parameter g , but only want to know whether v < g or v ? g . When NWS is applied to the brothers of a max PV-candidate we are interested to see whether there are any better brothers?here better means lower : they have a common min parent . -LRB- In case of a min PV-candidate , v ? g or v > g is needed . -RRB- With NWS , this can be realized in the former case by calling alpha-beta -LRB- n , g ? 1 , g -RRB- , in the latter case by calling alpha-beta -LRB- n , g , g + 1 -RRB- , as can be observed from the postconditions given above . Now we turn our attention to SSS-2 . Since SSS-2 performs successive calls to get a lower ? + -LRB- r -RRB- after each call , it does not need the full generality of the three-part postcondition . SSS-2 's bounding procedure expand has the same postcondition as the first -LRB- max brother - -RRB- NWS call : v < g or v ? g . Expand and NWS have the same pre - and postcondition , both are called on empty search trees , and both expand nodes in a left-to-right order . Close inspection of the code of these procedures revealed that they are in fact identical , in the sense that they traverse the same nodes . The dual of SSS-2 performs successive calls , starting with ?? , to get a higher ?? -LRB- r -RRB- after each call . Dual-expand has in this case the same postcondition as the second -LRB- min brother - -RRB- NWS : v ? g or v > g . Dual-expand does the same as NWS for brothers of a min PV-candidate . In the algorithms of section 5 a postcondition of either a lower bound or an upper bound is not sufficient . We need a procedure that constructs a critical tree as well?cf . the middle part of alpha-beta 's postcondition?we want to test the hypothesis that the game value equals g . In this case we can choose a = g ? 1 and b = g + 1 , yielding the following postcondition : v < g fi g > v = ? + -LRB- n -RRB- ? ? -LRB- n -RRB- v = g fi g = v = ? + -LRB- n -RRB- = ?? -LRB- n -RRB- = ? -LRB- n -RRB- v > g fi g < v = ?? -LRB- n -RRB- ? ? -LRB- n -RRB- In the rest of this paper we will sometimes abbreviate a call to alpha-beta -LRB- n , g ? 1 , g + 1 -RRB- to alpha-beta -LRB- n , g -RRB- . 4 A Bounding Procedure Given the need for a procedure to construct solution trees to deliver bounds for proofs , we will focus our attention in this section on how to construct such a procedure . Luckily this turns out to be quite straightforward . A Bounding Procedure for Non-Empty Search Trees Alpha-beta can only be called on open nodes n . In figure 4 we propose a version of alpha-beta that can be called on the root of a non-empty search tree S . This procedure will be useful for the algorithms to be discussed in the next section . We will investigate how alpha-beta should be changed so that it will be able to perform this new task . The procedure will be called S-alpha-beta , since it can be called on a search tree S . In -LSB- PdB92 , PdB93a , PdB93b -RSB- a version of alpha-beta is presented which can be applied to so-called informed game trees -LSB- Iba86 -RSB- . These are trees for which in all internal nodes n a heuristic upper and lower bound to ? -LRB- n -RRB- is available . The idea is that the values ? + -LRB- n -RRB- and ?? -LRB- n -RRB- derived from the search tree rooted in n can be used as these heuristic bounds . -LRB- In a leaf n of the game tree ? + -LRB- n -RRB- = ?? -LRB- n -RRB- = ? -LRB- n -RRB- holds . -RRB- The precondition -LRB- a < b -RRB- and postcondition , as well as the correctness proof of S-alpha-beta are the same as for the heuristic bounds version of alpha-beta -LSB- PdB92 -RSB- . In the previous section we noted the equivalence of expand -LRB- n , g -RRB- and alpha-beta -LRB- n , g ? 1 , g -RRB- . An interesting observation is that diminish -LRB- n , g -RRB- and S-alpha-beta -LRB- n , g ? 1 , g -RRB- have this same postcondition . The difference is that diminish and S-alpha-beta are applied to non-open nodes . The analogy can be extended : if both procedures are applied to the same solution trees , they traverse the same nodes as well . We might say that diminish -LRB- n , g -RRB- is to S-alpha-beta -LRB- n , g ? 1 , g -RRB- what expand -LRB- n , g -RRB- is to alpha-beta -LRB- n , g ? 1 , g -RRB- . We will formalize and prove this claim in a later paper . Narrower Window searches Surpass Wider Window searches It is a well known feature that the narrower the a-b-window , the more cut-offs occur and hence , the smaller the number of expanded nodes is -LSB- CM83 , Pea84 -RSB- . The alpha-beta version function S-alpha-beta -LRB- n , a , b -RRB- fi v ; if a ? ? + -LRB- n -RRB- or ?? -LRB- n -RRB- ? b or ? + -LRB- n -RRB- = ?? -LRB- n -RRB- then if ?? -LRB- n -RRB- ? b then return ?? -LRB- n -RRB- ; else return ? + -LRB- n -RRB- ; if n = open then attach all children to search tree S ; if n = MAX then a ? ? max -LRB- a , ?? -LRB- n -RRB- -RRB- ; g ? ?? ; for c ? firstchild -LRB- n -RRB- to lastchild -LRB- n -RRB- do g ? max -LRB- g , S-alpha-beta -LRB- c , a ? , b -RRB- -RRB- ; a ? ? max -LRB- a ? , g -RRB- ; if g ? min -LRB- b , ? + -LRB- n -RRB- -RRB- then exit for loop ; if n = MIN then b ? ? min -LRB- b , ? + -LRB- n -RRB- -RRB- ; g ? + ? ; for c ? firstchild -LRB- n -RRB- to lastchild -LRB- n -RRB- do g ? min -LRB- g , S-alpha-beta -LRB- c , a , b ? -RRB- -RRB- ; b ? ? min -LRB- b ? , g -RRB- ; if g ? max -LRB- a , ?? -LRB- n -RRB- -RRB- then exit for loop ; update -LRB- ?? -LRB- n -RRB- , ? + -LRB- n -RRB- -RRB- ; return g ; Figure 4 : S-alpha-beta in -LSB- PdB92 , PdB93a , PdB93b -RSB- , suited for game trees with heuristic bounds in each node , expands less nodes as the heuristic bounds become tighter or the a-b gets narrower . -LRB- See the proof ibid . -RRB- Accordingly , a call to S-alpha-beta expands less new nodes , when -LRB- a -RRB- the size of the existing search tree S is greater , or -LRB- b -RRB- the input window is narrower . Therefore , every alpha-beta call with a null-window surpasses the alpha-beta algorithm . -LRB- Here , surpassing is used in the sense of Stockmann 's paper on SSS * -LSB- Sto79 -RSB- , where the set of nodes , expanded at least once , is considered and re-expanding or revisiting actions on such nodes are not taken into account . -RRB- It follows that every sequence of S-alpha-beta calls with null windows surpasses the alpha-beta algorithm . Since SSS-2 consists of a number of NWS calls , this algorithm surpasses alpha-beta . Here , we rediscover a result in -LSB- PdB90 -RSB- extending a weaker result in -LSB- Sto79 -RSB- . Also , -LSB- Rei89 , p. 99 -RSB- shows that PVS surpasses alpha-beta for the same reason . In the next section we present other algorithms built around NWS calls , and hence , surpassing alpha-beta . 5 Two New Solution Tree Algorithms Drawing on the knowledge of bounding procedures and how they are used in other algorithms , we will present in this section a few examples of new ways of using bounding procedures . We do not wish to imply that these two algorithms are the only possible ways of using bounding procedures like S-alpha-beta to create new algorithms . We mention these instances only as examples of what is possible . At the end of this paper , the results of some experiments to determine the performance of these algorithms will be discussed . SSS-0 SSS-2 performs a sequence of calls to establish sharper max solution trees in each iteration . It can be described as repetitive S-alpha-beta -LRB- n , g ? 1 , g -RRB- . This can be formalized in the following pseudo-code fragment , which is adapted from -LSB- PdB90 -RSB- . function SSS-2 -LRB- n -RRB- fi v ; g ? + ? ; repeat g ? g ; g ? S-alpha-beta -LRB- n , g ? 1 , g -RRB- ; until g = g ; return g ; Note that this formulation of SSS-2 makes construction of the dual of SSS-2 almost trivial : g ? ?? ; g ? S-alpha-beta -LRB- n , g , g + 1 -RRB- . A natural extension of the idea of starting the search at + ? is to start the search at a value that we expect to be closer to the game value . We might save ourselves searching some nodes by starting closer -LRB- hopefully -RRB- to our target . The idea to start at some other value than + ? can be regarded as a generalization of SSS-2 . The resulting generalization will be called SSS-0 , for might be a good first approximation . function SSS-0 -LRB- n , g -RRB- fi v ; repeat g ? g ; g ? S-alpha-beta -LRB- n , g ? 1 , g + 1 -RRB- ; until g = g ; return g ; Apart from the different initialization of g and a choice for a and b yielding a three-part postcondition , the code for SSS-0 is the same as SSS-2 . If , after the first call to the bound-procedure , the first bound g = ? + -LRB- n -RRB- or g = ?? -LRB- n -RRB- turns out to be lower than our initial guess , then we have -LRB- by the postcondition -RRB- an ? + . We can perform SSS-2 -LRB- lower the upper bound -RRB- by calling S-alpha-beta . If , on the other hand , the first bound is higher than our guess , then we have an ?? . We can find the game value by performing the dual of SSS-2 -LRB- increase the lower bound -RRB- , which comes down to calling S-alpha-beta as well . SSS-0 may save work because it starts close to ? , and can probably reach ? in fewer steps than SSS-2 -LRB- which starts at ? -RRB- . Given the smaller number of steps , it is hoped that SSS-0 's steps expand about the same number of nodes as SSS-2 's steps?in other words , that the solution trees are about the same size . If SSS-0 performs less steps of which the size is about the same , we would have found a profitable way to make use of heuristic knowledge in the form of a first guess . Stepwise State Space Search?SSS -4 Another possibility to exploit the idea of ? bigger steps get you home sooner ? is to lower S-alpha-beta 's input parameter g in bigger steps than from upper bound to upper bound as in SSS-2 ? keeping ?? -LRB- r -RRB- ? g ? ? + -LRB- r -RRB- , since searching outside the root 's bottom up live window is useless . function SSS-4 -LRB- n -RRB- fi v ; g ? + ? ; repeat g ? g ; g ? S-alpha-beta -LRB- n , g ? 1 , g + 1 -RRB- ; g ? max -LRB- g ? STEPSIZE , ?? -LRB- n -RRB- -RRB- ; until g = g ; return g ; This idea should be compared to SSS-0 . SSS-0 can be used to speed up the search when we have some idea of ? beforehand . SSS-4 can be used to get closer to ? in less steps . A danger inherent to SSS-4 is that it can overshoot the target if the steps are too large . This way of attack resembles somewhat the bisection method used to solve an equation ? -LRB- x -RRB- = 0 . A variation might be to resort to a wide window call to S-alpha-beta , when the bounds have become relatively close : v ? S-alpha-beta -LRB- n , ?? -LRB- n -RRB- , ? + -LRB- n -RRB- -RRB- . Another variation might be to have a variable STEPSIZE . To achieve good performance some application dependent fine tuning will probably be necessary . Average Time Complexity Whether the last two algorithms , SSS-0 and SSS-4 , expand fewer nodes than SSS-2 / SSS * depends on the question whether a null-window call that starts near the game value expands fewer nodes than a call with say + ? . In other words , does a ? bigger steps get you home sooner ? approach work ? -LRB- Bigger in the sense of big steps in return value g , not big solution trees . -RRB- Although this may seem obvious at first , some care is needed here , since it can be shown that there exist game trees in which S-alpha-beta -LRB- n , g = ? + x1 -RRB- expands fewer nodes than S-alpha-beta -LRB- n , g = ? + x2 -RRB- where x1 > x2 . To get an impresssion of the average case performance we have conducted some experiments . We have called SSS-0 with different parameters on a number of artificially constructed uniform game trees , each with game value equal to 504 . We only report for trees of width 5 and depth 9 , although we believe that the results hold for wider trees as well -LRB- e.g. , w = 20 , d = 5 -RRB- . We have generated 100 different trees , using a procedure based on -LSB- MRS87 , Hsu90 -RSB- . The uniformly distributed leaf values ranged from to 999 . The set is made up of 20 different random seeds , whose results are averaged . We show 5 different levels of node ordering -LRB- the probability that the first successor is best -RRB- : from 1 / w -LRB- unordered -RRB- , 25 % ,50 % , 90 % to 100 % -LRB- or perfectly ordered -RRB- . On these 100 trees , we have called SSS-0 with 32 different values for g , the input parameter . On the y-axis the number of expanded nodes -LRB- inner plus leaves -RRB- is shown for different levels of node ordering . On the x-axis the values for the input parameter to SSS-0 are tabulated . -LRB- Figure 5 should not be confused with the ? refutation wall ? graph in -LSB- MRS87 -RSB- , which is a graph of single calls to NWS . The nodecount in figure 5 refers to calls to SSS-0 , which consists of a number of calls to NWS/S-alpha-beta . -RRB- 10000 20000 30000 40000 50000 60000 70000 100 200 300 400 500 600 700 800 900 1000 NodeCount g unordered 25 % 50 % 90 % perfect Figure 5 : Node count of SSS-0 , relative to input parameter To the left of the graph you find the performance of Dual SSS-2 , to the right primal SSS-2 . Figure 5 shows that the closer a search starts to the minimax value of a game tree , the less nodes are expanded , on average . The gain in performance is less in ordered trees . This implies that the ? bigger steps get you home sooner ? idea of SSS-0 and SSS-4 may work in principle , although the actual gains depend on the tree-characteristics of the application at hand . If the results of these preliminary experiments on artificial trees hold for ? real ? trees , encountered in actual application domains , then it would appear that SSS-0 , and probably SSS-4 , are preferable over SSS-2 / SSS * . Whether this is the case is the subject of ongoing research . 6 Future Work We will try to find more , and also more interesting algorithms . For instance , we have experimented with an algorithm ? second best search ? that finds the best successor to the root by trying to establish a proof that it is better than the other root-successors . This can be done by applying S-alpha-beta to a successor of the root with current highest ? + - value , however with a g - parameter equal to the value of the second highest successor of the root . Also , the space complexity of S-alpha-beta must be addressed . By deleting irrelevant parts of the search tree it should be possible to manage S-alpha-beta 's memory usage . A transposition table approach , i.e. , a scheme comparable to hash tables common in chess programs might be advantageous in this respect . -LRB- -LSB- BB86 -RSB- discusses similar issues for RecSSS * . -RRB- We plan to look into the effect of tree characteristics on the relative performance of the preceding algorithms . Furthermore we will try to extend this research to parallel versions of the algorithms . Our hope is to base a taxonomy of -LRB- parallel -RRB- game tree algorithms on the way they generate and handle solution trees and critical trees . We believe that the relation of our work to search enhancements like iterative deepening and transposition tables deserves some attention . Finally , the relation with other algorithms like Proof Number Search -LSB- AvdMvdH94 -RSB- , B * -LSB- Ber79 -RSB- , and H * -LSB- Iba87 -RSB- is worth investigating . Acknowledgements We would like to thank Jonathan Schaeffer for inspiration as well as critique . Talking with him has given us the opportunity to look from a different perspective at game tree search . We thank Henri Bal of the Department of Computer Science of the Free University Amsterdam for generously letting us use their equipment to run our tests . References -LSB- AvdMvdH94 -RSB- L. Victor Allis , Maarten van der Meulen , and H. Jaap van den Herik , Proof-number search , Artificial Intelligence 66 -LRB- 1994 -RRB- , 91 ? 124 . -LSB- BB86 -RSB- Subir Bhattacharya and A. Bagchi , Making best use of available memory when searching game trees , AAAI-86 , 1986 , pp. 163 ? 167 . -LSB- BB93 -RSB- Subir Bhattacharya and A. Bagchi , A faster alternative to SSS * with extension to variable memory , Information processing letters 47 -LRB- 1993 -RRB- , 209 ? 214 . -LSB- Ber79 -RSB- Hans J. Berliner , TheB * tree searchalgorithm : A best-first proof procedure , Artificial Intelligence 12 -LRB- 1979 -RRB- , 23 ? 40 . -LSB- CM83 -RSB- Murray S. Campbell and T. A. Marsland , A comparison of minimax tree search algorithms , Artificial Intelligence 20 -LRB- 1983 -RRB- , 347 ? 367 . -LSB- FF80 -RSB- John P. Fishburn and Raphael A. Finkel , Parallel alpha-beta search on arachne , Tech . Report 394 , Computer Sciences Dept , University of Wisconsin , Madison , WI , 1980 . -LSB- Hsu90 -RSB- Feng-Hsiung Hsu , Large scale parallelization of alpha-beta search : An algorithmic and architectural study with computer chess , Ph.D. thesis , Carnegie Mellon University , Pittsburgh , PA , February 1990 . -LSB- Iba86 -RSB- Toshihide Ibaraki , Generalization of alpha-beta and SSS * search procedures , Artificial Intelligence 29 -LRB- 1986 -RRB- , 73 ? 117 . -LSB- Iba87 -RSB- Toshihide Ibaraki , Game solving procedure H * is unsurpassed , Discrete Algorithms and Complexity -LRB- D. S. Johnson et al. , ed . -RRB- , Academic Press , Inc. , 1987 , pp. 185 ? 200 . -LSB- KK84 -RSB- Vipin Kumar and Laveen N. Kanal , Parallel branch-and-bound formulations for AND/OR tree search , IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-6 -LRB- 1984 -RRB- , no. 6 , 768 ? 778 . -LSB- KM75 -RSB- Donald E. Knuth and Ronald W. Moore , An analysis of alpha-beta pruning , Artificial Intelligence 6 -LRB- 1975 -RRB- , no. 4 , 293 ? 326 . -LSB- MRS87 -RSB- T. A. Marsland , Alexander Reinefeld , and Jonathan Schaeffer , Low overhead alternatives to SSS * , Artificial Intelligence 31 -LRB- 1987 -RRB- , 185 ? 199 . -LSB- PdB90 -RSB- Wim Pijls and Arie de Bruin , Another view on the SSS * algorithm , Algorithms , International Symposium SIGAL ' 90 , Tokyo , Japan , August 16 ? 18 , 1990 Proceedings -LRB- T. Asano , T. Ibaraki , H. Imai , and T. Nishizeki , eds . -RRB- , LNCS , vol . 450 , SpringerVerlag , August 1990 , pp. 211 ? 220 . -LSB- PdB92 -RSB- Wim Pijls and Arie de Bruin , Searching informed game trees , Tech . Report EUR - CS-92-02 , Erasmus University Rotterdam , Rotterdam , NL , October 1992 , Extended abstract in Proceedings CSN 92 , pp . 246 ? 256 , and Algorithms and Computation , ISAAC 92 -LRB- T. Ibaraki , ed -RRB- , pp. 332 ? 341 , LNCS 650 . -LSB- PdB93a -RSB- Wim Pijls and Arie de Bruin , A framework for game tree algorithms , Tech . Report EUR-CS-93-03 , Dept. of Computer Science , Erasmus University , Rotterdam , The Netherlands , 1993 . -LSB- PdB93b -RSB- Wim Pijls and Arie de Bruin , Generalizing alpha-beta , Advances in Computer Chess 7 , Maastricht -LRB- H.J. van den Herik , ed . -RRB- , July 1993 . -LSB- Pea80 -RSB- Judea Pearl , Asymptotical properties of minimax trees and game searching procedures , Artificial Intelligence 14 -LRB- 1980 -RRB- , no. 2 , 113 ? 138 . -LSB- Pea84 -RSB- Judea Pearl , Heuristics ? intelligent search strategies for computer problem solving , Addison-Wesley Publishing Co. , Reading , MA , 1984 . -LSB- Pij91 -RSB- Wim Pijls , Shortest paths and game trees , Ph.D. thesis , Erasmus University Rotterdam , Rotterdam , NL , November 1991 . -LSB- PK87 -RSB- Judea Pearl and Richard E. Korf , Search techniques , Annual Reviews Computer Science 2 -LRB- 1987 -RRB- , 451 ? 467 . -LSB- Rei89 -RSB- Alexander Reinefeld , Spielbaum suchverfahren , volume Informatik-Fachberichte 200 . Springer Verlag , 1989 . -LSB- Sch89 -RSB- Jonathan Schaeffer , The history heuristic and alpha-beta search enhancements in practice , IEEE Transactions on Pattern Analysis and Machine Intelligence PAMI-11 -LRB- 1989 -RRB- , no. 1 , 1203 ? 1212 . -LSB- Sto79 -RSB- G. Stockman , A minimax algorithm better than alpha-beta ? , Artificial Intelligence 12 -LRB- 1979 -RRB- , no. 2 , 179 ? 196 .

B I O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O B I O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B I O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O O O O O O O O B O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

algorithms
game tree search
solution trees