Back to Adversarial Search

Alpha-Beta Pruning: Efficient Search

Watch Branches Get Eliminated for Faster Search

Same result as Minimax, but with dramatic speedup!
Alpha (α)
-∞
Best MAX can guarantee
Beta (β)
+∞
Best MIN can guarantee
Pruning Rule
Prune when α ≥ β

If MAX's guaranteed value (α) ≥ MIN's guaranteed value (β), then MIN will never choose this branch - PRUNE IT!

Algorithm Controls
Efficiency Gained

Nodes evaluated: 0 / 20

Nodes saved: 0 (0% reduction!)

Pruning Detected!

Why this branch was pruned...

Alpha-Beta Game Tree

Root - MIN Node
X
MIN Root
?
α=-∞, β=+∞
Depth 1 - MAX Nodes (O's possible moves)
Depth 2 - Terminal States

Alpha-Beta vs Minimax

Minimax Algorithm
  • Explores ALL nodes in game tree
  • Always finds optimal solution
  • Time complexity: O(b^d)
  • Evaluates ~20 nodes for this position
Alpha-Beta Pruning
  • Prunes branches that can't affect result
  • Finds SAME optimal solution
  • Best case: O(b^(d/2))
  • May evaluate only ~10 nodes!