Analysis and Implementation of The Game Arimaa: Christ-Jan Cox
Analysis and Implementation of The Game Arimaa: Christ-Jan Cox
=
m
i k
k i
k
j
j i
i
i
p
p
p
H n StateSpace O
1
12
2
,
1
1
,
1 ,
64 64
) _ ( (1)
In this formula i H is the number of hits (Appendix B) from pattern , i j i p , is the value
of the j
th
element in pattern , i n is the number of pieces on the board, and m is the number
of sorted unique patterns (column 4 of table 2.1) for n pieces. The results for each n are
given in column 5 of table 2.1.
This results in a total of
43
10 51 . 2 number of possible board positions according to
formula (2). Here we also take into account the player to move.
43
32
0
10 51 . 2 ) _ ( 2 ) _ ( = =
= n
n StateSpace O Positions StateSpace O (2)
Next we have calculated some number of illegal positions reducing this state-space
complexity. The first group is when a piece comes on a trap without a friendly piece next to
the trap, resulting in a piece less on the board. We have to calculate these situations and
reduce the state-space complexity with this result. We only have to calculate when there is at
least one piece on a trap that will be removed. This situation includes then also the other
positions where two, three or four pieces are standing on a trap and will be removed.
To calculate this number of illegal positions we started with the pattern
822211/822211. Assume that there is one gold piece on a trap. We split the pattern into the
patterns in table 2.2 where one gold piece is on a trap.
Possible Patterns
Gold Silver # positions
722211 822211
41
10 50 . 7
812211 822211
41
10 87 . 1
821211 822211
41
10 87 . 1
822111 822211
41
10 87 . 1
822201 822211
40
10 37 . 9
822210 822211
40
10 37 . 9
total
42
10 50 . 1
Table 2.2: Summation of the number of illegal positions where one gold piece is trapped.
Because there can be an unfriendly piece next to the trap we have to calculate these
possibilities. These patterns look like
e m h d c r
n n n n n n , where
r
n is the number of unfriendly
rabbits adjacent to the trap, etc. The maximum value for each position in the pattern is 4, 2, 2,
2, 1, and 1.The maximum for
r
n is 4 in stead of 8 is because there can only be 4 pieces next
to the trap. We generate all patterns where there are no pieces next to the trap up to the
16
maximum of four pieces. When we take, e.g., the pattern 822210/822211 from table 2.2, we
have to subtract each generated pattern for the unfriendly pieces that could stand next to the
trap, from the silver part (822211), because a gold piece is standing on the trap. For example
the silver part will be split into the pattern 722211/100000, where 100000 is one of the
generated patterns, for an unfriendly piece (Silver) standing next to the trap. We take these
two together with the gold part which results in 822210/722211/100000. Now we use formula
(3) where m is the number of patterns we get from the splitting of the silver part.
=
= =
=
18
14
,
1
13
,
1
13 ,
12
2
,
1
1
,
1 ,
4 4 59 59
4 ) _ (
k
k i
k
j
j i
m
i
i
k
k i
k
j
j i
i
p
p
p
p
p
p
trap StateSpace O (3)
In the last column of table 2.2 we see the summation of these results according to the
gold part of the pattern. All these positions result in at least one gold piece and none or more
silver pieces on the traps without a friendly piece next to the gold piece. When we also take
into account which player has to move we have to apply a factor of two.
As we can see we have to do a great dead of calculations because we have 944,784
(summation column 3 table 2.1) possible starting patterns such as 822211/822211 for which
we have to apply formula (3). We are going to make an assumption. When we have 32 pieces
on the board there are
42 42
10 26 . 9 10 63 . 4 2 possible positions and
42 42
10 00 . 3 10 50 . 1 2 are illegal positions according to the trap rule, being a factor
of 323 . 0 . When there is only one piece left on the board there is only a factor of 0625 . 0
illegal. Now we assume that a factor of 323 . 0 is the upper bound of illegal positions
according to the trap rule. The result will then be
42 43
10 08 . 8 10 51 . 2 323 . 0 illegal trap
positions.
The second group of illegal board positions are the board positions that will never be
reachable. We distinguish three categories of illegal positions within this group. In the first
category are those positions with at least one own Rabbit and two opponent Rabbits that have
reached their goals at the end of turn, since such position would require at least five steps. To
calculate this we generated the pattern from table 2.1 again but with a difference in the
sorting. In stead of disregarding the colour and type of the piece we now put the Rabbits in the
front two places and we sort the rest disregarding the colour and type again. Then we split
every first two positions (Rabbits) of the pattern.
M L, K, J, I, H, G, F, E, D, C, B1), - B B2( A1), - A A2( B1, A1, M L, K, J, I, H, G, F, D, C, B, A, = =
In this pattern A1 is two and B1 is one. Then we remove all patterns where A2 or B2 are
below zero, because those patterns have not enough Rabbits to put in the goals. Now we can
apply formula (4). Here we do not take into account which player is going to move because as
we have seen the minimum condition to calculate this is depending on which player is to
move. It results in
41
10 13 . 3 illegal positions according to the number of Rabbits in the goal.
As a second category we have those positions where the player who moved last has at
least three Rabbits of his own and at least one of his opponent Rabbits in the goal. Also here
we apply the new patterns, but now A1 becomes three and B1 one. Again we remove all
patterns where A2 and B2 are below zero. Using formula (4) we get
41
10 84 . 1 illegal
positions which are not reachable for the player to move.
17
= = =
=
32
0 1
14
3
,
1
1
, 64
1 B
8
1 A
8
) 1 B _ 1 A _ _ (
n
m
i k
k i
k
j
j i
i
p
p
H goal StateSpace O (4)
The third category of unreachable positions is when we have five or more Rabbits
from one player in the goal at the end of a turn. Here we must give A1 the value five and B1
the value zero. This yields
39
10 01 . 10 illegal positions. A part of these positions we have
already calculated above, where A1 is also five and B1 is one which results in
39
10 71 . 1 . So
there are
39 39 39
10 30 . 8 10 71 . 1 10 01 . 10 = positions where five Rabbits of one player and
no Rabbits of the other player are in the goal. These positions are unreachable disregarding
which player finished his move so we have
40 39
10 66 . 1 10 30 . 8 2 = illegal positions.
We have
41
10 13 . 3 and
41
10 84 . 1 and
40
10 66 . 1 unreachable positions for both
players together at the end of their move. This gives in total
41
10 04 . 5 unreachable positions.
Using the values above we can say that the state-space complexity can be
approximated by
43 41 42 43
10 66 . 1 10 04 . 5 10 08 . 8 10 51 . 2 .
2.2 Game-tree Complexity
The game-tree complexity can be approximated by the number of leaf nodes of the
game tree with as depth the average game length (in ply), and as branching factor the average
branching factor during the game. It is not hard to calculate the last. There is a database
available with 6,075 Arimaa games played. These are not all usable, so we have selected
games that have finished by:
1. a Rabbit reached the goal.
2. a player had no moves.
3. no Rabbit on the board.
4. a position repeated three times.
After this selection we have a database of 4,251 records. From the records we have
determined the average branching factor at 276,386. In the beginning of the game the average
branching factor is 23,026. The branching factor will increase for the first five ply, because
we will have more moves per piece on average (figure 2.2). After that we see that the
branching factor slowly goes down, but still stays extremely high.
With the same database we have determined the average game length. The result is an
average of 55.2 ply (moves of four steps).
The formula to calculate the game-tree complexity is ,
d
b where b is the average
branching factor and d the average depth. Using the values above, the game-tree complexity
for Arimaa is calculated as
300 2 . 55
10 1 . 3 386 , 276 .
18
0
50000
100000
150000
200000
250000
300000
350000
400000
2 8
1
4
2
0
2
6
3
2
3
8
4
4
5
0
5
6
6
2
6
8
7
4
8
0
8
6
9
2
Figure 2.1: Average branching factor per ply.
2.3 Comparing Arimaa to Other Games
As mentioned in Chapter 1 there are at least four reasons why Arimaa is difficult for
computers to play. First the branching factor runs into the twenty-thousand as compared to an
average of about 35 for Chess. With a much bigger range of possibilities at each turn it
becomes extremely hard for computers to use the brute-force look-ahead method to search
through all of them to find the best moves. For example at the start of chess games White has
20 possible moves. In Arimaa a player has about 2,000 to 3,000 moves in the first turn
depending on the way they chose to setup the pieces. During the mid-game the number of
possible moves ranges from about 5,000 to 40,000. If we assume an average of 20,000
possible moves at each turn, looking forward just 2 moves (each player taking 2 turns) means
exploring about 160 million billion positions. Even if a computer is 5 times faster than DEEP
BLUE and could evaluate a billion positions per second it would still take more than 5 years to
explore all those positions. However, modern game-playing programs use pruning algorithms
to reduce significantly the number of positions that need to be explored. Even with such
pruning the number of positions that need to be evaluated is still sufficiently large to make it
extremely difficult for a program to search very deep.
Second, endgame databases have also significantly improved the performance of
computers in many traditional strategy games. When the number of pieces remaining on the
board is reduced to just a few, computers can play a perfect ending by simply looking up the
best move for the current position from a precomputed database of endgame positions.
However a typical Arimaa game can end with most of the pieces still on the board. It is not
uncommon for a game to end without any pieces ever being exchanged. Thus building
endgame databases for Arimaa will not be useful.
Third, important factor is that the starting position of Arimaa is not fixed as it is in
Chess. The number of different ways in which each player can setup their pieces at the start of
the game can be computed with formula (5).
19
800 , 864 , 64
1
1
1
2
2
4
2
6
2
8
8
16
) 1 , _ ( =
(4.1)
32
As an example we consider COXA, which searches 20000 nodes per second (nps). If it
plays Arimaa using a 3-minute search, the number of nodes investigated is
6
10 6 . 3 . Assume
that an attempt is made to store them all in the transposition table. If the hash value consists of
58 bits (index + key), the probability of at least one type-1 error is:
5
2 2
3600000
10 2 . 2 1
58
2
e
Because the transposition table is small, we cannot store all the positions occurred in
the search. It happens that a position is to be stored in an entry, which is already occupied by
another position. This is called a type-2 error or a collision. A choice has to be made which of
the two involved positions should be stored in the transposition table. There are several
replacement schemes (Breuker et al., 1994), which tackle the collision problem. We use the
familiar Deep replacement scheme. If a collision occurs, the one with the greatest depth is
kept. Notice that for every new search process the transposition table is cleared.
4.3 Move Ordering
By sorting the moves generated in the alpha-beta search we can maximize the number
of cut-offs in the process. Therefore we have to create an ordering function, which tries
plausible moves first. The idea behind this is that if the best move is evaluated first, then the
alpha and beta bounds will leave only a small window in which moves are not pruned. In
effect every move which violates these bounds will be pruned. However, we do not know
which the plausible moves are, since that is why we are searching in the first place. We can
solve this problem by determining those by heuristics. There are two kinds of heuristics that
exist: game-specific and game-independent. Game-specific heuristics are based on
characteristics of the game and are discussed in section 4.3.1. Game-independent heuristics do
not take characteristics of the game into consideration, but their applicability can depend on
the kind of game. Besides the transposition move we will use two other game-independent
move-ordering techniques, discussed in sections 4.3.2 and 4.3.3.
4.3.1 Game-specific Heuristics
The characteristics of Arimaa we used are that push and pull move will be investigated
before single steps. This is done because this can give a material advantage and can open or
close ways for other pieces. Another heuristic we used for the push and pull moves is that the
moves of the stronger pieces will be tried first. The single steps will be generated also in order
of the strongest pieces first. These single steps will be reordered when we use the history
heuristic, as discussed in section 4.3.3.
4.3.2 Killer-move Heuristic
The killer-move heuristic (Huberman, 1968) is one of the most efficient move-
ordering heuristics. It has proved to be quite successful and reliable in all sorts of games. The
logic behind this heuristic is based on the assumption that the best move for a given position
could well be a very good or even the best move in another position encountered at the same
depth during the search process. Normally the last pruning or best move is stored, but more
33
killer moves can be stored. Pruning by the killer move is mostly due to information gathered
at the same depth in the same subtree. The heuristic is cheap: for k moves at n plies, the
memory cost is n k entries in a move table. For more information on the killer-move
heuristic we refer to (Akl and Newborn, 1977).
4.3.3 History Heuristic
The history heuristic was invented by Schaeffer (1983). The working of the history
heuristic is in some way similar to that of the killer moves. Unlike the killer heuristic, which
only maintains a history of one or a few best killer moves at each ply, the history heuristic
maintains a history for every legal move seen in the search tree. The best move at an interior
node is the move which either causes an alpha-beta cut-off, or which causes the best score.
With only a finite number of legal moves, it is possible to maintain a score for each move in
two (Gold and Silver) tables. At every interior node in the search tree the history-table entry
for the best move found is incremented by
d
2 where d is the depth of the subtree searched
under the node. When a new interior node is examined, moves are re-ordered by descending
order of their history scores.
The logic behind the history heuristic is that a move, often preferred over other moves,
has a high likelihood of causing a large number of cut-offs. Moreover, a move that is good at
this depth might very well also be good at other depths. A well-known problem that we
stumble upon here is that the history table keeps building up and what appear to be good
moves now can still be overshadowed by the good moves earlier in the game. To
counterbalance this we divide all the counters by 2 at the start of a new search process.
This heuristic does not cost very much memory. The history tables are defined as two
tables with 4096 entries ( s to_square res from_squa 64 64 ), where each entry is 4 byte
large. The total memory cost is only 32.7 kilobytes.
4.4 Overall Framework
In this chapter we have discussed several methods which are used in the experiments
to create COXA. The pseudo code of Marsland (1986) and Donninger (1993) are combined. In
which way alpha-beta, PVS, transposition tables, null move and tree construction are used is
described by them. Before the null move is tried, the transposition table is used to prune a
subtree or to narrow the window. As far as move ordering is concerned, the transposition
move, if applicable, is always tried first. Next, the killer moves are tried. After that the push
and pull moves are tried in the order as generated (i.e., according to the piece strength). All
the other moves are ordered decreasingly to their scores in the history table.
34
35
5 Tuning the Evaluation Function
For optimal performance of the evaluation function we have to tune the weights that
we added to the different parts of the evaluation function. In this chapter we will discuss the
tuning of the evaluation function.
5.1 Setup of the Tuning
There are 14 weights and 1 bonus value that we have to tune. We choose for two type
of players. One will be the standard player, were as the other (the variable player) will be the
player were we vary the weights every time. The standard player will get the value 1.0 for all
weights. The variable player will get also all weights set to 1.0 except the weight to be tuned.
Each weight will be tuned separately. For the weight to be tuned we try a large negative value
and then we play a tournament against the standard player were each player will be 50 times
playing Silver and 50 times playing Gold. We also do this with a large positive value and
some weight values in between. From the results we determine an optimum value.
When the optimum is reached we give both players the optimum value for that weight
and we go on to the next weight.
5.1.1 Random Factor
Before the tuning can start, we need a random value that we add to every evaluation of
a position, since otherwise we get the same result for every game. This random value makes
the games every time a little bit different. The impact of the random value may not be too big
to prevent determining the outcome of a search. Therefore we optimize this value first.
Every evaluation we start with a random number between 0 and 10. This number will
be multiplied with a factor x to be tuned. The outcome of the two numbers will then be
added to the evaluation value.
For tuning this weight, we set the search depth to 4 without any time limit. This gives
us a better look on how big the influence of the random factor is. For the standard player we
used the value 0.0 for the weight so he will not have any influence on the results of the
variable player. We made steps of 0.1 and investigated the number of different steps for move
2. Like we have discussed before also here we had to do with transpositions. These
transpositions are deleted and the results are shown in figure 5.1.
As we can see in figure 5.1 for depth 4 the influence of a very small random factor has
already much influence on the number of different moves. This is stabilized around 0.2. For
depth 3 this is around 0.3. For depths 2 and 1 there is no influence at all in the beginning, and
a random factor of at least 0.7 is needed for enough variation.
We chose for a random weight of 0.3, because there it has almost a stable influence on
depth 3 and, as we can see in figure 5.2, 0.3 is the point were the random variable still has not
too much influence on the outcome of the games.
36
0
5
10
15
20
0.0 0.5 1.0 1.5 2.0
Weight Value
#
D
i
f
f
e
r
e
n
t
m
o
v
e
s
1 2 3 4
Figure 5.1: Influence of the random weight on the difference of moves for each depth.
0
20
40
60
80
100
0 0.2 0.4 0.6 0.8 1 1.2
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.2: Winning % of the random value.
5.2 Tuning the Basic Evaluation
After determining the random variable we will tune the other weights of our evaluator
according to the setup described. Now we take a look at the weights of the basic evaluation
parts.
37
5.2.1 Material Weight
In this experiment we set for both players the random value at 0.3 and the remaining
weights at 1.0; only the material weight of the variable player receives the values -20, -10, 0,
10, 20, 30, and 40. From the result depicted, figure 5.3, we see a top around 10. This is the
area were we have used more values.
0
10
20
30
40
50
60
70
-30 -20 -10 0 10 20 30 40 50
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.3: Winning % of the material value.
By zooming in step by step to the top we get the results shown in figure 5.4. As
optimum we settled to use the value of 4 for the material weight.
0
10
20
30
40
50
60
70
80
-15 -10 -5 0 5 10 15 20 25
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.4: Winning % of the material value (zoomed in).
38
5.2.2 Piece-square Tables
As said in chapter 3, we have three different piece-square tables for all six pieces, but
six weights that we have to tune. We start with the piece-square table weight for the rabbit.
Here we also started with some sparsely distributed values to locate the top. These
values ranged from -10 to 40 with steps of 10 and plus the value of 60. the results are shown
in figure 5.5.
0
10
20
30
40
50
60
70
80
-20 0 20 40 60 80
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.5: Winning % of the rabbit piece-square table.
We see a top around 10 and that is the point where we zoomed in. From the results
shown in figure 5.6 we decided for the value 6 as the optimum.
30
40
50
60
70
80
0 5 10 15 20 25
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.6: Winning % of the rabbit piece-square table (zoomed in).
39
After the weight of the rabbit piece-square table, we tuned the weight of the cat piece-
square table. The results are shown in figure 5.7, were we see that the top is located around 0.
Zooming in on 0 we obtain figure 5.8 where we see that the optimum is at 0 or 1. We decided
to use the value 1 as the best value for the cat piece-square table weight, since for that value
the difference between the gold and silver winning percentage is smaller.
0
10
20
30
40
50
60
-40 -30 -20 -10 0 10 20 30 40
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.7: Winning % of the cat piece-square table.
20
25
30
35
40
45
50
55
60
-15 -10 -5 0 5 10 15
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.8: Winning % of the cat piece-square table (zoomed in).
40
The next weight is that of the piece-square table of the Dog. Also here we did many
test runs. We found a best value of 0, as we can see in figures 5.9 and 5.10. This means that
the dog piece-square table that we use at the moment is no improvement to the player.
0
10
20
30
40
50
60
-30 -20 -10 0 10 20 30
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.9: Winning % of the dog piece-square table.
0
10
20
30
40
50
60
-15 -10 -5 0 5 10 15
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.10: Winning % of the dog piece-square table (zoomed in).
41
After training the weight for the dog piece-square table we similarly tuned the weight
for the Horse. Just like by the Dog, this piece-square table did not give any improvement to
the player, as we can see in figures 5.11 and 5.12.
0
10
20
30
40
50
60
70
-30 -20 -10 0 10 20 30
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.11: Winning % of the horse piece-square table.
0
10
20
30
40
50
60
70
-15 -10 -5 0 5 10 15
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.12: Winning % of the horse piece-square table (zoomed in).
42
Next we tuned the value of the weight of the camel piece-square table. This table
seems to be an improvement to our player because, as we can see in figures 5.13 and 5.14, we
find the value 3 to be the best value.
0
10
20
30
40
50
60
-30 -20 -10 0 10 20 30 40
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.13: Winning % of the camel piece-square table.
0
10
20
30
40
50
60
70
0 5 10 15 20 25
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.14: Winning % of the camel piece-square table (zoomed in).
43
For the last weight of the piece-square table, that of the Elephant, we performed the
test runs and found the value of 15 to be the best for the player. This is a large value, which is
explainable since the Elephant is the strongest piece on the board and has to get access to each
side as quick as possible. Therefore it strongly wants to stay in the middle of the board just as
the piece-square table indicates.
0
10
20
30
40
50
60
-30 -20 -10 0 10 20 30 40
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.15: Winning % of the elephant piece-square table.
0
10
20
30
40
50
60
70
0 5 10 15 20 25 30 35
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.16: Winning % of the elephant piece-square table (zoomed in).
44
5.2.3 Mobility
As said in chapter 3 we split mobility in two, namely a weight for the frozen part, and
one for the partial mobility.
First we tuned the frozen part. Here we find a negative weight, which is correctly
indicated that a piece is penalized for being frozen. A can be seen in figures 5.17 and 5.18 we
found the value -8 for this weight.
0
10
20
30
40
50
60
70
-40 -30 -20 -10 0 10 20 30
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.17: Winning % of the frozen-weight value.
40
45
50
55
60
65
70
-25 -20 -15 -10 -5 0
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.18: Winning % of the frozen-weight value (zoomed in).
45
Second we tuned the partial-mobility part. Here we see that the effect of this weight
hardly depends on its value, except for the optimum value 0. See figures 5.19 and 5.20.
0
10
20
30
40
50
60
70
-30 -20 -10 0 10 20 30
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.19: Winning % of the partial-mobility weight value.
0
10
20
30
40
50
60
70
-15 -10 -5 0 5 10 15
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.20: Winning % of the partial-mobility weight value (zoomed in).
5.3 Tuning the Knowledge Evaluator
Besides the basic evaluator we also had the knowledge-evaluation part which we
described in section 3.2. The tuning of this part will be described in this section, similarly as
we did for the basic evaluator.
46
5.3.1 Rabbit Evaluation
Like we have seen in chapter 3 we had two parts in the rabbit evaluation. First we had
a weight to encourage the Rabbits to from solid walls. The results for this weight can be seen
in figures 5.21 and 5.22, where it is tuned to the value 10.
40
45
50
55
60
-20 -10 0 10 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.21: Winning % of the solid-wall weight value.
30
35
40
45
50
55
60
65
0 5 10 15 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.22: Winning % of the solid-wall weight value (zoomed in).
47
Second we had to tune the weight rewarding Rabbits on free files to the goal. This
weight is tuned in figures 5.23 and 5.24 and resulted in the value 50.
30
35
40
45
50
55
60
-50 -30 -10 10 30 50
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.23: Winning % of the free-file weight value.
35
40
45
50
55
60
65
40 45 50 55 60
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.24: Winning % of the free-file weight value (zoomed in).
48
5.3.2 Goal-threat Evaluator
Like the other tuning experiments we did a rough investigation first (figure 5.25), and
then zoomed in around value 10 (figure 5.26). The value 5 was found to be the best for the
goal-threat evaluator weight.
0
10
20
30
40
50
60
-20 -10 0 10 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.25: Winning % of the goal-threat weight value.
30
40
50
60
70
80
0 5 10 15 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.26: Winning % of the goal-threat weight value (zoomed in).
49
5.3.3 Trap-control Evaluator
For the trap control evaluator we had two ways to determine the bonus. First we had a
weight when there was only one colour present at the goal. This weight we tuned according to
figures 5.27 and 5.28. Here we see that the best value is 0. This means that the current trap
control for one colour present is no improvement to our player.
0
10
20
30
40
50
60
70
-20 -10 0 10 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.27: Winning % of the trap-control weight value.
0
10
20
30
40
50
60
70
-10 -5 0 5 10
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.28: Winning % of the trap-control weight value (zoomed in).
50
Second we had the possibility that both colours are present near a trap. For this we
determine how big the weight should be for the strongest player. This tuning can be seen in
figures 5.29 and 5.30. Here we see again that the best value is 0. This means also that this
brings no improvement to our player.
0
10
20
30
40
50
60
70
-20 -15 -10 -5 0 5 10 15 20
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.29: Winning % of the bonus weight value.
20
30
40
50
60
70
-10 -5 0 5 10
Weight Value
W
i
n
%
Average Gold Silver
Figure 5.30: Winning % of the bonus weight value (zoomed in).
51
5.4 Chapter Conclusion
We have tuned the weights of the evaluation function, the results of which are
gathered in table 5.1. We see that some parts of the evaluation (viz. with weight 0) are no
improvement to COXA. So we removed the dog piece-square table, horse piece-square table,
and the partial mobility for the basic evaluator, and trap control for single and two player(s)
for the extended evaluator.
Furthermore, we see that the piece-square table for the Elephant is very important with
a weight of 15, meaning that it is important for the Elephant to be in the middle of the board.
Another point that gets our attention is the rabbit evaluation. Here we see that solid
walls with weight 10 are important. We also see that free files become very important when
they are present (weight 50).
Overall we see that the basic evaluation does good work to give improvement. The
extended evaluation also gives improvement except the trap control. This needs more
attention before it can become part of a better playing program.
Weight Value
material balance 4
rabbit piece-square table 6
cat piece-square table 1
dog piece-square table 0
horse piece-square table 0
camel piece-square table 3
Elephant piece-square table 15
frozen pieces -8
Basic
partial mobility 0
Rabbit's solid walls 10
Rabbit's free files 50
goal threat 5
trap control single player 0
Extended
trap control two players 0
Table 5.1: Overview of the weight values of the tuned evaluation function.
52
53
6 Testing of Search Algorithm
This chapter describes some numerical tests about the search techniques described in
chapter 4. All results in this chapter are taken from a series of 100 games of Arimaa. Each
algorithm played 50 times as Gold, and 50 times as Silver. The small random factor of 0.3
was also added to the evaluation function to avoid playing the same game 100 times. For each
experiment, the search depth of the algorithm was fixed at depth 5, and iterative deepening
was enabled.
First, the results for the various windowing techniques are described in section 6.1.
The best algorithm is then extended with the transposition tables (see section 6.2) and then the
move ordering techniques are added (see section 6.3). Finally, in section 6.4 a short
conclusion is given about all search-algorithm experiments.
In all tests, the results are displayed as the average number of nodes searched per
search depth, the time in seconds to reach that depth and the percentage of nodes gained when
using two different search algorithms.
6.1 Windowing Techniques
Two windowing techniques were implemented: principal variation search (PVS), and
the null move. First PVS is tested in two ways against plain Alpha Beta in subsection 6.1.1,
and then the best algorithm is tested against itself with the null move enabled in subsection
6.1.2. These tests were run at a fixed search depth of 5 plies, as it almost takes three days to
complete a test run of 100 games at this depth.
6.1.1 Principal Variation Search
Principal variation search was tested in two ways. In the first test, plain Alpha Beta
played against PVS, where PVS is applied on every step of a move.
Alpha Beta PVS all steps
depth # sec # nodes # sec # nodes % gain
1 0.0 20 0.0 23 -15.0
2 0.0 483 0.0 494 -2.3
3 1.7 10943 1.6 10825 1.1
4 41.7 251166 36.8 244461 2.7
5 65.6 352949 61.1 351604 0.4
Table 6.1: Principal Variation Search (all steps) test results.
As table 6.1 shows, PVS performs much like Alpha Beta, with only a small
enhancement at depth 4.
In the second test, Alpha Beta was compared to PVS, where PVS was only used on the
last step of a move.
54
Alpha Beta PVS only last step
depth # sec # nodes # sec # nodes % gain
1 0.0 19 0.0 19 0.0
2 0.0 438 0.0 431 1.6
3 1.5 9383 1.4 9206 1.9
4 33.6 203392 32.7 196009 3.6
5 60.0 322094 58.7 316579 1.7
Table 6.2: Principal Variation Search (last step) test results.
As shown in table 6.2, principal variation search, only on the last step, performs
slightly better than PVS on all steps. Here we see an improvement on depth 4, which is where
the last step of the first player occurs.
6.1.2 Null-move Search
In the last test of this series, two different versions of principal variations search
played against each other. One used the null move heuristic, and the other did not. For the null
move, R (the reduced- depth parameter) was set to 0, because here the null move is only
applied at depth 5. When the null move is used the depth springs from 5 to 9 directly because
switching from player means omitting 4 steps. On the others steps it is allowed to pass
anyway and adding a null move.
Null move Disabled Null move enabled
depth # sec # nodes # sec # nodes % gain
1 0.0 20 0.0 20 0.0
2 0.0 479 0.0 475 0.8
3 1.7 10782 1.7 10625 1.5
4 40.2 240242 40.3 241485 -0.5
5 64.4 345210 66.4 356405 -3.2
Table 6.3: Null-move search test result
As table 6.3 clearly shows, when the null move is used (see depth 5) it is bad for our
search. To test the null move really good we have to go much deeper in the search, since it
only can be used at depths like 5, 9, 13, 17, etc. But depths 9 and above are unreachable at the
moment.
6.2 Transposition Table
To test the effect of transposition tables on Arimaa, each of its components was
enabled separately and tested against the reference player from now on: PVS on the last step
without null move. In subsection 6.2.1 the transposition table is only used when an exact hit
has been found. In subsection 6.2.2 only upper/lower bound hits in the table are used. In
subsection 6.2.3 the table is only used as a move ordering mechanism, and finally in
subsection 6.2.4 all components are enabled and the table is fully used.
55
6.2.1 Only using Exact Table Hits
In this test, the transposition table pruning was only enabled when the value stored in
the table was an exact value. The number of tthits is therefore defined as the number of times
that exact values in the tables were used to cut off the search.
TT disabled TT enabled (exact)
depth
# sec # nodes # sec # nodes # tthits % gain
1 0.0 20 0.5 20 0 0.0
2 0.0 454 0.6 257 205 43.4
3 1.6 10053 1.4 2821 7442 71.9
4 38.1 223364 15.1 20127 211669 91.0
5 60.3 323719 38.8 38889 411411 88.0
Table 6.4: TT (exact) test results.
As table 6.4 shows, only pruning the tree when an exact hit is found in the
transposition table reduces the number of nodes with about 90% at search depth 5.
6.2.2 Only using Upper and Lower Bound Pruning
In this test, only upper and lower bound hits in the table were used to speed up the
search process. These values are obtained from previous Alpha and Beta values and can be
used to adjust the search window. In this case, the tthits count is the number of upper and
lower bound hits that were used to prune the tree.
TT disabled TT enabled (upper/lower bound)
depth
# sec # nodes # sec # nodes # tthits % gain
1 0.0 20 0.5 20 0 0.0
2 0.0 479 0.6 484 0 -1.0
3 1.7 10708 1.1 6146 348 42.6
4 39.8 241324 6.1 58676 3872 75.7
5 64.9 353936 12.2 78206 43241 77.9
Table 6.5: TT (upper / lower bound) test results.
As shown in table 6.5, using upper and lower bound reduces the number of nodes with
about 78% at search depth 5.
6.2.3 Only using Move Ordering
In this test, the transposition table was only used as a move ordering mechanism. If the
current position has a value and a move stored in the table, that move is tried first when
searching the position, even if the value stored in the table could have been used to cut off the
tree. The tthits value stands for each time the transposition table is used to re-order the moves.
56
TT disabled TT enabled (ordering)
depth
# sec # nodes # sec # nodes # tthits % gain
1 0.0 20 0.5 21 0 -5.0
2 0.0 471 0.6 486 217 -3.2
3 1.6 10489 1.4 10902 8664 -3.9
4 39.3 235967 15.9 248376 236015 -5.3
5 63.2 341181 41.6 488458 686605 -43.2
Table 6.6: TT (ordering) test results.
As the results in table 6.6 shows, only using the move ordering feature of the
transposition table yields a negative reduction in nodes searched of about 43% at search depth
5.
6.2.4 Full use of the Table.
In the last test of this series, the transposition table was fully enabled, combining all
three features tested in the previous tests. This time, tthits is the number of times some
information stored in the table was used in the search. This can either be an exact hit, an
upper/lower bound hit or a re-ordering hit.
TT disabled TT enabled (full)
depth
# sec # nodes # sec # nodes # tthits % gain
1 0.0 20 0.5 21 0 -5.0
2 0.0 452 0.6 273 221 39.6
3 1.6 9896 1.1 2508 4143 74.7
4 36.2 217874 6.3 21143 43759 90.3
5 62.7 340407 12.5 40531 84999 88.1
Table 6.7: TT (full) test results.
As table 6.7 shows, using the full transposition table lowers the number of nodes
searched with about 90% at depth 5. This is the same as in table 6.4 where we only used the
exact feature. However, the full feature searches uses for a similar number of nodes
considerably less time, a gain of almost 68% at search depth 5. The reason is that the number
of times information is retrieved from the table, as indicated by the number of hits, is
considerably lower when the full feature is used. Consequently, we opted to use the full
feature from now on.
6.3 Move Ordering
As said in chapter 4 we put the game-specific heuristics directly into the code. Two
different game-independent move-ordering techniques were implemented for Arimaa: the
killer-move heuristic, and the history heuristic. (The use of the transposition move as move
ordering was already tested in subsection 6.2.3.) The best algorithm so far, PVS only on the
last step of a move with the null move disabled and the transposition table fully used, will
play against its counterpart with the killer move enabled in subsection 6.3.1, where a few
variants of the killer-move heuristic are tested.
57
Furthermore, in subsection 6.3.2 the history heuristic is tested. In all these tests, most
settings remain unchanged, but the search depth was fixed at ply 6 since use of the
transposition table enabled a considerable speed-up in search time.
6.3.1 Killer-move Heuristic
To test the impact of the killer-move heuristic, five tests were run. In test 1, the best
algorithm so far, PVS only on the last step of a move with the null move disabled and the
transposition table fully used, played against its counterpart with killer-move heuristic
enabled. For this first test, only one killer was recorded per search depth. For the other four
tests each time one killer extra will be recorded per search depth, so in the last test we have 5
killers recorded.
Killer disabled Killer enabled (record one)
depth
# sec # nodes # sec # nodes % gain
1 0.5 19 0.5 20 -5.3
2 0.6 230 0.6 244 -6.1
3 1.0 1983 1.1 2144 -8.1
4 4.9 15783 5.4 17358 -10.0
5 9.7 30685 10.7 34060 -11.0
6 15.1 43201 16.8 49181 -13.8
Table 6.8: Killer-move heuristic (record one) test results.
As shown in table 6.8. using the killer heuristic as move ordering on top of PVS and
transposition table yields an increase of up to 14 % at depth 6.
In test 2, we record two killers for one player and none for the other.
Killer disabled Killer enabled (record two)
depth
# sec # nodes # sec # nodes % gain
1 0.5 20 0.5 19 5.0
2 0.6 247 0.6 242 2.0
3 1.1 2194 1.1 2124 3.2
4 5.5 18029 5.3 17198 4.6
5 11.0 34918 10.4 33262 4.7
6 16.9 47045 16.2 45547 3.2
Table 6.9: Killer-move heuristic (record two) test results.
Table 6.9 shows a little improvement of around 4-5 % at depth 5.
In test 3, again we recorded one extra killer, i.e., three for one player and none for the
other.
58
Killer disabled Killer enabled (record three)
depth
# sec # nodes # sec # nodes % gain
1 0.5 19 0.5 19 0.0
2 0.6 239 0.6 240 -0.4
3 1.1 2093 1.1 2115 -1.1
4 5.2 17023 5.2 17112 -0.5
5 10.3 33031 10.4 33410 -1.1
6 15.9 45483 16.4 47763 -5.0
Table 6.10: Killer-move heuristic (record three) test results.
As shown in table 6.10 it gives no improvement in node reduction. It searches
throughout more nodes.
In test 4, the fourth killer will also be recorded for one player and none for the other.
Killer disabled Killer enabled (record four)
depth
# sec # nodes # sec # nodes % gain
1 0.5 19 0.5 20 -5.3
2 0.6 236 0.6 243 -3.0
3 1.0 2061 1.1 2143 -4.0
4 5.1 16521 5.3 17388 -5.2
5 10.1 32062 10.5 33584 -4.7
6 15.9 46557 16.2 45050 3.2
Table 6.11: Killer-move heuristic (record four) test results.
Once again, as table 6.11 shows, more recording of killers gives no reduction of nodes
searching. Only a little improvement at depth 6 of some 3%.
Finally in test 5, we recorded five killers for one player.
Killer disabled Killer enabled (record five)
depth
# sec # nodes # sec # nodes % gain
1 0.5 20 0.5 20 0.0
2 0.6 242 0.6 244 -0.8
3 1.1 2126 1.1 2162 -1.7
4 5.3 17186 5.4 17646 -2.7
5 10.4 33306 10.7 33977 -2.0
6 16.4 47658 16.4 45445 4.6
Table 6.12: Killer-move heuristic (record five) test results.
As shown in table 6.12, we see here no improvement in reducing nodes, except for a
small gain at depth 6 of almost 5%. This could mean that deeper searches will give more
reducing of nodes. Further research is needed to answer this question.
59
6.3.2 History Heuristic
In the history test, PVS only on the last step of a move with the null move disabled,
the transposition table fully used and the killer move enabled using two killers per depth was
equipped with the history heuristic enabled. For this test, the values in the history tables were
incremented with
d
2 .
History disabled History enabled
depth
# sec # nodes # sec # nodes % gain
1 0.5 19 0.5 20 -5.3
2 0.6 230 0.6 251 -9.1
3 1.0 2009 1.1 2256 -12.3
4 5.0 16281 5.7 18645 -14.5
5 9.9 31639 11.4 35768 -13.1
6 15.3 43205 16.8 41972 2.9
Table 6.13: History-heuristic test results.
As table 6.13 shows, the history heuristic brings no improvement to our search. Once
again, like with the killer-move heuristic, it gives however a small improvement at depth 6.
6.4 Chapter Conclusions
As seen throughout this chapter, most search enhancements yield a positive result in
nodes reduction. So far, only null move search, some killer-move heuristic variations and the
history heuristic had a negative influence. Therefore, the recommended search algorithm will
use the following enhancements:
principal-variation search but only at the last step;
the transposition table fully used;
the killer-move heuristic with 2 killers per depth.
60
61
7 Conclusions
This chapter contains the final conclusions on our research. Section 7.1 revisits the
problem statement and research questions, and section 7.2 lists possibilities for future
research.
7.1 Problem Statement and Research Questions Revisited
In section 1.3 we have defined the following research questions:
What is the complexity of Arimaa?
In chapter 2, we have seen that the state-space complexity of Arimaa is ) 10 (
43
O , and
the game-tree complexity is ) 10 (
300
O . These numbers are only an approximation, since the
state-space complexity includes some unreachable positions as shown, and the game-tree
complexity is based on games between humans and is subject to change once more Arimaa
programs are created. Both the state-space complexity and the game-tree complexity of
Arimaa are comparable to that of the game of Amazons. Completely solving Arimaa is,
probably impossible in a foreseeable future.
The second research question was:
Can we use knowledge about the game of Arimaa in an efficient and effective
implementation of an Arimaa program?
The evaluation function described in chapter 3 implements different strategies. The
basic evaluation, i.e., material balance, piece-square tables, and mobility, are useful in
Arimaa, with the exception of the dog and horse piece-square tables. Also the partial mobility
did not work.
For the extended evaluation the rabbit evaluation and the goal threats appeared to be
useful in Arimaa, but trap control not.
The third research question was:
Can we apply and adapt relevant techniques, developed for computer-game playing,
to the game Arimaa?
As described in chapter 4, many known techniques can be used for Arimaa. Compared
to standard Alpha Beta search, PVS on the last step, transposition tables and killer move
heuristic all cause a more or less substantial reduction in nodes searched.
Now that the research questions have been answered, we can also formulate an answer
to the problem statement:
Can we build an efficient and effective program to play the game of Arimaa?
62
To build a program to play Arimaa, known search algorithms like Alpha Beta search,
PVS on the last step, transposition tables and killer move heuristic can be used. Game
knowledge in the form of a static evaluation function based on game strategies also has to be
used.
A program with these features plays reasonably well against amateur human players.
This at least is indicative for a positive answer to the problem statement.
7.2 Future Research Possibilities
The search algorithms and enhancements can be more fine-tuned. The null move is not
used in the game, but probably when the search depth is large enough it will give better
results. More research can be done with the history tables, a different method for upgrading or
reducing the counts. They can be used on more steps besides the single steps, like the push
and pull moves. And maybe other techniques that are not described here can be applied to
Arimaa. Furthermore, it can be possible to create a more efficient or faster implementation of
Arimaa.
The evaluator is still a crude estimate of the value of a board position. A more
elaborate (and perhaps faster) evaluator might possibly be created. Since besides basic
evaluation so far only the rabbit evaluation and the goal-threat strategy worked, it is likely
that a more elaborate evaluation function can be created.
63
References
Akl, S.G. and Newborn, M.M. (1977). The Principal Continuation and the Killer Heuristic.
1977 ACM Annual Conference Proceedings, pp. 466-473. ACM, Seattle.
Allis, L.V. (1994). Searching for Solutions in Games and Artificial Intelligence. Ph. D. thesis,
Rijksuniversiteit Limburg, Maastricht, The Netherlands.
Atkin, L.R. and Slate, D.J. (1977). CHESS 4.5 The Northwestern University Chess Program.
Frey P. W. (ed.), Chess Skill in Man and Machine, pp. 82-118. Springer-Verlag, New York.
Bernstein, A., Roberts, M. De V., Arbuckle, T. and Belsky, M.A. (1958). A Chess Playing
Program for the IBM 704. Proceedings of the Western Joint Computer Conference, pp. 157-
159
Breuker, D.M., Uiterwijk, J.W.H.M. and Herik, H.J. van den (1994). Replacement schemes
for Transposition Tables. ICCA Journal, Vol. 17, No.4, pp. 183-193.
Breuker, D.M. (1998). Memory versus Search in Games. Ph. D. thesis, University of
Maastricht, The Netherlands.
Chinchalkar, S. (1996). An Upper Bound for the Number of Reachable Positions. ICCA
Journal, Vol. 19, No. 3, pp. 181-183.
Donninger, C. (1993). Null Move and Deep Search: Selective-Search Heuristics for Obtuse
Chess Programs. ICCA Journal, Vol. 16, No.3, pp. 137-143.
Gillogly, J.J. (1972). The TECHNOLOGY Chess Program. Artificial Intelligence, vol. 3, pp.
145-163.
Gillogly, J.J. (1989). Transposition Table Collisitions. Workshop on New Directions on
Game-Tree Search (pre prints) (ed. T.A. Marsland), p.12. Printing Services, University of
Alberta, Edmonton.
Greenblatt, R.D., Eastlake, D.E. and Crocker, S. D. (1967). The Greenblatt Chess Program,
Proceedings of the Fall Joint Computer Conference, pp. 801-810.
Herik, H.J. van den, Uiterwijk, J.W.H.M. and Rijswijck, J van (2002). Games Solved: Now
and in the future. Elsevier, Artificial Intelligence, Vol. 134, pp. 277-311.
Huberman, B. J. (1968). A Program to Play Chess End Games. Ph. D. thesis, Stanford
University, Computer Science Department, USA. Technical Report no.CS-106.
Hyatt, R.M., Gower, A. and Nelson, H. (1985). CRAY BLITZ. Beal, D. F. (ed.), Advances in
Computer Chess 4, pp. 8-18. Pergamon Press, Oxford.
Hsu, F-h. (2004). Behind Deep Blue: Building the computer that defeated the world Chess
champion. Princeton university press.
64
Kister, J., Stein, P., Ulam, S., Walden, W. and Wells, M. (1957). Experiments in Chess.
Journal of the ACM, Vol. 4, pp. 174-177
Knuth, D.E. and Moore, R.W. (1975). An Analysis of Alpha-Beta Pruning. Artificial
Intelligence, Vol. 6, No. 4, pp. 293-326.
Kotok, A. (1962). A Chess Playing Program for the IBM 7090, B.S. Thesis, MIT. Computer
Chess Compendium, pp. 48-55.
Marsland, T.A. (1986). A Review of Game-Tree Pruning. ICCA Journal. Vol. 9, No.1, pp.3-19
McCarthy, J. (1961) A Basic for a Mathematical Theory of Computation. In Proc. Western
Joint Computer Conference, pp. 225-238.
Newell, A., Shaw, J.C. and Simon, H.A. (1958). Chess Playing Programs and the Problem of
Complexity, IBM Journal of Research and Development, Oct 1958, pp. 320-335.
Samuel, A.L. (1959). Some studies in machine learning using the game of Checkers. IBM
Journal of Research and Development, Vol. 3, No. 3, pp. 210-229.
Samuel, A.L. (1967). Some Studies in Machine Learning using the Game of Checkers. II-
Recent Progress. IBM Journal of Research and Development, Vol. 2, No. 6, pp. 601-617.
Schaeffer, J. (1983). The History Heuristic. ICCA Journal, Vol. 6, No. 3, pp. 16-19.
Schaeffer, J. (1997). One Jump Ahead. Springer-Verlag, New York.
Schaeffer, J. and Plaat, A. (1997). Kasparov versus Deep Blue: The Rematch. ICCA Journal,
vol. 20, No. 2, pp. 95-101.
Shannon, C. (1950). Programming a Computer for playing Chess. Philosophical Magazine,
vol. 41, pp. 256-275.
Syed, O. and Syed, A. (1999). Arimaa Official Homepage. http://www.Arimaa.com/Arimaa/.
Thompson, K. (1982). Computer Chess Strength. Advances in Computer Chess 3, Clarke,
M.R.B. (ed.), pp. 55-56. Pergamon Press, Oxford.
Turing, A.M. (1953). Chess. Digital Computers Applied to Games. Faster than Thought,
Bowden B.V. (ed.) pp. 286-310. Pitman
Uiterwijk, J.W.H.M. and Herik, H.J. van den (2000). The Advantage of the Initiative.
Information Sciences, Vol. 122, No.1, pp. 43-58.
Zobrist, A.L. (1969). A Model of Visual Organisation for the Game of Go. Proceedings of the
Spring Joint Computer Conference 69, pp 103-112.
Zobrist, A.L. (1970). A New Hashing Method with Application for Game Playing. Technical
Report 88, Computer Science Department, The University of Wisconsin, Madison, WI, USA.
Reprinted (1990) in ICCA Journal, Vol. 13, No. 2, pp.69-73.
65
APPENDIX A: Examples of time control in Arimaa
Example 1: 0/5 means 0 minutes per move with 5 minutes in reserve (per player). This is
equivalent to G/5 in Chess; it means each player has a total of 5 minutes of time to play. If a
player runs out of time before the game is over, the player loses. This is known as Blitz or
"Sudden Death" time control in Chess.
Example 2: 0:12/5 means 12 seconds per move with 5 minutes in reserve and all of the unused
time from each move is added to the reserve time. It is similar to "5 12" in Chess which
means "Game in 5 minutes with a 12 second increment". After each move 12 seconds is
added to the remaining time. This is known as Incremental time control in Chess.
Example 3: 3/0 means 3 minute per move and no reserve time, but 100 percent of the unused
time for each move is added to the reserve. This guarantees that each player will make at
least 40 moves in 2 hours. This is similar to the "40/2" Quota System time control used in
Chess.
Example 4: 0:30/5/100/3 means 30 seconds per move with 5 minutes in reserve and 100% of
the unused time from each move is added to the reserve time. When the reserve already
exceeds the limit, more time is not added to it. When the reserve falls below 3 minutes more
time can be added to it, but the reserve is capped at 3 minutes.
Example 5: 4/2/50/10/6 this means 4 minutes per move with a starting reserve of 2 minutes.
After the move 50% of the time remaining for the move (rounded to the nearest second) is
added to the reserve such that it does not exceed 10 minutes. There is a limit of 6 hours for the
game after which time the game is halted and the winner is determined by score.
Example 6: 4/4/100/4/6 this means 4 minutes per move and a starting reserve of 4 minutes.
100% percent of the unused move time gets added to the reserve such that it does not exceed
4 minutes. There is a time limit of 6 hour for the game after which the winner is determined
by score.
Example 7: 4/4/100/4/90t this is the same as above, but the game ends after both players have
made 90 moves. Thus it ends after move 90 of Silver is completed.
Example 8: 4/4/100/4/90t/5 This is the same as above, but the players may not take more than
5 minutes for each turn even if there is still time remaining in reserve.
Different time units for any of the time control fields can be specified by adding one of the
following letters after the numbers. In such cases the letter serves as the separator and :
should not be used.
s - seconds
m - minutes
h - hours
d - days
For example: 24h5m10s/0/0/0/60d means 24 hours, 5 minutes and 10 seconds per move and
the game must end after 60 days. Such a time control may be used in a postal type match.
The game time parameter (G) can also be specified in terms of maximum number of turns
each player can make by adding the letter t after the number.
66
67
APPENDIX B: All unique patterns and their hits for each n
N sorted unique pattern # hits ) _ ( n StateSpace O
only the unique
pattern
) _ ( n StateSpace O
0 1 1 1 1 2 2 2 2 2 2 8 8 1 4.63473E+42 4.63473E+42
1 0 1 1 1 2 2 2 2 2 2 8 8 4 5.61785E+41 4.49428E+42
1 1 1 1 1 2 2 2 2 2 8 8 6 1.68536E+42
1 1 1 1 2 2 2 2 2 2 7 8 2 2.24714E+42
2 1 1 1 1 2 2 2 2 2 2 7 7 1 2.64369E+41 2.30497E+42
0 1 1 1 2 2 2 2 2 2 7 8 8 2.64369E+41
1 1 1 1 1 2 2 2 2 2 7 8 12 7.93108E+41
1 1 1 1 2 2 2 2 2 2 6 8 2 4.62647E+41
1 1 1 1 1 1 2 2 2 2 8 8 15 2.47846E+41
0 1 1 1 1 2 2 2 2 2 8 8 30 2.47846E+41
0 0 1 1 2 2 2 2 2 2 8 8 6 2.47846E+40
3 0 0 0 1 2 2 2 2 2 2 8 8 4 4.72088E+38 8.31347E+41
0 1 1 1 2 2 2 2 2 2 7 7 4 3.02136E+40
0 0 1 1 2 2 2 2 2 2 7 8 12 1.13301E+40
1 1 1 1 1 1 1 2 2 2 8 8 20 1.88835E+40
0 0 1 1 1 2 2 2 2 2 8 8 60 1.41626E+40
0 1 1 1 1 1 2 2 2 2 8 8 90 4.24879E+40
1 1 1 1 1 2 2 2 2 2 7 7 6 9.06409E+40
1 1 1 1 1 1 2 2 2 2 7 8 30 1.13301E+41
0 1 1 1 1 2 2 2 2 2 7 8 60 1.13301E+41
1 1 1 1 2 2 2 2 2 2 6 7 2 1.05748E+41
0 1 1 1 2 2 2 2 2 2 6 8 8 5.28739E+40
1 1 1 1 1 2 2 2 2 2 6 8 12 1.58622E+41
1 1 1 1 2 2 2 2 2 2 5 8 2 7.93108E+40
4 1 1 1 1 2 2 2 2 2 2 6 6 1 1.0281E+40 2.35457E+41
0 0 0 0 2 2 2 2 2 2 8 8 1 3.27839E+36
0 0 1 1 2 2 2 2 2 2 7 7 6 1.2589E+39
0 0 0 1 2 2 2 2 2 2 7 8 8 2.09817E+38
0 1 1 1 2 2 2 2 2 2 6 7 8 1.17498E+40
1 1 1 1 1 1 2 2 2 2 7 7 15 1.2589E+40
0 1 1 1 1 2 2 2 2 2 7 7 30 1.2589E+40
1 1 1 1 1 2 2 2 2 2 6 7 12 3.52493E+40
1 1 1 1 2 2 2 2 2 2 5 7 2 1.76246E+40
0 1 1 1 2 2 2 2 2 2 5 8 8 8.81231E+39
1 1 1 1 1 2 2 2 2 2 5 8 12 2.64369E+40
1 1 1 1 2 2 2 2 2 2 4 8 2 1.10154E+40
1 1 1 1 1 1 2 2 2 2 6 8 30 2.20308E+40
0 1 1 1 1 2 2 2 2 2 6 8 60 2.20308E+40
0 0 1 1 2 2 2 2 2 2 6 8 12 2.20308E+39