4. Alpha-BetaPruning= MinimaxExcept
• This game search strategy is a modification to Minimax game
search that avoids exploring nodes that are not useful in the
search.
• It gives the same results as Minimax but avoids exploring
some nodes.
• In the previous example, the path explored using Minimax was
A-B-D-J.
• Also the Alpha-Beta Pruning path will be A-B-D-J but
without exploring all nodes as in Minimax.
5. Alpha-Beta PruningMotivation
Never explore values that are not useful.
• =Min(Max(1, 2, 5), Max(6, x, y), Max(1, 3, 4))
• =Min(5, Max(6, x, y), 4)
• =Min(Max(6, x, y), 4)
• =4
34. Introduction
34
• Alpha-beta pruning is a way of finding the optimal minimax solution while
avoiding searching subtrees of moves which won't be selected. In the
search tree for a two-player game, there are two kinds of nodes, nodes
representing your moves and nodes representing your opponent'smoves.
• Alpha-beta pruning gets its name from two parameters.
– They describe bounds on the values that appear anywhere along the
path under consideration:
• α = the value of the best (i.e., highest value) choice found so far
along the path for MAX
• β = the value of the best (i.e., lowest value) choice found so far
along the path for MIN
35. Alpha Beta Pruning
35
• Alpha-beta pruning gets its name from two bounds that are passed along
during the calculation, which restrict the set of possible solutions based on
the portion of the search tree that has already been seen. Specifically,
• Beta is the minimum upper bound of possiblesolutions
• Alpha is the maximum lower bound of possiblesolutions
• Thus, when any new node is being considered as a possible path to the
solution, it can only work if:
where N is the current estimate of the value of the node
71. 71
• Once again, we're at a point where alpha and beta are tied, so we prune.
Note that a real solution doesn't just indicate a number, but what move led
to that number.
• If you were to run minimax on the list version presented at the start of the
example, your minimax would return a value of 3 and 6 terminal nodes
would have been examined
72. SYLLABUS: UNIT - 5
Advanced Topics: Game Playing: Minimax search procedure-
Adding alpha-beta cutoffs. Expert System: Representation-
Expert System shells-Knowledge Acquisition. Robotics:
Hardware-Robotic Perception-Planning-Application domains
74. What is MINIMAX ?
Minimax is a kind of backtracking algorithm that is used in decision
making and game theory to find the optimal move for a player,
assuming that your opponent also plays optimally. It is widely used in
two player turn-based games such as Tic-Tac-Toe, Backgammon,
Mancala, Chess, etc
83. Minimax GameSearch
Two Players take
turns: Max and
Min
Max : Maximizes
Score. Min :
Minimizes Score.
Special Case.
Max is an
expert. Min is
a beginner.
MAX
MIN
88. Minimax GameSearch
A
B C
Which node to follow?
No heuristic values.
Hot to find heuristic
values for other
nodes?
Use children
heuristics to
calculate parent
heuristic.
89. Minimax GameSearch
A
B C
Which node to follow?
No heuristic values.
Hot to find heuristic
values for other
nodes?
Use children
heuristics to
calculate parent
heuristic.
Minimax Game
Search Steps
90. Minimax GameSearch
Which node to
follow?
No heuristic
values.
A
B C
Hot to find heuristic
values for other
nodes?
Use children
heuristics to
calculate parent
heuristic.
Minimax Game Search Steps
Calculate Heuristics
91. Minimax GameSearch
Which node to
follow?
No heuristic
values.
A
B C
Hot to find heuristic
values for other
nodes?
Use children
heuristics to
calculate parent
heuristic.
137. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
B C
5
F G
4
4
7
5
5
138. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
B C
Q R S
5
F G
4
4
7
5
5
139. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
5
F G
4
4
7
5
5
140. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
5
F G
4
4
7
5
5
141. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Max
8
5
F G
4
4
7
5
5
142. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4
4
7
5
5
143. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
4
7
5
5
144. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Min
8
4
7
5
5
145. Phase 1 :Heuristic ValueCalculation
Depth-First
Search A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
8
4
7
5
5
146. Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
4
8
4
7
5
5
4
147. Max
Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
4
8
4
7
5
5
4
148. Max
Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
4
5
8
4
4
7
5
5
149. Ma
x
Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
4
5
5
8
4
4
7
5
5
150. Ma
x
Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
-6 8 2
B C
Q R S
Ma
x
8
5
8
F G
4 8
Mi
n
4
4
4
5
5
8
4
5
4
7
5
5
151. Ma
x
Phase 1 :Heuristic ValueCalculation
A
B
C
G
Q R
C
F G
S
8
B C
Q R S
Ma
x
5
8
F G
4 8
Mi
n
4
4
4
5
5
8
4
5
4
7
5
5
-6 8 2
If both players play optimally then Max will win by a score 5.
159. Minimax Game Search
Drawback
• Expandsall the
tree
while not all
expanded nodes are
useful.
• In this example, just
few nodes of the
whole tree was
useful in reaching
the goal.
161. Alpha-BetaPruning= Minimax
Except
• This game search strategy is a modification to Minimax game
search that avoids exploring nodes that are not useful in the
search.
• It gives the same results as Minimax but avoids exploring
some nodes.
• In the previous example, the path explored using Minimax was
A-B-D- J.
• Also the Alpha-Beta Pruning path will be A-B-D-J but
without exploring all nodes as in Minimax.