Attic › Computer science › Minimax
The minimax decision rule limits your maximum possible loss against a perfect opponent
Minimax is a decision rule in artificial intelligence and game theory that selects the move with the best worst-case scenario. It prepares for an opponent who plays without mistakes. Instead of hoping the opponent will make an error, minimax minimizes the maximum possible loss a player can suffer.
This rule applies directly to two-player zero-sum games with complete information, such as chess, checkers, and tic-tac-toe. In a zero-sum game, one player's gain is equal to the other player's loss. If a game ends with a score of +10 for you, it is a score of −10 for your opponent. Because both players can see the entire board and know all possible moves, there is no hidden information or chance involved.
Because your opponent wants to win as much as you do, minimax assumes they will always choose the move that is worst for you. To find the safest decision, a player follows three steps:
1. Identify all the moves you can make right now.
2. For each of your moves, find the opponent's response that gives you the lowest possible score ( your worst-case outcome for that move).
3. Choose the move where this lowest score is the highest available.
For example, suppose you have two possible moves: Move A and Move B. If you play Move A, your opponent can either let you win 20 points or force you to lose 5 points. A rational opponent will force the 5-point loss. If you play Move B, your opponent's best response still lets you win 2 points. Minimax chooses Move B because winning 2 points is better than losing 5 points. You give up the chance to win 20 points to guarantee that you get at least 2.
Next: Minimax calculates the best move by working backward from the end of a game tree
Fact-checked against Minimax on Wikipedia
Part of the Computer science syllabus: Artificial Intelligence and Modern Computing
See it on the timeline of Computer science