Constraint programming with MiniZinc and Phoenix/LiveView

Hello everyone,

For the last few months, I’ve been working on Solverl, Erlang/Elixir interface to MiniZinc and a supplemental project, SolverView,
which is a web application based on Phoenix/LiveView.

MiniZinc is a generic framework for solving optimization problems typical for Operations Research.
IBM CPLEX,
Google OR-Tools and many other popular OR products have an interface to MiniZinc.

So having Elixir interface to MiniZinc opens up a gateway to industrial-strength optimization tools.

But there is more. Currently, MiniZinc team hosts MiniZinc Python project, the idea is to assist
the solving of complex OR problems through incremental solving techniques driven by the Python code .

Spending quite a bit of time with MiniZinc Python, I’m confident that the similar Elixir-based product will be a much better option. This is mainly due to better asynchronicity/concurrency support.

Solverl already matches the most significant features of MiniZinc Python, and some Solverl features are not available in MiniZinc Python.

SolverView was started as a set of examples that visualize the solving process using Phoenix/LiveView.

You can try it by using Docker image:

docker run -p 4000:4000 bokner/solverview

I have several plans for extending it, one is to build Web IDE for MiniZinc,
with pluggable Elixir components for visualization, post-processing of solutions etc.

I’m very new to Phoenix/LiveView, and web design is not my thing yet, so any advice and/or contribution would help tremendously.
In particular, if anyone is willing to help with Web IDE pages, please let me know.

10 Likes

The readme for solverl seems impressively thorough! I currently don’t have a use for constraint programming, but kinda wish I did. :slight_smile: LiveVue is perfect for this sort of program.

3 Likes

Thank you! Normally, I’m not that thorough with documenting. In this case though, I was motivated by minizinc-python docs, and desire to make Elixir counterpart better :slight_smile:

I only came to Constraint Programming recently as part of my math program studies. It’s very addictive, especially if blended with coding.

1 Like

Just seen this. I’ve been working with constraint solving with OR-Tools in Ruby and never heard of MiniZinc which seems quite interesting in itself. So this is nice thing to start working on in the morning.

OR-Tools can be configured as a MiniZinc solver. One of the nice things about MiniZinc is that one can try the same model with different solvers.

Wonderful. Despite being a relative veteran I’m finding constraint solving in itself quite mind bending and difficult to explain the process to colleagues given that it’s new to me, so finding a way of focusing in on how to document and solve the problems we’re working on is pretty challenging. Not to mention the multitude of examples in Python which then add their own flavour of unfamiliar (to me) syntax. Thanks for your work on this.