Game Trees - PowerPoint PPT Presentation

About This Presentation
Title:

Game Trees

Description:

Game Trees. William Dotson. Overview. Definitions. Minimax. Alpha ... Tic-Tac-Toe 9! 362,280 states. Connect Four 10^13 states. Checkers 10^18 states ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 20
Provided by: wil0
Learn more at: http://www.cs.ucf.edu
Category:
Tags: checkers | game | trees

less

Transcript and Presenter's Notes

Title: Game Trees


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 1013 states
  • Checkers 1018 states
  • Chess 1050 states
  • Go 10170 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
0
X
Evaluate from Xs 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
5
4
7
Max
10
Minmax Example
  • 3 Looks Ahead D 3

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

Max
5
4
5
Min
3
3
10
5
4
7
Max
12
Minimax Pseudocode
  • MinMax (GamePosition game)
    MinMove (GamePosition game)
  • return MaxMove (game)
    best_move lt-

  • moves lt-
    GenerateMoves(game)

  • ForEach moves
  • MaxMove (GamePosition game)
    move lt- MaxMove(ApplyMove(game))
  • if (GameEnded(game))
    if(Value(move) lt
    Value(best_move))
  • return EvalGameState(game)
    best_move lt- move

  • else
  • best_move lt-
    return best_move
  • moves lt- GenerateMoves(game)
  • ForEach moves
  • move lt- MinMove(ApplyMove(game))
  • if (Value(move) gt Value(best_move))
  • best_move lt- 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 lt-

  • moves lt-
    GenerateMoves(game)

  • ForEach moves
  • MaxMove (GamePosition game)
    move lt- MaxMove(ApplyMove(game))
  • if (GameEnded(game))
    if(Value(move) lt
    Value(best_move))
  • return EvalGameState(game)
    best_move lt- move

  • beta lt-
    Value(move)
  • else
  • best_move lt-
  • moves lt- GenerateMoves(game)
    if(alpha gt beta)
  • ForEach moves
    return best_move
  • move lt- MinMove(ApplyMove(game))
  • if (Value(move) gt Value(best_move))
    return best_move
  • best_move lt- move
  • alpha lt- Value(move)
  • if(beta gt alpha)
  • 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_Neit
    z/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?pr
    intable1 Ray Kurzweil 2002.
Write a Comment
User Comments (0)
About PowerShow.com