The traveling salesmen is a problem to find the shortest path that visits all of the nodes in a graph. Input a number of points and the program will generate that many random points on the canvas and find the shortest path connecting them all. Once you click start, the red lines will signify that path it's currently trying, and the white lines represent the shortest path that it has currently found.

NOTE: Depending on how powerful the computer is, it may freeze for input greater than 8. If you want to generate a new set of points, you must refresh the page.

Number of points to calculate for