Roosters Algorithm: A Novel Nature-Inspired Optimization Algorithm

Some species of females, e.g., chicken, bird, fish etc., might mate with more than one males. In the mating of these polygamous creatures, there is competition between males as well as among their offspring. Thus, male reproductive success depends on both male competition and sperm rivalry. Inspired by this type of sexual life of roosters with chickens, a novel nature-inspired optimization algorithm called Roosters Algorithm (RA) is proposed. The algorithm was modelled and implemented based on the sexual behavior of roosters. 13 well-known benchmark optimization functions and 10 IEEE CEC 2018 test functions are utilized to compare the performance of RAwith the performance of well-known algorithms; Standard Genetic Algorithm (SGA), Differential Evolution (DE), Particle Swarm Optimization (PSO), Cuckoo Search (CS) and Grey Wolf Optimizer (GWO). Also, non-parametric statistical tests, Friedman and Wilcoxon Signed Rank Tests, were performed to demonstrate the significance of the results. In 20 of the 23 functions that were tested, RA either offered the best results or offered similar results to other compared algorithms. Thus, in this paper, we not only present a novel nature-inspired algorithm, but also offer an alternative method to the well-known algorithms commonly used in the literature, at least as effective as them.


Introduction
Nowadays, researchers have begun to get more inspiration from nature in order to model optimization algorithms. Thus, these stochastic algorithms, which are also called meta-heuristics, have become popular for some reasons: the search space. Other famous SBA are Ant Colony Optimization (ACO) [10], Cuckoo Search (CS) [11], Artificial Bee Colony (ABC) [12], Firefly Algorithm (FA) [13] and Grey Wolf Optimizer (GWO) [14].
However, one main problem of meta-heuristics is the lack of adjusting the balance between exploration and exploitation, which directly affects the genetic diversity of the population.
Exploration is an activity that discovers information or resources while exploitation refers researching a limited (but promising) area of the search space (owing to hope developing the promising solution). The traditional technique that using large population sizes to make exploration efficiently is inadequate since it causes to increase the computational budget. On the other hand, giving priority to good solutions is the common way for exploitation. However, this technique might bring about losing genetic diversity as the average and poor solutions are generally overlooked.
The aim of this paper is to create an algorithm to solve the main problem of meta-heuristics that mentioned in the above paragraphs. For this purpose, we have designed a new algorithm called Roosters Algorithm (RA). Owing to the step of RA, which benefits from the average and poor solution, it can control the genetic diversity better than other meta-heuristics that were tested.
Based on the No Free Lunch (NFL) theorem [24], a single algorithm cannot perform well in every optimization problem. This theorem allows researchers to present new algorithms to solve different problems in the related fields, which also encouraged us to propose RA.
In this paper, the performance of RA was compared with the performance of the distinguished metaheuristic algorithms: Standard GA (SGA), DE, PSO, CS and GWO. In addition to utilizing thirteen basic benchmarks, ten IEEE CEC 2018 test functions (shifted, rotated, expanded etc.) were also employed for the comparison. Furthermore, non-parametric statistical tests, Friedman and Wilcoxon Signed Rank, were performed to demonstrate the significance of the tests results.
According to the obtained results, RA performs better than other meta-heuristics that compared in this paper. Thus, besides presenting a novel algorithm, we also offer an alternative method to the well-known meta-heuristics, which is at least as effective as they are.
The rest of paper is organized as follow: Section 2 explains inspiration of RA besides to introducing it. While Section 3 describes the tests, Section 4 discusses the results from these tests. Finally, Section 5 concludes the paper.

The Inspiration
Female creatures might mate with more than one males [25]. In the mating of these polygamous creatures, the reproductive success of a male is based on the quality of his sperms, according to "sperm competition" theory [25]. Since chickens are these type of creatures, they can mate more than one roosters, especially attractive ones.
As in humans, the sexual life of roosters with chickens begins with flirting [26]. First of all, a rooster presents some foods to a chicken, and shows his dancing skills to engage her. If she is impressed by him, then they can mate.
However, the rooster may want to mate a chicken without her permission. In this scenario, even if he ejaculates his sperms to her ova, she nervously sprinkle them.
On the other hand, the age of the rooster is another important factor for mating [26]. For instance, chickens do not want to mate with senior roosters as their proportions of fertilizing an egg is very low.
When mating procedure is completed, the sperm competition starts if the chicken has more than one male. The VSL value, the most common estimator of sperm cell velocity, is significantly important in the competition of sperms [25]. If the VSL of a male's sperm is higher than others, he is more likely to outstrip his opponents in the manner of fertilizing the egg.
Furthermore, if the chicken has fears about her life or she has a disease, it directly affects the formation of her egg [26], i.e., disrupts the DNA of the egg.

