You are on page 1of 11

MINMAX ALGORITHM

MIN-MAX ALGORITHM
• Mini-max algorithm is a recursive or backtracking algorithm which is used in decision-
making and game theory. It provides an optimal move for the player assuming that
opponent is also playing optimally.
• Mini-Max algorithm uses recursion to search through the game-tree.
• Min-Max algorithm is mostly used for game playing in AI. Such as Chess, Checkers, tic-tac-
toe, go, and various tow-players game. This Algorithm computes the minimax decision for
the current state.
• In this algorithm two players play the game, one is called MAX and other is called MIN.
• Both the players fight it as the opponent player gets the minimum benefit while they get
the maximum benefit.
• Both Players of the game are opponent of each other, where MAX will select the maximized
value and MIN will select the minimized value.
• The minimax algorithm performs a depth-first search algorithm for the exploration of the
complete game tree.
• The minimax algorithm proceeds all the way down to the terminal node of the tree, then
backtrack the tree as the recursion.
EXAMPLE
7 Max

5 7 Min

5 9 7 8 Max

5 3 6 9 2 7 4 8

Terminal
Example
Exampl
MIN-MAX ALGORITHM
with alpha beta cut off.
• α>=β   (then we apply the cut off condition)
Min-Max algorithm with alpha beta cut off

• Set value of α -∞
• Set the value of β ∞
• α>=β   (then we apply the cut off condition)
Cut off condition  α>=β
Example
α = 7
Max
β =∞

α = 7
α = -∞ β =∞
β =7 Min

α = 7
α =8 β =∞
α = 7 β =8
5 8 α = 7
β =∞ α = 7
α = -∞ α = -∞ β =5 β = 11
α = -∞
β =5 α = 5 β =8 β =8
β =7 5 11 M
5 7 8 8

10 5 7 11 9 8 12 8 5 12 11 12
Max = - ∞ or 3

α = 3
β =∞

α = -∞ α = 3
β =3 β =2

Min β = 2, ∞

You might also like