Live data from Hacker News

MiniZinc

minizinc.org

51–60 of 76 posts

Re: MiniZinc

#51
I used MiniZinc extensively in my previous position, and have mixed feelings about it. As is stated in other comments, it works very well for specific small problems, but when the model gets complex it can become unwieldy.

We used it to create models of networked biological systems (e.g. the immune system, gene regulatory networks, etc.). The network topology was constructed from mined academic literature and then the model was constrained using data. The great thing about using MiniZinc was that it could propose multiple models with the same or similar “accuracy” to the data. You would then have an ensemble of models from which to make predictions (i.e. how does a drug affect the system).

We would have MiniZinc files that were 10s or 100s of MBs and would run for days. Sometimes they would be unsatisfiable within a few seconds, other times within hours. Many of the solvers are single threaded, and those that are multithreaded don’t seem to be much more efficient with more cores.

MiniZinc is very difficult to debug and the paradigm shift can be jarring coming from procedural languages. However, I am grateful it exists and for the work that many have put into it. Similar to the train yard comment, we used Python to construct the MiniZinc models and then submitted them to the solvers via the minizinc-python package which is well written and meek maintained.

Re: MiniZinc

#52
These things look neat! I can tell, being in the engineering industry for 20+ years that there's a lot of excitement and progress happening.

One thing I really wish there was more of though, was motivating examples that make sense in my world.

The comment "I used minizinc to try and generate levels for my puzzle game by encoding the rules." is a decent example.

I'll believe that sat-solvers are getting better and should be used more, but I feel there's a real dearth of motivating examples for those of us who live, eat, breathe and have no problem with the C/C++/systems engineering/high performance stuff. :)

edit:

Basically, I want a few dozen well written examples of things like (starting from "Solving Sudoku with SAT"):

https://codingnest.com/modern-sat-solvers-fast-neat-underuse...

It seems a significant amount of cleverness is required to model rules as the equations, before passing them off to the solver.

(also: https://news.ycombinator.com/item?id=36087464)

Re: MiniZinc

#53
Whenever MiniZinc, or constraint programming, comes up, I post this link to a programming challenge a friend gave me...14 years ago. I was learning J, and the challenge was me in J, her in javascript or php (she never completed the solution). Here's the link: https://gcanyon.wordpress.com/2009/10/28/a-programming-puzzl...

And a person I didn't know posted a solution using MiniZinc. That person happens to also be on HN, so whenever constraint programming comes up, or MiniZinc, I post this story, and Hakan shows up. You around, Hakan? :-)

Here's Hakan's page on the solution: http://www.hakank.org/minizinc/einav_puzzle.mzn

Re: MiniZinc

#54
post #53

Whenever MiniZinc, or constraint programming, comes up, I post this link to a programming challenge a friend gave me...14 years ago. I was learning J, and the challenge was me in J, her in javascript or php (she never completed the solution). Here's the link: https://gcanyon.wordpress.com/2009/10/28/a-programming-puzzl... And a person I didn't know posted a solution using MiniZinc. That person happens to also be on H…

Hakan’s examples have illustrated so many constraint programming principles, his site is a wealth of knowledge!

For the comments referring to examples more complex than Sudoku, his website is the best that I have found! Thanks Hakan.

Re: MiniZinc

#55
Constraint programming with MiniZinc is great for some problems. There is a good Coursera class on MiniZinc. I also had a simple Python+MiniZinc example in my last Python book.

Re: MiniZinc

#56
post #43

Earlier quoted context omitted.

Can LLM help in this task?

Seems like no? I mean, they are great in getting some text that looks correct but is an hallucination. LLM can help in getting something roughly ok, that a human can fix. This doesn't seem to be the case here.

Translating is the thing that GPT is best at. Hallucination is much less of a problem here because you’re dealing with a whole language, not a ton of libraries with different APIs.

Re: MiniZinc

#57
post #4

What exactly is "constraint modeling" and what is it used for?

Scheduling is probably the most obvious example of a real problem. You’ve got a space that has many different ways of being bounded and need to efficiently search that space. Physical design systems (modeling possible boat hulls, say—not the physics itself but the interaction of numerous variables) and resource allocation (drafting a baseball team, say) seem like other likely areas, though I’ve got no idea if constra…

I've wanted to do this myself... Tho as both an armchair engineer and an armchair programmer. If I'd gotten through engineering in university, (and studied programming language design) this would be an utterly tempting idea for me to try. I must have come back to thinking about doing this ten times in the last fifteen years or so. Off the top of my head, scientific models also sound like they might fit with constraint modelling, tho I might be far too superficial in my understanding of both subjects there.

Re: MiniZinc

#58

I can recommend this course and its sequels on Coursera to anyone interested in learning MiniZinc: https://www.coursera.org/learn/basic-modeling I enjoyed the courses and learning the techniques through the exercises but I still haven't really found a good application to a problem I need to solve for work or side projects.

Yes, the best online courses I have ever taken: entertaining and challenging in equal measure.

I then used MiniZinc to solve a resource allocation problem for two large border checkpoints, assigning staff across lanes for multiple transit types (motorcycle, car, truck, bus and train).

Re: MiniZinc

#59
post #14

Earlier quoted context omitted.

Is that a minizinc thing or a solver thing in general?

https://en.wikipedia.org/wiki/Variety_(cybernetics) key takeaway: Boisot and McKelvey updated this law to the "law of requisite complexity", that holds that, in order to be efficaciously adaptive, the internal complexity of a system must match the external complexity it confronts.

“Inner platform effect”

Re: MiniZinc

#60
post #53

Whenever MiniZinc, or constraint programming, comes up, I post this link to a programming challenge a friend gave me...14 years ago. I was learning J, and the challenge was me in J, her in javascript or php (she never completed the solution). Here's the link: https://gcanyon.wordpress.com/2009/10/28/a-programming-puzzl... And a person I didn't know posted a solution using MiniZinc. That person happens to also be on H…

> You around, Hakan? :-)

Of course! :-)

Post reply on HN