I am using the ga() function in the Global Optimisation Toolbox. The problem is constrained by a linear inequality and all the optimisation variables must be integers:
problem.Aineq=[1 1 1 1 1 1]; problem.bineq = 12; problem.intcon=[1 2 3 4 5 6];
However by looking at the population at various points through the evolution I can see that there are some candidate solutions being generated that violate the inequality constraint.
E.g. A candidate_solution might be: [3 2 2 2 2 2]
I am concerned that the ga() function is "wasting" computing time by evaluating the fitness of solutions that are outside the constrained solution space. Can anyone confirm if this is the case?
From reading the MATLAB documentation for ga() and constrained optimisation it states: "All the linear constraints and bounds are satisfied throughout the optimization." https://uk.mathworks.com/help/gads/examples/constrained-minimization-using-the-genetic-algorithm.html.
Am I misusing ga() if it is violating the constraints?
Thanks
Best Answer