
Minimax(node, 3, true) Working of Min-Max Algorithm: MinEva= min(minEva, eva) //gives minimum of the values
Ma圎va= max(ma圎va,eva) //gives Maximum of the values If MaximizingPlayer then // for Maximizer Player If depth =0 or node is a terminal node then
The minimax algorithm proceeds all the way down to the terminal node of the tree, then backtrack the tree as the recursion.įunction minimax(node, depth, maximizingPlayer) is. The minimax algorithm performs a depth-first search algorithm for the exploration of the complete game tree. Both Players of the game are opponent of each other, where MAX will select the maximized value and MIN will select the minimized value. Both the players fight it as the opponent player gets the minimum benefit while they get the maximum benefit. In this algorithm two players play the game, one is called MAX and other is called MIN. This Algorithm computes the minimax decision for the current state. Such as Chess, Checkers, tic-tac-toe, go, and various tow-players game.
Min-Max algorithm is mostly used for game playing in AI. Mini-Max algorithm uses recursion to search through the game-tree. It provides an optimal move for the player assuming that opponent is also playing optimally. Mini-max algorithm is a recursive or backtracking algorithm which is used in decision-making and game theory. Next → ← prev Mini-Max Algorithm in Artificial Intelligence