Improving Depth-first PN-Search: 1 + ε Trick



Similar documents
Generalized Widening

Monte-Carlo Tree Search Solver

Chapter 13: Binary and Mixed-Integer Programming

FIRST EXPERIMENTAL RESULTS OF PROBCUT APPLIED TO CHESS

Previous Lectures. B-Trees. External storage. Two types of memory. B-trees. Main principles

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

Faster deterministic integer factorisation

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Recursive Best-First AND/OR Search for Optimization in Graphical Models

Full and Complete Binary Trees

Binary Search Trees. Data in each node. Larger than the data in its left child Smaller than the data in its right child

A Least-Certainty Heuristic for Selective Search 1

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

Binary Heap Algorithms

Analysis of Algorithms I: Binary Search Trees

Offline sorting buffers on Line

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

Load Balancing. Load Balancing 1 / 24

Go-Moku and Threat-Space Search

The Goldberg Rao Algorithm for the Maximum Flow Problem

Broadband Networks. Prof. Dr. Abhay Karandikar. Electrical Engineering Department. Indian Institute of Technology, Bombay. Lecture - 29.

Binary Coded Web Access Pattern Tree in Education Domain

From Last Time: Remove (Delete) Operation

Data Structures Fibonacci Heaps, Amortized Analysis

OPTIMAL BINARY SEARCH TREES

The Cross-Platform Implementation

Best-First and Depth-First Minimax Search in Practice

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / October 3, 2012

Classification/Decision Trees (II)

Binary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *

Binary Trees and Huffman Encoding Binary Search Trees

Learning Outcomes. COMP202 Complexity of Algorithms. Binary Search Trees and Other Search Trees

Security-Aware Beacon Based Network Monitoring

Echidna: Efficient Clustering of Hierarchical Data for Network Traffic Analysis

root node level: internal node edge leaf node Data Structures & Algorithms McQuain

Binary search tree with SIMD bandwidth optimization using SSE

A Knowledge-based Approach of Connect-Four

Binary Heaps. CSE 373 Data Structures

Outline BST Operations Worst case Average case Balancing AVL Red-black B-trees. Binary Search Trees. Lecturer: Georgy Gimel farb

Adaptive Online Gradient Descent

Process Intelligence: An Exciting New Frontier for Business Intelligence

The Methodology of Application Development for Hybrid Architectures

CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

Physical Data Organization

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

A Non-Linear Schema Theorem for Genetic Algorithms

Measuring the Performance of an Agent

Big Data and Scripting. Part 4: Memory Hierarchies

B-Trees. Algorithms and data structures for external memory as opposed to the main memory B-Trees. B -trees

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

High-performance local search for planning maintenance of EDF nuclear park

A single minimal complement for the c.e. degrees

SIDN Server Measurements

MapReduce and Distributed Data Analysis. Sergei Vassilvitskii Google Research

Troubleshooting PHP Issues with Zend Server Code Tracing

Algorithms and Data Structures

Interactive comment on A parallelization scheme to simulate reactive transport in the subsurface environment with OGS#IPhreeqc by W. He et al.

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Output: struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr;

Symbol Tables. Introduction

A Tool for Generating Partition Schedules of Multiprocessor Systems

Algorithms Chapter 12 Binary Search Trees

Persistent Binary Search Trees

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

DURING a project s lifecycle many factors can change at

Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)

MATHEMATICAL ENGINEERING TECHNICAL REPORTS. The Best-fit Heuristic for the Rectangular Strip Packing Problem: An Efficient Implementation

Data Structures. Algorithm Performance and Big O Analysis

Challenges in Optimizing Job Scheduling on Mesos. Alex Gaudio

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

A Study on Workload Imbalance Issues in Data Intensive Distributed Computing

Windows Server Performance Monitoring

Online Ensembles for Financial Trading

External Sorting. Why Sort? 2-Way Sort: Requires 3 Buffers. Chapter 13

