-
Notifications
You must be signed in to change notification settings - Fork 92
[Bridges] fix supports for VariableIndex: Take II #1992
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5176826
[Bridges] fix supports for VariableIndex: Take II
odow 3607535
Add tests
odow 6714c63
More updates
odow 2908acc
Revert
odow 87f87fb
Add comment and broken test
odow c8ffda7
Add another test
odow 83979ff
Fix formattinng
odow b188804
Update bridge_optimizer.jl
odow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Suppose you have a solver that supports
You add variables on creation to S
Then you add a constraint on this vector of variables in T. This is bridged into VAF-in-T.
Here,
is_bridged(b, T)
isfalse
with aLazyBridgeOptimizer
.There are cases in which both might be possible, it depends whether it was constrained on creation or not. In that case,
supports
should returntrue
if one of the two cases istrue
because there is a chance that it is supported.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'm going around in circles. Is there a way to tell if a
VectorOfVariables
was added byadd_constrained_variables
? Not really just from the type, right?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.
So I think we actually have a much bigger issue that means we can't get this right.
The
SingleBridgeOptimizer
tests are failing for things likeflip_sign.jl
, because if you add aVectorOfVariables-in-Nonnegatives
constraint, the solver supports the constraint and the attribute. But if you add constrained variables inNonnegatives
, the solver force bridges (even though the model supports it) and the bridge doesn't support the attribute.But, we can't distinguish whether to return
true
orfalse
, because given a constraint index we don't know whether it was added as a constraint or a constrained variable.Uh oh!
There was an error while loading. Please reload this page.
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.
Exactly, given just the type, you cannot know how all constraint of that type will be dealt with.You need to consider all possible cases and return
true
if at least one case supports itGiven a constraint index you can know that but not given just the types