← Glossary · Concepts

MiniMax

Technique

Fact-checked Jun 5, 2026

MiniMax is a decision-making rule used in game theory and artificial intelligence to minimize the possible loss for a worst-case scenario. It helps an AI choose the best move in two-player games by assuming the opponent plays optimally.

MiniMax is a fundamental decision-making algorithm, most commonly applied in artificial intelligence for playing two-player turn-based games like chess or tic-tac-toe. The core idea is to find the best possible move by making a choice that minimizes the maximum possible loss. Think of it as a strategy where you assume your opponent will always make the move that is worst for you, and then you pick the move that limits how bad that 'worst' outcome can be.

To understand MiniMax, imagine a game as a tree of possible moves. Your turn, then your opponent's turn, then your turn, and so on. At the very end of every possible sequence of moves (the 'leaves' of the tree), you can assign a score, like +1 if you win, -1 if you lose, or 0 for a draw. MiniMax works backwards from these end states. It assumes that on your turn, you want to *maximize* your score, and on your opponent's turn, they want to *minimize* your score (because they want to win, which usually means you lose).

The algorithm explores this game tree by looking ahead as many turns as computationally feasible. For each potential move you could make, it simulates all the moves your opponent could make in response, and then all your moves, and so on. It then 'propagates' scores up the tree. If it's your turn, you pick the branch that leads to the highest score. If it's your opponent's turn, they pick the branch that leads to the lowest score for you. By doing this recursively, the algorithm can determine the best move for the current player.

A simple example is tic-tac-toe. The AI would evaluate every possible sequence of moves. If it's its turn, it looks at all possible squares it could place its 'X'. For each 'X', it then pretends the opponent places an 'O' in every open square, and so on. Eventually, each path leads to a win, loss, or draw. The AI then works backward, choosing the path that maximizes its chances of winning and minimizes its chances of losing. It’s a very logical, systematic way of planning ahead.

MiniMax is a classic algorithm, but it has limitations. For games with many possible moves or long game sequences, the 'game tree' can become incredibly vast, making it computationally expensive or even impossible to explore fully. This is known as a 'combinatorial explosion'. Techniques like 'alpha-beta pruning' are often used to optimize MiniMax by cutting off branches of the tree that are obviously not going to lead to the optimal solution, thereby speeding up the search significantly. Despite its age, MiniMax forms the basis of many strategic AI implementations, especially in simpler games.

Learn AI in 5 minutes a day.

Daily Deck explains terms like MiniMax as part of a free seven-card daily brief. No jargon. No fluff.

Start free