0% found this document useful (0 votes)
9 views

04. [AI - Slides] Search - Adversarial Search (Min-Max Part 02 & Alpha-Beta Algorithm)

ai

Uploaded by

alieslam20014
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

04. [AI - Slides] Search - Adversarial Search (Min-Max Part 02 & Alpha-Beta Algorithm)

ai

Uploaded by

alieslam20014
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

(An Introduction to Artificial Intelligence)

Lecture

Problem Solving as Search

1
Outline

o Adversarial Search

( Heuristics in Two-Person Games )

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

.. getting this game state's favourability for player.


MinimaxtoaFixedPlyDepth
3
MAX
3 0 2
MIN
3 9 0 7 6
2
MAX

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

o A search space is explored in depth-first down to the full ply depth.


o Apply heuristic evaluation to a state and all its siblings.
o For MIN nodes, the maximum is backed up to their parent (a MAX
node).
o For MAX nodes, the minimum is backed up to their parent (a MIN node).
o This value is offered to the grandparent as Beta value for MIN nodes, or
Alpha value for MAX nodes.
o Alpha is a value associated with MAX nodes, that can never decrease.
o Beta is a value associated with MIN nodes, that can never increase.
Alpha–BetaPruningProcedure..AnIllustration

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?

o Search is an iterative local procedure

o Good heuristics should provide some


global look-ahead (at a low
computational cost).
OtherSearchTechniques

Steepest descent (~ greedy best-first with no search)


→ may get stuck into local minimum
OtherSearchTechniques

Steepest descent (~ greedy best-first with no search)


→ may get stuck into local minimum
o Simulated annealing
o Genetic algorithms
WhentoUseSearchTechniques?

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
?

You might also like