Merkle Hash Trees for Distributed Audit Logs

Information, Entropy, and Coding

A Case for Dynamic Selection of Replication and Caching Strategies

Integrating Pattern Mining in Relational Databases

Lecture 3: Finding integer solutions to systems of linear equations

Parallel Discrepancy-based Search

How Asymmetry Helps Load Balancing

Lecture 10: Regression Trees

arxiv: v1 [math.pr] 5 Dec 2011

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / September 23, 2014

Clustering UE 141 Spring 2013

Stiffie's On Line Scheduling Algorithm

Technical White Paper. Symantec Backup Exec 10d System Sizing. Best Practices For Optimizing Performance of the Continuous Protection Server

Checkers Is Solved. *To whom correspondence should be addressed.

Flexible mobility management strategy in cellular networks

Distributed Dynamic Load Balancing for Iterative-Stencil Applications

CHAPTER 4 PERFORMANCE ANALYSIS OF CDN IN ACADEMICS

Notes on Factoring. MA 206 Kurt Bryan

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP.

MATHEMATICAL ENGINEERING TECHNICAL REPORTS. A Parallel Tree Contraction Algorithm on Non-Binary Trees

6 March Array Implementation of Binary Trees

Parallel Computing for Option Pricing Based on the Backward Stochastic Differential Equation

A Performance Study of Load Balancing Strategies for Approximate String Matching on an MPI Heterogeneous System Environment

Binary Search Trees CMPSC 122

Compact Representations and Approximations for Compuation in Games

Transcription:

Improving Depth-first PN-Search: 1 + ε Trick Jakub Pawlewicz, Łukasz Lew {pan,lew}@mimuw.edu.pl Institute of Informatics, Warsaw University Banacha 2, 02-097 Warsaw, Poland Abstract. Various efficient game problem solvers are based on PN- Search. Especially depth-first versions of PN-Search like DF-PN or PDS contrarytootherknowntechniques areabletosolvereallyhard problems. However, the performance of DF-PN and PDS decreases dramatically when the search space significantly exceeds available memory. A simple trick to overcome this problem is presented. Experiments on AtariGoandLinesofActionshowgreatpracticalvalueoftheproposed enhancement. 1 Introduction In many popular two-person zero-sum games there often arises a situation with anon-trivialbutforcedwinforoneoftheplayers.inordertocomputeawinning strategy a large tree search is performed. PN-Search like algorithms are able to solveaproblemwithaforcedwinsequenceasdeepas20plyanddeeper. Unfortunately usage of the basic PN-Search is in fact limited to very short runsbecauseofhighmemoryrequirements.thesimpleimprovementispn 2 algorithm which was deeply investigated in[1]. It is still a best-first algorithm and needssomememorytoworkwith,sothelengthofthesinglerunisstilllimited. Several depth-first versions of PN-Search have appeared to overcome the memory requirements problem and they were successful in many fields. Seo[2] successfully appliedittomanydifficultproblemsinhistsume-shogisolverusingpn.the PDSalgorithm anextensionofpn wasdevelopedbynagai[3].another successful algorithm is DF-PN[4] which is a straightforward transformation of PN-Search to a depth-first algorithm. However, all those methods lose their effectiveness on very hard problems when the search lasts so long that the number of positions to explore significantly exceeds the available memory. The methods spend most of time repeatedly reproducing trees stored in the transposition table but overwritten by a search in otherbranchesofagametree.thiskindofperformanceleakdoesnotoccurin alpha-beta search. Thereisstillaroomtoimprovethesemethods.ForinstanceWinands[5] presented a method called PDS-PN used in his LOA program. This variation wascreatedbytakingthebestofpn 2 andpds.kishimotoandmüller[6] successfully applied DF-PN in their tsume-go problems solver. They enhanced DF-PN by additional threshold increments.

This paper presents a more general approach of threshold increments, which reduces the number of tree reproductions during the search and results in a very efficient practical enhancement. The enhancement is applicable both to DF-PN and PDS and possibly to other variants of tree-walking algorithms. A deeper understanding of DF-PN is needed to see the enhancement value. The second section precisely describes a transformation of PN-Search algorithm to the depth-first search algorithm. The third section makes a further insight into DF-PNsearchandshowsitsweakpointalongwitharemedy.Thesamesection presents also an application of the trick to PDS. The fourth section presents results of experiments. The last section concludes. 2 Depth-first Transformation of PN-Search Section 2.1 briefly describes PN-Search. Section 2.2 describes DF-PN as a depthfirst transformation of PN-Search. 2.1 PN-Search For detailed description of PN-Search we refer to[7]. We recall only selected properties essential for an analysis in the later sections. The algorithm maintains a tree in which each node represents a game position. With each node we associate two numbers: the proof-number(pn) and the disproof-number(dn). ThePN(DN)ofanode vistheminimumnumberofleavesinthesubtree rooted at v valued unknown such that if they change theirs value to true(false) thenthevalueof vwouldalsochangetotrue(false). Inotherwords,thePN(DN)isalowerboundonthenumberofleavesto expand in order to prove(disprove) v. PNandDNforaprovednodearesetto0and + andforadisprovednode aresetto + and0.inanunsolvedleaf-nodewesetbothpnanddnto1.in anunsolvedinternalnodepnanddncanbecalculatedrecursivelyasshownin Fig.1.AsquaredenotesanORnodeandacircledenotesanANDnode. OR node AND node p = min p i d = P d i p = P p i d = min d i p 1 d 1 p 2 d 2 p n d n p 1 d 1 p 2 d 2 p n d n Fig.1.InanORnodePNisaminimumofchildren spnswhilednisasumof children sdns.inanandnodepnisasumofchildren spnswhilednisaminimum of children s DNs

The algorithm iteratively selects a leaf and expands it. To minimize the total numberofexpandednodesinthesearchitchoosesaleaftoexpandinasuch way that proving(disproving) it decreases the root s PN(DN) by 1. Such a leaf is called the most proving node(mpn). ItcanbeeasilyshownthatMPNalwaysexists.Thisleafmaybefoundby walkingdownthetreeandchoosingchildonlyonthebasisofpnsanddns ofthenode schildren.inanodeoftypeor(and)wechooseachildwiththe minimumpn(dn).thatisthechildwiththesamepn(dn)asitsparent. AfterexpandingtheMPN,PNsandDNsareupdatedbygoingbackonthe pathuptotheroot.thealgorithmstopswhenitdeterminesagamevalueofthe root,i.e.ifoneoftheroot snumberswillbeinfinitywhiletheotherwilldrop tozero.anexampleofselectingmpnandupdatingpnsanddnsisshownin Fig. 2. 4 3 4 3 5 1 4 2 5 1 4 2 3 2 1 2 3 4 1 2 3 1 3 1 3 3 3 1 1 4 1 3 1 1 1 4 1 3 1 3 1 1 1 1 1 1 selecting MPN updating PNs and DNs Fig.2.SelectingMPNandupdatingPNsandDNs. 2.2 DF-PN AsinFig.2weseethatupdatingPNsandDNscanbestoppedbeforewereach the root. It happens for instance when updating a node does change neither PNnorDN.InthatcasewemaybeginsearchofthenextMPNfromthelast updated node instead from the root. Infactwecanshortenthewayupevenmore.IfthenextMPNisinasubtree rootedinthenodecurrentlyvisitedwecansuspendupdateoftheparentand furtherancestors.observethatweneedvalidvaluesofpnsanddnsofthe ancestors only while walking down and selecting MPN. Therefore in general we cansuspendupdatingtheancestorsaslongasmpnresidesinthesubtreeofthe node.

To take advantage of the above observation we introduce PN and DN thresholds.thethresholdsarestoredonlyfornodesalongthepathfromtherootto thecurrentnode.let pand dbethepnanddnofnode v.wewanttodefine thethresholds ptand dtfornode vinsuchawaythatif p < ptand d < dtthen thereexistsmpninthesubtreerootedat vandconverselyifthereexistsmpn inthesubtreerootedat vthen p < ptand d < dt. Wewillnowdeterminetherulesforsettingthethresholds.Fortherootwe setthethresholdsto +.Clearly,thecondition p < + and d < + holds onlyifthetreeisnotsolved. WenowlookcloserwhathappensinaninternalORnode(Fig.3).Let pand pt p = min p i dt d = P d i pt 1 dt 1 p 1 d 1 p 2 d 2 p n d n Fig.3.VisitingthefirstchildinanORnodeandsettingthethresholds dbethenode spnanddnrespectively.let ptand dtbeitsthresholds.assume thenodehas nchildren.assumethe i-thchild spnanddnequal p i and d i. Withoutlossofgeneralityweassume p 1 p 2... p n. ThesubtreewhereMPNliesisrootedatthechildwiththeminimumPN. Since p 1 isthesmallestvalue,mpnliesintheleftmostsubtree,sowearegoing tovisitthefirstchild.wehavetosetthethresholds pt 1 and dt 1 forthischild suchthatifthepnordnreachesitsthreshold(i.e.if p 1 pt 1 or d 1 dt 1 ) then MPN must lie outside this child s subtree. Wesetconstraintsfor pt 1 todeducetheactualvalue.when p 1 exceeds p 2, thenthesecondchildwillhavetheminimumpnandmpnwillnolongerliein thefirstchild ssubtree.hence pt 1 p 2 + 1.When p 1 reaches pt,butdoesnot exceed p 2,thenthePN pintheparentwillalsoreachitsthreshold pt,andby ptthresholddefinition,mpnwillnolongerbeadescendantoftheparentand thusitwillnotlieinthechild ssubtree.hencethesecondconstraintis pt 1 pt. Thesetwoconstraintsgiveustheformula pt 1 = min(pt,p 2 + 1). Consequently,when d 1 increasessuchthat dreaches dt,thenagainmpnwill beoutsidethecurrentsubtree.wecalculatehow dchangeswhen d 1 changesto d 1.Let d denotednoftheparent,afterdnofthefirstchildhaschanged from d 1 to d 1.Thenwehave d = d + (d 1 d 1 ).Weareinterestedwhether d dt.replacing d andrewritingtheinequalitywegettheanswer.thatis: if d 1 dt d + d 1 then d dt.thereforewehaveaformulafordnthreshold dt 1 = dt d + d 1.

pt 1 = min(pt,p 2 + 1), dt 1 = dt d + d 1. Itremainstoshowthatfortheabovethresholdsinequalities p 1 < pt 1 and d 1 < dt 1 holdifandonlyifmpnisinthefirstchild ssubtree.wehavealready seenthatif p 1 pt 1 or d 1 dt 1 thenmpnisnotinthechild ssubtree.so suppose p 1 < pt 1 and d 1 < dt 1.Then p < ptand d < dt,hencempnliesinthe parent ssubtree.moreover p 1 < p 2 + 1.Thisisthesameas p 1 p 2.Thusthe firstchildhasthesmallestpnamongallchildren.thereforempnliesinthe first child s subtree. Similarly,wecangettheformulasforanANDnodeforthefirstchild s thresholds(assuming d 1 d 2... d n ): pt 1 = pt p + p 1, dt 1 = min(dt,d 2 + 1). Usingthresholdswecansuspendupdatesaslongasitispossible. Another important advantage of this approach is possibility of switching from maintaining a whole search tree to using a transposition table to store positions (nodes ) PN and DN. Insuchimplementationifalgorithmvisitsanode,wecantrytoretrieveits PNandDNfromthetranspositiontablesearchingforanearlycut.Incaseof failureweinitializethenode spnanddnthesamewayaswedoitforaleaf allowing the further search to reevaluate them. The resulting algorithm called DF-PN[4]isadepth-firstalgorithm,anditcanbeimplementedinarecursive fashion. ThemainpropertyofDF-PNisthefollowing.Ifallnodescanbestoredina transposition table, then nodes are expanded in the same order as in standard PN-Search.OfcourseinDF-PN,wearenotobligatedtostoreallnodes,and usuallywestoreonlyafractionofthem,withaslightlossofefficiency. 3 Enhancement Section 3.1 shows a usual scenario for which DF-PN has poor performance. Section3.2showsthe 1 + εtrickappliedtodf-pn.section3.3describesan analogous improvement of PDS. 3.1 Weak Point of DF-PN Summarizing,wegettheformulasforanORnodeforthefirstchild sthresholds: Weremindthatincaseofafailureinretrievingchildren svaluesfromatransposition table, DF-PN initializes children s PNs and DNs to 1 and re-search their values. Usually in an OR(AND) node with a large subtree all the children s

