Should I use minimax or alpha-beta pruning (or both)? Apparently, alpha-beta pruning prunes some parts of the search tree.
2 Answers
Both algorithms should give the same answer. However, their main difference is that alpha-beta does not explore all paths, like minimax does, but prunes those that are guaranteed not to be an optimal state for the current player, that is max or min. So, alpha-beta is a better implementation of minimax.
Here are the time complexities of both algorithms
- Minimax: $\mathcal{O}(b^d)$,
- Alpha-beta (best-case scenario): $\mathcal{O}(b^{d/2}) = \mathcal{O}(\sqrt{b^d})$
where $b$ is an average branching factor with a search depth of $d$ plies.
Minimax is the base algorithm, and alpha beta pruning is an optimisation that you can apply to minimax to make it more efficient.