Keywords

1 Introduction

Situations arising in almost all spheres of human activities can be designed mathematically as optimization problems. Mathematically, the optimization problems can be categorized in several ways; for example, as continuous problems (dealing with real functions [1, 2]), constrained problems (having limitations or bounds [3, 4]), combinational problems where solution is determined from finite or infinite sets [5, 6,7,8] multimodal problems having large number of local solutions better than all neighboring solutions, but not good as the globally optimal solution [9], multi-objective problems, where the fineness of a solution is defined by its performance relative to different objectives [10, 11], and non-stationary problems which are dynamic and noisy [12].

Often these problems are challenging and require a suitable method for their solutions. Classical methods are usually problem specific and depend on a certain set of rules to be followed before these methods can be applied. For example, Newton’s type methods can be applied only to differentiable functions; likewise, simplex method can be applied only to problems which are strictly linear in nature and so on.

Consequently, in the past few decades, emphasis is being laid on techniques which are generic in nature and can be applied to a wide range of problems. Past few decades have witnessed the emergence of optimization techniques following based on some natural phenomena like theory of evolution or socio cooperative behavior displayed by various species including humans. These are stochastic search techniques and are collectively called nature-inspired metaheuristics (NIM).

In the present article, the search technique taken is firefly algorithm (FA), a comparatively newer addition to the class of NIM. FA belongs to a class of swarm intelligence (SI)-based algorithms. SI takes inspiration from the collective behavior of insects or animals. This term was first used by Beni and Wang [13] in 1989. SI is mainly based on the philosophy that by working together, species can solve the most complex task (e.g., mound building of termites). Various species follow simple interaction rules which they follow for communication and thus form a self-organized multi-agent system. A relation between SI-based algorithms, bio-inspired algorithms, and nature-inspired algorithms can be given as follows:

$$ {\text{SI-based}} \subset {\text{bio-inspired}} \subset {\text{nature-inspired}} $$

SI-based ⊂ bio-inspired ⊂ nature-inspired

Most common swarm intelligence optimization techniques available in nature include particle swarm optimization (PSO) [14, 15], ant colony optimization (ACO) [16], artificial bee colony (ABC) [17, 18], firefly algorithm (FA) [19, 20], differential evolution (DE) [21, 22], bat algorithm [23], glow swarms [24], krill herd bio-inspired algorithms [25], cuckoo search [26], fish optimization [27], bacterial foraging optimization [28]; most of these algorithms are population based and have a natural advantage over single-point search algorithms [29].

The objective of the present study is to introduce the researchers with a brief overview of FA. The article consists of five sections including introduction. In the second section, we define the working, structure of firefly. In the third section, we classify the firefly algorithm. In the fourth section, we discuss the application of firefly algorithm, and the fifth section is for conclusion.

2 Introduction of Firefly Algorithm

A firefly algorithm was developed by Yang [19]. Fireflies are quite fascinating insects found typically in warm environment and are normally active during night when they look mesmerizing. Some interesting facts about fireflies are as follows:

  • More than two thousand species of firefly can be found in nature, and mostly all fireflies produce tiny, periodic flashes. The pattern of flashing is incomparable for a particular species.

  • The function of flashing light is either to attract partners (communication) or is a warning toward the predator.

  • Each firefly can glow with a different intensity.

Many researchers have discussed firefly behavior in nature. For reference, the interested reader may see [30,31,32].

In FA algorithm, better fireflies have a smaller error and have a higher intensity. The flashing light can be expressed in such a way that it can be linked with the objective function which is to be optimized. In this paper, firstly, we discuss the structure of the firefly algorithm (FA), classification, and then move toward their applications.

The basic idea of FA is that a firefly will be attracted to any other firefly that has a higher intensity, and that attractiveness (the distance moved toward a more intense firefly) is stronger if the distance between the two fireflies is smaller. Firefly algorithm is based on a physical formulation of light intensity, which is varied at the distance from the eyes of beholder. In general, as the distance between two fireflies’ increases, then light intensity decreases rapidly which means light intensity is inversely proportional to the distance between two fireflies [19].

The two major issues in FA are intensity and attractiveness. Since FA is a metaheuristic, one is free to define intensity in any manner while keeping in mind that higher intensity is associated with a better solution/position. The next major issue is to define attractiveness so that closer fireflies will move toward a more intense target. Thus, the brightness phenomenon is associated with objective function to be optimized.

Firefly algorithms use the following three idealized rules:

  1. 1.

    Fireflies are unisex so that they are attracted to each other regardless of their gender.

  2. 2.

    The attractiveness is proportional to the brightness, and both attraction and brightness decrease as the distance between consecutive fireflies increases. This implies that the firefly having lesser brightness will move toward the brighter firefly. However, if the brightness is same, the firefly will have a random movement.

  3. 3.

    For a maximization problem, brightness is proportional to the objective function.

2.1 Structure of Firefly

