-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constraint programming support #1805
Comments
I've opened PRs to add the first 5 sets, since they are the simplest. There's still some bike shedding to be done. For the next step, I'll add the FlatZinc file format to get things in place. One we have that, we can start some end-to-end tests with a CP solver, and that should flush out any issues before we work on the other 5 sets. |
I've been taking a look at FlatZinc support. it's actually slightly more complicated than it looks, because its effectively MOI without bridges, and each solver supports a different set of constraints. What would be easier to target is MiniZinc, and then have MiniZinc compile down to FlatZinc when passed a particular solver. For example, Chuffed_jll contains a directory of re-definitions, which are equivalent to our bridges. First step is to get libminizinc building: JuliaPackaging/Yggdrasil#4861 |
I now have https://github.com/jump-dev/MiniZinc.jl. This writes the JuMP model into a flattened form of MiniZinc, and we then call out to different solvers. The benefit of this is that it automatically supports all of the solvers that MiniZinc supports, so it works for Chuffed and Gurobi, for example. I have it working locally, but |
Bill says
We could probably add |
Initial support for the sets has been merged, and MiniZinc.jl is being registered: JuliaRegistries/General#62010 |
MILP bridges are largely done. I haven't done Path and Cumulative because they're quite complicated, but Cbc, HiGHS, and Gurobi are all passing tests with the new constraint programming sets! Once #1931 is merged, I'll prep for v1.6.0, and then write a blog post showing off the new goods. |
I've started looking into reified constraints: jump-dev/MiniZinc.jl#13 |
This issue is pretty close to completion. One blocker is deciding whether to add the Reified set. I've added Reified to MiniZinc.jl, but adding to MOI would add a lot more sets, and the reified to MILP bridges are much more complicated. |
This issue is to track support for a limited subset of constraint programming in MOI. At present, we don't envisage MOI having the same scope as MiniZinc, but we want users to be able to write down common constraint programs and solve them using a specialized constraint programming solver, or a MIP solver via bridges.
Background
MathOptInterface
Add new sets to MOI. Definitions taken from: https://www.minizinc.org/doc-2.5.5/en/lib-globals.html
all_different
: Add support for Constraint Programming #1825nvalue
Add CountDistinct set #1826among
Add CountBelongs set #1827at_least
Add CountAtLeast set #1828count_gt
Add CountGreaterThan set #1829bin_packing
Add constraint programming sets #1837path
Add constraint programming sets #1837cumulative
Add constraint programming sets #1837table
Add constraint programming sets #1837circuit
Add constraint programming sets #1837MOI.Bridges
CumulativeAgreed with Bill to not includePathAgreed with Bill to not includeMOI.FileFormats
Add FlatZinc writer. Initial work here: https://github.com/JuliaConstraints/ConstraintProgrammingExtensions.jl/tree/master/src/FlatZincMOI.Test
Solvers
Update solvers to new sets in MOI
The text was updated successfully, but these errors were encountered: