Game tree
A game-tree ismathematical term that refers todirected graph illustratingtotal numberpossible "positions" inparticular game, diagrammingwaygame moves from positionposition as itplayed. Games withlarger graph have higher game-tree complexity, andconsidered "harder"game theory, chessGo being classic examplesvery complex gameshuge game trees.
Most games, or at least turn-based games, havelimited number"states", or possible positions. For instance,tic-tac-toe players take turns placing their mark (the X or O) onboardnine positions. After both players have placed their markgamesaidhave progressed by one move.
A game treetic-tac-toe startsnine branches, becausefirst player can pick any one ofnine open spaces. For eachtheir nine branchessecond player can place their mark ineight remaining spaces, sotree has eight branches leading from each oforiginal nine. Thusgame tree forfirst full movetic-tac-toe has 9 x 8 = 72 leaves, 9 branches forfirst ply (half-move)eight fornext. Following thisits conclusion buildstree9! = 362,880 leaves, somewhichwon forfirst player, some forsecond, andrest tied.
However thingsnever this simple. Tic-tac-toe can be wonas little as 5 ply, iffirst player can place all their marks inrow right off. For this reasongame tree contains many branches that"cut off" shorter thanfull depthnine. In fact if one considers additional trimmings"dumb moves" and"real" starting positions (corners or middle, not any ofnine locations)total numberbranchesactually just over 34,000.
And if one takes into account thatboardNoughtsCrossesequal no matter which wayperson looks at it,diminishesnumbermoves bythree quarters.
In orderrefer todifferencepossible moves vs. those that actually can occur, game-tree complexitydefined (typically) asproduct ofgame's average branching factor andnumberplies (half-moves)an average game.
A tremendous amountresearch has been put into figuring out what"best possible move"giventree andcurrent state, an outcome referredasminimax algorithm. The alpha-beta pruning algorithmmost widely usedthis, butnumbervariationsnew systemsstartinggenerate interest, one ofnewer ones being SSS.
The three hundred thousand possible statestic-tac-toetoo manybe remembered by most players, but this istrivial exercise formodern computer. For this reasongamenot considered "hard" by game theoretic standards. Most "interesting" games, like chess, have game trees withnumberstates much greater thannumberparticles inuniverse. Such gamesconsidered "hard" mathematically, as thereno way, eventheory,remember every possible chess position.
The general solutionthese sortsgames isbuild partial trees onfly, givencurrent state. For instance,chess-playing program might buildtree ofmillion possible future outcomes reachable fromcurrent board layout,then apply alpha-betathis partial tree. Of course this might result insystem pickingmove where all ofpossible outcomes onnext level oftree below those million leavesall losses. Thisknown ashorizon effect, where significant changes exist just beyonddepthtree was searched, whichwhy most chess programs trybuildbiggest trees possible given memorytime constraints.
Even then"rules based" approach used by humans, whichmany caseslargely freeany state ("don't bring your queen out early"), will often outperform programsthis reason. The speedmodern computers has almost eliminated this effect however, even non-elite chess programs can win against any butbest human players. Today itmore difficultmakeprogram play "intelligently bad"givehumanchance, thanprogramstrong game.
Numberlegal positionsgame-tree complexitysome games
- Tic-tac-toe - 3.6 x 106 positions
- Connect Four - complexity 1013
- Checkers - 1018 positions - complexity 1031
- Reversi - 1028 positions - complexity 1058
- Chess - 1050 positions - complexity 10123
- Xiangqi - complexity 10150
- Go - 10170 positions - complexity 10397 (??)