The Algorithm
Algorithm 1: Roosters Algorithms (RA) Randomly identify roosters and chickens in the population Randomly choose chickens from the population of chickens Determine the attractive chicken for mating Randomly choose roosters based on the rooster size r j is the rooster j where j is 1,2,…,n for j = 1:n do if r j impresses the attractive chicken then Allow mating else if r j wants to mate by force then Kill his sperms end if end if end for if the attractive chicken has more than one male then Calculate VSL values of all sperms Allow sperm competitions The winner offspring fertilizes the egg else The male of offspring fertilizes the egg end if if the attractive chicken is stressful then Mutate the egg else Let it remain as it is end if i = i + 1 end while Inspired by the sexual life of roosters with chickens, a novel natured-inspired optimization algorithm called RA, whose complexity is O (n) (where n is the population size), is proposed. Initially, the rooster size, which is the number of roosters that desire to mate, is determined. Then, the algorithm sustains its procedure by creating the initial population, as other meta-heuristics do. In RA, roosters and their offspring are accepted as the candidate solution for the problem.
After stochastically identifying roosters and chickens, the attractive chicken is determined among chickens by looking at their fitness values which are acquired by the fitness function that needs to be optimized. The age of a rooster, which means the number of existences of the rooster during its life cycle, shows how effectively he dances. On the other hand, the fitness value also refers whether the rooster is accomplished to find food resources. For instance, the rooster having better fitness value can present adequate foods for a chicken.
If a rooster impresses the chicken by dancing or presenting food, he can mate with her. Otherwise, he may try to mate by force, which is randomly determined. However, in this case, the chicken kills sperms of the rooster by sprinkling them.
When the attractive chicken may have more than one male, the competition occurs among the sperms of males. In this case, the sperm quality of males is identified by VSL value, which is obtained by the fitness function. The offspring who has better VSL value than others gets a chance to fertilize an egg. If the chicken has only one male, then his offspring fertilizes the egg.
Furthermore, if the chicken has fears about her life or she has a disease, then the offspring is mutated. Random Mutation, which randomly select gene(s) by replacing any value within the range of corresponding dimension(s), has been utilized for the mutation.
The process of RA is repeated until the termination criteria are met; either the optimum solution is found or maximum number of generations are reached, shown in Algorithm 1.

Test Functions
In the field of meta-heuristics, researchers have generally employed benchmarks as test functions. On the other hand, with the advancement of technology, the number of proposed algorithms in meta-heuristics has increased; therefore, different types of functions has been needed to test them. To do that, researchers has created new test functions by shifting, rotating, expanding and hybridizing the well-known benchmarks.
These functions are grouped into two classes; unimodal and multimodal. Unimodal class comprises sensitive functions that accomplish to converge slowly to the global extremum. Multimodal class includes functions having more than one local extremum.
In addition to utilizing thirteen well known benchmarks in the field of meta-heuristics [27,28], ten IEEE CEC 2018 test functions [29] were also operated to test the performance of the compared algorithms, see Tab. 1.

Statistical Tests
Hypothesis testing has been commonly used in order to infer the comparison of the algorithms [30]. However, the null hypothesis, H0, and the alternative hypothesis, H1, are supposed to be defined in order to make inferences. The null hypothesis is a proposition that generally refers no differences between compared algorithms. Conversely, the alternative hypothesis is an expression of the differences. In our case; H0: There is no difference between compared algorithms H1: There is difference between compared algorithms Moreover, the probability value of a statistical test, α, decides which hypothesis should be rejected. For our test, α is accepted as 0.05.
In this paper, Friedman and Wilcoxon Signed Rank tests were performed to demonstrate the significance of the results. While IBM SPSS Statistics 22 was utilized to obtain the results of the Friedman test, the signrank function of Matlab 2019a was used to get the results of the Wilcoxon Signed Rank test.

Friedman Test
The Friedman test, introduced by Friedman [31,32], is a non-parametric statistical test. It has been utilized to specify differences in behaviour of more than one algorithm. In the Friedman test, test cases are represented in rows and results of compared algorithms takes places in columns.
The test initiates its procedure by giving rank to each row based on the values of columns in the row, then, it computes the total rank values for each column. The significance of the test is determined by X 2 (Chi-square) distribution with k-1 degrees of freedom (df) where k is the number of compared algorithms. Appropriate X 2 values corresponding to df can be found in [33]. From the table in [33], expected Expanded Rotated Extended Scaffe's Multimodal -300 X 2 = 11.07 since df = 5 and α = 0.05. If found X 2 value is greater than the expected one, then, we need to reject the null hypothesis. Found X 2 value can be obtained by utilizing Eq. (1): where k means number of columns, n refers number of rows and R 2 i means sum of ranks.

