Advanced Topic 47 of 51 AI & Machine Learning
Minimax and Alpha-Beta
Game-tree search with pruning.
How it works
Minimax is an algorithm for two-player zero-sum games that assumes both players play optimally: the maximizing player chooses the move with the highest value, and the minimizing player chooses the lowest, recursively down the game tree to terminal states or a depth limit where an evaluation function estimates the position. Alpha-beta pruning keeps track of the best values already guaranteed for each player and skips branches that cannot influence the result, giving the same answer while examining far fewer nodes, up to the square root in the best case with good move ordering.
Step-by-step walkthrough
- Minimax assumes both players play optimally.
- Max picks the child with the highest value.
- Min picks the lowest at its level.
- Alpha-beta stops exploring a branch that cannot change the result.
- The result is identical with far fewer nodes.
Where it is used
Chess, checkers, tic-tac-toe, Othello and other board-game engines use minimax with alpha-beta, plus iterative deepening, transposition tables and evaluation heuristics.
Common pitfall
The game tree is huge, so depth limits cause the horizon effect, and weak evaluation functions give poor play. Move ordering strongly affects pruning efficiency. Works for perfect-information, deterministic games; chance and hidden information need expectimax or sampling. Modern engines for Go use Monte Carlo tree search with neural networks.
Where it fits in the course
Minimax and Alpha-Beta is topic 47 of 51 in AI & Machine Learning, rated Advanced. It follows Search Algorithms in AI. The next topic is Bayesian Networks.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the AI & Machine Learning quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the AI & Machine Learning quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Minimax and Alpha-Beta?
Where do people use Minimax and Alpha-Beta?
What is the most common mistake with Minimax and Alpha-Beta?
What should I learn before this topic?
How can I practice it?
Is Minimax and Alpha-Beta hard to learn?
How long does it take to learn Minimax and Alpha-Beta?
Which topics are related to Minimax and Alpha-Beta?
What should I study after Minimax and Alpha-Beta?
Related topics
- Search Algorithms in AI (AI & Machine Learning)
- Bayesian Networks (AI & Machine Learning)
- Tokenization (AI & Machine Learning)
- Reinforcement Learning Algorithms (AI & Machine Learning)