argmin icon indicating copy to clipboard operation
argmin copied to clipboard

Constrained Optimization (especially lower+upper bounds)

Open Julian-J-S opened this issue 4 years ago • 8 comments

Hello, Coming from Python (scipy.optimize.minimize) and MATLAB (fmincon), I can't find a way to specify bounds (and other constraints), which to me are very essential parts of an optimization problem.

Python / Scipy:

res = minimize(opti_fun, x0, bounds=mybounds, constraints=myconstraints)

Matlab:

res = fmincon(opti_fun, x0, A, b, Aeq, beq, lowerbound, upperbound)

Looking through the documentation, I could not find that this is implemented. (With the exception of some manual bounds in the simulatedannealing.rs example). Is this something that is being worked on? Or is it planned? Or is it too complicated / time consuming at the moment? Or did I just miss something here? I would love to have constrained optimization (at least with bounds) in Rust!

Julian-J-S avatar Sep 27 '21 13:09 Julian-J-S

Unfortunately there is no constrained optimization yet (apart from, as you noted, SA, and possibly PSO). It is definitely planned; however due to other responsibilities I'm afraid I can't give you a timeline as to when this will happen.

stefan-k avatar Sep 27 '21 16:09 stefan-k

Thanks for the reply. Looking forward to the implementation! =)

Julian-J-S avatar Sep 28 '21 06:09 Julian-J-S

Any update on this?

sahilosaro avatar Jun 06 '22 21:06 sahilosaro

Unfortunately not yet. I plan to have a look at it after the release of version 0.6.

stefan-k avatar Jun 07 '22 06:06 stefan-k

FWIW, I would like to mention here that external solvers handle constraints. In both case, cost function returns a vector: the first component is the actual cost value, the remaining components are constraints values.

Notice that egobox-ego::EgorSolver adjusts x to make constraints negative while cobyla::CobylaSolver try to make them positive.

relf avatar Feb 03 '23 16:02 relf

I don't know what role this library will play in constraint optimization, solver caller?, don't be silly and do it in Python

Euraxluo avatar Apr 08 '24 07:04 Euraxluo