Naive Solutions
A naive program attempting to play a game like chess will:- Determine the number of moves which can be made from the current position,
- For each of these moves,
- Apply the move to the current position,
- Calculate a "score" for the new position,
- If the maximum search "depth" has been reached, return with this score as the score for this move,
- else recursively call the program with the new position.
- Choose the move with the best score and return its score and the move generating it to the calling routine.
However, with a little cunning, the number of moves which needs to be searched can be dramatically reduced - enabling a computer to search deeper in a reasonable time and, as recent events have shown, enable a computer to finally be a match for even the best human players.
Alpha-Beta Algorithm
The Alpha-Beta algorithm reduces the number of moves which need to be explored by "cutting off" regions of the game tree which cannot produce a better result than has already been obtained in some part of the tree which has already been searched. Alpha-Beta pruning Algorithm