Backtracking search explores one decision at a time, checks whether the partial assignment remains valid, and returns to the last decision point when the path fails. It is recursive depth-first search applied to spaces of candidate solutions. section 3.1
Permuting cities for the traveling salesman problem
A Swift permutation helper swaps an element into a fixed position, recursively explores the remaining positions, then swaps back. Applying it to five Vermont cities generates every route; closing each route into a cycle and summing dictionary-based distances produces a shortest path of 318 miles. section 8.2
Use the scheduling diagram to see how variables, domains, and constraints form a classic backtracking search problem. section 3.0





