Professional Documents
Culture Documents
Motivation
GO
chess
tic-tac-toe
2
Today
MiniMax
Alpha-beta pruning
Type of game:
Perfect information
zero-sum game
both players know the state of the game and all possible moves
No chance involved
If the total gains of one player are added up, and the total losses are subtracted,
they will sum to zero.
a gain by one player must be matched by a loss by the other player
Today
MiniMax
Alpha-beta pruning
MiniMax Search
Game between two opponents, MIN and MAX
MiniMax procedure:
Rules
MiniMax Algorithm
Best next move for MAX is the one leading to the child with
the highest value (and vice versa for MIN)
10
No exhaustive search
Heuristic Function
12
13
14
e(n)
e(n) = 88 = 0
e(n) = 64 = 2
e(n) = 33 = 0
15
More examples
16
17
18
19
Today
MiniMax
Alpha-beta pruning
20
Alpha-Beta Pruning
21
22
A closer look
max level
-1 3 A
-1 C
min level
Pruning
-1
If it is a:
order sensitive
24
min level
25
min level
=2
value 2
e(n) = 2
26
min level
e(n) = 2
e(n) = 1
27
min level
e(n) = 2
=1
value 1
=1
value = 1
e(n) = 1
28
min level
e(n) = 2
=1
value 1
=1
value = 1
e(n) = 1
= -1
value -1
e(n) = -1
29
=1
Search can be discontinued below
any MIN node whose beta value is
less than or equal to the alpha value
of one of its MAX ancestors
e(n) = 2
e(n) = 1
=1
value 1 and value -1
= -1
value -1
e(n) = -1
30
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
31
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
32
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
33
-3
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
34
-3
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
35
-3
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
36
-3
0 5 -3 3 3 -3 0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0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
53
-3
-5
-5
-3
-5
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
54
-3
-5
-5
-3
-5
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
55
-3
-5
-5
-3
-5
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
56
-3
-5
-5
-3
-5
0 5 -3 3 3 -3 0 2 -2 3 5 2 5 -5 0 1 5 1 -3 0 -5 5 -3 3 2
57
source: http://en.wikipedia.org/wiki/File:AB_pruning.svg
58
Today
MiniMax
Alpha-beta pruning
59
60
61
63
Go: Goemate
?
VS
Goemate
(the best Go program available today)
Developed by Chen Zhixing
64
Secrets
alpha-beta pruning +
iterative deepening +
huge databases + ...
65
John McCarthy
66
Today
MiniMax
Alpha-beta pruning
67