• Nenhum resultado encontrado

The Choice of an Algorithm depends on Memory Size

No documento Large Exhaustive Search Problems (páginas 35-39)

1.E+00 1.E+01 1.E+02 1.E+03 1.E+04 1.E+05 1.E+06 1.E+07 1.E+08 1.E+09 1.E+10

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%

cache size

cache misses

dual index single index

Figure 2.7: The number of cache misses during one pass over the 25-stone database. Cache size is relative to the database size.

With this algorithm, databases 34 (10 GBytes) to 40 (47.6 GBytes) were calculated on a 1 GByte RAM machine.

2.6 The Choice of an Algorithm depends on Memory Size

It is always a challenge to solve large search problems with limited resources.

In this paper, we presented algorithms for Awari endgame database calcu- lation which require only two bits and one bit in memory, respectively. An improved version of the one bit algorithm uses dual indexing to calculate effi- ciently databases with a size of eighty times the main memory. This expands the horizon of solvable endgame databases far beyond the limits of today’s memory sizes.

We propose the following rule for algorithm selection: if the database fits into main memory, use a one-byte algorithm. Otherwise, if the memory is sufficiently large to store 1/4 of the database, use the two-bit algorithm.

Otherwise, if the memory is sufficiently large to store 1/8 of the database, use the one-bit algorithm. Otherwise, if the memory is sufficiently large to store about 1/80 of the database, use the one bit algorithm with caching and dual indexing.

The Awari databases and their statistics can be viewed online [28].

Chapter 3

Opening Book Construction

This chapter introduces the new drop-out expansion algorithm for the auto- matic construction of opening books. The algorithm differs from other ap- proaches in that it uses not only position values for node selection, but also takes the depth of leaf nodes into account to make it harder for the opponent to throw the book player out of the book.

For Chess, the most widespread method of opening book construction is the manual or semi-automatic compilation of human opening book know- ledge [5, 17, 44, 11]. This requires a Chess expert to select moves that are both favorable and suited to the playing style of the program. Besides the fact that this is tedious work, this method has other drawbacks. For example, there is no guarantee that the human knowledge is free of errors; every move should also be checked by the computer. Another drawback is that the method is only applicable if there is any human opening book knowledge around in the first place.

Our main interest for opening book construction was to create a strong computer Awari program. In Awari there is hardly any human literature on the game, and the computer programs have surpassed the level of human play anyway. The only way to create an opening book was therefore to construct it automatically using the Awari search engine. Sections 3.1 and 3.2 motivate our work on opening books and introduce the basics. Section 3.3 introduces drop-out diagrams, a method for the visualization of opening books. In Section 3.4 the new expansion strategy is introduced and compared to best- first expansion [10].

27

3.1 Introduction

Games are usually divided into three phases: opening, middlegame and endgame. In any of the three phases, the default action of a computer program is to start a search for a “best” move. Since such a search has to be performed within a limited time, it can only examine nodes down to a certain depth, which means that the calculated value is only a heuristic approximation of the game-theoretic value.

However, in endgames a different approach is possible if the game has the convergence property [4], i.e. the number of pieces on the board decreases monotonically. In this case we are able to construct an endgame database of precalculated game-theoretic values for positions with a sufficiently small number of stones [53]. A computer program can benefit from such a database in two ways: First, the values of the endgame positions can be retrieved in one operation instead of performing a lengthy search. Second, the retrieved values are exact game-theoretic values of the positions instead of approximations, which reduces the error in the heuristic search. The disadvantage is that we need additional space to store the database, and if the database is stored on disk then retrieving database values causes disk-I/O.

For openings an analogous approach is possible. Since the state-space up to a few plies into a game is small, we can precalculate a database (called

“opening book”, or just “book”) of values for positions that are likely to occur at the beginning of a tournament game. If the opening book is stored as a directed graph, with positions as nodes and moves as arcs, then the values can be propagated within the book. This way the computer program not only saves time compared to search, but also obtains better values, assuming the search depth used for precalculation is greater than the one used during play.

Although the benefits of using endgame databases and opening books are similar, algorithms for the construction of endgame databases have received more attention up to the present. The reason for this seems to be twofold:

values in endgame databases are exact game-theoretic values, whereas values in the opening book are (mostly) heuristic values. This makes it hard to judge the usefulness of an opening book, and the non-trivial truth of the endgame database provides a basis for data mining. Another reason is that efficient indexing functions for complete enumeration can be constructed for positions in endgame databases, whereas for positions in the opening book no efficient indexing functions exist, due to the fact that the relevance of a position for the opening book stems from the position value and not from the configuration of stones on the board.

No documento Large Exhaustive Search Problems (páginas 35-39)

Documentos relacionados