1 / 19

Game Trees

Game Trees. William Dotson. Overview. Definitions Minimax Alpha-Beta Pruning More Efficient Pruning Deep Blue – Deep Fritz Conclusion. Definitions. Directed Graph Nodes Paths Position Evaluator “Easy” vs “Hard”. Game Tree Complexity. Tic-Tac-Toe – 9! – 362,280 states

fuller
Download Presentation

Game Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Game Trees William Dotson

  2. Overview • Definitions • Minimax • Alpha-Beta Pruning • More Efficient Pruning • Deep Blue – Deep Fritz • Conclusion

  3. Definitions • Directed Graph • Nodes • Paths • Position Evaluator • “Easy” vs “Hard”

  4. Game Tree Complexity • Tic-Tac-Toe – 9! – 362,280 states • Connect Four – 10^13 states • Checkers – 10^18 states • Chess – 10^50 states • Go – 10^170 states

  5. Minimax • 2 Players – Max and Min • Generate Graph to depth D • Assign Values to Final Nodes • Build Up Tree Alternating Max/Min

  6. Static Position Evaluator 3 1 2 2 1 1 2 1 2

  7. Static Position Evaluator X 0 X 0 Evaluate from X’s Point of View: State Value of 4

  8. Minmax Example • 3 Looks Ahead – D = 3

  9. Minmax Example • 3 Looks Ahead – D = 3 3 10 4 5 7 Max

  10. Minmax Example • 3 Looks Ahead – D = 3 4 5 Min 3 3 10 4 5 7 Max

  11. Minmax Example • 3 Looks Ahead – D = 3 Max 5 4 5 Min 3 3 10 4 5 7 Max

  12. Minimax Pseudocode • MinMax (GamePosition game) { MinMove (GamePosition game) { return MaxMove (game); best_move <- {}; } moves <- GenerateMoves(game); ForEach moves { MaxMove (GamePosition game) { move <- MaxMove(ApplyMove(game)); if (GameEnded(game)) { if(Value(move) < Value(best_move)){ return EvalGameState(game); best_move <- move; } } else { } best_move <- {}; return best_move; moves <- GenerateMoves(game); } ForEach moves { move <- MinMove(ApplyMove(game)); if (Value(move) > Value(best_move)) { best_move <- move; } } return best_move; } }

  13. Alpha-Beta Pruning • Modification of Minimax • Next move needs consideration • If worse then best, first move which opposition could take will be last move we have to look at.

  14. Alpha-Beta Diagram Player Opponent . . . Player Opponent M n General Case: If M is is better than N for Player, we will never get to N.

  15. Minimax w/ Alpha Beta • MinMax (GamePosition game) { MinMove (GamePosition game) { return MaxMove (game); best_move <- {}; } moves <- GenerateMoves(game); ForEach moves { MaxMove (GamePosition game) { move <- MaxMove(ApplyMove(game)); if (GameEnded(game)) { if(Value(move) < Value(best_move)){ return EvalGameState(game); best_move <- move; } beta <- Value(move); else { } best_move <- {}; moves <- GenerateMoves(game); if(alpha > beta) ForEach moves { return best_move; move <- MinMove(ApplyMove(game)); } if (Value(move) > Value(best_move)) { return best_move; best_move <- move; } alpha <- Value(move); } } if(beta > alpha) return best_move; } return best_move; } }

  16. Other Algorithms • Try to avoid horizon affect • Ignore paths that can be known to be wrong • CCNS – ‘Controlled Conspiracy Node Search’ • Target driven. • Used in Ulysses a 1988 Chess Program.

  17. Deep Blue/Deep Fritz • Prunes Minimax Tree more intelligently • Both use Targets like Ulysses • Deep-Fritz uses Pattern Recognition • Deep-Fritz has 1.3% brute power of Deep Blue, but plays at roughly the same level.

  18. Conclusion • Game Trees • Minimax • Alpha-Beta • Moving Ahead

  19. Resources • Alpha Beta Pruning Nodes. http://sern.ucalgary.ca/courses/CPSC/533/W99/presentations/L2_5B_Lima_Neitz/search.html Stuart Russel, Peter Norvig. 1995. • Minimax Trees. http://www.generation5.org/content/2001/minimax.asp James Matthews. 2001. • Minimax Explained. http://ai-depot.com/LogicGames/MiniMax.html Paulo Pinto. • Deep Fritz Draws: Are Humans Getting Smarter, or Are Computers Getting Stupider? http://www.kurzweilai.net/articles/art0527.html?printable=1 Ray Kurzweil 2002.

More Related