AlgoViz

Minimax with Alpha-Beta Pruning

Tic-Tac-Toe

Current player: X

Algorithm Visualization

Alpha-Beta Pruning
Show Node Values
Show α-β Values
Search Depth: 3
Nodes Evaluated
0
Nodes Pruned
0
Speed: 50%
Maximizer (X)
Minimizer (O)
Pruned Node
Optimal Path

How It Works

Minimax with Alpha-Beta Pruning is a decision-making algorithm used in two-player games:

  1. The algorithm builds a game tree from the current state, alternating between maximizer (X) and minimizer (O) levels
  2. At terminal states or maximum depth, it evaluates the board using a heuristic function
  3. Values propagate upward: maximizers take the highest child value, minimizers take the lowest
  4. Alpha-Beta pruning optimizes the search by skipping branches that won't affect the final decision
  5. Alpha represents the minimum score the maximizer is guaranteed, beta is the maximum score the minimizer is guaranteed

Visualization Guide

  • Blue nodes represent maximizer (X) levels, orange nodes represent minimizer (O) levels
  • Red nodes show branches that were pruned by alpha-beta
  • The green line shows the optimal path found by the algorithm
  • Toggle alpha-beta pruning to see how it reduces the number of nodes evaluated
  • Adjust the search depth to see more comprehensive game tree analysis