%run ./index.ipynb

Feasbility First (Parameter-less Approach)ΒΆ

Most algorithms follow the so-called feasibility first (also known as a parameter-less approach). There, the constraint violation measure is chosen from a practical standpoint. In order to evaluate a solution, any designer will first check if the solution is feasible. Suppose the solution is infeasible (that is, at least one constraint is violated). In that case, the designer will never bother to compute its objective function value (such as the cost of the design). It does not make sense to compute the objective function value of an infeasible solution because the solution simply cannot be implemented in practice. Motivated by this argument, we devise the following penalty term where infeasible solutions are compared based on only their constraint violation values:


This constraint handling method is straightforward to integrate into a framework because it applies to many different algorithms that are either based on sorting or use the comparison of solutions. For more details please consult [25].

from pymoo.algorithms.soo.nonconvex.ga import GA
from pymoo.optimize import minimize

problem = ConstrainedProblem()

algorithm = GA(pop_size=100)

res = minimize(problem,

print("Best solution found: \nX = %s\nF = %s\nCV = %s" % (res.X, res.F, res.CV))
Best solution found:
X = [0.50357872 0.49642274]
F = [0.50002706]
CV = [0.]