PNs(DNs) are very similar, because DF-PN search the child with the smallest PN(DN)andreturnassoonasitexceedsthesecondsmallest. Consider the following typical situation during a run of DF-PN. Suppose we areinanornodewithatleasttwochildren.supposefurtherthatthethreshold isbigandsearchlastssolongthatmostofthenodessearcheddonotfitinthe transposition table. Aftersometime,thesearchedtreewillbesolarge,thatthealgorithmwillnot beabletostoremostofthesearchednodes.nowdf-pnwillmakearecursive treesearchforthefirstchildwithapnthresholdfixedtothesecondchild spn plusone.eventuallysearchwillreturnbutduetotheweakthresholdthenew PNwillbeonlyslightlygreaterthanbeforethesearch.SeeFig.4forexample. 7500 9000 3010 3475 3013 7259 3010 1734 3012 1741 tt tt 7500 9000 3012 3481 3014 1740 3012 1741 tt tt rebuilt nodes expanded nodes visiting the first child state after the recursive call Fig.4.ExampleofasinglerecursivecallinanORnodeduringarunofDF-PN.The numbersarepotentialvaluesduringthesearch.graypartofatreemarkedasttdenotes nodes stored in a transposition table. The left picture shows what happens during the recursivecallforthefirstchild.thestateafterthecallisshownintherightpicture. ThencontrolgoesbacktotheparentlevelandwecallDF-PNforthesecond child, again setting the PN threshold to its sibling s PN plus one. After expensive reconstruction of the second child s tree, its PN increases insignificantly and we will have to again switch to its sibling. Unfortunately, most information from theprevioussearchinthefirstchildhasbeenlostduetoinsufficientmemory. Weseethatforeachsuccessiverecursivecall,wehavetorebuildalmostthe whole child s tree. Usually the number of recursive calls in the parent node is linear to the parent s PN threshold. 3.2 1 + εtrick TheaboveexampleshowsthatwhenweareinanORnode,settingthePN thresholdtothenumberonelargerthan p 2 canleadtotheverybignumberof visits in a single child, causing multiple reconstructions of a tree rooted in that

