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

5 views (last 30 days)
ga error.JPG

Accepted Answer

Walter Roberson
Walter Roberson on 13 Jan 2019
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
Yousuf Azimi
Yousuf Azimi on 13 Sep 2020
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.
Walter Roberson
Walter Roberson on 13 Sep 2020
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)

Doanh Luong
Doanh Luong on 28 Feb 2019
Edited: Doanh Luong on 28 Feb 2019
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!