A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Monte Carlo Tree Search

Graduate Depth 90 in the knowledge graph ☐ I know this ☆ Set as goal
18topics build on this
532prerequisites beneath it
See this on the map →
Algorithm Design BasicsExpected Value+1 more→→A* Search Algorithm
search monte-carlo games sampling

Core Idea

MCTS builds a game tree incrementally through random simulations. Each iteration selects nodes using UCB, expands children, runs random playouts, and backpropagates results. It excels in large branching-factor games where evaluation functions are unavailable, balancing exploration and exploitation.

Explainer

Traditional game-tree search algorithms like minimax require an evaluation function that can score any board position — but for games like Go, with a branching factor in the hundreds and positions that resist simple heuristic scoring, no good evaluation function exists. Monte Carlo Tree Search sidesteps this problem entirely: instead of evaluating a position, it plays out random games from that position and uses the win/loss statistics as a stand-in for evaluation. If you simulate a thousand random games from a position and win 700 of them, that position is probably strong — no domain-specific heuristic needed.

Each MCTS iteration follows four steps. Selection walks down the existing tree from the root, at each node choosing the child that maximizes the Upper Confidence Bound (UCB1) formula: the child's average reward plus an exploration bonus that grows when the child has been visited less often. This is the same exploration-exploitation tradeoff you know from probability and expected value — UCB ensures you do not just exploit the currently best-looking move but also explore uncertain alternatives that might turn out better. Expansion adds a new child node when selection reaches a leaf. Simulation (or rollout) plays the game to completion from that new node using a random or lightly guided policy. Backpropagation sends the result — win or loss — back up the tree, updating the visit counts and reward totals at every ancestor node.

The elegance of MCTS is that it is anytime: you can stop after ten iterations or ten million, and at any point the most-visited child of the root is your best move. With more iterations, the tree grows deeper and wider around the most promising lines of play, automatically allocating search effort where it matters most. Early iterations explore broadly; later iterations concentrate on refining the best candidates. The UCB formula guarantees that every move gets tried eventually, but clearly bad moves are quickly abandoned in favor of more promising branches.

MCTS achieved its most famous success in computer Go, where it broke through decades of stagnation in AI game-playing. When combined with neural network evaluation (as in AlphaGo), the random rollout phase is replaced by a learned value network, and the selection phase is guided by a learned policy network — but the four-phase structure remains the same. Even in its pure form without neural networks, MCTS performs remarkably well in domains with large state spaces, imperfect information, or no obvious evaluation heuristic, from game AI to planning under uncertainty.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Monte Carlo Tree Search

Longest path: 91 steps · 532 total prerequisite topics

Prerequisites (3)

Leads To (1)