4 ms·
Can someone explain why I would use this instead of Python + Pulp or Pyomo, or Julia + JuMP.
by 3rdAccount 8y ago
Can someone explain why I would use this instead of Python + Pulp or Pyomo, or Julia + JuMP.
- timClicks 8y agoPerhaps MiniZinc can be used in areas where linear programming is unable to model?
- bigger_cheese 8y agoI know my Work uses something called an SQP Solver (Sequential Quadratic Programming) for our nonlinear stuff I'm not sure how that compares.
- cerved 8y agoI don't know anything about those but Minizinc allows you to write one model that compiles to a SAT solver, MIP solver, CP solver, CBLS solver etc. Which is neat.
- wenc 8y agoI was going to write something but this answers your question. [1] pulp and jump only model mixed integer programs, if I’m not mistaken. However when I looked at this some years ago, I came across journal publications that found mixed integer program (MIP) solvers to be much faster than constraint solvers for many problems. I suspect that this was because MIP theory was much more well developed at the time and that commercial interests (airline scheduling, oil and gas, etc.) were driving impressive improvements in MIP solver technology (dominant players are IBM CPLEX, Gurobi and Xpress), whereas constraint programming remained more or less a niche domain in computer science. [1] https://www.solver.com/integer-constraint-programming https://www.solver.com/integer-constraint-programming
- 3rdAccount 8y agoPulp and Jump are interfaces to CBC, GUROBI, CPLEX, XPRESS...etc. They can do LP, MIP, IP, and Nonlinear optimization to a degree. These are used for massive scale optimization problems as you've indicated. When I look at constraint programming, it looks usable only for problems of a small fraction of my model's size I guess. It looks like the flatzinc language that minizinc compiles to has an interface to GUROBI, CPLEX, & CBC. So at least it can be used as a modeling language. Btw...Picat looks like it has similarities to Minizinc.
- wenc 8y ago> Pulp and Jump are interfaces to CBC, GUROBI, CPLEX, XPRESS Right, which is different from MiniZinc. But to answer your original question "Can someone explain why I would use this instead of Python + Pulp or Pyomo, or Julia + JuMP", I don't think Pulp and Jump can handle constraint programming explicitly unless you reformulate the CP as an MIP or similar. As you alluded to, this is Minizinc's advantage -- it's a modeling language specifically for CPs, which Pulp and Jump are not. Despite the mathematical equivalencies, CP folks model stuff a little differently from MIP folks (modeling is more convoluted for MIPs). To expand, Pulp and Jmp write out .nl files (AMPL binary format for optimization), which is a standard format for many optimization solvers. I don't know much about flatzinc, but due to a subset of mathematical equivalencies, I imagine the interfaces are able to translate to .nl, in which case, any number of optimization solvers can be deployed. However, the converse doesn't seem to be true -- I don't think models written in Pulp and Jmp can call CP solvers (not sure if there's an .nl subset to flatzinc interface).
- 3rdAccount 8y agoThank you for the explanation. Any idea why one would choose to use CP over an LP, IP, or MIP solver? Maybe some CP problems can't be translated? I'm not sure what the mathematical relationship is.
- wenc 8y agoMost MIP solvers contain performance heuristics tailored to MIP metaphors. If you're using translation, some CPs could translate into MIP formulations that MIP-solvers happen to not handle that well (these are theoretical worst-case exponential problems, and you can't know a priori if your solver is going to hit the worst case; MIP solvers are fast in general but there's a measure of luck involved in the solution process -- anyone who does discrete optimization for a living knows this). You're also at the mercy of the translation algorithm, which may not possess a library of the most efficient MIP formulations. Furthermore, MIP modeling is an art which takes years to hone (less so today than when I started -- algorithms are getting more and more sophisticated -- but nevertheless, it takes human reasoning and intuition to produce a good formulation). It's always useful have a range of solvers at your disposal and not limit yourself. CP solvers are specialized to CP problems and for simple problems they may work better due to less translation overhead.