5.module3 ADVERSARIAL SEARCH 4
5.module3 ADVERSARIAL SEARCH 4
5.module3 ADVERSARIAL SEARCH 4
1
Outline
• Introduction
• Optimal decisions
• Minimax procedure
• α-β pruning
• Imperfect, real-time decisions
2
Introduction
• Game playing is one of the oldest sub-filed of
AI.
• Game playing involves abstract and pure form
of competition that seems to require
intelligence
• It is easy to represent the state and actions
• To implement game playing is required very
little world knowledge
3
• The most common used AI technique in game is
search
• Game playing research has contributed ideas on how
to make the best use of time to reach good decisions
• Game playing is a search problem defined by:
» Initial state of the game
» Operators defining legal moves
» Successor function
» Terminal test defining end of game states
» Goal test
» Path cost/ utility/ payoff function
4
Characteristics of game playing
6
• Game Tree: Game tree is graphical representation of the
initial state and legal moves for each side (two players – one
by one) for a specific game
• MAX has nine possible move from initial state
• MAX with X and MIN with O symbol. The leaf nodes are
entitled by utility value
• The MAX is assumed with high values and MIN is with low
values. The best move is always determined by MAX by using
search tree
• Optimal Strategies
– A sequence of moves which achieves Win state/ Terminal state/ Goal
state in search problem
• Optimal Strategy in Game
– It is techniques which always leads to superior that any other strategy
as opponent is playing in perfect manner 7
Game tree (2-player, deterministic, turns)
8
MINIMAX Procedure
• Starting from the leaves of the tree (with final scores
with respect to one player, MAX), and go backwards
towards the root
• All nodes in the tree will be scored, and the path from
root to the actual result is the one on which all nodes
have the same score
9
Minimax algorithm
10
Minimax
• Perfect play for deterministic games
• Idea: choose move to position with highest minimax value
= best achievable payoff against best play
• E.g., 2-ply game:
11
Properties of minimax
12
Alpha (α)- beta (β) pruning
• The basic idea of alpha-beta cutoffs is “It is possible
to compute the correct minimax decision without
looking at every node in the search tree”
• Allow the search process to ignore portion of thee
search tree that make no difference to the final choice
• General principle of α-β pruning is
– Consider a node n somewhere in thee tree, such that a
player has a chance to move to this node
– If player has a better chance m either at the parent node of
n then n will never be reached in actual play
13
• Alpha: The highest value that the maximizer
can guarantee himself by making some move
at the current node OR at some node earlier on
the path
• Beta: The lowest value that the minimizer can
guarantee by making some move at the current
node OR at some node earlier on the path to
this node
14
α-β pruning example
15
α-β pruning example
16
α-β pruning example
17
α-β pruning example
18
α-β pruning example
19
Properties of α-β
20
Why is it called α-β?
• α is the value of the best
(i.e., highest-value) choice
found so far at any choice
point along the path for max
21
The α-β algorithm
22
The α-β algorithm
23