Graphs and NetworksSalesman
The 2-Opt Algorithm starts with a random possible path. Then you repeatedly pick two edges and swap them around if that would reduce the length of the path. You stop when you can't reduce the length further by swapping any pairs of edges.
Animation coming soon…