naive traveling salesperson
This is the “naive” or “brute-force” approach to the traveling salesperson algorithm. This is extremely inefficient at finding a solution.
- The distance between the cities is calculated and compared with the current shortest.
- Two members of the array are swapped, and the process repeats.
The green line is the best fit so far.