Eric Stoltz
Aug 31, 2018 · 1 min read

Hi Jesper- thanks for reading diligently!

In the selection function, we use the roulette wheel approach to favor top performers. In doing so, we assign a greater probability to selecting the best routes from a generation by giving those routes a bigger chunk of the roulette wheel, so to speak.

As for inserting the genes at the beginning of the child, for this use case it doesn’t make a difference. That’s because we’re doing a round trip (and we’re not dealing with external factors like traffic, etc.). Since the round trip means there’s a closed loop, it doesn’t matter which point on the route you start with since the total distance traveled will be the same. To visualize this, take look at the first picture showing a sample TSP route. You can pick any dot as a starting point and will end up with the same distance traveled for that specific route.

Enjoy!

    Eric Stoltz

    Written by

    Energized by tackling challenging problems in complex industries