Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COBYLA hangs #118

Open
bluescarni opened this issue Apr 8, 2017 · 8 comments
Open

COBYLA hangs #118

bluescarni opened this issue Apr 8, 2017 · 8 comments

Comments

@bluescarni
Copy link

bluescarni commented Apr 8, 2017

COBYLA seems to hang on the following code:

https://gist.github.com/bluescarni/bdb1981c80966ebae5d92551b605347d

Compilation command line, on 64bit linux GCC 6.3 and NLopt 2.4.2:

g++ -std=c++11 -O2 -DNDEBUG file.cpp -lnlopt -march=native

If the dimension of the problem is changed, from 150, to 149 or 151, the optimisation does not hang. If the dimension is 150, the optimisation seems to hang after ~170 objfun/constraint evaluations (strangely enough, the exact number is 171 on my Gentoo linux installation, and 175 on my Arch linux installation).

The optimisation problem is No. 5.1. from Luksan, L., and Jan Vlcek. “Sparse and partially separable test problems for unconstrained and equality constrained optimization”. It has only equality constraints.

http://folk.uib.no/ssu029/Pdf_file/Luksan99.ps

@ericjster
Copy link

For what it is worth, using NLOPT_AUGLAG with the local solver NLOPT_LN_NEWUOA or NLOPT_LN_BOBYQA, can solve this problem in about 28000 evaluations, in about 90 seconds on my machine, with ftol_rel = ftol_abs = 1e-6. I only mention this as a fellow user, if it might help to work around the infinite loop in COBYLA.

@bluescarni
Copy link
Author

@ericjster Thanks for the pointer! I thought it might be somehow related to the equality constraints as, as far as I understand, those are not handled by the original COBYLA algorithm...

@bluescarni
Copy link
Author

@ericjster btw, shameless plug, but if you might find our project pagmo interesting:

https://github.com/esa/pagmo2

I was writing the NLopt wrappers for pagmo when I ran into this issue.

@ericjster
Copy link

ericjster commented Apr 10, 2017 via email

@virtmax
Copy link

virtmax commented Feb 17, 2018

Are there any plans to eliminate this bug?

@jschueller
Copy link
Collaborator

jschueller commented Feb 17, 2018

Not that I know.
There are some nans at some point propagating, for example in the z__ variable.

@jschueller
Copy link
Collaborator

Found it at line 1428 of cobyla.cn both sp and temp are 0.

1428          alpha = sp / temp;

Add this in your main and run gdb:

#include <fenv.h>

int main ()
feenableexcept(FE_INVALID | FE_OVERFLOW);

@aphirst
Copy link

aphirst commented Mar 19, 2018

Out of curiosity, is this division by zero also expected to cause issues if solving the same system reimplemented in a different language? (If I have time this evening, I'll attempt a rewrite in Fortran.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants