Minimax & Alpha-Beta Pruning — Searching a Game Tree

MAX (▲) maximizes, MIN (▼) minimizes. Watch depth-first search propagate the (α, β) window and cut off branches that cannot change the value. The pruned result equals plain minimax.

step 0

Game tree (depth-first, left to right)

MAX node (▲) MIN node (▼) active (being searched) pruned (cut off)

Search state

window at current node:
α = −∞   β = +∞
node value:
leaves evaluated: 0
leaves pruned: 0
root minimax value:
Press Step to begin. We do a depth-first walk: descend to leaves, bubble values up taking max at MAX nodes and min at MIN nodes, and prune whenever α ≥ β.
Self-contained visualization. Leaf values are from MAX's perspective. A beta cutoff fires at a MAX node when its running value reaches β; an alpha cutoff fires at a MIN node when its running value drops to α. Pruned branches are never evaluated, yet the root value is identical to a full minimax search — see junior.md and the proof in professional.md.