Alpha-Beta Pruning Algorithm
Alpha-Beta Pruning Algorithm
Algorithm
GAMES - ADVERSARIAL SEARCH
Pruning the Minimax Tree
Since we have limited time available in the games, we want to avoid unnecessary computation
in the minimax tree.
Alpha-beta pruning is a modified version of the min-max algorithm. It is an optimization
technique for the min-max algorithm.
Pruning: ways of determining that certain branches will not be useful.
The two values can be defined as:
α = the value of the best (highest-value) choice we have found so far at any choice point
along the path for MAX. The initial value of alpha is -∞.
β = the value of the best (lowest-value) choice we have found so far at any choice point
along the path for MIN. The initial value of beta is +∞
Alpha-Beta Pruning Algorithm
Key points about alpha-beta pruning algorithm:
α >=β
Alpha-Beta Example
[α =-∞, β=+∞] Max
[α =-∞, β=+∞]
Min
[α =-∞,
[α =-∞, β=+∞]
β=7] Min
[α =-∞, β=7]
β=6] Min
7 6
[α =-∞, β=6]
[5] β=5] Min
7 6 5
this is the last value from this sub-tree, and the exact value is known
Max now has a value for its first successor node, but hopes that something better might
still come
Alpha-Beta Example
[α =5, β=+∞]
Max
[5] [α =5,
[α =5, β=+∞] Min
β=3]
7 6 5 3
[5] [α =5,
[3]β=3] Min
7 6 5 3
◦ Min is lucky, and finds a value that is the same as the current worst value at
this level
Alpha-Beta Example
[α =5,[5]β=+∞]
Max
7 6 5 3 6 5
14