nlopt
nlopt copied to clipboard
Optimize throws "nlopt failure"
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!
Did you come to a conclusion on this?
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.
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.