Skip to main content
. 2023 Jun 25;23(13):5881. doi: 10.3390/s23135881
Algorithm 2 Cuckoo Search main steps
  • Define objective function f(x)

  • Define parameters L, Nc, M, Pa

  • Generate initial positions xi of the host nests

  • t: = 1

  • while (tM) and (solution not yet found) do

  •    Choose cuckoo j randomically

  •    Move it using a Lévy step

  •    Evaluate the quality of the new nest using f(x)

  •    Sort existing nests based on the quality

  •    Abandon Pa of the worst nests

  •    Generate new ones around the best nest

  •    Keep the remaining 1 − Pa nests with the best quality

  •    Sort nests and pick the best one

  •    t: = t + 1

  • end while

  • Return the best nest