Backtracking algorithms.