Asked by Yohei Shibata
on 6 Mar 2019

Hi, I'm doing the optimization using GA with multiple constraint functions and have difficulty in understanding an effect of ConstrainTorelance.

For example, I have three constraint functions as follows:

Fcn1 > 10

Fcn > 8

Fcn > -7

One of the result was that Fcn1 = 9.8592, Fcn2 = 9.6328 and Fcn3 = -3.0568 showing that only Fcn2 and Fcn3 meet the constraints.

I thought that the reason is related to ConstraintTolerance, and it was set to 1.0000e-03 in the program.

But I don't understand how Fcn1 = 9.8592 was possible in the process of GA not meeting the constraint.

Could you please give me some advice on this problem?

Answer by Alan Weiss
on 7 Mar 2019

Accepted Answer

Thank you for the clear explanation. You have a difficult nonlinear problem with all integer variables. The solver is struggling to find any feasible point. Until it finds one feasible point, it does not matter that it satisfies a few constraints, the solver attempts to find something feasible and does not attempt to keep some constraints feasible when not all are feasible. See Integer ga algorithm.

I'm afraid that the best advice I can give you is to increase the size of the population considerably in an attempt to find a feasible point. This will slow the optimization even further, but until you find a feasible point, the solver is not doing anything productive. Also, there is no point in specifying a mutation function, as the integer ga algorithm overrides your choice anyway.

Good luck,

Alan Weiss

MATLAB mathematical toolbox documentation

Yohei Shibata
on 8 Mar 2019

Thank you so much for the insightful advice!

First, I did not understand that the solver was struggling to find an answer to meet the constraints. So I will first try to increase the size of the population.

Also thanks for pointing out that there's no need for specifying the mutation function. I will also refer to the link about Integer ga algorithm.

I really appreciate you taking time to answer my question.

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## Alan Weiss (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/448548-question-about-an-effect-of-constrainttolerance-on-multiple-constraints-for-ga-optimization#comment_678110

## Yohei Shibata (view profile)

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/448548-question-about-an-effect-of-constrainttolerance-on-multiple-constraints-for-ga-optimization#comment_678360

Sign in to comment.