Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/freetonik/gen_tsp

Simple genetic algorithm for solving the Travelling salesman problem (TSP)
https://github.com/freetonik/gen_tsp

Last synced: about 2 months ago
JSON representation

Simple genetic algorithm for solving the Travelling salesman problem (TSP)

Awesome Lists containing this project

README

        

# gen_tsp
This is simple genetic algorithm for solving the Travelling salesman problem (TSP).

The problem is as follows. You are given a set of cities (represented as points in the plane with X and Y co-ordinates). The goal is to find the shortest tour that visits each city exactly once, returning in the end to its starting point. Finding the optimal tour is no simple matter. Given just 50 cities, there are more tours possible than the estimated number of atoms in the known universe! Even with the power of GA we are forced, by the difficulty of this NP-complete problem, to settle for "good" solutions instead of the optimum solution.

There are several types of crossover used: partially mapped crossover, injection crossover; and several types of mutation: one point, n-point (user specified) or random-template-based mutation. There is also one tournament selection mechanism based on ranks.