Chicken Swarm Optimisation Algorithm

Shourya Mupparapu
5 min readMar 24, 2021

How are algorithms written? , Do people create them from scratch? Do they get inspired by an incident?

If they do get inspired, Won’t understanding where the inspiration came from help us to understand the algorithm even more and help us to use them in more situations.

Chicken Swarm Optimisation Algorithm(CSO) is a bio-inspired algorithm that has been proposed in the need for Optimisation applications.

Introduction

CSO is a heuristic algorithm that can be used to find optimal solutions for different kinds of problems and TSP is one of a kind to which in this paper we use CSO. This is a bio-inspired algorithm based on the chicken’s behavior in the swarm. Since they have the capability to recognize 100 individuals even after several months we understand its intelligence and use it to solve our aim.

Inspiration

There exists a hierarchal order in the social lives of chickens. The dominant chickens in the flock will dominate the weak. In their social life there exist a dominant group of hens that remain near to the head roosters' side and also submissive hens who stand at the periphery. By sudden increment or decrement in the number of chickens from an existing flock would cause temporary chaos to their social order until the order is established again.

Why is this order necessary?

The chicken’s behaviors vary with gender. The head rooster would positively search for food, and fight with chickens who invaded the territory the group inhabits. The dominant chickens would be nearly consistent with the head roosters to forage for food. The submissive ones, however, would reluctantly stand at the periphery of the group to search for food.

There exist competitions between different chickens. As for the chicks, they search for the food around their mother. There is also another behavior of random stealing of foods from other groups. And There is also another factor is that the chicks can learn from their mother to search for food. Only the Rooster can fix the domain of the search area. With time the dominance of chickens can change i.e, the hens or the chicks could also become the rooster. Thus, this behavior could decrease the time elapsed to find the optimal solutions.

This swarm intelligence can be associated with the objective problem to be optimized and hence led to the inspiration of the Chicken Swarm Optimisation Algorithm (CSO).

Algorithm

An Example of solving Travelling Salesman problem (TSP) using chicken Swarm Algorithm-

Define a population of N chickens; no. of roosters, hens, chicks;

Define no. of iterations ‘i’,g;

For i = 0 : t

.. if t % g:

….Categorize chicken into rooster, hen and chick based on fitness values

…. Form groups and determine the relationships (Mother-chick, Rooster-Hen)

….Define movement of the rooster (improve using 3-opt)

….if (fitness>best)

……best=fitness, Update location using equation 1

…. Define movement of hen, Update location using equation 2

….Define movement of chick, Update location using equation 3

Use three opt to increase fitness value of the final solution

Print fitness; Print best fit path

Parametric Analysis

There exist six parameters in CSO. Humans keep chickens primarily as a source of food. As the food themselves, only hens can lay eggs, which can also be the source of 90 X. Meng et al. food. Hence keeping hens is more beneficial for human than keeping roosters. Thus HN would be bigger than RN.

Given the individual differences, not all hens would hatch their eggs simultaneously. Thus HN is also bigger than MN. Though each hen can raise more than one chick, we assume the population of adult chickens would surpass that of the chicks, CN. As for G, it should be set at an appropriate value, which is problem-based.

If the value of G is very big, it’s not conducive for the algorithm to converge to the global optimal quickly. While if the value of G is very small, the algorithm may trap into local optimal. After the preliminary test, may achieve good results for most problems.

Furthermore, the formula of the chick’s movement can be associated with the corresponding part in DE. If we set RN and MN at 0, thus CSO essentially becomes the basic mutation scheme of DE. Hence the partial conclusions from the DE can be used. In practice, FLE[0.4,1 ]usually perform well.

Equations involved:

  1. Movement of Rooster:

𝑥𝑖 ^(𝑡+1) = 𝑥𝑖^( 𝑡)ⓍRandint (∇²)

Let 𝑥𝑖 ^(𝑡) be [2,3,5,1,4,6,7] and Randint=3

Then, 𝑥𝑖^( t)=

Simultaneous swapping: 𝑥𝑖^( 𝑡+1)=

2) Movement of Hen:

𝑥𝑖^(𝑡+1) = 𝑥𝑖^(t)⊕Randint⊗(𝑥𝑟1^𝑡 ⊖𝑥𝑖 ^𝑡)⊕Randint(𝑥𝑟2 ^𝑡 ⊖ 𝑥𝑖^ 𝑡 ) here,

A⊖B means to contain all the swaps required to change B to A

for example, if we take, A= {1,3,4,5,6} and B= {3,1,6,5,4}

Step 2:-(swapping again)

we interchange in such a way that we do two swaps to get A from B

S0, A⊖B= {[1,3], [4,6]}

Randint⊗ (𝑥𝑟1^ 𝑡 ⊖𝑥𝑖 ^𝑡 ):

Randint means if randint=a, then do first a number of swaps in 𝑥𝑖^ 𝑡 to change it to 𝑥𝑟1^ 𝑡 . This is so that the hens follow the lead rooster. r:⊕ operator:- This is to ensure that all operations are carried out in sequential order.

3) Movement of Chick:

w(𝑥𝑖^𝑟 )⊕FL⊗(𝑥𝑚 ^𝑟 ⊖𝑥𝑖 ^𝑟 )⊕C⊗(𝑥𝑟^ 𝑡⊖𝑥𝑖 ^𝑡 )

where,

FL is the learning factor from mother

w is the self-permutation

C is the learning factor from rooster

Experimental Results :

This section illustrates performance test of various forms of Chicken Swarm Optimization on Euclidean instance of TSPLIB. The program is coded in python programming language.

The following graph is the representation of result of TSPLIB dataset EIL51:

The following table represents the comparison between different forms of Chicken Swarm Optimisation:

Conclusion:

We can conclude that by using Chicken Swarm Optimisation Algorithm to solve the Travelling Salesman Problem we are able to produce results which are comparable to the optimal values. The solutions keep improving over the next generations with added complexity and efficiency. The solution depends upon the fitness functions.

Therefore, the algorithm provides near-optimal solutions in terms of both accuracy and robustness compared to other approaches.

--

--