As already mentioned, in FA, there are two important parameters, intensity and attractiveness. A firefly will move toward the other firefly which is brighter than itself and the attractiveness depends on light intensity.

The light intensity and attractiveness both are inversely proportional to the distance \( d \) between attracted fireflies which implies that light intensity and attractiveness decrease as the value of \( d \) increases. These two parameters are defined below.

Intensity:

$$ I = I_{0} *e^{{ - \gamma d^{2} }} , $$

where

I :

light intensity

I 0 :

original light intensity or initial light intensity

D :

distance between firefly i and j

\( \lambda \) :

the light absorption coefficient controls the light intensity

Attractiveness

Attractiveness is proportional to the light intensity, and attractiveness \( \beta \) is defined as follows:

$$ \beta = \beta_{0} *e^{{ - \gamma d^{2} }} , $$

where

Β 0 :

attractiveness when d equals to zero

The distance between two fireflies can be defined as follows:

$$ d_{ij} = \left\| {u_{i} - u_{j} } \right\| = \sqrt {\mathop \sum \limits_{k = 1}^{n} \left( {u_{i,k} - u_{j,k} } \right)^{2} } . $$

Movement of firefly:

When a firefly i is attracted toward the brighter firefly j, its movement is defined as follows:

$$ u_{i}^{t + 1} = u_{i}^{t} + \beta_{0} *e^{{ - \gamma d_{i,j}^{2} }} *(\,u_{j}^{t} - u_{i}^{t} ) + \alpha *\varepsilon_{i} . $$

The second term shows attraction, and \( \gamma \) is limitation. If \( \gamma \) tends to zero or is too small, then attractiveness and brightness become constant, \( \beta = \beta_{0} \) implies that a firefly can be seen in any place, and this shows the firefly will also search global firefly. If \( \gamma \) tends to infinity or too large then attractiveness and brightness will decreases near to zero which means firefly will move randomly and the third term is for randomization here \( \alpha \) is a parameter called random parameter.

\( \varepsilon_{i} \) can be replaced by (rand  1/2), where rand is a random number generated between 0 and 1.

The pseudocode of basic FA is given below:

3 Classification

Many variants in firefly algorithms have been proposed in the literature. Attempts have been made to find the best possible combination of parameters through tuning [33] or by controlling the parameters adaptively.

Research has also been done on the movement of fireflies using different probability distributions Levy, uniform, Gaussian etc. or by using chaotic sequences. Binary and real coded, both versions of FA, are available in the literature. In general, more than 20 variants of firefly exist in the literature. Fig. 1 gives a pictorial representation of modified and hybridized variants of FA, while Tables 1 and 2 list the various modified and hybridized FA (Fig. 2).

Fig. 1
figure 1

Pseudocode of basic FA

Table 1 Modified firefly algorithms
Table 2 Hybrid firefly algorithms
Fig. 2
figure 2

Classification of firefly algorithm

4 Application

FA has been applied to several fields like economic emissions load dispatch problem, multi-level thresholding selection [34], vector quantization for image compression [35], finding optimal test sequence generation [36], object tracking [37]. Various optimization problems that have been dealt with FA are (Fig. 3) as follows:

Fig. 3
figure 3

Taxonomy of firefly algorithm

  • Continuous,

  • Constrained,

  • Combinatorial,

  • Multimodal,

  • Multi-objective,

  • Dynamic and noisy.

figure a

Pie-chart. Uses FA in optimization

Firefly algorithms have also been applied to various real-life applications problems like industrial optimization [38,39,40], image processing [35, 41], business optimization [42], antenna design [43], civil engineering [44], semantic web [45], robotics [46], chemistry [47], meteorology [48] and wireless sensor networks [49]; optimal placement and sizing of voltage-controlled distributed generators in unbalanced distribution networks [50], rescheduling of real power for congestion management with integration of pumped storage hydro-unit [51], for multi-stage transmission expansion planning with adequacy-security considerations in deregulated environments [52], optimizing real power loss and voltage stability limit of a large transmission network [53], for congestion management in deregulated environment [54].

5 Conclusion

The objective of the present study is to familiarize the researchers toward FA, a comparatively newer NIM. The authors have tried to include most of the work proposed in the area of FA; however, it is possible that some important paper is left out. Concluding remarks on FA can be as follows:

  • FA has emerged as an attractive alternative for solving complex problems. In a small span of around 6 years, we can find around 20 variants of FA in the literature, including hybridization, variation in parameters.

  • FA has been applied to a wide range of optimization problems with highest applications found in combinatorial optimization (27%), followed by continuous optimization (24%). FA has also been applied to multi-objective, noisy, and dynamic optimization problems as well.

  • FA has also been applied to different real-life problems like image processing, robotics, business optimization.

  • FA can be combined with other soft computing techniques (such as neural network [55], genetic algorithm [56] and other NIAs [14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]) to get better performance.