child.tobemoreeffectiveweshouldspendmoretimeinasinglenode,doing some search in advance. Wehaveaconstraint pt 1 p 2 +1forthechild spnthresholdinanornode. Wecanloosenthatconstraintalittletoasmallmultiplicityof p 2,forexample to 1 + ε,where εisasmallrealnumbergreaterthanzero.thuswechangethe constraintto pt 1 p 2 (1+ε) andthenewformulaforthechild spnthreshold inanornodeis pt 1 = min(pt, p 2 (1 + ε) ). That way after each recursive call the child s PN increases by a constant factor rather by a constant addend. More precisely after the call either the parent s DN thresholdisreachedorthechild spnincreasesatleast 1 + εtimes.therefore singlechildcanbecalledatmost log 1+ε pt = O(log pt)timesbeforereachingthe parent s PN threshold. As a consequence the described trick has a nice property of reducing number of recursive calls from linear to logarithmic in the parent s PN threshold. This enhancement not only improves the way a transposition table is used, but also reduces the overhead of multiple replaying the same sequences of moves. Observe that using the presented trick we lose the property of visiting nodes in the same order as in PN-Search. 3.3 Application to PDS The 1 + εtrickisalsoapplicabletopds.inpdsweusetwothresholds ptand dt like in DF-PN. The main difference is their meaning. The algorithm stays in anodeuntilboththresholdsarereachedorthenodeissolved.pdsintroduces the notion of proof-like and disproof-like nodes. When making a recursive call at achildwithpn p 1 anddn d 1,itsetsthethresholds pt 1 = p 1 + 1and dt 1 = d 1 ifthenodeisproof-like,and pt 1 = p 1 and dt 1 = d 1 + 1ifthenodeisdisprooflike.PDSusesasimpleheuristictodecidewhetherthenodeisproof-likeor disproof-like. We refer the reader to[3] for the details. ThesimilarweaknessasinDF-PN,describedin3.1,hurtsPDS.Weapplyour techniquebysettingthethresholds: pt 1 = p 1 (1 + ε), dt 1 = d 1 foraproof-like child,and pt 1 = p 1, dt 1 = d 1 (1 + ε) foradisproof-likechild. 4 Experiments InthissectionweexaminethepracticalefficiencyofDF-PNandPDSwithand without the presented enhancement. We focus on solving times for various setups. First, section 4.1 describes the background for the performed experiments. Then the results of these experiments are described. In section 4.2 we test the influence ofthesizeofatranspositiontable.insection4.3wecomparethealgorithms under tournament conditions. In section 4.4 we explore capabilities to solve hard problems.

4.1 ExperimentEnvironment Wechoosetwogamesforourexperiments.ThefirstoneisAtariGo,thecapture gameofgo.insection4.2wetakeasastartingpositiona6 6boardwitha crosscut in the centre. The second one is Lines of Action. For more information werefertowinands webpage[8].therulesandtestingpositions,usedin section 4.3 and 4.4, were taken from there. OurimplementationoffoursearchmethodsintheAtariGoandLOAgames doesn t have any game-specific enhancements. For a transposition table, TwoBig scheme[9] is used. ForacceleratedversionofDF-PNwiththe 1+εtrick, εwassetempiricallyto 1/4. With bigger values of ε, enhanced DF-PN tends to significantly over-explore some nodes. With smaller values, enhanced DF-PN is usually slower. InPDSspendingmoretimeinonechildisacommonbehaviorbecausethe ending condition requires to exceed both thresholds simultaneously. Usage of 1 + εtrickinpdsmakesthisdeepexploringbehaviorevenmoreexhaustive, what can often lead to over-exploring. Therefore ε should be much smaller in enhanced version of PDS. We found 1/16 as the best ε value. All experiments were performed on 3GHz Pentium 4 with 1GB RAM under Linux. 4.2 The Size of a Transposition Table, Tested on Atari Go We run all four methods with different transposition table sizes. The results are showninfig.5andexacttimesforthesizesbetween 2 12 and 2 22 nodesare shownintable1. ttsizeinnodes 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 DF-PNwith 1 + εtrick672 236 95 98 55 70 32 77 38 54 68 DF-PN 3403 279 189 187104168111113106 PDSwith 1 + εtrick 489532461017 468 440527350400235269 PDS 405714481124776494353261195 Table1.SolvingtimesinsecondsofAtariGo 6 6withacrosscut Obviously enhanced DF-PN is the fastest method and plain DF-PN is the second fastest. Settingthesizegreaterthan 2 20 doesn tnoticeablyaffectthetimes.inthat range there is no remarkable difference between plain and enhanced PDS. For sizessmallerthan 2 20 enhancedpdsbecomesfasterthanplainpds. Anoticeabledropofperformancecanbeobservedwhenthesizeisbelow 2 16. Withina2hourtimelimitPDSisunabletosolvetheproblemfortransposition tablewithsizeof 2 14 nodes,df-pnwithsizeof 2 13 nodesandenhancedpds withsizeof 2 12 nodes.

