Skip to content
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

Adding a bridge that needs final_touch bridges in the final_touch of another bridge #1980

Open
blegat opened this issue Aug 12, 2022 · 2 comments
Labels
Submodule: Bridges About the Bridges submodule
Milestone

Comments

@blegat
Copy link
Member

blegat commented Aug 12, 2022

If a bridge adds a constraint that needs a bridge that need_final_touch then it will modify the needs_final_touch being iterated over

# Function barrier to iterate over bridges of the same type in an efficient way.
function _final_touch(bridges, model)
for bridge in bridges
MOI.Bridges.final_touch(bridge, model)
end
return
end
function MOI.Bridges.final_touch(map::Map, model::MOI.ModelLike)
for bridges in values(map.needs_final_touch)
_final_touch(bridges, model)
end
return
end

In that case, we might not call final_touch on that bridge.

@blegat blegat changed the title Ddding need_final_touch bridges in final_touch Ddding a bridge that needs final_touch bridges in the final_touch of another bridge Aug 12, 2022
@blegat blegat changed the title Ddding a bridge that needs final_touch bridges in the final_touch of another bridge Adding a bridge that needs final_touch bridges in the final_touch of another bridge Aug 12, 2022
@odow
Copy link
Member

odow commented Aug 12, 2022

Is there an example of this?

@odow odow added this to the v1.x milestone Sep 13, 2022
@odow odow added the Submodule: Bridges About the Bridges submodule label May 9, 2023
@odow
Copy link
Member

odow commented Nov 12, 2023

So we nearly had an example of this with #2316. I started to add SOSToMILP but then the IndicatorToSOS bridge would enable Indicator to MILP, except that IndicatorToSOS does not add variable bounds, so it would error.

To fix, we'd need a final_touch in IndicatorToSOS to update the final bounds on the slack variable, and then the usual final touch in SOSToMILP. So we'd have to touch IndicatorToSOS before touching SOSToMILP.

This will require a DAG of final_touch rather than the Set that we currently use, but it might be sufficient to just use a vector ordered by creation date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Submodule: Bridges About the Bridges submodule
Development

No branches or pull requests

2 participants