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 insta…
Ask HN: Do you use an optimization solver? Which one? Do you like it?
121–130 of 158 posts
Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#122The history of state-of-the-art MIP solvers is fascinating. There are very few people in the world who can develop them, and there is a strong history of developers jumping ship from one company to another, tilting performance accordingly. Initially, CPLEX and Xpress were founded in the eighties. In the nineties, CPLEX was acquired by ILOG (a French CP company), which in turn was purchased by IBM around 2009. Around…
Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#123Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#124I 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?
#125I 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…
curious to know - how do you solve this today ? what is your abstraction/solver-speak today ? I also have faced this (though im not a power user like you) - so im curious what did u end up using today ? I have a niggling feeling somewhere that JSON is the wrong language for this. Something like cue lang may be the right thing. ( https://www.sobyte.net/post/2022-04/cue/ )
The nice thing about scoring with SA is that I don't need to think like an operations research student. I just think in code with if/then/else and the number of dimensions don't matter. The code is working fine for now but now the problem is a business requirement to make it MUCH more complex and factor in a whole new set of constraints. SA will straight up not work with it because the scoring itself can take tens of seconds now. So I need to come up with a new 'proper' way, hence my renewed interest in solvers.
Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#126I've used custom made implementation in Java ( proprietary based on the owner thesis ) to optimize train crossings for big mining companies like Vale, BHP and Rio tinto, it was stressful but super fun work! Lot's of money to be made on it too if you guys are interested, but it's super niche and hard to get into. There is a huge resistence from train controllers and other workers. I actually understand it because of t…
A comment on a recent thread about a train IT failure went on a bit of an interesting tangent about ahead-of-time network scheduling in (IIUC) the Netherlands' TURNI system - https://news.ycombinator.com/item?id=30902585
(The whole thread was a bit of a wide-spectrum ramble, as one might expect for a downtime event.)
So you're saying you were actually doing JIT routing as opposed to AOT? The linked system apparently precomputed the tripdriver/conductor schedules overnight. I wonder if they're still using that approach today. It does feel like a JIT approach is much more amenable to handling the unpredictable non-spherical real world (eg electricity issues, track breakage, crashes at crossings, train malfunctions that block tracks (right on junctions >:D), etc).
This sorta thing is definitely beyond my own mental level :) but for reference, how would someone interested get their foot in the door in this area?
Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#127I 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…
Thanks for looking at our docs in light of your problem domain. That's way beyond what I anticipated, and much appreciated! We haven't put a lot more examples into our SDK docs lately since we've been working more on our routing engine and cloud offering. Now we're getting back to more foundational questions like "what should our solver be?" and "how should model formulation work?" Hop started off as a decision diagr…
Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#128Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#129Re: Ask HN: Do you use an optimization solver? Which one? Do you like it?
#130Cf. https://stackoverflow.com/questions/71878354/constraint-prog...
For now, I could not find anything satisfactory, so any recommendation would be most welcome. Otherwise, I guess I'll have to generate a variable for each tuple and use and all_different (e.g. https://cpmpy.readthedocs.io/en/latest/api/expressions/globa... ) on those.