Elena Fersman and Leonid Mokrushin Algorithmic Project

Title: Heuristic Tree Search Algorithms or One can try Java at chess. (depth=5)

Participants

Aims and Goals

Problem Statement, Applications

"If you can't beat your computer at chess, try kickboxing."
-Anon.


How can a computer play chess? For many people that is an important question. Chess seems like a distinctly human activity requiring intelligence and thought, so how can a computer possibly play chess? Actually computers are now the best chess players on the planet, even though they do it totally blindly and the number of possibilities that need to be explored is astronomically large - approximately 10E+44 (the number of particles in the universe is estimated to be 10E+80).
Applications are limited by people interested in this old as Adam game and students, especially from Uppsala University :)

Known Results - So how do computers play chess?

There are two basic strategies for restricting the number of possibilities. The so-called Shannon type A strategy considers all possible moves up to certain number of plies at which point some criteria is applied. It behaves almost like human chess players do. For the evaluation of a position, an evaluation function assigns to each position a number showing how good or bad this situation is for both of players.
The second strategy, Shannon type B strategy, which limits the number of moves that are considered at each level. A move generator determines a set of reasonably good replies (approximately 8) for each given position.
Some common techniques to improve both strategies have been developed. These techniques have allowed computers with the same basic speed to play significantly better through time.

Techniques Used/Compared/Invented/Eliminated

Used:

  1. NegaScout - is a directional search algorithm for computing the minimax value of a node.

Compared:

  1. Alpha-Beta Cut - is the major refinement for reducing the number of positions that has to be searched. The idea relies on the fact that once a strong reply has been found by your opponent in a given situation, the computer may stop considering ways of improving this situation and focus on moves that avoid such a position altogether.
  2. Principal Variation Search - is a variation of alpha-beta search where all nodes outside the principal variation (alternation of best own moves and best opponent moves from the root to the depth of the tree) are searched with a zero window. The idea is that with perfect move ordening all moves outside the principal variation will be worse than the principal variation itself.
  3. NegaScout - is the further refinement of principal variation search.

Invented:

  1. Improved Random Transposition Cutoff - is the search moves ordering procedure. The idea is to try capturing moves first and then randomize the order of evaluation for the remaining moves.
  2. Game Tree Leaves Evaluation - the function that for each leave of the game tree calculates an integer value representing current situation of the game relative to the tree root. This function takes into account amount of existing pieces, their costs and the costs of attacks of both players.

Programs

  1. Latest Java chess player (executable .jar file, parameter - tree search depth)
  2. You can play it online (You need to install Swing Plug-in for your browser)
  3. Note (SV): If your browser does not support latest plugins, just do the following:
    1. ssh -X -l saps01 peg
    2. cd public_html/FersmanMokrushin/chess
    3. java Chess 3 &
      (meaning that the program will count 3 moves deep)
    4. Enjoy (my netscape does not support plug-ins)
  4. Source code

Experimental Data

The following diagrams are available in .ps format:
    MaxDepth=3
  1. AlphaBeta, Principle Variation and NegaScout algorithms comparison without Transposition Cutoff
  2. AlpaBeta without and with (worst case/average) Transposition Cutoff
  3. NegaScout without and with (worst case/average) Transposition Cutoff
  4. AlphaBeta and NegaScout with Transposition Cutoff comparison (average)
    MaxDepth=4
  5. AlphaBeta, Principle Variation and NegaScout algorithms comparison without Transposition Cutoff
    Comparison
  6. AlphaBeta and NegaScout (MaxDepth=3,4) without Transposition Cutoff comparison. OBS! Logarithmic scale!
  7. NegaScout with Random and Improved Random Transposition Cutoff comparison.
  8. Final results: Classical AlphaBeta vs Improved Random NegaScout

Conclusions, Comparisons, Problems for Future Research

  1. The narrower the AlphaBeta window, the more cutoffs you get, the more efficient the search is.
  2. Hence algorithms using zero window (such as Pricipal Variation Search and NegaScout) are better than classical AlphaBeta.
  3. It's more efficient to start the search close to it's goal. Heuristics help us to guess this start.
  4. Some specific information, e.g. captures are often good moves, so we try them first.
  5. There is more efficient than NegaScout algorithms - MTD(f) (used in strongest MIT chess program), which stores already seen nodes in memory to get rid of overheads in multiple re-search phases. But it's require additional techniques to be implemented such as hashing and first move guess.

Major Links on the topic

  1. Illustrated rules of chess
  2. Chess Tree Search
  3. Most Popular Books on Computer Chess
  4. MTD(f) - A Minimax Algorithm faster than NegaScout, AlphaBetaWithMemory and NegaScout
  5. Strategy and board game programming
  6. Kasparov vs Deep Blue

Bibliography

  1. J.Schaeffer, The Games Computers (and People) Play, 2000
  2. J.Furnkranz, Machine Learning in Computer Chess: The Next Generation
  3. J.Schaeffer, The History Heuristic and Alpha-Beta Search Enhancements in Practice
  4. M.Buro, Improving Heuristic Mini-Max Search by Supervised Learning
  5. J.Schaeffer, A.Plaat, New Advances in Alpha-Beta Searching
  6. A.Plaat, J.Schaeffer, W.Pijls, A.Bruin, Best-First Fixed-Depth Game-Tree Search in Practice
  7. D.McAllester, D.Yuret, Alpha-Beta-Conspiracy Search
  8. N.Inuzuka, H.Fujimoto, T.Nakano, H.Itoh, Pruning Nodes in the Alpha-Beta Method Using Inductive Logic Programming
  9. A.Plaat, J.Schaeffer, W.Pijls, A.Bruin, An Algorithm Faster than NegaScout and SSS in Practice