Info & Theory
Monte Carlo Tree Search (MCTS) builds a search tree incrementally by repeating four phases, using randomised simulations instead of a hand-crafted evaluation function.
The four phases
- Selection — starting at the root, walk down the tree choosing the child that maximises UCB1, until reaching a node with untried moves or no children.
- Expansion — add one new child node for an untried move.
- Rollout (simulation) — play uniformly random legal moves from the new node until the game ends.
- Backpropagation — walk back to the root, updating visit and win counts on every node along the path.
UCB1: balancing exploration and exploitation
Upper Confidence Bound applied to trees selects the child
maximising
winRate + C·√(ln(parentVisits) / childVisits).
The first term favours moves that have won often
(exploitation); the second term grows for rarely-visited
children (exploration), so the search keeps sampling
promising but under-explored branches instead of fixating
on early results. C = √2 ≈ 1.41 is the
theoretically motivated constant for rewards in [0,1].
No heuristic evaluation needed
Unlike minimax, which needs a hand-crafted evaluation function to score non-terminal positions, MCTS estimates a position's value purely from the outcomes of random rollouts. This makes it applicable to games where good heuristics are hard to design.
Convergence & real-world use
As the number of simulations grows, visit counts concentrate on the strongest moves and win-rate estimates converge toward true game values. MCTS scales gracefully with large branching factors, which is why it powered AlphaGo and AlphaZero, where it was combined with deep neural networks that replaced random rollouts with learned value and policy estimates.