Why crossover and mutation functions in GA was not considered while using integer variable indices (integer constrain)?

 Accepted Answer

They are considered.
The way that integer constraints are enforced is that ga() puts in its own CrossoverFcn and MutationFcn that forces the constraints to be honored. User crossover and mutation functions have the risk of generating new entries that do not satisfy the integer constraints.
If you are certain that your crossover and mutation functions enforce your integer constraints, then leave your intcons empty, and set an initial population matrix that gives initial entries that are consistent with your integer constraints, and then count on your crossover and mutation functions to force the entries to continue to be integer.

5 Comments

Thank you so much for the answer.
And adding to the same questtion, is there any way to identify the type of crossover and mutation function which is automatically considered by matlab while using this integer constrain? Because after using the integer constrain, I see a large different between mean fitness and best fitness at convergence.
Note: This was not observed without integer constrain
When intcons are present:
CreationFcn: @gaminlpcreationuniform
CrossoverFcn: @gaminlpcrossoverlaplace
MutationFcn: @gaminlpmutationpower
All three of these are .p files so unfortunately their source cannot be examined.
Dear Walter
thank you for your answer to Shibu question.
I write for my self a simple form of NSGA II to solve an optimization problem with integer constraints. I use the ordinary crossover and mutation crossover and I use the "round" function to convert the new children into integer form before I call them in the cost function of the problem. But unfortunately, I didn't get good results. As my question is there a way that I can call these three functions "CreationFcn: @gaminlpcreationuniform" and "CrossoverFcn: @gaminlpcrossoverlaplace" and "MutationFcn: @gaminlpmutationpower" inside my NSGA II code. I would be so grateful if you could help me.
Thanks in advance.
They are just MATLAB functions, and the interface to them is documented (it is the same as the interface for custom functions). So if NSGA II can call arbitrary functions then Yes.

Sign in to comment.

More Answers (1)

Integer programming with ga involves several modifications of the basic algorithm (see How the Genetic Algorithm Works). For integer programming:
  • Special creation, crossover, and mutation functions enforce variables to be integers. For details, see Deep et al. [2].
[2] Deep, Kusum, Krishna Pratap Singh, M.L. Kansal, and C. Mohan. A real coded genetic algorithm for solving integer and mixed integer optimization problems. Applied Mathematics and Computation, 212(2), pp. 505–518, 2009.
From the paper, laplace crossover and power mutation are considered.

Tags

Community Treasure Hunt

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

Start Hunting!