![]() |
LaMoScaIntroduction |
The structure of a chess program
While the first task is fairly easy to implement, the other two are, for different reasons, far more difficult for a computer. How hard it is to evaluate a game position on the chessboard correctly is known to anyone who wants to play chess at a level even slightly above that of a player without a long-term strategy. Choosing the best sequence is a task that only looks simple. In theory it would be enough for the software to generate every possible move from the opening to the end of the game. Counting the options that would have to be examined in this way shows how complex the task is. In the opening, for example, there are 20 possible moves. Since the opponent can answer each of them with another twenty, the first level alone gives a total of 20^2 = 400 alternatives. Assuming an average of 35 alternatives per level for each player, and about 40 levels in a game of chess, the total number of nodes to analyse is 35^(2*40) = 3.35e+123, which makes a complete search of all the variations impossible. However, the set of all the possible variations from the initial position forms a tree of moves, in which finding the best sequence means finding an optimal path: a well-known problem in computer science. Searching for the optimal path in the tree generated by the software is the defining feature of today's chess programs. Making this search more efficient, and so increasing the depth of analysis the computer can reach, is the way to overcome the machine's limits in judging the quality of play. As for the data structures used by the software, in principle only a few pieces of information are needed:
Each specific algorithm added to the chess program will then need its own data structures. |
References
Paolo Ciancarini: |
Links |
| Back | Index | Next |