JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.12k stars 217 forks source link

JuMP Interface, Incorrect Status Returned #1068

Open ccoffrin opened 8 months ago

ccoffrin commented 8 months ago

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,

Per this guide, https://jump.dev/MathOptInterface.jl/stable/manual/solutions/#Local-search-solvers

In this situation it should probably return,

The issue can be reproduced by running this example, https://github.com/lanl-ansi/rosetta-opf/blob/main/debug/optim-jump.jl

CC @blegat

pkofod commented 8 months ago

Thanks for reporting it!

blegat commented 8 months ago

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 ?

ccoffrin commented 8 months ago

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`
pkofod commented 8 months ago

Is it possible to give a reproducer here? Then it'd be a bit easier to look into.

ccoffrin commented 8 months ago

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