Sie sind auf Seite 1von 23

Games and Search

Move Generation
Min Max
Alpha Beta

1949 Shannon paper


1951 Turing paper
1958 Bernstein Program
55-60 Simon-Newell Program
1961 Soviet Program
66-67 MacHack 6 (MIT AI)
70s NW Chess 4.5
80s Cray Blitz
90s Belle, Hitech, Deep
Thought, Dee Blue

Game Tree Search

Initial State : Initial Board Position and Player


Operators : one for each legal move
Goal States : winning board positions
Scoring Function : assigns numeric value to states
Game Tree : encodes all possible games

Not only the path but also the next move( leading to
winning state)
Best move depends on the opponent
2

Move Generation
b = branching factor

d = depth

My moves

Result
Opponent Moves

Chess
b = 36
d > 40

40

36 is big!

Partial Game Tree for Tic-Tac-Toe

Partial Game Tree for Tic-Tac-Toe

Static Evaluation
S = C1 x material

C2 x pawn structure

C3 x mobility

3.5

C4 x king safety

C5 x center control

Too weak to predict success


6

Limited look ahead and Scoring

min
ply

Static evaluations

Player : try to maximize score


Opponent : try to minimize score

Deep Blue
32 SP2 processors
each with 8 dedicated chess processors = 256 Chess Processors
50 100 billion moves in 3mins
13 30 ply search

-
>=2

max

2
min
2

is lower bound on score


is upper bound on score

-
// = best score for MAX , = best score for MIN
//Initial call is MAX-VALUE(state, -, , MAX-DEPTH)
function MAX-VALUE(state, , , depth)
if(depth==0) then return EVAL(state)
for each s in SUCCESSORS(state) do
=MAX(,MIN-VALUE (s, , , depth-1)
if then return //cutoff
end
return
function MIN-VALUE(state, , , depth)
if(depth==0) then return EVAL(state)
for each s in SUCCESSORS(state) do
= MIN(,MAX-VALUE (s, , , depth-1)
if then return //cutoff
end
return
10

-
-

max

2
min
2

is lower bound on score


is upper bound on score

11

-
-

max

2
min
2

2
7

is lower bound on score


is upper bound on score

12

-
-

max

2
min
2

- 2

2
7

is lower bound on score


is upper bound on score

13

-
-

max

- 2
min
2

7
7

is lower bound on score


is upper bound on score

14

-
-

max

2
min
2

- 2

7
7

is lower bound on score


is upper bound on score

15

-
-

max

- 2

min
2

is lower bound on score


is upper bound on score

16

-
max

- 2

min
2

is lower bound on score


is upper bound on score

17

-
max

- 2

min
2

is lower bound on score


is upper bound on score

18

-
max

- 2

min
2

is lower bound on score


is upper bound on score

19

-
max

- 2

2 1
1

min
2

is lower bound on score


is upper bound on score

20

-
max

- 2

2 1
1

min
2

Cut off

is lower bound on score


is upper bound on score

21

-
2

max

- 2

2 1
1

min
2

Cut off

is lower bound on score


is upper bound on score

22

-
Guaranteed to return exactly the same value as
the Min-Max algorithm
Pure optimization without any approximations
or trade-offs

In a perfectly ordered tree, with the best moves


on the left, alpha beta reduces the cost of the
search from order b^d to order b^(d/2)

23

Das könnte Ihnen auch gefallen