blogs.uoregon.edu

Download Report

Transcript blogs.uoregon.edu

Software Tools for
Scientific Research
CIS 607
Kanika Sood
Adversarial Search
•
•
Minimax Search
i. Introduction
ii. Algorithm
iii.Example
Alpha-Beta Search
i. Introduction
ii. Algorithm
iii.Example
Minimax Search Introduction
•
•
•
It tries to maximize the minimum gain.
It tries to reduce the loss for a worst case
scenario.
Minimax Intro: Minimax Theorem
The minimax theorem states:
For every two-person, zero-sum game with
finitely many strategies, there exists a value
V and a mixed strategy for each player, such
that
(a) Given player 2's strategy, the best payoff
possible for player 1 is V, and
(b) Given player 1's strategy, the best payoff
possible for player 2 is −V.
Minimax Properties
•
Optimal?
Yes, against perfect player.
•
Time complexity? O(b^m)
•
Space complexity? O(bm)
Minimax Search Algorithm
Screenshot
Minimax Search Example
Minimax Search
A11=3 , A12=12 , A13=8
A21=2 , A22=4 , A23=6
A31=14 , A32=5 , A33=2
A1=3
A2=2
A3=2
A=3
Alpha Beta Search Introduction
•
•
Alpha beta pruning is a search algorithm
that reduces the number of number of
nodes that are to be expanded by the
minimax algorithm in the search tree.
It prunes away branches that do not have
any impact on the final decision.
Alpha beta pruning
•
•
•
α is the best value that
MAX can get at any choice point along the
current path
If n becomes worse than α, MAX will avoid
it, so can stop considering n’s other
children
Define β similarly for MIN
Alpha beta pruning Properties
This pruning has no effect on final result at the
root
Values of intermediate nodes might be wrong!
but, they are bounds
Good child ordering improves effectiveness of
pruning
With “perfect ordering”:
Time complexity drops to O(bm/2)
Alpha Beta Algorithm
Alpha Beta Search Example
Alpha Beta Search Example
Screenshot
Thank you