Professional Documents
Culture Documents
Ch5 AdversarialSearch
Ch5 AdversarialSearch
Adversarial Search
(Game-Playing)
❖ Games
❖ Optimal decisions in games
❖ Minimax algorithm
❖ Alpha-Beta Pruning (α-β pruning)
❖ Stochastic Games
❖ We draw the tree assuming the two players, MAX and MIN
where MAX moves first.
How do we
search this
tree to find
the optimal
move?
Terminal states are labeled depending on the winner
(MAX=+1,MIN=-1)
High values are good for MAX and bad for MIN.
Similarly, when MIN plays he wants the node with the lowest value.
So the MIN-node parent of a set of nodes gets the min of all their
values.
❖ i.e., Given a choice, MAX prefer to move to a state of maximum
value, whereas MIN prefers a state of minimum value
❖ We back up values until we get to the children of the start node, and
MAX can use this to decide which node to choose.
Designed to find the optimal strategy for Max and find best move:
❖ Two solutions:
And so on.
[-∞,+∞]
[-∞, +∞]
[-∞,+∞]
[-∞,3]
[-∞,+∞]
[-∞,3]
[3,+∞]
[3,3]
[3,+∞]
This node is
worse for MAX
[3,3] [-∞,2]
[3,14] ,
[3,5] ,
[3,3]
[3,3]
Opponent n v
, b, passed to kids
=−
b =+
=−
b =+
=−
b =3
=−
b =+
=−
b =3
3 is returned
as node value.
=3
b =+
, b, passed to kids
=3
b =+
=3
b =+
MIN updates b,
based on kids.
=3
b =2
=3
b =+
=3 ≥ b,
b =2 so prune.
2 is returned
as node value.
=3
b =+ ,
, b, passed to kids
=3
b =+
=3
b =+ ,
MIN updates b,
based on kids.
=3
b =14
=3
b =+ ,
MIN updates b,
based on kids.
=3
b =5
=3
b =+ 2 is returned
as node value.
5 6
3 4 1 2 7 8
Max
5 6
3 4 1 2 7 8
3 4
6 5 8 7 2 1
Min
Max
3 4
6 5 8 7 2 1