HearLore
ListenSearchLibrary

Follow the threads

Every story connects to a hundred more

Topics
  • Browse all topics
  • Featured
  • Recently added
Categories
  • Browse all categories
  • For you
Answers
  • All answer pages
Journal
  • All entries
  • RSS feed
Terms of service·Privacy policy

2026 HearLore

Preview of HearLore

Free to follow every thread. No paywall, no dead ends.

ListenSearchLibrary

Adapted from Game tree, licensed under CC BY-SA 4.0. Modified for audio. This HearLore entry is also licensed under CC BY-SA 4.0.

— Ch. 1 · Defining Game Trees —

Game tree.

~4 min read · Ch. 1 of 5
The diagram shows the first two levels, or plies, in the game tree for tic-tac-toe. This visual representation captures how rotations and reflections of positions are equivalent. The first player has three choices of move: in the center, at the edge, or in the corner. The second player has two choices for the reply if the first player played in the center, otherwise five choices. In combinatorial game theory, a game tree is a graph representing all possible game states within a sequential game that has perfect information. Such games include chess, checkers, Go, and tic-tac-toe. A game tree can be used to measure the complexity of a game, as it represents all the possible ways that the game can pan out. To better understand the game tree, it can be thought of as a technique for analyzing adversarial games. These games determine the actions that player takes to win the game. In game theory, a game tree is a directed graph whose nodes are positions in a game. Nodes represent arrangements of pieces on a board game. Edges are moves that transfer pieces from one position to another.

Analyzing Adversarial Outcomes

The number of leaf nodes in the complete game tree is the number of possible different ways the game can be played. For example, the game tree for tic-tac-toe has 255,168 leaf nodes. This count establishes a baseline for measuring how complex a game truly is. Large game trees like those found in chess make computation feasible only through partial search techniques. Algorithms designed to play these classes of games use partial game trees instead of full ones. The complete game tree starts at the initial position and contains all possible moves from each position. It matches the extensive-form game representation obtained from theoretical models. Two-person games can also be represented as and-or trees. For the first player to win a game, there must exist a winning move for all moves of the second player. Disjunction represents the first player's alternative moves while conjunction represents all of the second player's moves. Increasing the search depth generally improves the chance of picking the best move except in pathological cases which seem quite rare in practice.

Continue Browsing

Combinatorial game theoryTrees (graph theory)

Common questions

What is a game tree in combinatorial game theory?

A game tree is a directed graph whose nodes are positions in a sequential game that has perfect information. Such games include chess, checkers, Go, and tic-tac-toe. Nodes represent arrangements of pieces on a board game while edges are moves that transfer pieces from one position to another.

How many leaf nodes does the complete game tree for tic-tac-toe have?

The game tree for tic-tac-toe has 255,168 leaf nodes representing all possible different ways the game can be played. This count establishes a baseline for measuring how complex a game truly is. The number of leaf nodes equals the total possible distinct sequences of play from start to finish.

Which algorithm solves a game by coloring nodes in a game tree?

Backward induction or retrograde analysis works recursively to solve a game by coloring final plies based on wins for player 1, player 2, or ties. Analysts move up through each ply checking if nodes exist colored opposite as the current player to determine outcomes. The color of the root node determines the nature of the game after all nodes are processed.

Why do chess-playing programs use partial game trees instead of full ones?

Complete game trees for larger games like chess are much too large to search within available time limits. Algorithms designed to play these classes of games use partial game trees instead of full ones to make computation feasible. Alpha-beta pruning allows analysts to skip moves when another option proves better for the same player.

What advantages do randomized algorithms offer when solving game trees?

Randomized algorithms provide speed and practicality compared to deterministic versions that take significant time. These methods allow systems to function where complete enumeration remains computationally prohibitive while foiling an enemy opponent who cannot beat the system by knowing the algorithm used. Randomized algorithms have an expected run time that scales differently than deterministic approaches.

See all questions about Game tree →

In this section

Loading sources

All sources

 

Solving With Deterministic Algorithms

With a complete game tree it is possible to solve the game. That means finding a sequence of moves that either the first or second player can follow to guarantee the best possible outcome. Usually this results in a win or a tie. The deterministic algorithm known as backward induction or retrograde analysis works recursively. Color the final ply of the game tree so that all wins for player 1 are colored one way. Wins for player 2 get another color while ties receive a third color. Look at the next ply up and check if there exists a node colored opposite as the current player. If such a node exists color this node for that player as well. If all immediately lower nodes are colored for the same player color this node for the same player too. Otherwise color this node a tie. Repeat for each ply moving upwards until all nodes are colored. The color of the root node determines the nature of the game. Any subtree that can be used to solve the game is known as a decision tree. Sizes of decision trees of various shapes serve as measures of game complexity.

Practical Search In Artificial Intelligence

Game trees are important in artificial intelligence because one way to pick the best move is to search the game tree using numerous tree search algorithms. These methods combine with minimax-like rules to prune the tree. The game tree for tic-tac-toe is easily searchable but complete game trees for larger games like chess are much too large to search. Instead a chess-playing program searches a partial game tree. It typically explores as many plies from the current position as it can search in the time available. Except for pathological cases which seem quite rare increasing the search depth generally improves the chance of picking the best move. Alpha-beta pruning allows analysts to skip moves when another option proves better for the same player. This technique enables computers to play complex games within strict time limits without examining every single possibility.

Randomized Solution Methods

Randomized algorithms can be used in solving game trees. There are two main advantages in this type of implementation: speed and practicality. A deterministic version of solving game trees takes significant time while the randomized algorithm has an expected run time that scales differently. If every node in the game tree has degree 2 the process becomes faster. Randomized algorithms are capable of foiling an enemy meaning an opponent cannot beat the system by knowing the algorithm used to solve the game tree because the order of solving is random. The algorithm makes use of short-circuiting logic. If the root node is considered an OR operator then once one true value is found the root is classified as true. Conversely if the root node is considered an AND operator then once one false value is found the root is classified as false. These methods allow systems to function where complete enumeration remains computationally prohibitive.