nlopt icon indicating copy to clipboard operation
nlopt copied to clipboard

Optimize throws "nlopt failure"

Open antoine-bussy opened this issue 4 years ago • 3 comments

Hi,

I am currently using Nlopt in C++ for a path planning algorithm with collision constraints. It works great with a fair amount of constraints, but when I try to scale it up to 100k+ constraints, a "nlopt failure" is thrown by the optimize method.

I have an option to check my gradient computations against the numeric gradients, and they are equal to 1e-5.

I am currently using the nlopt::AUGLAG optimizer with nlopt::LD_VAR1 as the local optimizer, as it seemed to work better for my problem.

Is there a limitation on the number of constraints ? If not, how can I make the solver work for my problem ?

Thanks!

antoine-bussy avatar Jun 23 '20 14:06 antoine-bussy

Did you come to a conclusion on this?

LivelyLiz avatar Dec 16 '20 13:12 LivelyLiz

It would be good to diagnose where NLOPT_FAILURE is being returned. I don't see anything in the AUGLAG code that can return that error, so might be from the local optimizer. Is it from this line or this line or this line? You might have to use a debugger or insert some printf statements to trace the location and find the return code that leads to the problem.

stevengj avatar Dec 17 '20 03:12 stevengj

Not really. I have only an intuition about what was happening.

In my problem, the initialisation of the state was violating constraints. The more constraints I added, the more difficult it was for the solver to find a solution, hence the error I guess. In some cases, I was even feeding the solver with a problem with no solution, with the same result. Relaxing the constraints a bit helped.

antoine-bussy avatar Dec 20 '20 16:12 antoine-bussy