The travelling salesman problem is basically: how to visit every city once, taking the shortest route between them. This problem has a lot of relevance still today, for example, postal routes and rubbish disposal routes e.t.c.
This project uses a hill climber algorithm to approximate the solution, this is much faster than using brute force to check every possible route for the shortest solution. The basic premise of a hill climber algorithm is that you start with a sub optimal solution, usually a random one, then you mutate it, if the mutated solution is better you keep it, if not, you undo the mutation and try again. This leads to a ratcheting effect where the solution can only ever get better. Due to the introduction of random mutation which are selected on, leading to an improvement over time, the hill climber is considered a genetic algorithm, albeit a very simple one.
Once the website is completed this project is a prime candidate for my first "Javascript + HTML5 Canvas" project, that would mean you could try it out on this website, instead of needing to download it.
Try it yourself: Salesman.jar
Source code (MIT License): Github