Wilcoxon Signed Rank Test
Wilcoxon signed rank test is another non-parametric statistical test that has been used to state the differences between two samples or algorithms [34]. As a common way, the test initially takes differences between the results of the two algorithms whose sizes are N*1 (where N means the number of tests) in order to obtain the difference vector. Then, it ranks to each row of the vector from 1 to N, i.e., min. value is ranked 1. Afterwards, it computes R þ and R À values of the difference vector. Based on the values, T value of the test, min R þ ; R À ð Þis determined. Thus, the probability value (p) of the test is computed by utilizing the T value.

Results and Discussions
All algorithms were implemented by using Matlab 2019a, except CS and GWO. The Matlab codes of CS and GWO were taken from [35] and [36] respectively.
The tests were repeated with 30 runs that have 30 different random seeds in order to minimize the effects of randomization. The results were achieved by utilizing default parameter settings of algorithms. All algorithms were analyzed where population sizes are equal to 50, 100 and 200. As expected, all algorithms show their best performance when population size is 200. Therefore, population size is taken as 200 throughout tests. Furthermore the number of iteration is accepted as 100. The results in the following tables are acquired based on the best results of algorithms. On the other hand, rooster size, which is an experimental value, was accepted as 4 during the tests.

Results of the Test Functions
According to Tab. 2, RA offers better performance than the compared algorithms, albeit with small differences. In all basic benchmark functions (from F1-F13), RA offers the best performance in all cases. Moreover, in IEEE CEC 2018 functions (except F14, F20 and F21), RA is either only the winner or there is a tie between some of compared algorithms. Moreover, PSO is the second algorithm that present the best performance. It achieves global values in all basic benchmark functions. However, it is not as successful as RA in IEEE CEC 2018 functions.
Even though RA proved its effectiveness on the test functions, non-parametric statistical tests should be applied in order to show the significance of obtained results.

Results of Friedman Test
It is obvious to clarify which algorithm is more successful by looking at Tab. 3. An algorithm having minimum rank value means that the algorithm has better performance comparing to other. According to Tab. 3, RA presents better performance in all test functions.  In addition to having probability values that are less than α = 0.05, X 2 found value (54.9472295514512) is also greater than the expected one in Tab. 4, which is 11.07. Thus, the null hypothesis must be rejected which refers that "There is difference between compared algorithms".

Results of Wilcoxon Signed Rank Test
p values describe the significant differences between the compared algorithms. These values must be less than α = 0.05 to reject null hypothesis. Otherwise, it is required to accept it, which means that compared algorithms have similarity in terms of performance.
Based on the results in Tab. 5, the performance of RA is only similar to the performance of PSO since the p value is 0.08984375. On the other hand, CS and SGA behaves similarly in the terms of the performance.

Conclusions
In this paper, a novel nature-inspired optimization algorithm called RA has been introduced. The algorithm is modelled by inspiring the sexual behaviour of roosters with chickens.
In order test its performance in 23 test functions (13 basic benchmarks, 10 IEEE CEC 2018), it was compared with well-known algorithms; SGA, DE, PSO, CS and GWO. Furthermore, non-parametric statistical tests, Friedman and Wilcoxon Signed Rank, were utilized to make sense of the obtained results.
To summarize all the test results that have been made, RA has presented successful results in both unimodal and multimodal functions, thanks to its step that takes advantage of average and potentially poor results. However, although PSO performed very close to RA, it was the second best method among the compared methods.
On the other hand, the statistical results not only confirms the test results, but also approve that RA offers the best performance comparing the other algorithms that were tested.  Considering the results that were acquired, the following remarks can be made: Besides to simple test functions, compelling test functions such as IEEE CEC'18 should be also used to observe the performance of an algorithm. RA is accomplished in either basic or challenging (shifted, rotated, hybrid and expanded) functions. It does not exist an algorithm that solve all optimization problem, according to the NFL theorem. As the performance of RA is reasonable, it can be considered as an alternate optimizer.
As a future work, testing the performance of RA in real world engineering optimization problems can be recommended.
Funding Statement: The authors received no specific funding for this study.
Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.