Using Genetic Algorithm to calculate the shortest routine