13 Minimax Search
# Minimax search
done ← leaves((S, E))
while done ≠ S:
next ← { s' ∈ S ∖ done | children(s', (S, E)) ⊆ done }
for s ∈ next:
C ← children(s, (S, E))
if owner(s) = 1:
O ← arg max_{s' ∈ C} u(s') # maximise
else:
O ← arg min_{s' ∈ C} u(s') # minimise
s'' ← any element of O
u(s) ← u(s'') # back score up
done ← done ∪ {s}
Here, we are concerned with zero sum games, which are a subset of extended form games.
For a two player zero sum game (where one player’s win is the other player’s loss)
The components are almost the same as extended form games, except:
is set of two players
gives the scores for player 1. The score of player 2 is the negation of score of player 1.
Minimax is a variation of backward induction, optimised for zero sum games.
13.1 Depth-limited minimax with heuristics
In practice, real game trees are too large for full backward induction. We want to use depth-limited search. We then have to replace the exact utilities at new leaves with some heuristic evaluations. For example, in chess it might be .
13.2 Alpha-beta pruning
An optimisation for minimax.
Keep track of , the best (highest) value that Maximiser has found so far.
is the lowest value that Maximiser has found so far.
If , stop searching a branch. There is no point as Maximiser cannot get a higher value .