This paper proposes a swarm intelligence algorithm, called firefly mating algorithm (FMA), for solving continuous optimization problems. FMA uses genetic algorithm as the core of the algorithm. The main feature of the algorithm is a novel mating pair selection method which is inspired by the following 2 mating behaviors of fireflies in nature: (i) the mutual attraction between males and females causes them to mate and (ii) fireflies of both sexes are of the multiple-mating type, mating with multiple opposite sex partners. A female continues mating until her spermatheca becomes full, and, in the same vein, a male can provide sperms for several females until his sperm reservoir is depleted. This new feature enhances the global convergence capability of the algorithm. The performance of FMA was tested with 20 benchmark functions (sixteen 30-dimensional functions and four 2-dimensional ones) against FA, ALC-PSO, COA, MCPSO, LWGSODE, MPSODDS, DFOA, SHPSOS, LSA, MPDPGA, DE, and GABC algorithms. The experimental results showed that the success rates of our proposed algorithm with these functions were higher than those of other algorithms and the proposed algorithm also required fewer numbers of iterations to reach the global optima.
Optimization is a process of finding the most desirable solution to the problem of interest. Optimization problems can be divided into two main categories depending on the types of variables involved (discrete or continuous). A problem with discrete variables is known as a combinatorial optimization problem while a problem with continuous variables is known as a continuous optimization problem. The optimization algorithm proposed in this paper only emphasizes solving continuous optimization problems. Optimization algorithms are of many varieties ranging from simple search to much more complex ones that require a great deal of computational time. At present, among the widely researched types of optimization algorithms, self-organized algorithms employing procedures that emulate animal swarm behavior are very popular. Brief overviews of recent metaheuristic algorithms based on firefly, ant, fish, bird, and bee are presented in the next paragraph.
Yang [
In this paper, a swarm intelligence algorithm called firefly mating algorithm (FMA) is presented. In FMA, GA is used as the core of the algorithm. A new mating pair selection method, inspired by the mating behavior of fireflies in nature, is introduced and incorporated into GA.
The rest of the paper is organized as follows: Sections
This section describes the original firefly algorithm. Firefly algorithm (FA) is a reliable and efficient metaheuristic algorithm capable of solving many real-world problems such as scheduling, optimization problems in dynamic environments, and economic load dispatch problem. This algorithm is influenced by the flashing behavior of fireflies to attract one another. It is constructed based on three rules [
(i) All fireflies are unisex so that one firefly is attracted to all other fireflies.
(ii) The attractiveness of a firefly is proportional to its brightness. For any two fireflies, the dimmer one is attracted by (and thus moves towards) the brighter one. However, if there are no fireflies brighter than a given firefly, that firefly will move randomly.
(iii) The brightness of a firefly decreases as the distance from it increases. This is because light is absorbed when it passes through the medium. Therefore, the brightness (also attractiveness) of the firefly
If the firefly
Genetic algorithm (GA) is an optimization technique inspired by the process of natural selection. GA starts with an initial population which consists of a number of randomly generated chromosomes. A new population is created from the current one by means of 3 genetic operators: selection, crossover, and mutation. The selection operator stochastically chooses chromosomes to be included in the mating pool; the ones with higher fitness values are more likely to be chosen. Crossover operator selectively chooses some genes from the chromosomes of the parents and combines them into the offspring. Mutation operator randomly changes some genes of the offspring. This evolution process is repeatedly performed until any of the stopping criteria is met. The commonly used stopping criteria are as follows: (i) a predefined number of iterations is reached, (ii) the best solution does not improve for a predefined number of iterations, and (iii) a large percentage of the chromosomes in the population is the same.
There are over 2,000 species of fireflies around the world, but most of them are found in the tropical zone. They live under the water when they are larvae and on the ground and in the air when they are adults. Fireflies are social animals. They stay in a swarm on tree branches and lay eggs on the ground around the trees. The fascinating thing when observing fireflies is their light flash. The light emitted from their abdomens is a cold light through chemical reactions within their bodies. Fireflies emit flashing light for communication, luring preys, repelling predators, and attracting mates. Note that this research only focuses on the mating behavior of the firefly; therefore, the detailed relation of the flashing light signal to the mate selection process is further discussed in the next paragraph.
In the mating season, female fireflies release pheromones into the air to signal their readiness to mate. The pheromones are carried away in the direction controlled by the wind [
This section describes a firefly mating algorithm (FMA), which is built on top of the GA. FMA incorporates a new mating feature, inspired by the mating behavior of fireflies in nature, into GA. This new feature, which will be discussed in Section
FMA consists of three main processes: (i) a male selects a female according to the level of her released pheromone that he senses which changes according to wind speed and direction; (ii) a female selects a male according the light intensity of his flash; and (iii) a male or a female mates repeatedly until he runs out of sperms or her spermatheca is full, producing more able offspring for the next generation. This algorithm proceeds from the first step to the last in the 6 following steps.
An initial population of
This step features a new method for determining the mating pairs. Unlike in the GA where mating pairs are selected by using a roulette wheel selection technique, our proposed algorithm introduces a new selection method based on a process of firefly mate selection. First, male fireflies are drawn to a female’s location by following the pheromone that the female releases. Second, the female selects males based on their brightness. Finally, mating pairs are formed based on the mutual attraction of each pair. By introducing this concept to the algorithm, it provides a way to overcome the problem of getting stuck in local optima, as is often the case with the roulette wheel selection technique. A detail of this new selection method is described in the following subsection.
Female sex appeal is directly proportional to the amount of pheromone released by the female. The pheromone released by the female firefly diffuses downwind and reaches each male firefly in unequal amounts depending on 2 factors: (i) the distance and (ii) the speed and direction of the wind. In this subsection, therefore, the male fireflies determine the concentration level of each female’s pheromone reaching them. A highly fit female that is farther away from a male can get selected by the male if her highly concentrated pheromone gets carried along by a high-speed wind towards the male. The concentration level of the female
In this subsection, the female fireflies determine the appeal of each male in their vicinity. Similar to the original FA, the appeal of a male firefly is directly proportional to his brightness. Thus, by imitating (
According to the degree of mutual attraction, a number of males and females are paired together as potential parents. A pair whose mutual attraction value is the highest among all pairs is selected as the first mating pair. The mutual attraction between the female firefly
At the beginning, the number of sperms in each male’s sperm reservoir and the size of each female’s spermatheca are randomly initialized within the range
After mating, the number of sperms in each male’s sperm reservoir and the space of each female’s spermatheca are checked. Once a male runs out of sperm or a female’s spermatheca is full, he/she will be disqualified from mating in the next round. Equations (
When a male and a female mates, some of their genes are crossed over to form two new offspring. One of the two following cases is applied with a specific crossover procedure as follows.
If the parents have never been mated before, the 2-point crossover operator (Figure
Example of 2-point crossover.
If either of the parents has been mated before, the
Example of
After an incipient offspring is produced from mating, some of its genes are randomly changed (mutated) to new values within the range of the variables as shown in Figure
Example of the mutation operation.
After all offspring are mutated, the
After the selection of a new population for the next generation, the current iteration is completed. The algorithm then moves on to perform the next iteration until the specified maximum number of iterations is reached or the best solution does not improve for a predefined number of iterations.
Our FMA algorithm was performance-tested on Core-i7 computers, and the test results were compared against those of firefly algorithm (FA) and 11 other widely cited algorithms in the literature, namely, ALC-PSO [
Test functions.
Function ID | Equation |
|
|
|
---|---|---|---|---|
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
30 |
|
0 |
|
||||
|
|
2 |
|
0 |
|
||||
|
|
2 |
|
0 |
|
||||
|
|
2 |
|
|
|
||||
|
|
2 |
|
3 |
The parameter setting.
Parameters | Values |
---|---|
Population size | 300 |
Maximum number of iterations | 5000 |
Light absorption | 0.2 |
Crossover rate | 1.0 |
Mutation rate | 0.2 |
The performance of all compared algorithms in finding the optimal solutions of 20 test functions is shown in Table
Performance comparison between FMA and other algorithms.
FMA | FA | ALC-PSO | COA | MCPSO | LWGSODE | MPSODDS | DFOA | SHPSOS | LSA | MPDPGA | DE | GABC | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
— |
|
|
|
— | — | — |
|
— | — |
|
— | — | — | — |
|
|
|
— |
|
— | — | — | — |
|
|
— |
|
— |
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
— | — | — |
|
|
|
— |
|
— |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— | — | — | — |
|
|
— | — | — | — |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— | — | — | — | — | — | — | — |
|
— | — |
|
|
|
— |
|
|
— |
|
|
|
|
— |
|
— |
|
|
|
|
|
— | — | — |
|
|
|
— |
|
— |
|
|
|
— | — | — | — | — | — | — | — | — | — |
|
|
|
|
— | — | — | — | — | — | — | — | — | — |
|
|
|
|
— | — | — | — | — | — |
|
— | — | — |
|
|
|
|
— | — | — | — | — | — |
|
— | — | — | — |
|
|
|
— | — |
|
— | — | — |
|
— | — | — |
|
|
|
|
— |
|
— | — | — | — | — |
|
— | — | — |
|
|
|
— |
|
— | — | — | — | — |
|
— |
|
— |
Besides being very effective, FMA also has good convergence performance. Table
Success rates and average numbers of iterations achieved by FMA and FA.
FMA | FA | |||
---|---|---|---|---|
Average number of iterations | Success rate | Average number of iterations | Success rate | |
|
126.8 | 100% | 47.2 | 100% |
|
51.6 | 100% | 229.6 | 100% |
|
32 | 100% | N/A | 0% |
|
N/A | 0% | N/A | 0% |
|
214.4 | 100% | 83 | 100% |
|
158 | 100% | N/A | 0% |
|
84.2 | 100% | 120 | 100% |
|
N/A | 0% | N/A | 0% |
|
62.8 | 100% | 207.8 | 100% |
|
90.8 | 100% | N/A | 0% |
|
80 | 100% | 162 | 100% |
|
133.8 | 100% | N/A | 0% |
|
101.5 | 40% | N/A | 0% |
|
N/A | 0% | N/A | 0% |
|
113 | 100% | N/A | 0% |
|
102.4 | 100% | 284 | 100% |
|
280.6 | 100% | N/A | 0% |
|
171 | 100% | N/A | 0% |
|
N/A | 0% | 64.2 | 100% |
|
67 | 100% | 125.2 | 100% |
The distinct advantage of FMA is the rich diversity of offspring that it generates. Two main causes for this kind of diversity are that FMA enables fireflies to perform multiple mating and that the level of female pheromone that a male senses depends not only on the distance between them but also on the wind speed and direction which is randomly selected for each iteration. As a result, FMA is better able to converge to a global optimum of a function that has a wide and complex search space.
In this paper, a new mating pair selection technique, inspired by the mating behavior of fireflies in nature, is proposed and incorporated into the original firefly algorithm and genetic algorithm. The performance of FMA was tested with sixteen 30-dimensional benchmark functions and four 2-dimensional functions against several widely accepted algorithms. The test results showed that it was able to converge to the global optima in 16 of them. Moreover, compared to the firefly algorithm, FMA required fewer numbers of iterations for most of the functions tested. Because of this initial success, FMA is worth further investigation and application to combinatorial optimization problems.
The authors declare that they have no conflicts of interest.