CS451CS551EE565 ARTIFICIAL INTELLIGENCE - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

CS451CS551EE565 ARTIFICIAL INTELLIGENCE

Description:

CS451/CS551/EE565. ARTIFICIAL INTELLIGENCE. Adversary Search ... 4-ply lookahead is a hopeless chess player! 4-ply human novice. 8-ply typical PC, human master ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 28
Provided by: janicets
Category:

less

Transcript and Presenter's Notes

Title: CS451CS551EE565 ARTIFICIAL INTELLIGENCE


1
CS451/CS551/EE565ARTIFICIAL INTELLIGENCE
  • Adversary Search
  • 9-29-2006
  • Prof. Janice T. Searleman
  • jets_at_clarkson.edu, jetsza

2
Outline
  • Adversary Search
  • Optimal decisions Minimax
  • AlphaBeta
  • Reading Assignment AIMA Chapter 6

3
Game Tree Search
  • What are games?
  • Optimal decisions in games
  • Which strategy leads to success?
  • ?-? pruning
  • Games of imperfect information
  • Games that include an element of chance

4
What are and why study games?
  • Games are a form of multi-agent environment
  • What do other agents do and how do they affect
    our success?
  • Cooperative vs. competitive multi-agent
    environments.
  • Competitive multi-agent environments give rise to
    adversarial search a.k.a. games
  • Why study games?
  • Fun historically entertaining
  • Interesting subject of study because they are
    hard
  • Easy to represent and agents restricted to small
    number of actions

5
Relation of Games to Search
  • Search no adversary
  • Solution is (heuristic) method for finding goal
  • Heuristics CSP techniques can find optimal
    solution
  • Evaluation function estimate of cost from start
    to goal through given node
  • Examples path planning, scheduling activities
  • Games adversary
  • Solution is strategy (strategy specifies move for
    every possible opponent reply).
  • Time limits force an approximate solution
  • Evaluation function evaluate goodness of game
    position
  • Examples chess, checkers, Othello, backgammon

6
Games vs. search problems
  • "Unpredictable" opponent ? specifying a move for
    every possible opponent reply
  • Time limits ? unlikely to find goal, must
    approximate
  • Plan of attack
  • Computer considers possible lines of play
    (Babbage, 1846)
  • Algorithm for perfect play (Zermelo, 1912 Von
    Neumann, 1944)
  • Finite horizon, approximate evaluation (Zuse,
    1945 Wiener, 1948 Shannon, 1950)
  • First chess program (Turing, 1951)
  • Machine learning to improve evaluation accuracy
    (Samuel, 1952-57)
  • Pruning to allow deeper search (McCarthy, 1956)

7
Two-player games
  • A game formulated as a search problem
  • Initial state board position and turn
  • Operators definition of legal moves
  • Terminal state conditions for when game is over
  • Utility function a numeric value that describes
    the outcome of the game. E.g., -1, 0, 1 for
    loss, draw, win. (AKA payoff function)

8
Type of games
9
The Minimax algorithm
  • Perfect play for deterministic environments with
    perfect information
  • Basic idea choose move with highest minimax
    value best achievable payoff against best
    play
  • Algorithm
  • Generate game tree completely
  • Determine utility of each terminal state
  • Propagate the utility values upward in the tree
    by applying MIN and MAX operators on the nodes in
    the current level
  • At the root node use minimax decision to select
    the move with the max (of the min) utility value
  • Steps 2 and 3 assume that the opponent plays
    perfectly.

10
Minimax algorithm
11
Properties of minimax
  • Complete?
  • Yes (if tree is finite)
  • Optimal?
  • Yes (against an optimal opponent)
  • Time complexity?
  • O(bm)
  • Space complexity?
  • O(bm) (depth-first exploration)
  • For chess, b 35, m 100 for "reasonable"
    games? exact solution completely infeasible

12
Resource limits
  • Suppose we have 100 secs, explore 104 nodes/sec?
    106 nodes per move
  • Standard approach
  • cutoff test
  • e.g., depth limit (perhaps add quiescence search)
  • (static) evaluation function
  • estimated desirability of position

13
Evaluation functions
  • Types of evaluation functions
  • - Weighted linear function sum of weights times
    features
  • - Non-linear e.g. neural nets for backgammon
  • Characteristics of a good evaluation function
  • - should agree with the real utility function
  • - should be quick to compute
  • - should reflect the ability to win
  • Often a linear weighted sum of features
  • Eval(s) w1 f1(s) w2 f2(s) wn fn(s)

14
Evaluation functions
  • Weighted linear evaluation function to combine n
    heuristics f w1f1 w2f2 wnfn
  • e.g, ws could be the values of pieces (1 for
    pawn, 3 for bishop etc.), fs could be the number
    of type of pieces on the board

15
Heuristic EVAL example
Eval(s) w1 f1(s) w2 f2(s) wnfn(s)
16
Static Evaluation
17
Cutting off search
  • MinimaxCutoff is identical to MinimaxValue except
  • Terminal? is replaced by Cutoff?
  • Utility is replaced by Eval
  • Does it work in practice?
  • bm 106, b35 ? m4
  • 4-ply lookahead is a hopeless chess player!
  • 4-ply human novice
  • 8-ply typical PC, human master
  • 12-ply Deep Blue, Kasparov

18
A subtree
win
lose
draw
x
o
o
x
o
x
o
o
o
x
x
o
x
o
x
o
x
x
x
x
o
x
x
o
19
What is a good move?
win
lose
draw
x
o
o
x
o
x
o
o
o
x
x
o
x
o
x
o
x
x
x
x
x
o
20
TicTacToe
Static evaluation function for state s 8 if s
is a win for X eval(s) -8 if s is a win for
O ( of rows, cols diags open for X) (
of rows, cols diags open for O)
21
First move
22
Second move
23
Next move
24
When to cut off search
  • fixed depth limit (static or dynamic)
  • Iterative deepening
  • cutoff at depth d
  • problem horizon effect may cut off before some
    really good move for opponent
  • solution add quiescence
  • another variation add secondary search

25
What if MIN does not play optimally?
  • Definition of optimal play for MAX assumes MIN
    plays optimally maximizes worst-case outcome for
    MAX.
  • But if MIN does not play optimally, MAX will do
    even better. proven.

26
Multiplayer games
  • Games allow more than two players
  • Single minimax values become vectors

27
Problem of minimax search
  • Number of games states is exponential to the
    number of moves.
  • Solution Do not examine every node
  • gt Alpha-beta pruning
  • Remove branches that do not influence final
    decision
  • Revisit example next time
Write a Comment
User Comments (0)
About PowerShow.com