Why it matters

Game algorithms underlie chess engines + game AI. Understanding shapes decision-making systems.

Advertisement

The architecture

Minimax: maximize your score, opponent minimizes.

Grundy (Nim-value): position value in impartial games.

Game algorithmsMinimaxadversarialGrundy numbersNim-valueAlpha-betaprune subtreesSprague-Grundy theorem: any impartial game equivalent to Nim of size G(position)
Game algorithms.
Advertisement

How it works end to end

Alpha-beta: prune subtrees that can't affect result. O(b^(d/2)) with good ordering.

Iterative deepening: search depth incrementally.

Transposition table: cache seen positions.

Move ordering: try good moves first for better pruning.