Professional Documents
Culture Documents
Lab 8 Research
Lab 8 Research
Mutation
Mutation is done by swapping two random cities:
123456789 --> 123546789
Mutation
None - no mutation
Breeding/crossover
Breeding is done by selecting a random range of cities from the first parent route,
and placing it into an empty child route (in the same range). Gaps are then filled in,
without duplicates, in the order they appear in the second parent route. For example:
parent1: 0123456789
parent1: 5487961320
start_pos = 0 (random)
end_pos = 4 (random)
unfilled child: 01234*****
filled child: 0123458796
Each number represents a city. Asterisks are unfilled.
Crossover
One point - part of the first parent is copied and the rest is taken in the
same order as in the second parent
Two point - two parts of the first parent are copied and the rest between is
taken in the same order as in the second parent
None - no crossover, offspring is exact copy of parents