Mutation function with integer variables GA

8 views (last 30 days)
Hi, I'm trying to use ga function. But I'm having trouble because i can't change parameter in the mutation function (gets override if i change something) Does Someone know any trick to deal with it? Best regards,

Accepted Answer

Alan Weiss
Alan Weiss on 26 Jun 2013
As the documentation states, GA overrides any mutation function you give when you have integer constraints. The only way I know to change this behavior is to edit the GA function. I suggest you make a copy, and not edit the source file directly.
I am curious to know in what way the current mutation function is unsatisfactory.
Good luck,
Alan Weiss MATLAB mathematical toolbox documentation
  1 Comment
BBradley
BBradley on 24 Sep 2015
Hello Alan,
I know this is an old thread, but I am curious about a similar issue. In the case of integer programming, the documentation you linked to above states "Special creation, crossover, and mutation functions enforce variables to be integers. For details, see Deep et al. [2]." This referenced paper discusses a "Power mutation" function for choosing a mutated child from a parent, with a parameter p called the index of mutation that "governs the strength of perturbation of power mutation". In the Matlab implementation of this 'special mutation function' for integer problems, what is the default value for p? And is it possible to change the value of this parameter (e.g. as one would change "Scale" and "Shrink" when 'MutationFnc' is @mutationgaussian)?
This question is not driven by the mutation function being unsatisfactory - I'm more just trying to understand what exactly is going on when Matlab overrides any other mutation function for integer problems, and whether a user has any control over the level of mutation through this p parameter in such cases.
Many thanks.

Sign in to comment.

More Answers (2)

Benjamin Mac-Clure
Benjamin Mac-Clure on 26 Jun 2013
Thanks Allan, My problem is that the fitness function use a lot of calculations, so i use very few population (wich also have few genes), when the mutation is gaussian (or have a very low rate of change, or both) it's probable that the code can't find the optimal value. So i was trying to give some randomness to the algorithm, but i could't. Now i going to try to create my own mutation function that allows integer and real values. I hope it works.

Ian Bortolotti Gomes
Ian Bortolotti Gomes on 23 Aug 2018
Edited: Ian Bortolotti Gomes on 23 Aug 2018
Hello,
I am running an optimization problem with integer variables to which I know there are better global minimums than what the ga function is finding. I have already changed the generations and stall stopping criteria, but in every run, the algorithm finds different local minimum, gets stuck with it neglects the other possible minimums. I watch the best individual plot while it is running and can see this happening.
My guess is that mutations aren't happening often enough.
Is there any way to solve this? Is this just the case to increase even more the generations and stall stopping criteria?
Regards, Ian

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!