Live data from Hacker News

Ask HN: Do you use an optimization solver? Which one? Do you like it?

news.ycombinator.com

41–50 of 158 posts

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#42
post #2

I would love to use one or more but the process to convert business logic to solver is painful so I ended up having to write a simulated annealing algo in Rust instead. I tried solver.com, Google OR-Tools, and a few other utilities. It was much easier to build a score-calculator for min/max based on user-tweaked parameters, then, jiggle the data, re-calculate score, and keep doing it until there was significant impro…

> so I ended up having to write a simulated annealing algo

I think there are much better algorithms in metaheuristic search than just simulated annealing.

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#44

After several years of exploring, my current gotos are: * Minion for IP for scheduling + edge crossing minimization. * cvxpy (wrapping ECOS, OSQP, and SCS by default) for convex optimization for making nice geometry. * Z3 and STP for SAT/SMT for program analysis. All are FLOSS, which is my main criterion in many situations. Beyond that, I like minion for its focus on only providing efficiently implementable primitive…

I'm curious what kind of person has 3 favorite constraint optimizers. What do you do that has you making use of so many different ones?

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#45
Matlab toolboxes: Lots of algorithms. Good documentation. Converting LPs/QPs into standard forms is kind of a fun puzzle but very error-prone. Manual gradient/Jacobian for general nonconvex/nonlinear problems can be painful. Not open-source, so I stopped using it.

SciPy.optimize: Similar pros/cons as Matlab other than open-source.

CVXPY (& its default backends): Modeling languages are great. First thing I will try for a new convex problem.

CVXGEN: Amazing, but infuriating that it can only be used through a web app.

PyTorch: Only supports unconstrained first-order methods. Automatic differentiation of arbitrarily complex functions is huge. Somebody should implement interior-point and SQP on the GPU for PyTorch.

---

As a researcher, my first impression is that your product is designed for people who want to deploy optimization in some service or business process, not for me.

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#46

I loved the JuMP package in Julia for being able to write models once, then swap in different solvers. Most open-source solvers don't handle parallelization well, and they lack the latest research on techniques like branch-cutting and heuristics that can speed things up significantly. In my experience, Gurobi is still leader for linear and MiP solving. But, it's really expensive and the licensing terms seem anachroni…

I love JuMP too. I am very amateur when it comes to optimization, but I found it to be a very efficient way to describe a matching algorithm for a post card exchange I ran (think of it as a Secret Santa, but generalized to each person sending multiple gifts, and discouraging mutual exchanges.) Here's the code: https://twitter.com/paulgb/status/1462483698427781120

To OP's question, besides JuMP, the other use case I've had for optimization is for optimizing the drawing order of pen plots, for which I used or-tools. A write-up on it is here: https://nb.paulbutler.org/optimizing-plots-with-tsp-solver/

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#47

After several years of exploring, my current gotos are: * Minion for IP for scheduling + edge crossing minimization. * cvxpy (wrapping ECOS, OSQP, and SCS by default) for convex optimization for making nice geometry. * Z3 and STP for SAT/SMT for program analysis. All are FLOSS, which is my main criterion in many situations. Beyond that, I like minion for its focus on only providing efficiently implementable primitive…

I'm curious what kind of person has 3 favorite constraint optimizers. What do you do that has you making use of so many different ones?

I'd love to see an answer to this, too. Just to learn a little bit more about the field!

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#49
A past project used OR Tools. I generally liked it. It was a bit confusing at times and the documentation was a bit cryptic for using some of the advanced features, though the community was good about answering questions.

In general, I would recoment OR Tools.

Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?

#50

I loved the JuMP package in Julia for being able to write models once, then swap in different solvers. Most open-source solvers don't handle parallelization well, and they lack the latest research on techniques like branch-cutting and heuristics that can speed things up significantly. In my experience, Gurobi is still leader for linear and MiP solving. But, it's really expensive and the licensing terms seem anachroni…

I haven't looked at JuMP in a while - the last time I tried it was when I was still doing personal blogging (https://ryanjoneil.github.io/posts/2014-07-18-are-we-getting...).

I remember liking JuMP, but Julia itself didn't feel ready yet. Some of the packages had weird behaviors. For example, Gadfly took several minutes to render some of my charts. IIRC when I looked at the source, it was solving a MIP to compute the best bounding box for display purposes.

I should probably check it out again.

Also: agreed regarding Gurobi licensing.

Post reply on HN