Optim.jl
Optim.jl copied to clipboard
JuMP Interface, Incorrect Status Returned
There seems to be an issue when using Optim as a solver for JuMP in a constrained optimization setting.
If the algorithm terminates but does not satisfy the constraints it currently returns,
termination_statusofLOCALLY_SOLVEDprimal statusofFEASIBLE_POINT
Per this guide, https://jump.dev/MathOptInterface.jl/stable/manual/solutions/#Local-search-solvers
In this situation it should probably return,
termination_statusofLOCALLY_INFEASIBLEprimal statusofINFEASIBLE_POINT
The issue can be reproduced by running this example, https://github.com/lanl-ansi/rosetta-opf/blob/main/debug/optim-jump.jl
CC @blegat
Thanks for reporting it!
We are assuming that converged means LOCALLY_SOLVED:
https://github.com/JuliaNLSolvers/Optim.jl/blob/1a649e885c887e84043a48c013130d1a1bdc7ab1/src/MOI_wrapper.jl#L337-L338
Is this an incorrect assumption or should converged be false here ?
I am surely not on expert in Optim but based on my brief experience using it, I suspect this function should look something like,
if converged,
check if the constraints are satisfied up to the prescribed tolerance
if yes return `LOCALLY_SOLVED` otherwise return `LOCALLY_INFEASIBLE`
Is it possible to give a reproducer here? Then it'd be a bit easier to look into.
It's not a steam lined example but this code can be used to reproduce,
The issue can be reproduced by running this example, https://github.com/lanl-ansi/rosetta-opf/blob/main/debug/optim-jump.jl