5

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.

Kuifje
  • 13,324
  • 1
  • 23
  • 56
Sutanu Majumdar
  • 3,461
  • 1
  • 2
  • 11

3 Answers3

6

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 .

6

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

Kuifje
  • 13,324
  • 1
  • 23
  • 56
5

Try optapy.

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

Geoffrey De Smet
  • 4,851
  • 10
  • 34