Choose a set of cities in the cities panel and press Run. Drag the map to move it and use the wheel to change the scale, which is also typed directly at the bottom right. The names at the top right open and close each panel, panels can be dragged anywhere and snap to each other, and double-clicking a panel title pins one panel to the top right instead.
The traveling salesman problem asks for the shortest tour that visits every city once and returns to the start. The number of possible tours grows as the factorial of the number of cities, so trying them all is hopeless past a few dozen points. What is practical instead is to build one reasonable tour and then keep improving it.
The initial tour comes from one of three constructions. Nearest neighbour always hops to the closest unvisited city, which is quick but leaves a long edge at the end to pick up whatever was skipped. Greedy edge takes the shortest edges first, refusing any that would close a loop early or give a city three neighbours. Random is there as a baseline, to show how much the improvement step alone can do.
Two-opt cuts two edges and reconnects them the other way, which is exactly what undoes a crossing. It only ever accepts a shorter tour, so it stops at the first local optimum it reaches. Simulated annealing also accepts moves that make the tour longer, with a probability set by a temperature that falls as the run goes on. Early on it wanders widely; later it only takes improvements, which is why the two together beat either one alone. Or-opt moves add a second kind of neighbour: a short run of cities is lifted out and dropped in somewhere else, forwards or reversed.
Distances are great-circle distances in kilometres, so the tour is measured on the sphere rather than on the flat picture. While it runs, the thick line is the best tour found so far and the thin one is where the search currently is. The chart shows both lengths against the iteration count, and the temperature bar shows how much freedom is left.