Threat Stacks to Guide Pruning and Search Extensions in Shogi by guy26

VIEWS: 15 PAGES: 15

									Threat Stacks to Guide Pruning
and Search Extensions in Shogi


         Reijer Grimbergen
  Department of Information Science
       Saga University, Japan


                IWEC2002              1
Presentation Overview
 The problem of time constraints
   Pruning, search extensions and the horizon effect
 Pruning and extensions in shogi
 Threat stacks
   Using threat stacks for search extensions
   Using threat stacks for pruning
   Dealing with horizon moves
 Preliminary results
 Conclusions and future work


                        IWEC2002                       2
The Problem of Time Constraints
  How to deal with premature termination of the search?
 Iterative deepening
    Ensures that there is a completed search to a certain nominal
    search depth
 Search extensions
    Needed to get a reliable result at each iteration
    Examples: Quiescence search, Singular extensions
 Pruning
    Used to speed up the search and free time for search extensions
    Examples: Futility pruning, ProbCut


  Horizon problem Push threats over the search horizon

                              IWEC2002                          3
Pruning and Extensions in Shogi
Shogi and chess
 Shogi is a two-player complete information
 game similar to chess
 Differences with chess
   Drop rule
   Promotion rule




                    IWEC2002           4
Pruning and Extensions in Shogi
Extensions in shogi
               Problem in shogi
       The set of non-quiescent positions
          is much larger than in chess

 Evaluation function is a combination of material
 and king danger
   Need to check both captures and king attack for a
   position to be quiescent
 Extended promotion possibilities lead to a sudden
 change in evaluation value more often

                       IWEC2002                        5
Pruning and Extensions in Shogi
Pruning in shogi
 Futility pruning in shogi
   It is more difficult to judge inability to recover
   from a bad position
 ProbCut in shogi
   It is more difficult to the establish the
   likelihood that a deep search can be replaced by
   a shallow search



                      IWEC2002                  6
Pruning and Extensions in Shogi
The horizon problem in shogi
 Drop moves make the horizon problem much worse in
 shogi than in chess
 In strong shogi programs threat analysis is used for
 pruning, extensions and detection of horizon moves
    Gekizashi’s probability classification
    YSS’s move classification
    Shotest’s Super-SOMA algorithm
 No general framework for the use of threats in the search



                      Threat Stacks
                             IWEC2002                7
Threat Stacks
The method
 Two stacks to store the threats of both players
   After each move, the threats by each player are pushed
   on the stacks
   When a move is undone, the threat stacks are popped
 Threat entry
   Threat identification number
   Up to three squares for the pieces involved in the threat
   A value indicating the strength of the threat
 Weak threats and strong threats
   Ignore weak threats in case of a strong threat
   Depend on the phase of the game


                        IWEC2002                     8
Threat Stacks
Threat categories
 Check
 Threat to gain material
 Promotion threat
 Discovered attack
 Pins
 King threats


                   IWEC2002   9
Threats Stacks and Extensions
  Extend the search to empty the threat stacks
  Procedure
 a. Determine the strongest threat by each side
 b. If the side to move has a stronger threat than the
    opponent, execute the threat
 c. If the opponent has a stronger threat than the side to
    move, generate moves to defend against the threat
  In case of weak threats, this procedure is only
  followed in the opening and middle game


                        IWEC2002                     10
Threats Stacks and Pruning
 Pruning decisions
   Prune sacrifices one move before the nominal search
   depth
   Prune if the number of threats is larger than the
   remaining search depth
   In case of a threat, prune moves that neither
    • Execute a threat
    • Resolve a threat
    • Introduce a threat
 Pruning only done in positions with a strong
 threat


                           IWEC2002               11
Threats and the Horizon Problem
  Horizon moves are dealt with in two steps
 1. Detect a potential horizon move
 2. Analyze threat stacks at the nominal search
    depth to see if the original threat is still there
  This is why threat stacks are used




                      IWEC2002                   12
Results
Tactical shogi problems
 Set of 298 tactical shogi problems from Shukan
 Shogi
 30 seconds on a 1.2 GHz Pentium III
 Comparison of threat stacks and quiescence search

Version             Total       Solved      Time used

Threat stacks       298         128 (42%)   02:14:12

Quiescence search   298         97 (33%)    02:34:45



                     IWEC2002                    13
Results
Material vs. Attack/defense
 115 tactical problems involving material
Version              Total    Solved         Time used
Threat stacks        115      93 (81%)       00:50:31
Quiescence search    115      99 (86%)       01:00:45

  175 tactical problems involving attack and defense
 Version             Total        Solved     Time used
 Threat stacks       175          89 (51%)   01:18:27
 Quiescence search   175          57 (33%)   01:38:12

                       IWEC2002                     14
Conclusions and Future Work
 Conclusions
   Threat stacks can be used for making decisions about
   search extensions, pruning and to detect horizon moves
   Preliminary results indicate that threat stacks may
   improve the tactical ability of a shogi program
 Future work
   Investigate if the tactical improvement results in
   winning more games
   Use threat stacks to guide best first search



                        IWEC2002                        15

								
To top