Minimax - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Minimax

Description:

Minimax. COT 4810. Lorn Miller. Minimax. What is it? Game play algorithm. How do you use it? ... If values are known, pick the largest ... – PowerPoint PPT presentation

Number of Views:224
Avg rating:3.0/5.0
Slides: 29
Provided by: Gene163
Category:
Tags: lorn | minimax

less

Transcript and Presenter's Notes

Title: Minimax


1
Minimax
  • COT 4810
  • Lorn Miller

2
Minimax
  • What is it?
  • Game play algorithm
  • How do you use it?
  • Search a game state tree
  • How efficient is it?
  • Well see!

3
Minimax
  • What is it?
  • Game play algorithm
  • Used to select the next move
  • Useful in avoiding traps
  • Ex Chess

4
Minimax
  • How do you use it?
  • Create a game state tree
  • Assign state values to every leaf
  • Use a heuristic
  • Use the Minimax algorithm to select next move

5
Minimax
6
Minimax
  • The Minimax Algorithm
  • Indirect recursion
  • Max function and Min function
  • Max
  • If values are known, pick the largest
  • Otherwise ask min what the values should be for
    each option
  • Min
  • If values are known, pick the smallest
  • Otherwise ask max what the values should be
  • Call one of the functions on the root of the tree

7
Minimax
8
Minimax
8
102
1
9
Minimax
102
8
102
1
10
Minimax
  • How Efficient is it?
  • Depends on size of search tree
  • Imagine Tic-Tac-Toe

11
Minimax
  • 9 Possible Initial moves
  • 8 possible second moves
  • 7 possible third moves
  • 9! Possible states
  • (9!362880)

12
Minimax
  • 9! States
  • 1 bit to show if square is occupied
  • 1 bit to show who occupies square
  • 9 squares
  • 18 bits per state to describe board

13
Minimax
  • 9! States
  • 18 bits to define state
  • Integer to hold heuristic value (4 bytes)
  • 32 bits to hold heuristic for state

14
Minimax
  • 9! States
  • 183250 bits per state
  • 9! 50 18144000 bits
  • 18144000 bits 2268000 bytes
  • 2268000 bytes 2214.84375 KB
  • 2214.84375 KB 2.162933349609375 MB

15
Minimax
  • More than 2.16 MB of search space for Tic Tac Toe!

16
Minimax
  • What to do?
  • Searching larger state makes searching slower
  • Only generate a few levels
  • Modify Minimax to run faster

17
Minimax
  • Modification of Minimax Alpha and Beta Pruning
  • Prevents processing unnecessary states
  • Effectively shrinks search space

18
Minimax
19
Minimax
20
Minimax
21
Minimax
12
1
102
22
Minimax
102
12
1
102
23
Minimax
24
Minimax
25
Minimax
26
Minimax
412
87
102
27
Minimax
87
412
87
102
28
Minimax
  • Questions?
Write a Comment
User Comments (0)
About PowerShow.com