You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thanks very much for the interesting paper and especially for providing the reference implementation in Python! It's made it possible for a hobbyist like myself to try the algorithm out.
I'm trying to reproduce the results in another paper (or rather, apply the methods to my own problem) which used COA to optimize the placement of $n$ wireless routers in 2D space1. While testing the algorithm, I noticed that it seemed a bit too difficult to get the minimum cost to converge to satisfactory values - it was taking me around $10^5$ iterations ("function evaluations") to start reaching even the ballpark of the results in the paper, plateauing around 0.2 (I'm using 0..1 for my cost) They got their results with $10^3$ iterations!
So I started stepping through the implementation, and noticed that the initial random values generated for the coyotes were actually out of the VarMin, VarMax range. I was initially using negative values in VarMin, which made this pop out.
The possible error
I believe that there are parentheses missing in this statement, which generates the initial random values for each coyote:
Due to the missing parentheses, this gets evaluated essentially as min + (random() * max) - min, instead of the intended min + random() * (max - min). This causes the initial random values to be biased towards the maximum, depending on min and max.
The latter (min + random() * (max - min)) is also used when generating the puppies:
Hello! Thanks very much for the interesting paper and especially for providing the reference implementation in Python! It's made it possible for a hobbyist like myself to try the algorithm out.
I'm trying to reproduce the results in another paper (or rather, apply the methods to my own problem) which used COA to optimize the placement of$n$ wireless routers in 2D space1. While testing the algorithm, I noticed that it seemed a bit too difficult to get the minimum cost to converge to satisfactory values - it was taking me around $10^5$ iterations ("function evaluations") to start reaching even the ballpark of the results in the paper, plateauing around 0.2 (I'm using 0..1 for my cost) They got their results with $10^3$ iterations!
So I started stepping through the implementation, and noticed that the initial random values generated for the coyotes were actually out of the
VarMin, VarMax
range. I was initially using negative values inVarMin
, which made this pop out.The possible error
I believe that there are parentheses missing in this statement, which generates the initial random values for each coyote:
COA/COA.py
Lines 34 to 35 in e880367
Due to the missing parentheses, this gets evaluated essentially as
min + (random() * max) - min
, instead of the intendedmin + random() * (max - min)
. This causes the initial random values to be biased towards the maximum, depending onmin
andmax
.The latter (
min + random() * (max - min)
) is also used when generating the puppies:COA/COA.py
Lines 117 to 119 in e880367
After changing that line like the following, I started instantly receiving much better results (first sub-0.1 min cost with 20k function evaluations!)
Footnotes
S. Mekhmoukh Taleb et al. "Solving the Mesh Router Nodes Placement in Wireless Mesh Networks Using Coyote Optimization Algorithm," in IEEE Access, vol. 10, pp. 52744-52759, 2022, doi: 10.1109/ACCESS.2022.3166866. ↩
The text was updated successfully, but these errors were encountered: