Closed tso-martin closed 10 months ago
Thanks for reporting @tso-martin. I will have a look at this over the weeekend. I am pretty sure Plasmo.jl just needs to correctly wrap the JuMP callback functions.
Dear Jordan, I made an successful attempt to add lazy constraints via callbacks. Setting the callback attribute requires an attached solver. Since this is only done in the Plasmo override of JuMP.optimize!, I set the callback attribute there. My solution may not be perfect, but maybe you can get some inspiration from https://github.com/tso-martin/Plasmo.jl/commit/3473f46a9205d6c6bc9cae94e74933c8bed2f610.
Hello @tso-martin, thank you for sharing your solution. I ended up using some of your code to get this working. However, I did not need to use the .ext
dictionary in the call to JuMP.optimize!
. Just using set_attribute
seems to work as intended.
This should be supported now by PR #95, but please re-open if the issue persists.
Actually, i made a mistake. The variable index here: https://github.com/plasmo-dev/Plasmo.jl/blob/42f3242182d8492b58bad9de01aba53768b0f11c/src/optigraph.jl#L967-L973 needs to be mapped to the actual graph index. index(x)
returns the node index. I'll fix this and release v0.5.5 shortly after.
Dear @jalving , Thank you for this update. I'll try that out once v0.5.5 is released.
I try to use lazy constraints on a OptiGraph using Gurobi, but unfortunately I get this error:
ERROR: Cannot query MathOptInterface.CallbackVariablePrimal{Gurobi.CallbackData}(Gurobi.CallbackData( sense : minimize ... , Ptr{Nothing} @0x000002be63f18ad0, 4)) from caching optimizer because no optimizer is attached.
The code a ran was this:
Of course, there is currently only one node, but I want to run the OptiGraph with multiple nodes and with PIPS-NLP afterwards. I appreciate your help.