Search code examples
genetic-algorithmmutation

How do I determine the amount of genes that are mutated using a mutation operator?


I am familiar with mutation techniques and have implemented some in my project, however I have never really known how many genes should be mutated when implementing a mutation operator. Let's take boundary mutation for example; we select a gene at random and replace it with either a lower or upper bound of that gene.

However, I am unsure of whether I should just mutate 1 gene, or mutate more of them. I have therefore thought of two approaches I believe are viable strategies:

  1. Assign a random probability to every gene that determines if the gene will be mutated. Roll a dice for every gene and mutate it if lands within the probability. Then stop and go on to the next chromosome.
  2. Pick one gene at random and mutate it. Then stop and go on to the next chromosome.

Am I in the right direction here? When should I prefer one strategy over the other? Or is there another way to determine the amount of genes to be mutated? Or is it problem-specific?


Solution

  • I have never really known how many genes should be mutated...

    No one knows. There is no optimal mutation rate/scheme.

    is there another way

    Yes, there are many, many ways. In fact you can change the mutation rate or scheme whenever you want. No one is gonna stop you!

    Generically, you can have a dynamic mutation rate, which imho is preferable.

    When should I prefer one strategy over the other?

    There is a natural tradeoff between exploration vs Exploitation. Exploration is high mutation rate, exploitation is low. You choose. Good luck!