Tested tool guide
Tested browser tools
Checked August 16, 2026
What Traveling Salesman Visualizer does, with a checked example
Place cities by clicking the canvas, run the three classic traveling-salesman heuristics - nearest neighbor, greedy edge selection, and simulated annealing - and the tool draws each resulting tour and reports its length so you can compare them. The thing most users misread: this is a heuristic comparison, not an exact solver, so the shortest line on screen is a candidate solution, not a proven optimum. The other surprise is the closing edge: the reported length includes the trip back to the starting city, and that return leg is often what inflates a naive tour.
Worked example
A concrete input and expected output from the current implementation.
Input
Click four cities onto the canvas at the corners of a square four units on a side: (0,0), (4,0), (4,4), (0,4).
->
Expected output
Nearest neighbor and greedy both draw the perimeter route and report 16 units; simulated annealing converges on the same tour.
Every side of the square is 4 units and every diagonal is about 5.66, so the perimeter tour, 4 + 4 + 4 + 4 = 16, beats any route that uses a diagonal and is the true optimum. The symmetric layout forces all three heuristics onto the same tour; that agreement is a coincidence of symmetry, not a general guarantee.