Alpha-Beta Pruning

Minimax's answer without reading every leaf — prune branches that provably can't matter. Asked in every exam paper

The Simplest Explanation

Minimax wastes effort on branches that could never influence the final decision. Alpha-beta's insight:

"While backing up values, keep track of the best already-guaranteed options for both sides. If a branch turns out worse than something already guaranteed — stop looking. Cut it off."

Two values travel down the tree:

  • α (alpha): the best value MAX is already assured of somewhere else (lower bound). Starts at −∞-\infty.
  • β (beta): the best value MIN is already assured of (upper bound). Starts at +∞+\infty.

The cutoff rule: whenever α≥β\alpha \geq \beta, stop expanding the current node and return. Nothing below can change the outcome.

Remember This

Alpha-beta returns the EXACT same root value as minimax — it just skips work that cannot matter. α is "how good MAX's fallback is", β is "how good MIN's fallback is". When they cross (α ≥ β), the current branch is dead.

The Rules (memorize these four lines)

  1. At a MAX node: update α←max⁡(α,child value)\alpha \leftarrow \max(\alpha, \text{child value})
  2. At a MIN node: update β←min⁡(β,child value)\beta \leftarrow \min(\beta, \text{child value})
  3. Children inherit the current (α,β)(\alpha, \beta) window
  4. If at any point α≥β\alpha \geq \beta: prune remaining children of this node and back up immediately
    • If cut off at a MAX node → called a β-cutoff
    • If cut off at a MIN node → called an α-cutoff

Interactive Demo

Same idea as minimax — but watch two leaves escape evaluation entirely:

Alpha-Beta TraceStep 0 / 9
Examining
Value finalized
Pruned (never examined)

Root A is a MAX node with three MIN children B, C, D. Start with the widest window: α = −∞, β = +∞. Descend left-to-right, depth-first.

Window α
−∞
Window β
+∞
Leaves Examined
0 / 9

What Just Happened

  • After B backs up 3, the root knows: whatever else happens, MAX gets ≥ 3 (α=3\alpha = 3).
  • Inside C, the first child returns 2. C is a MIN node, so C ≤ 2 < 3. MAX would never pick C.
  • Therefore C's remaining children (4, 6) are irrelevant — pruned without being read.

Result: minimax value 3, optimal move A→B, only 7 of 9 leaves examined.

Worked Exam-Style Trace (by hand)

Tree: Root MAX with three MIN children; leaves left-to-right: B(3, 12, 8), C(2, 4, 6), D(14, 5, 2).

StepWhereActionα at rootNotes
1Bmin(3,12,8) = 3 backed upα = 3full min computed
2Cfirst leaf 2 → β_C = 2 ≤ α = 3α = 3α-cutoff: skip C's other leaves
3Dleaves 14, then 5 (>3 keep going), then 2α = 32 ≤ 3 fires but no siblings remain

Root value: max⁡(3,2,2)=3\max(3, 2, 2) = 3. Leaves evaluated: 7 of 9.

How to Count Cuts in Exams

A cut fires the moment a node's provisional value becomes ≤ α (at MIN nodes) or ≥ β (at MAX nodes), using the inherited window. Count every sibling after the firing child as pruned — even if the firing child was last, some papers still ask "was there a cutoff?" (answer: the condition held).

Inverse Design Problems (2026 trend!)

Recent exams flip the question: "Assign evaluation values to maximize the number of cuts."

Strategy:

  • To force an early α-cutoff at a MIN node under window (α,β)(\alpha, \beta): make its first leaf ≤ α (e.g., very negative)
  • To force an early β-cutoff at a MAX node: make its first leaf ≥ β (e.g., very large)
  • Left-to-right order matters: cuts only fire on children examined after the window tightened, so put extreme values early in promising subtrees and let later siblings be cut

Effectiveness

ScenarioLeaves evaluated
Worst ordering (best moves last)bmb^{m} — no savings, equals plain minimax
Random ordering≈b3m/4\approx b^{3m/4}
Best ordering (best moves first)≈b⌈m/2⌉+b⌊m/2⌋−1\approx b^{\lceil m/2 \rceil} + b^{\lfloor m/2 \rfloor} - 1 ≈ doubles searchable depth!

With perfect move ordering alpha-beta searches roughly twice as deep as minimax in the same time — why it powers every chess engine.

Inspected vs Pruned — Two Sides of One Trace

Papers flip between asking which leaves were pruned (skipped) and which were inspected (evaluated). They're complements:

inspected∪pruned=all horizon leaves,inspected∩pruned=∅\text{inspected} \cup \text{pruned} = \text{all horizon leaves}, \qquad \text{inspected} \cap \text{pruned} = \emptyset

Question phrasingWhat to output
"List the horizon nodes pruned by Alpha-Beta"skipped leaves, sorted
"First five horizon nodes pruned"skipped leaves in chronological cut order, not alphabetical!
"Leaf nodes inspected by Alpha-Beta" (25T2)evaluated leaves — everything not pruned
"Leaves not affecting the game value" (24T3)leaves whose value cannot change the root under optimal play — typically deep pruned branches

The chronological variant matters when several cuts fire: order them by when the cutoff occurred during the left-to-right traversal, then sort alphabetically only within simultaneous cuts.

Cutoff Taxonomy

When a forced eval triggers a stop, name it correctly:

Where the window closesNode typeCut name
value ≤ α reachedMIN nodeα-cutoff
value ≥ β reachedMAX nodeβ-cutoff

25T3 papers ask this directly: give a leaf eval that induces a cutoff at a named node, then classify it. Recipe: check whether the node is MIN or MAX; that fixes α-cut vs β-cut; solve the inequality for the leaf's smallest/largest feasible value.

QuizA paper asks for leaves 'inspected' by Alpha-Beta. You should list...
Quiz'First five horizon nodes pruned' must be ordered by...
QuizAlpha-beta pruning returns a different move than full minimax when...
QuizAn α-cutoff occurs when...
QuizWith PERFECT move ordering, alpha-beta examines roughly how many leaves vs minimax?