MadNLP / MadNLP.jl

A solver for nonlinear programming
MIT License
164 stars 14 forks source link

Wrong solution in QuickStart example #238

Open haavardhvarnes opened 1 year ago

haavardhvarnes commented 1 year ago

I believe the print of iterations shows wrong results or that the solver does not handle this problem. Objective should end at 306.5

http://www.stfmc.de/fmc/rhs/x/wschfh.shtml?ampl/tp015.mod or https://vanderbei.princeton.edu/ampl/nlmodels/hs/hs015.mod

frapac commented 1 year ago

HS015 is a nonconvex problem, with different local solutions. Most interior-point solvers (Ipopt, Knitro, MadNLP) are converging only locally, without guarantee to find the global solution if the problem is non-convex. That's exactly what we are observing in this example.

The solution with objective 360.4 is also a local solution, albeit not as good as the other local solution with objective 306.5. Usually, one can try to change the initial point in the algorithm to assess if the solver is able to find a different (and potentially better) solution.

This example is also implemented in Knitro, with the same caveat: https://github.com/jump-dev/KNITRO.jl/blob/master/examples/nlp1.jl#L7-L21

To avoid any confusion in the future, I would suggest modifying the starting point to find the other solution (with objective 306.5) and add a discussion about the local nature of any solution. @haavardhvarnes Do you think that would help to clarify?