Unit 2 - Adversarial Searching
Unit 2 - Adversarial Searching
Search
Unit- 2
Game Playing
Outline
• Game domain
• Optimal decisions
• α-β pruning
Game domain
• Game playing can be achieve by machine
intelligence
• They provide structured task – easy to
measure success or failure
• They do not require large amount of
knowledge
• Can solvable by straightforward search to
solve from starting state to winning state
• Not true for all the games.
Contd…
• In the chess machine
• Average branching factor is 35
• In an average game each player might
make 50 moves
• In order to examine the complete game
tree, we would have to examine 35100
positions
• Therefore it is highly impossible to select a
move during the lifetime of the opponent
Solution
• Some kind of heuristic search procedure is
necessary
• Improve the generate procedure so that
only good moves (or paths) are generated
• Improve the test procedure so that the
best moves (or paths) will be recognized
and explored
• Minmax search procedure
• It is depth-first, depth-limited search
procedure.
Games vs. search problems
• "Unpredictable" opponent → specifying a
move for every possible opponent reply
• Time limits → unlikely to find goal, must
approximate
Optimal Decision in Games
• Initial state : which represented board
position and identifies the player to move
• Successor function : which returns a list of
(move , state) pairs. Legal move and
resulting state.
• Terminal state : which determine where
the game is over
• utility function : which gives numeric value
for the terminal states. (ex : +1,0,-1)
Game tree (2-player,
deterministic, turns)
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:
Minimax algorithm
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)
•