Discova
Back to cards
Programming4 min readWikipedia, updated 3 November 2026

Cuckoo search

Optimization algorithm

In operations research, cuckoo search is an optimization algorithm developed by Xin-She Yang and Suash Deb in 2009. It has been shown to be a special case of the well-known (μ + λ)-evolution strategy. It was inspired by the obligate brood parasitism of some cuckoo species by laying their eggs in the nests of host birds of other species.

Some host birds can engage direct conflict with the intruding cuckoos. For example, if a host bird discovers the eggs are not their own, it will either throw these alien eggs away or simply abandon its nest and build a new nest elsewhere.

Some cuckoo species such as the New World brood-parasitic Tapera have evolved in such a way that female parasitic cuckoos are often very specialized in the mimicry in colors and pattern of the eggs of a few chosen host species. Cuckoo search idealized such breeding behavior, and thus can be applied for various optimization problems.

Metaphor

Cuckoo search (CS) uses the following representations:

Each egg in a nest represents a solution, and a cuckoo egg represents a new solution. The aim is to use the new and potentially better solutions (cuckoos) to replace a not-so-good solution in the nests. In the simplest form, each nest has one egg. The algorithm can be extended to more complicated cases in which each nest has multiple eggs representing a set of solutions.

CS is based on three idealized rules:

  1. Each cuckoo lays one egg at a time, and dumps its egg in a randomly chosen nest;
  2. The best nests with high quality of eggs will carry over to the next generation;
  3. The number of available host nests is fixed, and each cuckoo egg is discovered by the host bird with a probability of . In this case, the host bird can throw the egg away/abandon the nest, and build a completely new nest.

In addition, Yang and Deb discovered that the random-walk style search is better performed by Lévy flights rather than simple random walk.

Algorithm

The pseudo-code of the cuckoo search algorithm can be summarized as:

Objective function: 
Generate an initial population of  host nests; 
While (t<MaxGeneration) or (stopping criterion)
    Get a cuckoo randomly (say, i) and replace its solution by performing Lévy flights;
    Evaluate its quality/fitness 
        [For maximization,  ];
    Choose a nest among n (say, j) randomly;
    if (),
        Replace j by the new solution;
    end if
    A fraction () of the worse nests are abandoned and new ones are built;
    Keep the best solutions/nests;
    Rank the solutions/nests and find the current best;
    Pass the current best solutions to the next generation;
end while

The original formulation of cuckoo search uses the discovery probability () and the population size () as control parameters. Its implementation also involves choices concerning the generation of random steps and their step sizes.

Random walks and the step size

Lévy flights and random walks can be used to generate new candidate solutions according to the following equation:

where is drawn from a standard normal distribution with zero mean and unity standard deviation for random walks, or drawn from Lévy distribution for Lévy flights. Here the step size determines how far a random walker can go for a fixed number of iterations. The generation of Lévy step size is often tricky, and a comparison of three algorithms (including Mantegna's) was performed by Leccardi who found an implementation of Chambers et al.'s approach to be the most computationally efficient due to the low number of random numbers required.

If the step size is too large, a new solution may be too far from the previous solution or fall outside the permitted bounds, making it unlikely to be accepted. Conversely, a step size that is too small may produce changes too minor for efficient exploration. Choosing an appropriate step size is therefore important for search efficiency.

As an example, for simple isotropic random walks, we know that the average distance traveled in the d-dimension space is

where is the effective diffusion coefficient. Here is the step size or distance traveled at each jump, and is the time taken for each jump. The above equation implies that

For a typical length scale L of a dimension of interest, the local search is typically limited in a region of . For and t=100 to 1000, we have for d=1, and for d=10. Therefore, we can use s/L=0.001 to 0.01 for most problems. Though the exact derivation may require detailed analysis of the behaviour of Lévy flights.

Theoretical analysis

Areas of theoretical research on cuckoo search algorithms include:

  1. Theoretical analysis on convergence of CS-based algorithms
  2. Identifying necessary and sufficient conditions for selecting control parameters
  3. Employing non-homogeneous search rules to enhance the classical CS algorithm

Improved Cuckoo Search Algorithms

Convergence of Cuckoo Search algorithm can be substantially improved by genetically replacing abandoned nests (instead of using the random replacements from the original method). Modifications to the algorithm have also been made by additional interbreeding of best (high quality) nests and this approach has been successfully applied to a range of industrial optimisation problems.

Adapted from the Wikipedia article, CC BY-SA 4.0. Continue on Wikipedia

Go deeper

Ideas this article links to.