Lab · hands-on
Minimax and αβ pruning live
A game tree of depth 3 (MAX→MIN→MAX→leaves). Leaf values are random. Work minimax bottom-up, turn on αβ pruning and watch which leaves go dark (never looked at) and how far the visited-leaf count drops. Shuffle the order — you'll see that it decides everything.
How to use this
Green nodes are MAX (take the maximum), pink are MIN (the minimum). Values are pushed up from the leaves to the root. Hit αβ pruning: leaves that αβ never looks at (the parent already rejected the branch) go dark and get a ✂, and the counter shows how many of the 8 leaves were actually visited. Shuffle reorders the same values — and the visited count jumps: with a lucky order the pruning is stronger (closer to √). New tree — new values.
MAX (maximum)
MIN (minimum)
pruned (✂ not looked at)
Try this: turn on αβ and hit "Shuffle" a few times with the same values. The visited-leaf count moves between ~5 and 8 — that is exactly what move ordering buys you: look at the likely-best moves first and you get more cutoffs. Full minimax always looks at all 8.
What to notice
αβ gives the same answer while looking at less
The value at the root under αβ always matches full minimax — pruning only throws away branches that cannot change the result (the parent would reject them). But the visited-leaf count falls: αβ skips subtrees as soon as the current bound (α for MAX, β for MIN) makes them pointless. That is "the same depth for less work" — or, on a fixed time budget, "deeper for the same money".
Ordering decides everything
Hit "Shuffle" — the values are the same, only the leaf order changes, and the visited count jumps. With perfect ordering (best move first at every node) αβ approaches the √ of the full tree (here ~4–5 leaves out of 8 instead of 8); with the worst ordering it looks at almost all of them. That is why real engines spend half their effort on move ordering (killer/history heuristics, transposition tables) to get near the best case.
Why do those particular leaves go dark?
αβ walks left to right. In a MIN node, as soon as a leaf ≤ α turns up (α being the best MAX has already secured to the left), there is no point looking at the remaining children: MAX won't go down this branch anyway (it is no better than what is already found) — a β cutoff. Symmetrically, an α cutoff in a MAX node on a leaf ≥ β. The darkened leaves are moves it is rational not to consider, because you or your opponent would never pick them.