running time 2h 1.5h 1h 30m 20m 10m 5m 3m 2m 1m 40s DF PN with 1 + ε trick DF PN PDS with 1 + ε trick PDS 2 6 2 8 2 10 2 12 2 14 2 16 2 18 2 20 2 22 2 24 transposition table size in number of nodes Fig.5.SolvingtimesofAtariGo 6 6withacrosscut The enhanced versions are much better for really small transposition tables. Forsizes 2 14 andsmaller,enhanceddf-pnisfarbetterthananyothermethod. Enhanced DF-PN is able to solve the problem almost not using a transposition tableatall.withamemoryof 256nodesitneeded 1535secondsandwitha memoryof 32nodesitneeded 5905seconds.Ofcoursethereisasubstantial information stored in the local variables in each recursive call. 4.3 Efficiency under Tournament Conditions, Tested on a Set of Easy LOA Positions WehavealreadyseenthatDF-PNwiththe 1+εtrickperformsexcellentlywhen the search space significantly exceeds the size of a transposition table. In this sectionwecheckapracticalvalueofthemethodsonthesetof[8]488loa positions.thepurposeofthistestistoevaluatetheefficiencyofsolvingthe positions with tournament time constraints, as it is desired in the best computer programs. Thesizeofatranspositiontableissetto 2 20 nodesandshouldfitintomemory ofmostcomputers.theresultsareshowninfig.6.thefigurewascreatedby measuring solving time for each method for every position from the set. Then for everytimelimitwecaneasilyfindthenumberofsolvedpositionswithtimenot exceeding the limit. Exact numbers of solved positions for selected time limits areshownintable2. Here enhanced DF-PN is clearly the most efficient method, plain DF-PN is the second best and both PDS versions are the least efficient. The difference between enhanced PDS and plain PDS is unnoticeable.

timelimit 0.5s 1s 2s 5s10s20s30s1m2m5m DF-PNwith 1 + εtrick214278343410438457468478482486 DF-PN 184246304379419449457471479486 PDSwith 1 + εtrick 100154217299358414430450471481 PDS 102144214300365409425451466480 Table 2. Numbers of solved positions from the set tscg2002a.zip[8] for selected time limits 4.4 Efficiency of Solving Hard Problems, Tested on a Set of Hard LOA Positions This experiment is aimed at checking our ability of solving harder problems in reasonabletime.286testpositionsweretakenfrom[8].againwesetthesize ofatranspositiontableto 2 20 nodes.theresultsareshowninfig.7andexact number of solved positions for selected time limits are shown in Table 3. timelimit 5s10s20s30s1m2m3m5m10m20m30m DF-PNwith 1 + εtrick44107158182228258272280 285 286 286 DF-PN 25 64123154198241258273 282 284 285 PDSwith 1 + εtrick 1 18 52 80138186212228 257 272 278 PDS 3 22 56 83134179206224 252 265 274 Table 3. Numbers of solved positions from the set tscg2002b.zip[8] for selected time limits Again, as in the previous test, enhanced DF-PN is the most efficient method, plaindf-pnisthesecondbestandbothpdsversionsaretheleastefficient. The difference between enhanced PDS and plain PDS is now noticeable. For each time limit greater than 90 seconds enhanced PDS solves more positions thanplainpds.itshowsadvantageofenhancedpdsoverplainpdsforharder positions. To illustrate speed differences in numbers for each two methods we calculated ageometricmeanofratiosofsolvingtimes(table4).thegeometricmeanis more appropriate for averaging ratios than the arithmetic mean because of the followingproperty:if Ais r 1 timesfasterthan B, Bis r 2 timesfasterthan C and Ais r 3 timesfasterthan Cthen r 3 = r 1 r 2. 5 Conclusions and Future Work The 1+εtrickhasbeenintroducedtoenhanceDF-PN.Wehaveshownthatthe trick can also be used in PDS. The experiments showed a noticeable speedup when the search space significantly exceeds the size of a transposition table. The trick is particularly well-suited to DF-PN, since the experiments have shown a big advantage of enhanced DF-PN over the other methods. The AtariGo

