Search: Games - PowerPoint PPT Presentation

About This Presentation
Title:

Search: Games

Description:

NOT perfect (maybe not even very good) Minimax Lookahead. Modeling adversarial players: ... Minimizer = negative values. Decisions depend on choices of other player ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 58
Provided by: ginal5
Category:

less

Transcript and Presenter's Notes

Title: Search: Games


1
Search Games Adversarial Search
  • Artificial Intelligence
  • CMSC 25000
  • January 29, 2002

2
Agenda
  • Game search characteristics
  • Minimax procedure
  • Adversarial Search
  • Alpha-beta pruning
  • If its bad, we dont need to know HOW awful!
  • Game search specialties
  • Progressive deepening
  • Singular extensions

3
Games as Search
  • Nodes Board Positions
  • Each ply (depth 1) Move
  • Special feature
  • Two players, adversial
  • Static evaluation function
  • Instantaneous assessment of board configuration
  • NOT perfect (maybe not even very good)

4
Minimax Lookahead
  • Modeling adversarial players
  • Maximizer positive values
  • Minimizer negative values
  • Decisions depend on choices of other player
  • Look forward to some limit
  • Static evaluate at limit
  • Propagate up via minimax

5
Minimax Procedure
  • If at limit of search, compute static value
  • Relative to player
  • If minimizing level, do minimax
  • Report minimum
  • If maximizing level, do minimax
  • Report maximum

6
Minimax Example
2
MAX
MIN
2
1
MAX
7
Alpha-Beta Pruning
  • Alpha-beta principle If you know its bad, dont
    waste time finding out HOW bad
  • May eliminate some static evaluations
  • May eliminate some node expansions
  • Similar to branch bound

8
Simple Alpha-Beta Example
2
gt2
MAX
MIN
lt1
2
MAX
1
9
Alpha-Beta Detailed Example
10
Alpha-Beta Detailed Example
11
Alpha-Beta Detailed Example
12
Alpha-Beta Detailed Example
13
Alpha-Beta Detailed Example
14
Alpha-Beta Detailed Example
15
Alpha-Beta Detailed Example
16
Alpha-Beta Detailed Example
17
Alpha-Beta Detailed Example
18
Alpha-Beta Detailed Example
19
Alpha-Beta Detailed Example
20
Alpha-Beta Detailed Example
21
Alpha-Beta Detailed Example
22
Alpha-Beta Detailed Example
23
Alpha-Beta Detailed Example
24
Alpha-Beta Detailed Example
25
Alpha-Beta Detailed Example
26
Alpha-Beta Detailed Example
27
Alpha-Beta Detailed Example
28
Alpha-Beta Detailed Example
29
Alpha-Beta Detailed Example
30
Alpha-Beta Detailed Example
31
Alpha-Beta Detailed Example
32
Alpha-Beta Detailed Example
33
Alpha-Beta Detailed Example
34
Alpha-Beta Detailed Example
35
Alpha-Beta Detailed Example
36
Alpha-Beta Detailed Example
37
Alpha-Beta Detailed Example
38
Alpha-Beta Detailed Example
39
Alpha-Beta Detailed Example
40
Alpha-Beta Detailed Example
41
Alpha-Beta Detailed Example
42
Alpha-Beta Detailed Example
43
Alpha-Beta Detailed Example
44
Alpha-Beta Detailed Example
45
Alpha-Beta Detailed Example
46
Alpha-Beta Detailed Example
47
Alpha-Beta Detailed Example
48
Alpha-Beta Procedure
If levelTOP_LEVEL, alpha NEGMAX beta
POSMAX If (reached Search-limit), compute
return static value of current If level is
minimizing level, While more children to explore
AND alpha lt beta ab alpha-beta(child) if
(ab lt beta), then beta ab Report beta If level
is maximizing level, While more children to
explore AND alpha lt beta ab
alpha-beta(child) if (ab gt alpha), then alpha
ab Report alpha
49
Alpha-Beta Pruning Analysis
  • Worst case
  • Bad ordering Alpha-beta prunes NO nodes
  • Best case
  • Assume cooperative oracle orders nodes
  • Best value on left
  • If an opponent has some response that makes move
    bad no matter what the moving player does, then
    the move is bad.
  • Implies check move where opposing player has
    choice, check all own moves

50
Optimal Alpha-Beta Ordering
1
4
3
2
7
5
6
10
8
9
13
11
12
35
36
37
38
39
40
32
33
34
29
30
31
26
27
28
23
24
25
14
15
16
17
18
19
20
21
22
51
Optimal Ordering Alpha-Beta
  • Significant reduction of work
  • 11 of 27 static evaluations
  • Lower bound on of static evaluations
  • if d is even, s 2bd/2-1
  • if d is odd, s b(d1)/2b(d-1)/2-1
  • Upper bound on of static evaluations
  • bd
  • Reality somewhere between the two
  • Typically closer to best than worst

52
Heuristic Game Search
  • Handling time pressure
  • Focus search
  • Be reasonably sure best option found is likely
    to be a good option.
  • Progressive deepening
  • Always having a good move ready
  • Singular extensions
  • Follow out stand-out moves

53
Progressive Deepening
  • Problem Timed turns
  • Limited depth
  • If too conservative, too shallow
  • If too generous, wont finish
  • Solution
  • Always have a (reasonably good) move ready
  • Search at progressively greater depths
  • 1,2,3,4,5..

54
Progressive Deepening
  • Question Arent we wasting a lot of work?
  • E.g. cost of intermediate depths
  • Answer (surprisingly) No!
  • Assume cost of static evaluations dominates
  • Last ply (depth d) Cost bd
  • Preceding plies b0 b1b(d-1)
  • (bd - 1)/(b -1)
  • Ratio of last ply cost/all preceding b - 1
  • For large branching factors, prior work small
    relative to final ply

55
Singular Extensions
  • Problem Explore to some depth, but things change
    a lot in next ply
  • False sense of security
  • aka horizon effect
  • Solution Singular extensions
  • If static value stands out, follow it out
  • Typically, forced moves
  • E.g. follow out captures

56
Additional Pruning Heuristics
  • Tapered search
  • Keep more branches for higher ranked children
  • Rank nodes cheaply
  • Rule out moves that look bad
  • Problem
  • Heuristic May be misleading
  • Could miss good moves

57
Summary
  • Game search
  • Key features Alternating, adversarial moves
  • Minimax search Models adversarial game
  • Alpha-beta pruning
  • If a branch is bad, dont need to see how bad!
  • Exclude branch once know cant change value
  • Can significantly reduce number of evaluations
  • Heuristics Search under pressure
  • Progressive deepening Singular extensions
Write a Comment
User Comments (0)
About PowerShow.com