minimax search

paths in a maze

game tree

This is the core pruning algorithm inside minimax search.

✔ Analogy

Instead of checking every path in a maze, you stop exploring a path when you already know it’s worse than a path you saw earlier.

✔ Why it matters

It eliminates useless branches of the game tree.

✔ What it does

  • Keeps track of best score for maximizing player (alpha)
  • Keeps track of best score for minimizing player (beta)
  • If a branch can’t possibly improve the outcome → cut it off immediately.

✔ Example

If Stockfish finds a checkmate in 5 on one branch, it doesn’t waste time analyzing a losing variation for you.

Referenced in:

All notes