-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support of JuMP anonymous constraints/variables #553
Comments
Hi, the model looks ok, so Coluna may have a bug. I'll check as soon as possible. |
Thanks for the report. When a constraint is unamed, BlockDecomposition does not send the annotation of the constraint to Coluna. As a result, Coluna does not know to which subproblem the constraint belongs and ignore it. A fix would be to assign to the master constraints or variables that are unamed. However, It seems possible to create anonymous constraints and variables that use an axis e.g. : c = @constraint(model, [Axis], ....) (you do that in your comment). If you name your constraint : @constraint(model, name, sum(x[i] for i in S) <= 1) it works. |
Thanks, this seems to work with named constraints |
It would be cool to support anonymous objects, especially for constraints, where names are not very useful. Naming constraints is easy when the constraints can be written in vectorized style, but it is harder when it gets more complicated. I'm not fluent in JuMP, MOI or Coluna internals, but I took a look at the source code, and the pitfall seems to be in this file: the objects are gathered via vars = all_variables(model)
for con_type in list_of_constraint_types(model)
cons = all_constraints(model, con_type...)
end Maybe filtering some constraint types... |
Ah, it's harder than I thought, |
Yes you found the pitfall. I didn't find any access to JuMP objects that contain anonymous variables or constraints from the JuMP model. I didn't try to go down to MOI because I think we loose the indices provided by the user (they are necessary to annotate & then perform the decomposition). I think you can access these JuMP objects only from the Julia variable you declare in the scope where you define the model. If this assumption is true, we must forbid anonymous vars & constrs. |
I didn't know these methods. Yes, we need JuMP containers (I called them JuMP objects in my previous message). |
Hi, I have some troubles with Coluna. Here is a MWE of my problem. I create two sub-problems
S1
containingx[1]
andS2
containingx[2]
, with the masterx[1] + x[2] <= 1
. (the sub-problems are not constrained, I put a more complex example in commented lines). The optimal solution returned is2
, whereas1
is expected.What am I doing wrong ?
The text was updated successfully, but these errors were encountered: