Presentations text content in AlphaBeta Pruning
AlphaBeta Pruning
(3Ply/turns)
Slide2>=2
AlphaBeta Pruning
(3Ply/turns)
Slide3AlphaBeta Pruning
(3Ply/turns)
>=3
Slide4[3]
AlphaBeta Pruning
(3Ply/turns)
Slide5<=
3
[3]
Slide6[3]
>= 3
<=
3
Slide7[3]
>=5
>= 3
<=
3
Slide8[3]
>=5
>= 3
<=
3
Slide9[3]
[3]
>=5
>= 3
Slide10[3]
[3]
[0]
>=5
>= 3
Slide11[3]
[3]
[0]
<=
0
>=5
>= 3
Slide12[3]
[3]
[0]
>=5
>= 3
<=
0
Slide13[3]
[3]
[0]
>=5
>= 3
<=
0
>=
2
Slide14[3]
[3]
[0]
>=5
>= 3
<=
0
[
2]
Slide15[3]
[3]
[0]
>=5
>= 3
<=
0
<=2
[
2]
Slide16[3]
[3]
[0]
>=5
>= 3
<=
0
<=2
[
2]
Slide17[3]
[3]
[0]
>=5
<=
0
<=2
[3]
[
2]
Slide18Node order
Ordering of nodes affects the number of nodes explored
Slide19How much does pruning help?
If perfect ordering: O(
b
d
) becomes
O(
b
d
/2
)
half as much time!
Typical ordering:
O(
b
3d/4
)
Chess
, b ≈ 35, d ≈100 for reasonable
games
O(35
75
) still unfeasible!
Slide20How much does pruning help?
If perfect ordering: O(
b
d
) becomes
O(
b
d
/2
)
half as much time!
Typical ordering:
O(
b
3d/4
)
Chess
, b ≈ 35, d ≈100 for reasonable
games
O(35
75
) still unfeasible!
Other ideas??
Slide21Evaluation Functions
Stop search early (at a depth limit k)
Slide22Evaluation Functions
Stop search early (at a depth limit k)
Now have to propagate utility values from nonleaf nodes
Slide23Evaluation Function
eval
(state) – estimates the utility of a state
Should:
Be efficient to compute
Order nodes at depth k in (roughly) same order as corresponding leaf nodes
Slide24>
>
Slide25Evaluation Function
eval(state) – estimates the utility of a stateShould:Be efficient to computeOrder nodes at depth k in (roughly) same order as corresponding leaf nodes
Ideas?
X
O
X
O
Slide26Evaluation Function for T3
Assuming MAX is playing as X
Difference in available wins
eval
(state)
If state is win for MAX, return
∞
Else if state is loss for MAX, return ∞
Else return:
#rows + # cols + # diagonals available to MAX – #
rows + # cols + # diagonals available to
MIN
Slide27Difference in available wins for T3
X
O
Slide28Difference in available wins for T3
X
O
=
6
–
Slide29Difference in available wins for T3
X
O
=
6
– 4
= 2
Slide30Difference in available wins for T3
X
O
X
O
X
O
=
6
– 4
= 2
=
4
– 3 =
1
Slide31MIN
MAX
All possible moves not shown
Difference in available wins for T
3
Slide32Chess evaluation functions
Ideas?
Slide33Chess EVAL
Assume each piece has the following valuespawn = 1;knight = 3;bishop = 3;rook = 5;queen = 9;EVAL(state) = sum of the value of white pieces on board – sum of the value of black pieces
= 31

36
=
5
Slide34Chess EVAL
Assume each piece has the following valuespawn = 1;knight = 3;bishop = 3;rook = 5;queen = 9;EVAL(state) = sum of the value of white pieces on board – sum of the value of black pieces
= 31
 36 = 5
Any problems with this?
Slide35Chess EVAL
Ignores actual positions!
Most valuable
Less valuable
Least valuable
Slide36Chess EVAL
Ignores actual positions!Actual heuristic functions are oftena weighted combination of features
Slide37Chess EVAL
A feature can be any numerical information about the boardas general as the number of pawnsto specific board configurationsDeep Blue: 8000 features!
number of pawns
number of attacked knights
1 if king has knighted, 0 otherwise
Slide38Chess EVAL
number of pawns
number of attacked knights
1 if king has knighted, 0 otherwise
How can we determine the weights (especially if we have 8000 of them!)?
Slide39Chess EVAL
number of pawns
number of attacked knights
1 if king has knighted, 0 otherwise
Machine
learning/Genetic algorithms!
play/examine lots of games
adjust the weights so that the
EVAL(s
) correlates with the actual utility of the states
Slide40
AlphaBeta Pruning
Download Presentation  The PPT/PDF document "AlphaBeta Pruning" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, noncommercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.