NiaOrg / NiaPy

Python microframework for building nature-inspired algorithms. Official docs: https://niapy.org
https://niapy.org
MIT License
255 stars 77 forks source link

It is neither a bug report nor a feature request. But an inquiry into CS algorithm. #505

Open dg-pb opened 2 months ago

dg-pb commented 2 months ago

The following papers: pap [Yang, Deb] Engineering Optimisation by Cuckoo Search 2009 pap [Yang, Deb] Cuckoo Search via Levy Flights 2009

Provide results which I am not able to reproduce.

To be specific: The table suggests that CS algorithm finds "Ackley's (d=128)" global optimum in 4936 ± 903(100%) function evaluations. I have can not reproduce it and libraries I have tested (including this one) doesn't seem to be able to reproduce it either.

Am I missing something? Maybe my interpretation is wrong? I read it as Ackley's function with 128 dimensions.

Maybe there is a certain parameter set to achieve this?

Any help here would be much appreciated.

firefly-cpp commented 2 months ago

Thanks. If I remember correctly, the original conference paper proposing CS was accompanied by Matlab source code, which may still live on the following link.

Please also try this original implementation and let us know if there is a chance to reproduce the results.

dg-pb commented 2 months ago

I am a bit confused to be honest. Easom's function is 2d and it takes 6751 ± 1902(100%) evaluations. Now they claim that Ackley’s (d=128) is 4936 ± 903(100%). So 126 more dimensions and the function does seem to be more complex and it takes less evaluations.

I am a bit uncertain. I will try to reproduce. But again, would appreciate any code that can actually match the results for Ackley's function in a paper.

Even PSO or GA working example would be helpful, which would indicate that I am at least interpreting it correctly.

PSO: 23407 ± 4325(92%) GA: 32720 ± 3327(90%)

Will let you know my findings.

dg-pb commented 2 months ago

https://www.mycompiler.io/view/6Z2EdDimkDA

The code you shared can't find it with 50k evaluations.

zStupan commented 2 months ago

In the "Cuckoo Search via Levy Flights" paper the stopping criterion is defined as: "The algorithms stop when the variations of function values are less than a given tolerance eps ≤ 10^−5."

I understand that as the differences of every fitness value between the current and previous iteration is less than 10^−5.

I could be wrong though.

dg-pb commented 2 months ago

Good to know, I was using 10^-9, so that will bring it slightly closer...

However still, the result after 50K evaluations for Ackley's with d=128 is nowhere near that. The global minimum is 0, but algorithm is still at 5, 6, 10...

You can run the code as it is online in the link I shared.