 # Traveling Salesman Algorithm

957 Words4 Pages
The traveling salesman problem and genetic algorithms

From Class I learned that genetic algorithms are search and optimization methods inspired by the evolution and genetic basis that it implies. For the use of an algorithm a set of possible solutions is generated (we will name each of these solutions "individuals")and our problem (called population), this population is mutated and recombined by random actions, as in evolution, they also undergo an assessment to decide which are the most suitable and separate them from the rest, which will be discarded. Throughout this paper I will try to explain how the problem of The Traveling Salesman can be solved by using a Genetic Algorithm (GA).
The Traveling Salesman Problem (TSP) is easy to understand,
…show more content…
The total number of trips grew from five to six cities, but not as much as six to seven, which will be 5,040 routes. It is clear that when increasing the number of cities, the total of routes rises extremely considering the case with ten cities, which is the amount that is being used in this AG. The factorial of 10 is 3,628,800. The problem was programmed in Java and it was observed that the shortest route is 7,392 miles, some of the routes which were found with this value…show more content…
In other words, the three routes are the same; it's just that the city taken as a departure varies therefore as we are working with 10 cities now there are 10 routes with different starting point. The test was conducted, with a GA, 420 generations were calculated, from reading about this problem I figured this number of generations would help find the ideal route. The program was designed so that the output is written to a text file. 420 generations were written, described and shown in this file. A fragment of the file is shown below:

Initial