Search
BoardSolve performs an iterative-deepening negamax with alpha-beta pruning and a killer-move table. At each leaf the evaluation function is the difference of BFS shortest-path lengths from each player's pawn to its goal row, minus a small term for remaining walls in hand.
Wall-placement moves are filtered: only walls that actually change one player's shortest path by ≥ 1 (or block a tactical pattern) are considered, which prunes the branching factor from ~130 to a few dozen without losing strength in practice.
Legality check
Every candidate wall is validated by re-running BFS for both pawns — Quoridor's hardest rule is that no wall may completely block either player's path to its goal.