rm-hull / travelling-salesman.cljs
Last updated

The TSP ('travelling salesman problem') is a popular demonstration of an NP-hard problem in Computer Science: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? This implementation uses an evolutionary cumulative-selection approach where on each iteration the five shortest candidate paths are reproduced a number of times and mutated. The shortest path is then displayed, and the resulting five candidate paths are used to evolve the next generation (see also: http://programming-enchiladas.destructuring-bind.org/rm-hull/8347c8fd72570d7a8b32).

Fork me on GitHub!