📝 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

AlgorithmTimeSpaceOptimal?
MinimaxO(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
ExpectiminimaxO((bnc)m)O(bncm)Yes (expected value)
MCTSAnytimeO(iterations)Converges with ∞ time

b = branching factor, m = max depth, nc = number of chance outcomes

4. Algorithm Comparison

FeatureMinimaxAlpha-BetaExpectiminimaxMCTS
Game typeDeterministicDeterministicStochasticAny
Eval function neededFor cutoff onlyFor cutoff onlyFor cutoff onlyNo
PruningNoneα-β pruningLimitedN/A (sampling)
AnytimeNoWith IDDFSWith IDDFSYes
Best forSmall gamesChess, checkersBackgammonGo, large games

5. Game Classification Quick Reference

GameDeterministic?Perfect Info?Zero-Sum?Algorithm
ChessYesYesYesAlpha-Beta + Eval
GoYesYesYesMCTS + Neural Nets
Tic-Tac-ToeYesYesYesMinimax (solvable)
BackgammonNo (dice)YesYesExpectiminimax
PokerNo (cards)NoYesCFR
Prisoner’s DilemmaYesYesNoGame 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

  1. Selection: Traverse tree using UCB1 policy
  2. Expansion: Add new child node for unexplored move
  3. Simulation: Random playout from new node to terminal state
  4. 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