Skip to content
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

Use this package more generally? #7

Open
dourouc05 opened this issue Mar 4, 2021 · 6 comments
Open

Use this package more generally? #7

dourouc05 opened this issue Mar 4, 2021 · 6 comments

Comments

@dourouc05
Copy link
Member

This package started with jump-dev/JuMP.jl#2227. Its goal is to be the official extension to MOI for constraint programming. It is now in a useable state, and allows to wrap most of the CPLEX CP Optimizer solver: it should be relatively stable, except for new features (unlike the first versions, which broke compatibility every now and then).

In the Julia ecosystem, there are two other packages for constraint programming, but they focus on solving problems: https://github.com/Wikunia/ConstraintSolver.jl and https://github.com/JuliaConstraints. For now, these packages have different MOI sets to represent the same constraints. The goal of the present package is to provide these MOI sets, so that users can easily switch from one solver to another (and to ease writing new solvers/wrappers for existing solvers). It may be integrated into MOI in the future.

I mapped the constraints supported in each package to those in CP: ConstraintSolver.jl and JuliaConstraints.

@Wikunia @Azzaare Is there anything missing in this package? Would you have designed things differently? Would you be ready to use this package as a dependency for your own solvers (instead of your custom sets), until it migrates into MOI?

@Azzaare
Copy link
Member

Azzaare commented Mar 5, 2021

Hi @dourouc05

Sorry, I have been quite busy, so I will try an extensive answer later.

The answer is yes on principle, even though I would need to check the exact implications (for instance are the involved packages all registered etc).

We have a Constraint Programming stream on julia's Zulip btw.
There is also an incoming new CP solver in Julia called SeaPearl.jl. one of the author is also on Zulip.

Talk to you soon (we can schedule an online meeting to make things smoother too).

@Wikunia
Copy link

Wikunia commented Mar 5, 2021

Hi @dourouc05
thanks for the package!
I have one question by skimming through it. Do you support x in AllDifferent() or just x in AllDifferent(5) so does one need to fill in the dimension as a user?

@dourouc05
Copy link
Member Author

@Azzaare Regarding dependencies, this package only depends on MOI, and it is also registered. (Unlike CPLEXCP, a wrapper for CPLEX CP Optimizer, which has heavier dependencies…)

Thanks for pointing at Zulip, I didn't know it existed! (And I now subscribed, of course!)

For meeting, we could have a BoF or equivalent at JuliaCon or the next JuMP workshop?

@Wikunia MOI forces you to implement MOI.dimension, so that the dimension must be stored in the set, like Zeros or Nonnegatives (although I don't know the whole set of consequences if you don't). At the very least, I'm using it in some sets like reification or conditions in order to parse the set of variables (e.g., for reification, the first variable is a binary and the rest is the constraint being reified). If there is no dimension, then it's not possible to parse things like conditions (if AllDifferent(4) then AllDifferent(3) else AllDifferent(2), for instance).

@Azzaare
Copy link
Member

Azzaare commented Mar 8, 2021

Thanks @dourouc05

If it registered I am fine with it. We were considering BoF, but we have little time left to submit ... I will try to have a better look at BoF submissions. It should not be too complicated.

As for the dimension related thing, there is a workaround that was given to me on JuMP-dev (@odow I think), which allows us to skip the dimension in JuMP syntax (but not in MOI). For my solver, providing the dimension is just extra noise.

What about making the dimension optional?

@odow
Copy link
Contributor

odow commented Mar 9, 2021

At the MOI level, you should explicitly state the dimension. We can make nicer syntax at the JuMP level
https://github.com/jump-dev/JuMP.jl/blob/3ba8d43527534492e904e79cc74732e5e265441c/src/sets.jl#L15-L39

@Azzaare
Copy link
Member

Azzaare commented Jun 1, 2021

Hi there!
I think I more or less completed the basic interface I wanted with JuMP. I think the solver framework in JuliaConstraints is ready to step forward with ConstraintProgrammingExtensions.jl and more.
All my code interfacing MOI (and JuMP) is in https://github.com/JuliaConstraints/CBLS.jl

Also, there is a new kid in town with https://github.com/corail-research/SeaPearl.jl
It seems they have a JuMP interface too.

It seems we have some critical mass. Should we try to have some meeting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants