Press space to show/hide the minimum distance between cities (using Bridson's Algorithm). Restart the project to generate a new set of cities. Enjoy! For faster results (run in turbo mode): https://sulfurous.aau.at/#216344883
The Traveling Salesman Problem is that given a set of cities, the goal is to find the shortest path to go in a complete cycle (through every city and back to the first). My brother was learning about this in one of his college classes, so I felt like trying it out myself. ;) I just used a genetic algorithm with each species having its own path. Every step, the worst half (more or less with randomness) of the population is taken out, and new mutated copies are made from the remaining half. I could probably make it a bit more efficient, but it works for now. I also used Bridson's Algorithm to generate a nice, spaced-out set of cities.