For games with very large or hard-to-evaluate state spaces (Go, general game playing), neither minimax nor a hand-crafted evaluation function is practical.
Monte Carlo Tree Search (MCTS) instead estimates a node's value by simulation: repeatedly playing random (or policy-guided) games to completion from that node and averaging the outcomes. MCTS has four phases, repeated for a fixed budget of iterations:
1. Selection. Starting at the root, repeatedly choose child nodes according to a rule that balances exploiting known-good moves against exploring under-visited ones, most commonly Upper Confidence Bound for Trees (UCT):
UCT(n) = w(n)/v(n) + c · √(ln v(parent) / v(n))
where w(n) is the total reward accumulated through node n, v(n) is its visit count, and c controls the exploration/exploitation trade-off.
2. Expansion. Add one or more child nodes of the selected leaf.
3. Simulation (rollout). Play a random (or lightweight-policy) game from the new node to a terminal state.
4. Backpropagation. Propagate the simulation's outcome back up every node visited in this iteration, updating w and v.
After the budget is exhausted, the root's child with the highest visit count (not highest average value — visit count is a more robust and less noise-sensitive signal) is returned as the move to play.
Continue with the book
Explore the full treatment, worked examples, and exercises in The AI Algorithms Compendium.
Companion article for The AI Algorithms Compendium, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
