Combinatorial game theory measures game complexity in several ways:
These measures involve understanding game positions, possible outcomes, and computation required for various game scenarios.
The state-space complexity of a game is the number of legal game positions reachable from the initial position of the game. [1]
When this is too hard to calculate, an upper bound can often be computed by also counting (some) illegal positions, meaning positions that can never arise in the course of a game.
The game tree size is the total number of possible games that can be played: the number of leaf nodes in the game tree rooted at the game's initial position.
The game tree is typically vastly larger than the state space because the same positions can occur in many games by making moves in a different order (for example, in a tic-tac-toe game with two X and one O on the board, this position could have been reached in two different ways depending on where the first X was placed). An upper bound for the size of the game tree can sometimes be computed by simplifying the game in a way that only increases the size of the game tree (for example, by allowing illegal moves) until it becomes tractable.
For games where the number of moves is not limited (for example by the size of the board, or by a rule about repetition of position) the game tree is generally infinite.
The next two measures use the idea of a decision tree , which is a subtree of the game tree, with each position labelled with "player A wins", "player B wins" or "drawn", if that position can be proved to have that value (assuming best play by both sides) by examining only other positions in the graph. (Terminal positions can be labelled directly; a position with player A to move can be labelled "player A wins" if any successor position is a win for A, or labelled "player B wins" if all successor positions are wins for B, or labelled "draw" if all successor positions are either drawn or wins for B. And correspondingly for positions with B to move.)
Decision complexity of a game is the number of leaf nodes in the smallest decision tree that establishes the value of the initial position.
The game-tree complexity of a game is the number of leaf nodes in the smallest full-width decision tree that establishes the value of the initial position. [1] A full-width tree includes all nodes at each depth.
This is an estimate of the number of positions one would have to evaluate in a minimax search to determine the value of the initial position.
It is hard even to estimate the game-tree complexity, but for some games an approximation can be given by raising the game's average branching factor b to the power of the number of plies d in an average game, or:
.
The computational complexity of a game describes the asymptotic difficulty of a game as it grows arbitrarily large, expressed in big O notation or as membership in a complexity class. This concept doesn't apply to particular games, but rather to games that have been generalized so they can be made arbitrarily large, typically by playing them on an n-by-n board. (From the point of view of computational complexity a game on a fixed size of board is a finite problem that can be solved in O(1), for example by a look-up table from positions to the best move in each position.)
The asymptotic complexity is defined by the most efficient (in terms of whatever computational resource one is considering) algorithm for solving the game; the most common complexity measure (computation time) is always lower-bounded by the logarithm of the asymptotic state-space complexity, since a solution algorithm must work for every possible state of the game. It will be upper-bounded by the complexity of any particular algorithm that works for the family of games. Similar remarks apply to the second-most commonly used complexity measure, the amount of space or computer memory used by the computation. It is not obvious that there is any lower bound on the space complexity for a typical game, because the algorithm need not store game states; however many games of interest are known to be PSPACE-hard, and it follows that their space complexity will be lower-bounded by the logarithm of the asymptotic state-space complexity as well (technically the bound is only a polynomial in this quantity; but it is usually known to be linear).
For tic-tac-toe, a simple upper bound for the size of the state space is 39 = 19,683. (There are three states for each cell and nine cells.) This count includes many illegal positions, such as a position with five crosses and no noughts, or a position in which both players have a row of three. A more careful count, removing these illegal positions, gives 5,478. [2] [3] And when rotations and reflections of positions are considered identical, there are only 765 essentially different positions.
To bound the game tree, there are 9 possible initial moves, 8 possible responses, and so on, so that there are at most 9! or 362,880 total games. However, games may take less than 9 moves to resolve, and an exact enumeration gives 255,168 possible games. When rotations and reflections of positions are considered the same, there are only 26,830 possible games.
The computational complexity of tic-tac-toe depends on how it is generalized. A natural generalization is to m,n,k-games: played on an m by n board with winner being the first player to get k in a row. It is immediately clear that this game can be solved in DSPACE(mn) by searching the entire game tree. This places it in the important complexity class PSPACE. With some more work it can be shown to be PSPACE-complete. [4]
Due to the large size of game complexities, this table gives the ceiling of their logarithm to base 10. (In other words, the number of digits). All of the following numbers should be considered with caution: seemingly-minor changes to the rules of a game can change the numbers (which are often rough estimates anyway) by tremendous factors, which might easily be much greater than the numbers shown.
Note: ordered by game tree size
Game | Board size (positions) | State-space complexity (as log to base 10) | Game-tree complexity (as log to base 10) | Average game length (plies) | Branching factor | Ref | Complexity class of suitable generalized game |
---|---|---|---|---|---|---|---|
Tic-tac-toe | 9 | 3 | 5 | 9 | 4 | PSPACE-complete [5] | |
Sim | 15 | 3 | 8 | 14 | 3.7 | PSPACE-complete [6] | |
Pentominoes | 64 | 12 | 18 | 10 | 75 | [7] [8] | ?, but in PSPACE |
Kalah [9] | 14 | 13 | 18 | 50 | [7] | Generalization is unclear | |
Connect Four | 42 | 13 | 21 | 36 | 4 | [1] [10] | ?, but in PSPACE |
Domineering (8 × 8) | 64 | 15 | 27 | 30 | 8 | [7] | ?, but in PSPACE; in P for certain dimensions [11] |
Congkak | 14 | 15 | 33 | [7] | |||
English draughts (8x8) (checkers) | 32 | 20 or 18 | 40 | 70 | 2.8 | [1] [12] [13] | EXPTIME-complete [14] |
Awari [15] | 12 | 12 | 32 | 60 | 3.5 | [1] | Generalization is unclear |
Qubic | 64 | 30 | 34 | 20 | 54.2 | [1] | PSPACE-complete [5] |
Double dummy bridge [nb 1] | (52) | <17 | <40 | 52 | 5.6 | PSPACE-complete [16] | |
Fanorona | 45 | 21 | 46 | 44 | 11 | [17] | ?, but in EXPTIME |
Nine men's morris | 24 | 10 | 50 | 50 | 10 | [1] | ?, but in EXPTIME |
Tablut | 81 | 27 | [18] | ||||
International draughts (10x10) | 50 | 30 | 54 | 90 | 4 | [1] | EXPTIME-complete [14] |
Chinese checkers (2 sets) | 121 | 23 | 180 | [19] | EXPTIME-complete [20] | ||
Chinese checkers (6 sets) | 121 | 78 | 600 | [19] | EXPTIME-complete [20] | ||
Reversi (Othello) | 64 | 28 | 58 | 58 | 10 | [1] | PSPACE-complete [21] |
OnTop (2p base game) | 72 | 88 | 62 | 31 | 23.77 | [22] | |
Lines of Action | 64 | 23 | 64 | 44 | 29 | [23] | ?, but in EXPTIME |
Gomoku (15x15, freestyle) | 225 | 105 | 70 | 30 | 210 | [1] | PSPACE-complete [5] |
Hex (11x11) | 121 | 57 | 98 | 50 | 96 | [7] | PSPACE-complete [5] |
Chess | 64 | 44 | 123 | 70 | 35 | [24] | EXPTIME-complete (without 50-move drawing rule) [25] |
Bejeweled and Candy Crush (8x8) | 64 | <50 | 70 | [26] | NP-hard | ||
GIPF | 37 | 25 | 132 | 90 | 29.3 | [27] | |
Connect6 | 361 | 172 | 140 | 30 | 46000 | [28] | PSPACE-complete [29] |
Backgammon | 28 | 20 | 144 | 55 | 250 | [30] | Generalization is unclear |
Xiangqi | 90 | 40 | 150 | 95 | 38 | [1] [31] [32] | ?, believed to be EXPTIME-complete |
Abalone | 61 | 25 | 154 | 87 | 60 | [33] [34] | PSPACE-hard, and in EXPTIME |
Havannah | 271 | 127 | 157 | 66 | 240 | [7] [35] | PSPACE-complete [36] |
Twixt | 572 | 140 | 159 | 60 | 452 | [37] | |
Janggi | 90 | 44 | 160 | 100 | 40 | [32] | ?, believed to be EXPTIME-complete |
Quoridor | 81 | 42 | 162 | 91 | 60 | [38] | ?, but in PSPACE |
Carcassonne (2p base game) | 72 | >40 | 195 | 71 | 55 | [39] | Generalization is unclear |
Amazons (10x10) | 100 | 40 | 212 | 84 | 374 or 299 [40] | [41] [42] | PSPACE-complete [43] |
Shogi | 81 | 71 | 226 | 115 | 92 | [31] [44] | EXPTIME-complete [45] |
Thurn and Taxis (2 player) | 33 | 66 | 240 | 56 | 879 | [46] | |
Go (19x19) | 361 | 170 | 505 | 211 | 250 | [1] [47] [48] | EXPTIME-complete (without the superko rule) [50] |
Arimaa | 64 | 43 | 402 | 92 | 17281 | [51] [52] [53] | ?, but in EXPTIME |
Stratego | 92 | 115 | 535 | 381 | 21.739 | [54] | |
Infinite chess | infinite | infinite | infinite | infinite | infinite | [55] | Unknown, but mate-in-n is decidable [56] |
Magic: The Gathering | [57] | AH-hard [58] | |||||
Wordle | 5 | 4.113 (12,972) | 6 | [59] | NP-hard, unknown if PSPACE-complete with parametization. |
In computational complexity theory, bounded-error quantum polynomial time (BQP) is the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all instances. It is the quantum analogue to the complexity class BPP.
In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and explores the relationships between these classifications. A computational problem is a task solved by a computer. A computation problem is solvable by mechanical application of mathematical steps, such as an algorithm.
In computational complexity theory, PSPACE is the set of all decision problems that can be solved by a Turing machine using a polynomial amount of space.
In computational complexity theory, a decision problem is PSPACE-complete if it can be solved using an amount of memory that is polynomial in the input length and if every other problem that can be solved in polynomial space can be transformed to it in polynomial time. The problems that are PSPACE-complete can be thought of as the hardest problems in PSPACE, the class of decision problems solvable in polynomial space, because a solution to any one such problem could easily be used to solve any other problem in PSPACE.
In computational complexity theory, the complexity class EXPTIME (sometimes called EXP or DEXPTIME) is the set of all decision problems that are solvable by a deterministic Turing machine in exponential time, i.e., in O(2p(n)) time, where p(n) is a polynomial function of n.
A solved game is a game whose outcome can be correctly predicted from any position, assuming that both players play perfectly. This concept is usually applied to abstract strategy games, and especially to games with full information and no element of chance; solving such a game may use combinatorial game theory and/or computer assistance.
An evaluation function, also known as a heuristic evaluation function or static evaluation function, is a function used by game-playing computer programs to estimate the value or goodness of a position in a game tree. Most of the time, the value is either a real number or a quantized integer, often in nths of the value of a playing piece such as a stone in go or a pawn in chess, where n may be tenths, hundredths or other convenient fraction, but sometimes, the value is an array of three values in the unit interval, representing the win, draw, and loss percentages of the position.
In the context of combinatorial game theory, which typically studies sequential games with perfect information, a game tree is a graph representing all possible game states within such a game. Such games include well-known ones such as chess, checkers, Go, and tic-tac-toe. This can be used to measure the complexity of a game, as it represents all the possible ways a game can pan out. Due to the large game trees of complex games such as chess, algorithms that are designed to play this class of games will use partial game trees, which makes computation feasible on modern computers. Various methods exist to solve game trees. If a complete game tree can be generated, a deterministic algorithm, such as backward induction or retrograde analysis can be used. Randomized algorithms and minmax algorithms such as MCTS can be used in cases where a complete game tree is not feasible.
In quantum computing, a quantum algorithm is an algorithm that runs on a realistic model of quantum computation, the most commonly used model being the quantum circuit model of computation. A classical algorithm is a finite sequence of instructions, or a step-by-step procedure for solving a problem, where each step or instruction can be performed on a classical computer. Similarly, a quantum algorithm is a step-by-step procedure, where each of the steps can be performed on a quantum computer. Although all classical algorithms can also be performed on a quantum computer, the term quantum algorithm is generally reserved for algorithms that seem inherently quantum, or use some essential feature of quantum computation such as quantum superposition or quantum entanglement.
In computational complexity theory, a generalized game is a game or puzzle that has been generalized so that it can be played on a board or grid of any size. For example, generalized chess is the game of chess played on an board, with pieces on each side. Generalized Sudoku includes Sudokus constructed on an grid.
In computational complexity theory, generalized geography is a well-known PSPACE-complete problem.
The Shannon number, named after the American mathematician Claude Shannon, is a conservative lower bound of the game-tree complexity of chess of 10120, based on an average of about 103 possibilities for a pair of moves consisting of a move for White followed by a move for Black, and a typical game lasting about 40 such pairs of moves.
The game of Go is one of the most popular games in the world. As a result of its elegant and simple rules, the game has long been an inspiration for mathematical research. Shen Kuo, an 11th century Chinese scholar, estimated in his Dream Pool Essays that the number of possible board positions is around 10172. In more recent years, research of the game by John H. Conway led to the development of the surreal numbers and contributed to development of combinatorial game theory (with Go Infinitesimals being a specific example of its use in Go).
Quantum complexity theory is the subfield of computational complexity theory that deals with complexity classes defined using quantum computers, a computational model based on quantum mechanics. It studies the hardness of computational problems in relation to these complexity classes, as well as the relationship between quantum complexity classes and classical complexity classes.
In algorithmic game theory, a succinct game or a succinctly representable game is a game which may be represented in a size much smaller than its normal form representation. Without placing constraints on player utilities, describing a game of players, each facing strategies, requires listing utility values. Even trivial algorithms are capable of finding a Nash equilibrium in a time polynomial in the length of such a large input. A succinct game is of polynomial type if in a game represented by a string of length n the number of players, as well as the number of strategies of each player, is bounded by a polynomial in n.
Solving chess consists of finding an optimal strategy for the game of chess; that is, one by which one of the players can always force a victory, or either can force a draw. It is also related to more generally solving chess-like games such as Capablanca chess and infinite chess. In a weaker sense, solving chess may refer to proving which one of the three possible outcomes is the result of two perfect players, without necessarily revealing the optimal strategy itself.
In computational complexity theory, and more specifically in the analysis of algorithms with integer data, the transdichotomous model is a variation of the random-access machine in which the machine word size is assumed to match the problem size. The model was proposed by Michael Fredman and Dan Willard, who chose its name "because the dichotomy between the machine model and the problem size is crossed in a reasonable manner."
In computer science, Monte Carlo tree search (MCTS) is a heuristic search algorithm for some kinds of decision processes, most notably those employed in software that plays board games. In that context MCTS is used to solve the game tree.
In discrete mathematics and theoretical computer science, reconfiguration problems are computational problems involving reachability or connectivity of state spaces.
{{cite journal}}
: CS1 maint: multiple names: authors list (link){{cite arXiv}}
: CS1 maint: multiple names: authors list (link)