GeneticAlgorithmPython
GeneticAlgorithmPython copied to clipboard
Scramble mutation unnecessary computation.
Hello,
I do not think the np.flip in this line is necessary in the scramble_mutation as it only reverses the order of selected genes (they were already shuffled):
https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/158e53c4bd0a80449a9fbb147ac95be724179b71/pygad.py#L2074
IMO this is enough:
genes_to_scramble = numpy.flip(offspring[idx, genes_range])
Let me know what you think,
Cheers,
Max