liveBook · Manning

Game tree

As explained in Grokking AI Algorithms, Second Edition

A tree representation whose nodes are game states and whose branches represent possible moves between them.

A game tree represents a game as connected states: each node is a possible position, and each branch is a valid move to another position. It turns an opponent’s choices into a structure that can be explored. section 3.7

A game tree supports Minimax search by:

  • Adding every valid move from a state as a child node. section 3.7
  • Alternating turns as the search moves deeper through the tree. section 3.7
  • Scoring leaf states with a heuristic, then choosing maximum or minimum child scores according to whose turn is simulated. section 3.7

A limited-depth search

A depth of four represents four simulated turns: player A moves, player B moves, then both move again. Because exploring the entire tree can exceed memory and computation limits, the search stops at a chosen depth and evaluates the resulting states. section 3.7

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains nodes, branches, leaves, alternating turns, heuristic evaluation, and depth limits, but not full-tree feasibility beyond resource constraints.
Examples
Uses simulated alternating turns, heuristic-scored leaf states, and Connect Four positions as concrete examples.
What you can do after
Apply it via Minimax search to organize valid moves, simulate future states, and compare resulting scores.
How it connects
Links game states and valid moves to Minimax search, heuristics, leaf nodes, and search depth.

Also explained in

Compare how 2 books explain game tree →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.