MathOptInterface.jl icon indicating copy to clipboard operation
MathOptInterface.jl copied to clipboard

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

Open blegat opened this issue 3 years ago • 2 comments

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 https://github.com/jump-dev/MathOptInterface.jl/blob/95a73a074c08a2e46820cae4a6522b34de6bb460/src/Bridges/Constraint/map.jl#L321-L334 In that case, we might not call final_touch on that bridge.

blegat avatar Aug 12 '22 09:08 blegat

Is there an example of this?

odow avatar Aug 12 '22 21:08 odow

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?

odow avatar Nov 12 '23 22:11 odow