-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
MixedIntegerLinearProgram.add_constraint: Option to return row indices, fix handling of empty constraints #34878
Comments
Author: Matthias Koeppe |
comment:2
Doctests need adjusting because of the extra output New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:8
I'm sorry to comment late. I have two (quite orthogonal) suggestions:
|
comment:9
That would be fine with me. Do you want to push a branch that does this? |
comment:10
Yes, I can do this. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
Please review! In particular, whether
is correct, i.e., there are currently no backends that do anything bad. |
Reviewer: Martin Rubey, Matthias Koeppe |
Changed author from Matthias Koeppe to Matthias Koeppe, Martin Rubey |
comment:17
LGTM, thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:20
Thank you! Actually, it would be practical if the following too would also work, don't you think (Ideally also with If you agree, it won't be hard to fix. I don't know whether one can add these as constraints to all backends, but we could simply ignore the first and raise a This would make (my) user code much more readable.
|
comment:21
You probably mean |
comment:22
It would be OK with me for
|
comment:23
Oh, thanks, yes, you are right. Here we currently have
|
comment:24
"trivial constraint starting with" is, of course, ridiculous wording. We should revise this. |
comment:25
I am away for a few hours now :-) |
comment:26
I've opened #34882 for this. |
comment:27
Thanks! However, I think the other two are bugs and should be fixed here. |
comment:28
Which two? |
comment:29
Note that there's the coercion route bool -> int -> ZZ |
comment:30
because it is actually not adding a constraint. |
comment:31
that's bool -> int -> ZZ -> linear_function_parent -> linear_constraints_parent, not a bug |
comment:32
-> #34882 |
comment:33
The problem is that for The following does work (also for GLPK):
I am not sure how reliable this is. Also, shouldn't the max be shown? |
comment:34
Ah, sorry, now I see. Sorry. |
comment:35
I agree that changing the display of the empty linear form in " <= -1.0" to 0 would be an improvement |
comment:36
So actually we should also try to do something sensible with |
Changed branch from u/mantepse/mixedintegerlinearprogram_add_constraint__return_row_index to |
(from #21003 comment:136)
... for use with methods that take row indices as input, such as
row
,row_bounds
,remove_constraint
.If a backend does not map a constraint to a unique new row (or
check_redundant=True
and the constraint is discarded by the frontend), the method may returnNone
.We also fix a longstanding bug in how empty constraints are handled in
add_constraint
.The changed interface (an optional return value) is backward-compatible with user code.
We also add a Feature CVXOPT so that the backend gets tested again.
CC: @mantepse @dimpase
Component: linear programming
Author: Matthias Koeppe, Martin Rubey
Branch/Commit:
3b929f8
Reviewer: Martin Rubey, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/34878
The text was updated successfully, but these errors were encountered: