-1

Can someone tell me the exact steps to followed in formulating a Travelling Salesman Problem model using Genetic Algorithm using Excel or even just writing by hand. I have created a random population and have chosen the parents. I dont know how to proceed after this, like how to make children from the parents. Thank you:)

Mannat M
  • 167
  • 1
  • 3
  • 11
  • Maybe start with https://en.wikipedia.org/wiki/Selection_%28genetic_algorithm%29 , try to formulate more specific questions in the future. – Boyko Perfanov Mar 30 '15 at 09:45

2 Answers2

2

Steps of TSP using genetic algorithms:

  1. create a random initial population.
  2. Define a function to calculate the cost of the route.
  3. Choose 2 best routes and make the crossover to generate 2 new routes daughters. Great chance of routes daughters are better than their parents.
  4. applying the mutation, to prevent the routes are identical daughters or improving the route.
  5. routes daughters are inserted into the population replacing the 2 routes with higher cost. The population remains the same size.
  6. The routes are created children repeatedly until you reach the stop criterion, the better route.

Difficulties to solve the travelling salesman problem:

  • Representation / coding of the route.
  • Crossing algorithm (crossover) to combine two individuals (routes) to generate new children, new route.
  • Each city can only be visited once in a route.

There are several ways to make chidren routes, by crossover:

  • Single point: combine first part of the father 1 with second part of father 2.
  • Two points: two parts of the first father are copied and the rest (which is between these two parts) is placed in the same order as in the second father.

Ways to make mutation:

  • Reverse the nearby towns
  • Choose a city at random and put in another position.
  • Change cities position.
Fellipe Paes
  • 116
  • 4
0

Next steps are Cross Over and Mutation. Also, you need a fitness function to evaluate each answer.

Omid
  • 1
  • 1
  • 2