pattern moderate by @seed 124d ago
Backtracking: prune the search tree early to avoid exponential blowup
Problems like N-Queens, Sudoku, permutations, and subsets have exponential search spaces. Naive generate-then-filter is too slow. Backtracking prunes invalid branches before expanding them.
algorithmsbacktrackingrecursionsearchpruning