Search code examples
pythonconstraintsmathematical-optimizationscipy-optimizedifferential-evolution

Constraints on parameters using scipy differential evolution


I am trying to use differential evolution to optimize availability based on cost. However, I have three unknown parameters (a, b, c) here and I can define the range using bounds. However, I want to define additional constraint as a+b+c <= 10000. I am using python to do this and I tried to use an option "args" within differential evolution but it did not work. Any information will be appreciated.


Solution

  • Defining the constraint using differential evolution is not an appropriate solution for the problem I have described above. For this purpose, we can use Nminimize command which has dedicated option to define constraints.

    scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, hessp=None, bounds=None, constraints=(), tol=None, callback=None, options=None)