Mini-Max Algorithm in Artificial Intelligence
Mini-Max Algorithm in Artificial Intelligence
Mini-Max Algorithm in Artificial Intelligence
Artificial Intelligence
Mini-max algorithm is a recursive or backtracking algorithm which
is used in decision-making and game theory.
Mini-Max algorithm uses recursion to search through the game-
tree.
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.
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.
Working
An example of game-tree which is representing the two-player game.
In this example, there are two players one is called Maximizer and other is
called Minimizer.
Maximizer will try to get the Maximum possible score, and Minimizer will
try to get the minimum possible score.
This algorithm applies DFS, so in this game-tree, we have to go all the way through the
leaves to reach the terminal nodes.
At the terminal node, the terminal values are given so we will compare those value and
backtrack the tree until the initial state occurs.
Properties
Complete- Min-Max algorithm is Complete. It will definitely find a
solution (if exist), in the finite search tree.
Optimal- Min-Max algorithm is optimal if both opponents are playing
optimally.
Time complexity- As it performs DFS for the game-tree, so the time
complexity of Min-Max algorithm is O(bm), where b is branching factor of
the game-tree, and m is the maximum depth of the tree.
Space Complexity- Space complexity of Mini-max algorithm is also similar
to DFS which is O(bm).
Limitation
The main drawback of the minimax algorithm is that it gets really slow for
complex games such as Chess, go, etc. This type of games has a huge
branching factor, and the player has lots of choices to decide. This
limitation of the minimax algorithm can be improved from alpha-beta
pruning.