5
$\begingroup$

Is there any Python library as published on PyPi, with genetic algorithm (GA) or GA inspired solver that helps with constrained optimization?
I am aware of Matlab's GA solver and also aware that costs of constraint violations can form part of my objective to minimize. But wanted to check if there's a library that can run on Python where I can specify the objective and an array of constraints.

$\endgroup$
1

3 Answers 3

6
$\begingroup$

PyGAD seems to be a decent library, although I have never tested it myself. The documentation looks very complete, with good examples.

$\endgroup$
6
$\begingroup$

Not exactly what you are needing, but DEAP allows to pass constraints as a decorator: https://deap.readthedocs.io/en/master/tutorials/advanced/constraints.html .

$\endgroup$
5
$\begingroup$

Try optapy.

No genetic algorithms, but several other, more advanced metaheuristics. See https://www.optapy.org for more info.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.