Solving Game Trees
With a complete game tree, it is possible to "solve" the game – that is to say, find a sequence of moves that either the first or second player can follow that will guarantee either a win or tie. The algorithm (which is generally called backward induction or retrograde analysis) can be described recursively as follows.
-
- Color the final ply of the game tree so that all wins for player 1 are colored one way (Blue in the diagram), all wins for player 2 are colored another way (Red in the diagram), and all ties are colored a third way (Grey in the diagram).
- Look at the next ply up. If there exists a node colored opposite as the current player, 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 as well. Otherwise, color this node a tie.
- Repeat for each ply, moving upwards, until all nodes are colored. The color of the root node will determine the nature of the game.
The diagram shows a game tree for an arbitrary game, colored using the above algorithm.
It is usually possible to solve a game (in this technical sense of "solve") using only a subset of the game tree, since in many games a move need not be analyzed if there is another move that is better for the same player (for example alpha-beta pruning can be used in many deterministic games).
Any subtree that can be used to solve the game is known as a decision tree, and the sizes of decision trees of various shapes are used as measures of game complexity.
Read more about this topic: Game Tree
Famous quotes containing the words solving, game and/or trees:
“Cultural expectations shade and color the images that parents- to-be form. The baby product ads, showing a woman serenely holding her child, looking blissfully and mysteriously contented, or the television parents, wisely and humorously solving problems, influence parents-to-be.”
—Ellen Galinsky (20th century)
“Intelligence and war are games, perhaps the only meaningful games left. If any player becomes too proficient, the game is threatened with termination.”
—William Burroughs (b. 1914)
“But we still remember ... above all, the cool, free aspect of the wild apple trees, generously proffering their fruit to us, though still green and crude,the hard, round, glossy fruit, which, if not ripe, still was not poison, but New English too, brought hither, its ancestors, by ours once. These gentler trees imparted a half-civilized and twilight aspect to the otherwise barbarian land.”
—Henry David Thoreau (18171862)