# How to identify the individuals not satisfying non-linear inequality constraints?

2 views (last 30 days)
Aakash Hassan on 14 Feb 2020
Commented: Gifari Zulkarnaen on 20 Feb 2020
I am using Genetic Algorithm to solve a problem which involves minimising a fitness function, subject to some non-linear inequality constraints and decision variables subject to integer constraint. I am setting Penalty as a non-linear constraint algorithm which adds a penalty to the fitness value of infeasible individual (not satisfying the constraint) depending on the constraint violation and worst feasible fitness value in that population.
I am also saving GA population history and scores during all generations. Now, I want to visualise that during each generation which individuals didn't satisfy the constraint and caused a penalty in fitness value?
I want to show whole optimisation process like individuals during 1st generation (feasible and infeasible), with corresponding fitness value and evolving to the optimum solution till last generation

Gifari Zulkarnaen on 19 Feb 2020
Suppose we have objective function and constraint function , the fitness function will be:
function fitness = objective(x)
fitness = x^2 + constraint(x);
end
function violation = constraint(x)
violation = sum(x>=0);
end
Then, can't you recalculate the violation of each individuals using that constraint function to indicate the infeasibility?
Aakash Hassan on 19 Feb 2020
Actually, it's not that simple. In my problem, Population size is 60, then during any generation population history and scores are like this:
x(1) x(2) x(3) x(4) Fitness Function Value
12 5 9 8 1.2
25 10 4 6 1.46
50 34 10 78 0.78
- - - - -
upto 60 (population size)
Now, GA automatically adds penalty in the fitness function value for all infeasible solutions which don't satisfy constraints. But, I can't tell by just looking at fitness function values that which ones are with added penalty.
Gifari Zulkarnaen on 20 Feb 2020
If you know what are the constraints, make a constraint function, then input the individuals to get the constraint output (for knowing the infeasibility). Do you know the constraints?