04. [AI - Slides] Search - Adversarial Search (Min-Max Part 02 & Alpha-Beta Algorithm)
04. [AI - Slides] Search - Adversarial Search (Min-Max Part 02 & Alpha-Beta Algorithm)
Lecture
1
Outline
o Adversarial Search
o Minimax Procedure
o Alpha-Beta Procedure
o Alpha-Beta Example
AdversarialSearch
(HeuristicsinTwo-PersonGames)
o Two players use and apply the same knowledge of the
state space in a consistent effort to win the game.
o Primary difficulty is in accounting for the actions of the
opponent.
Two heuristic pruning procedures:
o Minimax procedure.
o Alpha-beta procedure.
Minimax values:
Computed Recursively
MinimaxProcedure
5 max
o Opponents are referred to by MIN, and
MAX.
2 5 min
o MAX player is trying to Maximize his
opportunity to win.
o MIN player is trying to Minimize MAX’s
opportunity to win.
8 2 5 6
Implementation: Terminal values: part of the game
o Label each level of the search graph with MIN or MAX according to the
order of playing.
o Each leaf node is assigned a value of 0 or 1 depending on whether it is a
win for MIN, or MAX.
o MAX parent nodes are assigned the maximum of their children.
o MIN parent nodes are assigned the minimum of their children.
o Derived values are used to choose among possible moves.
MinimaxTreeExample
MinimaxtoaFixedPlyDepth
Example:Minimaxona2-playergame-treeof4-plies
MIN
2 3 5 9 0 7 4 2 1 5 6
Alpha–BetaPruningProcedure
o Alpha–beta pruning is a search algorithm that seeks to decrease the
number of nodes that are evaluated by the minimax algorithm in its
search tree.
o It is an adversarial search algorithm used commonly for machine
playing of two-player games (Tic-tac-toe, Chess, Go, etc.).
o It stops evaluating a move when at least one possibility has been
found that proves the move to be worse than a previously examined
move. Such moves need not be evaluated further.
o When applied to a standard minimax tree, it returns the same move
as minimax would, but prunes away branches that cannot possibly
influence the final decision.
Alpha–BetaPruningProcedure
α: MAX’s best option on path to root
β: MIN’s best option on path to root
The grayed-out subtrees don't need to be explored (when moves are evaluated from
left to right), since we know the group of subtrees as a whole yields the value of an
equivalent subtree or worse, and as such cannot influence the final result. The max
and min levels represent the turn of the player and the adversary, respectively.
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Alpha–BetaPruningExample
Search.. What’s the Issue?
The search space is small, and The search space is large, and
There is no other available techniques, There is no other available techniques,
or and
It is not worth the effort to develop a There exist “good” heuristics
more efficient technique
Thanks! …
Questions
?