I am trying to implement a Genetic Algorithm that solves a TSP. It works fine with a TSP of a small number of cities (say 10) and produces the optimal solution. However, when the number of cities is increased even to 50 cities, it converges prematurely. I tried changing the parameters (mutation prob, crossover prob, initial population size, number of generation), however it still does not converge to the optimal solution.
The algorithm I have implement is as following:
Create an initial population randomly of size p
Calculate the fitness
Pick p/2 random individuals to the parents
While counter < p/2
pick parent1 and parent2 by tournament selection
child1, child2 = mutate and crossover parent1 and parent2
add child1 and child2 to new population
pick p/2 distinct individuals from initial population and store in new population
Could any one tell me what I am doing wrong please?