Live data from Hacker News

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

news.ycombinator.com

101–110 of 158 posts

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

#101
post #77
post #62

Earlier quoted context omitted.

> here’s the code > link to twitter visible_confusion.png.jpg.exe

I hadn't before realised that you can circumvent the Twitter character limit by turning your message into an image and attaching it. Clever!

It’s funny, despite the code being on GitHub, Twitter search is the fastest way for me to find it. Searching my own tweets as a bookmarking tool is its hidden killer feature.

Images aren’t ideal for sharing code, of course, but it’s not like this example works as a standalone program.

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

#102

At my current job we use Optaplanner in a project, to move around seat reservations (in blocks of several hundred) whilst keeping the new seats as similar as possible to the old ones (each seat having 'attributes' with various weights). I mostly chose it due to being JVM (although it needed a little Java shim to make it usable from Scala) In grad school I used MiniZinc to find exact optimal subsets for a certain prob…

I’m curious to know how your experience with Optaplanner has been. As I understand you model your problems quite differently and it is more of a search for a good enough solution using metaheuristics?

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

#104
post #97

I use Minizinc in a personal toy project ( https://gitlab.com/dustin-space/meal-scheduler ), and GECODE or Google's ortools solver at the backend. It's used for meal planning. Unfortunately it's way way slower than I'd hope. I suspect I just have the domain not modeled efficiently. Maybe if I had a few days to put into it, and learn how to properly debug the CSP solver step by step, it might help...

Fun problem. When solving with Gecode, you might want to add the annotation `:: domain_propagation` to the `all_different` constraint (https://www.minizinc.org/doc-2.6.2/en/lib-stdlib-annotations...). Sometimes a good idea, sometimes not.

If you can extract some instances you could send in your problem to the MiniZinc challenge (https://www.minizinc.org/challenge2022/challenge.html), preferably with several instances with varying complexity. The benefit for you is that it is a good way to ensure that your particular problem is tested for a lot of solvers, and may be used for improvments of solvers in the future. The deadline for this years challenge problem submission is 6th of May.

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

#105

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?

Not OP either, but there are many different aspects to solvers that make them useful in different situations.

For example, I would perhaps not use the same solver for a best-effort problem where I can program strong heuristics, vs a problem that must be optimized and no natural heuristics exist. Sometimes problems have a natural type of formulation, and it is best to use a solver for that type of problem (linear programming, mixed integer programming, SAT, pseudo boolean, constraint programming, ...).

Choosing a solver also very much depends on the deployment situation; how should a model be used and what operational concerns are there.

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

#109

Earlier quoted context omitted.

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 t…

Julia (and the Gadfly package, which it's worth noting is not a standard library or anything like that) have come a long way since 2014. JuMP too. Julia was indeed "not ready" in 2014; it wasn't anywhere near the 1.0 release. We're now on the 1.7.x releases: stable and guaranteed backward compatible since 1.0, and a lot of quality of life improvements between 1.0 and 1.7, including much faster compilation. If I'm sol…

Wow, 2014 and Julia v0.2! That's pretty amazing really haha. That's the "before times". That's so long ago that most of the things tracking Julia's growth start tracking after that time, and the vast majority of users today hadn't even heard of Julia at that time. I would definitely open up Julia again some time treating it like essentially a wholly different language. Things like precompilation, package compiler, Plots.jl, etc. only came into being much later, so definitely OP should scratch the old workflow and try it fresh.
Post reply on HN