📝 Quick Revision Notes: Adversarial Search
Revision Notes
1. Core Concepts at a Glance
Adversarial Search = Game Playing
- Two players: MAX (wants to maximize utility) and MIN (wants to minimize)
- Game tree: Alternating MAX and MIN levels; leaves have utility values
- Zero-sum: UMAX + UMIN = 0 (one’s gain = other’s loss)
- Perfect information: Both players see complete game state (Chess, Go)
- Imperfect information: Hidden state (Poker, Battleship)
- Stochastic: Chance elements like dice (Backgammon)
2. Formula Sheet
Minimax Value
- MINIMAX(n) = UTILITY(n) if terminal
- MINIMAX(n) = maxc MINIMAX(c) if MAX node
- MINIMAX(n) = minc MINIMAX(c) if MIN node
Alpha-Beta Pruning Rules
- α = best value MAX can guarantee (init: −∞)
- β = best value MIN can guarantee (init: +∞)
- β cutoff: at MAX node, prune if v ≥ β
- α cutoff: at MIN node, prune if v ≤ α
Expectiminimax (Chance Nodes)
EXPECTIMINIMAX(n) = ∑c P(c) × EXPECTIMINIMAX(c) if CHANCE node
UCB1 (MCTS Selection)
UCB1(i) = wi/ni + C√(ln N / ni)
wi = wins, ni = visits to child, N = visits to parent, C = exploration constant (≈ √2)
3. Complexity Comparison
| Algorithm | Time | Space | Optimal? |
|---|---|---|---|
| Minimax | O(bm) | O(bm) | Yes (vs optimal opponent) |
| Alpha-Beta (worst) | O(bm) | O(bm) | Yes |
| Alpha-Beta (best) | O(bm/2) | O(bm) | Yes |
| Alpha-Beta (avg) | O(b3m/4) | O(bm) | Yes |
| Expectiminimax | O((bnc)m) | O(bncm) | Yes (expected value) |
| MCTS | Anytime | O(iterations) | Converges with ∞ time |
b = branching factor, m = max depth, nc = number of chance outcomes
4. Algorithm Comparison
| Feature | Minimax | Alpha-Beta | Expectiminimax | MCTS |
|---|---|---|---|---|
| Game type | Deterministic | Deterministic | Stochastic | Any |
| Eval function needed | For cutoff only | For cutoff only | For cutoff only | No |
| Pruning | None | α-β pruning | Limited | N/A (sampling) |
| Anytime | No | With IDDFS | With IDDFS | Yes |
| Best for | Small games | Chess, checkers | Backgammon | Go, large games |
5. Game Classification Quick Reference
| Game | Deterministic? | Perfect Info? | Zero-Sum? | Algorithm |
|---|---|---|---|---|
| Chess | Yes | Yes | Yes | Alpha-Beta + Eval |
| Go | Yes | Yes | Yes | MCTS + Neural Nets |
| Tic-Tac-Toe | Yes | Yes | Yes | Minimax (solvable) |
| Backgammon | No (dice) | Yes | Yes | Expectiminimax |
| Poker | No (cards) | No | Yes | CFR |
| Prisoner’s Dilemma | Yes | Yes | No | Game Theory |
6. Key Enhancements
Move Ordering Techniques
- Killer moves: Store moves that caused cutoffs at the same depth; try them first
- History heuristic: Global table H[move] tracking cutoff frequency; sort by H
- Transposition table: Hash table caching evaluated positions; Zobrist hashing with XOR
- Iterative deepening: Use best move from depth d−1 as first move at depth d
Evaluation Functions
- Form: EVAL(s) = w1f1(s) + w2f2(s) + …
- Chess features: material (P=1, N=B=3, R=5, Q=9), mobility, king safety, pawn structure
- Quiescence search: Extend search in captures/checks to avoid horizon effect
- Modern: Neural network evaluators (AlphaZero, Stockfish NNUE)
7. MCTS: Four Phases
- Selection: Traverse tree using UCB1 policy
- Expansion: Add new child node for unexplored move
- Simulation: Random playout from new node to terminal state
- Backpropagation: Update win/visit counts from leaf to root
Final move: choose child with highest visit count (not highest win rate).
8. Common GATE Mistakes
⚠ Avoid These Errors
- Backing up values from root to leaves instead of leaves to root
- Applying MAX at MIN nodes or vice versa
- Forgetting that α-β values are inherited from ancestors, not just the parent
- Assuming α-β changes the minimax result (it returns the SAME value)
- Confusing time complexity of α-β best case: it’s O(bd/2), not O(bd/2)
- Forgetting probability weights at chance nodes in expectiminimax
- Confusing zero-sum with general-sum (Prisoner’s Dilemma is NOT zero-sum)
9. Quick Facts
- Tic-Tac-Toe minimax value = 0 (draw)
- Checkers was solved in 2007 (draw with optimal play)
- Chess: b ≈ 35, tree size ≈ 10123
- Go: b ≈ 250, tree size ≈ 10360
- AlphaGo (2016): MCTS + neural networks defeated world champion
- AlphaZero (2017): Learned Chess, Go, Shogi from scratch via self-play
- Nash equilibrium = minimax solution for two-player zero-sum games
- Minimax theorem (von Neumann, 1928): equilibrium always exists in finite zero-sum games