-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Is there an element constraint? #195
Comments
Thanks for opening the issue. Unfortunately there isn't yet. For your example I could create own the next week which would look like this:
or something like that. Writing it like you is currently out of reach as one would need to rewrite JuMP by quite a bit I think. My way is very ugly which is somewhat the reason why I haven't implemented it yet. Additionally it would limit it quite a bit such that you would be able to write If you have any idea of a better syntax please let me know. Something like In the long run I'll try to add:
but that's currently out of reach. |
Let me see. Maybe I can even support the nice syntax with some of this: https://github.com/dourouc05/JuCP.jl/blob/master/src/sets.jl Will get back to you in a week 😄 |
It would be really great if you support The other CP systems has variants are something like (Regarding reification/indicator I will get back with some questions/comments later.) |
FYI: Here's an decomposition of
It works - for example with this Langford model. As other decompositions, it might not scale well...
|
The first step is done with #213 but it currently only works for constant arrays so your example isn't working yet. |
Great progress, Ole! |
I tried the following model which tests the
x[ix]
construct wherex
is an a array of decisions variables andix
is a decision variable, The constraint@constraint(m, x[ix] == ix)
yield the errorArgumentError: invalid index: ix of type VariableRef
.Is there some way of doing an element constraint, or a plan to implement this? (In traditional constraint programming the element constraint is a quite important constraint.)
Here's a simple model testing this:
The text was updated successfully, but these errors were encountered: