Skip to main content
The new Teacher Workspace is here. Your first 3 assignments are free. Try it →

Minimax algorithm

The minimax algorithm is a decision rule for two-player zero-sum games. It chooses the move that gives you the best result if your opponent responds with their best counterplay.

Last updated July 2026

What is the minimax algorithm?

The minimax algorithm is a way to choose moves in Game Theory when you are facing one opponent and whatever you gain, they lose. Instead of asking, “What move looks best right now?” minimax asks, “If I make this move and my opponent answers perfectly, what is my worst-case outcome?” Then it picks the move with the strongest worst-case result.

That logic matters most in zero-sum games, where one player’s gain is the other player’s loss. Chess and tic-tac-toe are the classic examples because both players take turns, both can see the same board, and the game ends with a clear winner, loser, or draw. Minimax assumes rational play, so it models both sides as trying to optimize their own outcome.

The algorithm works by building a game tree. Each branch is a possible move, then a possible response, then another response, and so on until the game ends or you stop at a cutoff depth. Terminal positions get scores, and those scores get pushed back up the tree. Your move is chosen by maximizing your minimum guaranteed payoff, while your opponent is modeled as minimizing your payoff.

A simple way to picture it is this: if Move A can lead to scores of 8, 3, or 2 depending on how your opponent responds, its worst case is 2. If Move B leads to 5, 5, or 4, its worst case is 4. Minimax prefers B because it protects you better against the strongest reply.

In algorithmic game theory, the catch is complexity. The number of possible lines grows very fast as games get bigger, so full minimax search can become too expensive for real-time use. That is why computer programs often combine minimax with smart search limits, evaluation functions, and alpha-beta pruning to skip branches that cannot change the final decision.

Why the minimax algorithm matters in Game Theory

Minimax is one of the cleanest examples of strategic reasoning in Game Theory because it turns “thinking ahead” into a precise rule. It shows how you can model competition when both players are rational and the payoff moves in opposite directions. That makes it a bridge between classic board-game strategy and the computational side of the course.

It also helps you see the limits of perfect planning. In tiny games like tic-tac-toe, minimax can effectively map the whole game and find optimal play. In larger games, the game tree grows too fast, which leads straight into computational complexity, approximation, and bounded rationality. That connection is a big reason minimax shows up in algorithmic game theory.

The term also matters in artificial intelligence and multi-agent systems. Game-playing programs, robot coordination systems, and other strategic agents often need a rule for handling an opponent or competing agent whose choices affect the outcome. Minimax gives you a baseline model for that kind of adversarial decision-making, even when later methods refine or outperform it.

If you are reading a game-theory problem, minimax is often the move that explains why a “safe” strategy is rational even when a riskier move could look better in one branch of the tree. It is a way to reason about worst-case outcomes without guessing what the opponent feels like doing.

Keep studying Game Theory Unit 14

Official unit cheatsheet

open one-pager

How the minimax algorithm connects across the course

Zero-sum game

Minimax is built for zero-sum settings, where one player’s gain exactly matches the other player’s loss. That assumption lets the algorithm treat the opponent as an adversary whose best response lowers your payoff. If the game is not zero-sum, minimax may not describe the strategic structure very well.

Game tree

The algorithm searches through a game tree, which lays out moves as branches from one position to the next. Each node represents a state of the game, and each branch represents a possible choice. Without a game tree, minimax would have no structure to evaluate.

Alpha-beta pruning

Alpha-beta pruning is a speed-up for minimax. It cuts off branches that cannot possibly improve the final choice, so the algorithm does less work without changing the answer. In bigger games, this is often the difference between a usable search and one that is far too slow.

Nash equilibrium

Both ideas involve strategic choice, but they ask different questions. Minimax is a search rule for choosing a move against an opponent, while Nash equilibrium describes a stable set of strategies where no player wants to change unilaterally. In some simple zero-sum games, the optimal minimax strategy connects closely to equilibrium thinking.

Is the minimax algorithm on the Game Theory exam?

A problem set or quiz question may give you a small game tree and ask you to trace the minimax choice from the terminal scores back to the root. Your job is to label which nodes are maximizing and which are minimizing, then work upward to find the guaranteed value of each move. If the course shifts into AI, you might also explain why the algorithm becomes expensive as the branching factor grows, or why alpha-beta pruning improves search without changing the decision. For discussion questions, you may compare a minimax strategy with a riskier move and justify why the worst-case logic is rational in a zero-sum setting.

The minimax algorithm vs Nash equilibrium

Minimax and Nash equilibrium both deal with optimal behavior, but they are not the same thing. Minimax is a decision procedure for choosing a move under adversarial conditions, while Nash equilibrium is a strategic state where no player can improve by changing alone. You can use minimax to find a best response, but equilibrium describes stability across all players' strategies.

Key things to remember about the minimax algorithm

  • Minimax picks the move with the best worst-case outcome, which makes it a natural fit for two-player zero-sum games.

  • The algorithm uses a game tree to look ahead at possible moves, responses, and counter-responses before deciding.

  • Its basic assumption is that both players act rationally and choose the move that best protects their own outcome.

  • Minimax can become computationally expensive because the number of game states grows quickly in larger games.

  • Alpha-beta pruning is a common way to make minimax faster by skipping branches that cannot affect the final choice.

Frequently asked questions about the minimax algorithm

What is minimax algorithm in Game Theory?

The minimax algorithm is a strategy for choosing the best move in a two-player zero-sum game by focusing on the worst-case outcome. It assumes your opponent will respond optimally, so you pick the option that gives you the strongest guaranteed result. That makes it a core idea in strategic decision-making and game-tree search.

How does minimax work in a game tree?

Minimax starts at the leaves of the game tree, where the results are known, and works backward to the current position. At your turns it chooses the largest value, and at your opponent’s turns it chooses the smallest value from your perspective. The move at the root with the best backed-up score is the one minimax recommends.

Is minimax the same as alpha-beta pruning?

No. Minimax is the decision rule that evaluates moves by looking ahead through the game tree. Alpha-beta pruning is an optimization that skips branches that cannot change the result. You often see them together, but pruning is a speed-up, not a different strategic idea.

Why does minimax get slow in bigger games?

Because the number of possible move sequences grows very fast as the game gets more complex. Even one extra layer of moves can multiply the number of positions the algorithm has to inspect. That is why minimax is easy to use in small games like tic-tac-toe but much harder in large games unless you cut the search off or prune branches.

Minimax Algorithm | Game Theory | Fiveable