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

Expose the DIRECT algorithm from NLopt #356

Open
Tomalwo opened this issue Oct 17, 2019 · 11 comments
Open

Expose the DIRECT algorithm from NLopt #356

Tomalwo opened this issue Oct 17, 2019 · 11 comments

Comments

@Tomalwo
Copy link

Tomalwo commented Oct 17, 2019

It would the great to expose the DIRECT algorithm that is available in NLopt.

@darioizzo
Copy link
Member

darioizzo commented Oct 17, 2019

This is related to #72. I do not remember why DIRECT was not exposed back then when @bluescarni made the nlopt wrappers maybe the version of NLOP we were using did not include it? Or some other, more fundamental reason?

In any case if its possible it should not be too difficult, but we are currently busy with other various requests and improvements, so any help on this one would be appreciated, even if to just tell us that its not possible for some reason ....

@bluescarni
Copy link
Member

When we first wrote the NLopt wrappers the idea was to focus on the local optimisation capabilities. At the time, NLopt had only a few global optimisation algorithms, but it looks like they added more in recent versions.

As @darioizzo puts it, it should not be too difficult to extend the NLopt wrappers to enable the use of the global optimisation algorithms (I believe there is a bullet point about this in #72). We'll get there eventually, but we don't have an ETA at the moment.

@bluescarni
Copy link
Member

I took a quick look at the NLopt API. One possible inconvenience is that the stochastic global optimisation algorithms seemingly force the random generation of the initial population, and thus there seems to be no way to tell NLopt to use pagmo's population data instead.

https://nlopt.readthedocs.io/en/latest/NLopt_Reference/#stochastic-population

@darioizzo
Copy link
Member

Thats bad, it would destroy the whole "island / migration" stuff. And also the logic of it all ....

@bluescarni
Copy link
Member

To be clear, it's not all the global optimisation algorithms that have this behaviour, only some of them. So perhaps the compromise here is to wrap only those who let us use our initial population data.

@Tomalwo
Copy link
Author

Tomalwo commented Oct 18, 2019

One possible inconvenience is that the stochastic global optimisation algorithms seemingly force the random generation of the initial population, and thus there seems to be no way to tell NLopt to use pagmo's population data instead.

If I'm not wrong, the DIRECT algorithm is deterministic, so it wouldn't be an issue for that particular algorithm. (It would be for others though, e.g., CRS2.)

@darioizzo
Copy link
Member

Why would in not be an issue? Even if deterministic it depends on an initial population right? Or its solution depends ony on the problem domain and not on an initial guess?

@Tomalwo
Copy link
Author

Tomalwo commented Oct 18, 2019 via email

@darioizzo
Copy link
Member

Ok then indeed its possible and relatively easy to add. It is not an algorithm in the spirit of the island model, nor of migration etc.. So its main use would be on a single thread / process via pop = direct.evolve(pop). But as long as we explicitly document this I am fine with it.

@darioizzo
Copy link
Member

Also, if I remember correctly, DIRECT can take quite some time to complete .... so its probably good to check how to stop it or how to log its progress ....

@Tomalwo
Copy link
Author

Tomalwo commented Oct 18, 2019 via email

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

No branches or pull requests

3 participants