positions solved out of 488 488 450 400 350 300 250 200 150 100 DF PN with 1 + ε trick DF PN PDS with 1 + ε trick PDS 500ms 1s 2s 5s 10s 20s 30s 1m 2m time limit Fig. 6. Numbers of solved easy LOA positions from the set tscg2002a.zip[8] for given time limit 286 positions solved out of 286 250 200 150 100 50 DF PN with 1 + ε trick DF PN PDS with 1 + ε trick PDS 5s 10s 20s 30s 1m 2m 3m 5m 10m 20m 30m time limit Fig. 7. Numbers of solved hard LOA positions from the hard set tscg2002b.zip[8] for given time limit

DF-PN enhanced DF-PN PDS enhanced PDS DF-PN 1.00 0.63 2.83 2.64 enhanced DF-PN 1.58 1.00 4.46 4.17 PDS 0.35 0.22 1.00 0.93 enhanced PDS 0.38 0.24 1.07 1.00 Table 4. Overall comparison for positions from the set tscg2002b.zip. The number rintherow Aandthecolumn Bsays Ais rtimesfasterthan Binaverage. experiment has shown that this method performs extremely well in low memory conditions. Moreover, DF-PN with the 1+ε trick was the most efficient method in the real-life experiment on the LOA game so it should be valuable in practice. The 1+ε trick is possibly applicable to other threshold-based depth-first versions of PN-Search. Thenicepropertyofthetrickisthatitcanbeaddedtoexistingimplementations with little effort. Its value has to be confirmed in other games different thanatarigoandloa.wenoticethatinothergamesandinotherdepth-first variantsofpn-search,thevalueof εcanbedifferent,anditshouldbefurther investigated. We hope that the presented technique becomes attractive for a brute-force frontsearchforgamessolving.howevertherearestillsomeweakpointsinpn based methods and more work for improvements is required to make depth-first PN-Search even more useful. References 1.Breuker,D.,Uiterwijk,J.,vanderHerik,H.:ThePN 2 searchalgorithm.invanden Herik, H., Monien, B., eds.: Advances in Computer Games. Volume 9., Universiteit Maastricht, Maastricht, The Netherlands(2001) 115 132 2.Seo,M.,Iida,H.,Uiterwijk,J.:ThePN searchalgorithm:applicationtotsumeshogi. Artificial Intelligence 129(1 2)(2001) 253 277 3. Nagai, A.: A new AND/OR tree search algorithm using proof number and disproof number. In: Proceeding of Complex Games Lab Workshop, Tsukuba, ETL(1998) 40 45 4. Nagai, A.: Df pn Algorithm for Searching AND/OR Trees and its Applications. Ph.d. thesis, The University of Tokyo, Tokyo, Japan(2002) 5. Winands, M., Uiterwijk, J., van den Herik, H.: An effective two-level proof-number search algorithm. Theoretical Computer Science 313(3)(2004) 511 525 6. Kishimoto, A., Müller, M.: Search versus knowledge for solving life and death problems in go. In: Twentieth National Conference on Artificial Intelligence(AAAI- 05).(2005) 1374 1379 7. Allis, L., van der Meulen, M., van den Herik, H.: Proof number search. Artificial Intelligence 66(1994) 91 124 8. Winands, M.:(Mark s LOA Homepage) http://www.cs.unimaas.nl/m.winands/loa/. 9. Breuker, D., Uiterwijk, J., van der Herik, H.: Replacement schemes and two level tables. ICCA J. 19(3)(1996) 175 180