Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
indicator to SOS bridge #877
indicator to SOS bridge #877
Changes from 5 commits
7506209
bf829d9
f4a32ef
11f5032
b2be67d
62ae22b
94665e7
23fd06b
3e54c05
32e2493
fc3102d
4fd52d6
c5b0b2f
2946115
3a6a676
32d7baa
cb78e29
de49ca4
89ff760
c753d2f
91a4c0a
6813017
2cf8729
8995b14
08fc80f
e35ffd1
7a8cd2f
f7c2e85
a01b091
2fb4b59
3603585
007e23e
970d801
7938dd5
4d4a8f0
9a7aaca
dbe41e2
0c8ad66
ec89295
5d3ab8c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not always add a free
w
so that it works for any indicator constraint (alsoMOI.Interval
, ...) ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a
free
fallback with all constraints butLessThan
,GreaterThan
, otherwise we add a free, which has to be re-bounded by two variables forLP
&MILP
solversThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understood "which has to be re-bounded by two variables"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry yes, if we create the variable
w
free, it will be replaced byw+ >= 0, w- >= 0, w = w+ + w-
instead of creating a boundedw
right awayThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also the case for SDP solvers with the
Variable.FreeBridge
. Which LP solver does not support free variables ? This transformation is done internally ?For a solver supporting free variables such constraints may increase the size of the problem, we should probably have informative constraints but that's out of the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All solvers (that I am aware of) support free variables, but the transformation needs to be done internally somehow. The simplex algorithm does require positive variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use the standard form you have equality constraints and nonnegative variables but then the dual has free variables. Some solvers might solve the dual using the simplex in which case they need all variables to be free. Although that's the textbook simplex so I don't know whether solvers might use a more sophisticated one supporting mixing free and non-free ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the standard form is a form
A x <= b, x >= 0
transformed inAx + s = b, x, s >= 0
. You need to have basic columns in the equality, so starting from a genericA x = b
, it will need to change the variable system in[A; -A] x <= [b; -b]
and then add slacks, in order to have as many basic columns as constraints.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also have a test with
basic_constraint_test
(see #750) and a test againstindicator1
,indicator2
orindicator3
(https://github.com/JuliaOpt/MathOptInterface.jl/blob/98a0e472e1757db14b849bbba8fe84597856def2/src/Test/intlinear.jl#L609-L611) withtest_model_equals
(see #820)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manage to make that work (yet)