# Cuckoo Search Algorithm

The CS algorithm is a natured-inspired metaheuristic search algorithm,based on the reproduction behavior of cuckoos, that has been recently developed by Yang and Deb, 2009; Yang and Deb 2013. Specific egg-laying andbreeding behavior of some cuckoo species is the basis of this optimizationalgorithm. Cuckoo is a brood parasite, which never build their own nests.They lay their eggs in the nest of other species, leaving host species to carefor the eggs. If these eggs are discovered by the host bird, it either throws outthe cuckoo egg or abandons the nest to start afresh. Some species of cuckooshave learnt to mimic the colour and pattern of their own eggs so as to matchthat of their hosts. This reduces the probability of the eggs being abandonedand therefore increases their reproductivity. To implement these concepts,the CS algorithm employs three idealized rules:}} [1] [2] [3]

Step 2: Generation of the initial population of nests of host birds

The initial population of the nests is generated randomly between the lower bound and the upper bound.

Step 3: Generation of new solutions/eggs by Levy flights

In this step, all the host eggs except the best one are replaced by new cuckoo eggs if the objective function corresponding to each new cuckoo egg is better than the corresponding existing host egg objective function. A new solution is generated by Levy flight as below

where a is the step size parameter, 'rand' is a random number from a standard normal distribution, yf is the ith nest current position, yb est is the current best nest and S is a random walk based on the Levy flights.

In the CS algorithm, Levy flights are used to explore the unknown, large- scale search space as it is more efficient than the Brownian random walks. The Levy flight essentially provides a random walk whose random step length is drawn from a Levy distribution (Equation 7.2).

This has an infinite variance with an infinite mean. In this work, a Levy flight has been performed for generating a new solution according to the Mantegna algorithm (Yang, 2014). In Mantegna's algorithm, the step length S is calculated by

where p is considered to be 1.5 and u and v are drawn from normal distributions. It takes the following form:

where

Here, Г is the standard Gamma function.

Step 4: Discovery of alien eggs

In this step, alien eggs' discovery is performed for each egg by generating a random number rand e [0,1] and comparing it with discovery probability pa as follows:

where y) and yk are two different solutions selected randomly by random permutation and Z is a random number drawn from a uniform distribution.

Step 5: Termination criterion

The maximum number of iterations or tolerance criteria may be used as the termination criterion of the algorithm. In this work, the maximum number of iterations has been used as a termination criterion. The pseudo-code and the flow diagram of the CS algorithm are shown in Figures 7.1 and 7.2, respectively.

• [1] Eggs are laid one at a time and then dumped randomly in a host nest.
• [2] The nest having better eggs (solutions) are carried over to nextgeneration.
• [3] The host bird usually finds an alien egg within a probability of unity.However, if an alien egg is found, the host bird can either throw theegg away or abandon the nest and build a completely new nest. The above rules are valid for single objective optimization problems. Formulti-objective optimization problems with K different objectives, the firstand the last rules need modification. Here, each cuckoo lays K eggs at a time(Rule 1) and thus a new nest with K eggs is built (Rule 3). From implementation point of view, each egg in a nest represents a solutionand a cuckoo egg represents a new solution. The aim is to use the potentiallybetter solution (the cuckoo egg) to replace the not-so-good solution (the egg)in the nests. The steps of the algorithm are as follows: Step 1: Initialization of CS algorithm parameters The following parameters are defined: number of nests (n), discoveryprobability (pa), lower and upper bounds and maximum number ofgenerations/iterations (itermax).