GeneticAlgorithmPython icon indicating copy to clipboard operation
GeneticAlgorithmPython copied to clipboard

Scramble mutation unnecessary computation.

Open maksym33 opened this issue 3 years ago • 0 comments

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

maksym33 avatar Dec 15 '21 18:12 maksym33