BIT252 ยท 2079 ยท 5 marks
What is the purpose of alpha beta pruning? Explain.
What is the purpose of alpha beta pruning? Explain. [5]
Quick answer
The purpose of alpha-beta pruning is to reduce the number of nodes evaluated in the minimax search tree without affecting the final result. It allows the minimax algorithm to search deeper in the same amount of time by eliminating (pruning) branches that cannot possibly influence the final decision.
Alpha-Beta Pruning
Purpose
Note: Reference notes were not available for this topic; the following is based on standard AI curriculum material consistent with TU BSc CSIT syllabus.
Background
The Minimax algorithm explores the entire game tree to find the optimal move, but this is computationally expensive. For a game tree with branching factor b and depth d, minimax evaluates O(b^d) nodes.
Alpha-beta pruning reduces this to approximately O(b^(d/2)) in the best case, effectively doubling the searchable depth.
Key Concepts
| Parameter | Role |
|---|---|
| Alpha (ฮฑ) | The best (highest) value that the MAX player can guarantee so far. Initialized to -โ |
| Beta (ฮฒ) | The best (lowest) value that the MIN player can guarantee so far. Initialized to +โ |
How It Works
- The algorithm performs a standard depth-first minimax search.
- At each node, it maintains the ฮฑ and ฮฒ values.
- Pruning occurs when:
- At a MIN node: if the current value becomes โค ฮฑ, prune remaining children (Alpha cutoff).
- At a MAX node: if the current value becomes โฅ ฮฒ, prune remaining children (Beta cutoff).
Pruning Conditions
At MAX node: if value >= ฮฒ โ PRUNE (Beta cutoff)
At MIN node: if value <= ฮฑ โ PRUNE (Alpha cutoff)
Example
Consider the following minimax tree:
MAX
/ \
MIN MIN
/ \ / \
3 5 2 9
- MAX evaluates left MIN node โ gets min(3,5) = 3, so ฮฑ = 3
- MAX evaluates right MIN node โ sees value 2
- Since 2 < ฮฑ (3), the right subtree value cannot exceed 3
- The remaining child (9) is pruned -- no need to evaluate it
- Final answer: MAX chooses 3
Advantages
- Efficiency: Reduces time complexity from O(b^d) to O(b^(d/2)).
- Same result: Always produces the same optimal move as full minimax.
- Deeper search: Allows AI to look further ahead within the same time limit.
- Practical use: Widely used in game-playing AI (chess, checkers, tic-tac-toe).
Summary
Alpha-beta pruning is an optimization technique for the minimax algorithm that prunes branches which cannot affect the outcome, using two boundary values ฮฑ and ฮฒ. It makes game-tree search significantly faster while guaranteeing the same optimal decision as the full minimax search.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.