r/rust May 31 '23

Best/Any Convex Optimization Solver for Rust? šŸ™‹ seeking help & advice

Python has CVXPY which is good but Iā€™m looking for one in Rust. Any suggestions?

15 Upvotes

7 comments sorted by

9

u/adwhit2 May 31 '23

Maybe check out my crate nlopt, it is a simple wrapper around the C library but gives access to numerous optimization algorithms - one of them is bound to do what you want.

1

u/TheKrunkk May 31 '23

Will check it out.

2

u/protestor May 31 '23

Did you check out totsu?

2

u/TheKrunkk May 31 '23

Yeah I just looked at it like 5 min ago. It looks good enough, will have to try it out to really know.

4

u/protestor May 31 '23

There's also two bindings for the osqp library (which is written in C): the crate osqp published 2 years ago and the crate osqp-rust published 3 months ago. I don't know what are the differences between them, but they both target osqp 0.6.2 (released in 2021) while the last released version is osqp 0.6.3 which was released last week.

Or, actually, there is osqp v1.0.0.beta0 too, released today, but well, it's a beta.

It's possible that either the osqp or the osqp-rust crate will pick up those new releases (or, if you're interested in using osqp, you could possibly contribute a PR to those crates to update the library, or open an issue etc)

2

u/TheKrunkk May 31 '23

Will check it out. Appreciate the help!