IEEE Workshop on Nonlinear Circuit Networks
December 9-10, 2016

Improved Firefly Algorithms
Including Slow Fireflies
Masaki Takeuchi

Haruna Matsushita

Yoko Uwate and Yoshifumi Nishio

Department of Electrical
Department of Electronics
Department of Electricaland Electronic Engineering,and Information Engineering,and Electronic Engineering,
Tokushima University
Kagawa University
Tokushima University
2-1 Minami-Josanjima,
2217-20 Hayashi-cho,
2-1 Minami-Josanjima,
Tokushima 770–8506, Japan
Takamatsu, Kagawa, 761-0396, Japan
Tokushima 770–8506, Japan
E-mail: masaki@ee.tokushima-u.ac.jp E-mail: haruna@eng.kagawa-u.ac.jp E-mail: {uwate, nishio}@ee.tokushima-u.ac.jp

Abstract—Animals having variation among individuals have agreater chance of surviving than those without variation. Therefore, we have proposed a improved Firefly Algorithm existing two
type fireflies. In this study, we propose two new Firefly Algorithm
existing fireflies flying slow. Numerical experiments indicate thatour proposed Firefly Algorithms are superior to the conventional
Firefly Algorithm.

This study is organized as follows: first, we explain theconventional Firefly Algorithm in Section II. Next, we describe
in detail of our proposed methods in Section III. Followed by,
we show numerical experiments. Finally, we conclude in thisstudy and discuss future work.

I. I NTRODUCTION

Firefly Algorithm (FA) has been developed by Yang, andit was based on the idealized behavior of the flashing characteristics of fireflies. The conventional FA is idealized theseflashing characteristics as the following three rules• all fireflies are unisex so that one firefly is attracted toother fireflies regardless of their sex;

The solution of optimization problems has recently become increasingly important. Most optimization problems are
nonlinear with many constraints. Consequently, optimization
algorithms must be efficient to find optimal solutions. Stochastic algorithms, one category of optimization algorithms, areefficient optimization algorithms. Stochastic algorithms havea deterministic component and a random component. Almost
all algorithms having only a deterministic component are local
search algorithms, for which there is a risk of being trapped at
local optima. However, the random component of stochastic
algorithms makes it possible to escape from such local optima.
One type of stochastic algorithm is swarm intelligencealgorithms, which are based on the behavior of animals andinsects. Representative examples are particle swarm optimization (PSO) [1], ant colony optimization (ACO), and the fireflyalgorithm (FA) [2]–[4].
In the conventional FA, all fireflies are unisex. However,in the real world, there are males and females. Animals
having variation among individuals have a greater chance ofsurviving than those without variation. In the case of solving
optimization problems, we also consider that variation amongindividuals will lead to a verity of solutions. These solutions
may include the global optimal solution. Therefore, we haveproposed a new FA that distinguishes the sex of fireflies[5]. In our proposed method, the movements of males andfemales are defined from their physical differences. Therefore, the movements of males and females are different. We
investigate the features of our proposed methods using wellknown test functions introduced at Congress on Evolutionary
Computation(CEC) 2013. Numerical experiments indicate thatour proposed methods are more efficient algorithms than theconventional FA.

II. T HE C ONVENTIONAL F IREFLY A LGORITHM (FA)•

Attractiveness is proportional to their brightness, thus
for any two flashing fireflies, the less brighter one will
move towards the brighter one. The attractiveness is
proportional to the brightness and they both decreaseas their distance increases. If no one is brighter than aparticular firefly, it moves randomly;

The brightness or light intensity of a firefly is affected ordetermined by the landscape of the objective function to
be optimized.
Attractiveness of firefly β is defined by•

β = (β0 − βmin )e−γrij + βmin ,
(1)
1
(2)
γ=√ ,
L
|Xmax − Xmin |
,
(3)
L=
2
where γ is the light absorption coefficient, βmin is the minimum value of β, β0 is the attractiveness at rij = 0, and rij isthe distance between any two fireflies i and j at xi and xj .
L means the average scale for the problem. The movementof the firefly i is attracted to another more attractive firefly j,
and is determined by- 53 -

2xi = xi + β(xj − xi ) + αϵi ,ϵi = (random − 0.5)L,

(4)
(5)

Algorithm 1 Firefly Algorithm
Objective function f (x), x = (x1 , ..., xd )T
Initialize a population of fireflies xi (i = 1, 2, ..., n)
Define light absorption coefficient γ
while t < M axGeneration dofor i = 1 to n, all n fireflies dofor j = 1 to n, all n fireflies doLight intensity Ii at xi is determined by f (xi )if Ii > Ij thenMove firefly i towards j in all d dimensions
end ifAttractiveness varies with distance r via exp[−γr]Evaluate new solutions and update light intensity
end forj
end fori
Rank the fireflies and find the current best
end while
Postprocess results and visualization

TABLE I
CEC’13 T EST F UNCTIONS
No. Name
Unimodal Functions
1
Sphere function
2
Rotated High Conditioned Elliptic Function
3
Rotated Bent Cigar Function
4
Rotated Discus Function
5
Different Powers Function
Basic Multimodal Functions
6
Rotated Rosenbrock’s Function
7
Rotated Schaffers F7 Function
8
Rotated Ackley’s Function
9
Rotated Weierstrass Function
10
Rotated Griewank’s Function
11
Rastrigin’s Function
12
Rotated Rastrigin’s Function
13
Non-Continuous Rotated Rastrigin’s Function
14
Schwefel’s Function
15
Rotated Schwefel’s Function
16
Rotated Katsuura Function
17
Lunacek Bi Rastrigin Function
18
Rotated Lunacek Bi Rastrigin Function
19
Expanded Griewank’s plus Rosenbrock’s Function
20
Rotated Expanded Scaffer’s F6 Function
Composition Functions
21
Composition Function 1 (n=5, Rotated)
22
Composition Function 2 (n=3, Unrotated)
23
Composition Function 3 (n=3, Rotated)
24
Composition Function 4 (n=3, Rotated)
25
Composition Function 5 (n=3, Rotated)
26
Composition Function 6 (n=5, Rotated)
27
Composition Function 7 (n=5, Rotated)
28
Composition Function 8 (n=5, Rotated)

where xi is the position vector of firefly i, random is a
uniform random number distributed in [0, 1] and α(t) is therandomization parameter. The parameter α(t) is defined by( −4 )t/tmax
10α(t) = α(0)
,
(6)
0.9
where t is the number of iteration.
Algorithm 1 shows pseudo code of the conventional FA for
minimum optimization problems.
III. O UR P ROPOSED FA S
One of the rules of the conventional FA is all fireflies areunisex. However males and females exist in the real world.
Therefore we distinguish sex of fireflies, that is, there are two
swarms in our proposed method. The movement of female
is modeled from the physical differences. In the real world,
females are bigger than males. Thus in our proposed method
females move slower than males.
In this study, we propose two patterns as female movement.
The female movements x are determined with parameters V
byxi = xi + (β(xj − xi ) + αϵi )/V,
xi = xi + β(xj − xi )/V + αϵi .

(7)
(8)

Pattern 1 is Eq. (7) and pattern 2 is Eq. (8). Males move thesame as fireflies of the conventional FA.
IV. N UMERICAL E XPERIMENTS
We compare our two proposed methods to the conventional
FA using the 28 CEC’13 Test Functions [6](see Table.I).
These functions are composed of 5 unimodal functions,
15 basic multimodal functions and 8 composition functions.
The graphic form of the unimodal function is very simple
because there are only one minimum. The graphic form of thebasic multimodal function is more complex than the unimodalf (x∗ )
−1400
−1300
−1200
−1100
−1000
−900
−800
−700
−600
−500
−400
−300
−200
−100
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400

function because there are many local minima and local
maxima. The composition functions are combined with some
unimodal function and some multimodal function. The optimal
solutions x∗ of these benchmark functions is shifted from 0,
and the global optima f (x∗ ) are not equal to 0. The searchrange of these functions is [−100, 100]D , and the dimension
N is 30. The total number of fireflies is also 30. We defineα(0) = 0.5, β0 = 1.0, βmin = 0.2. Each parameter is decided
by reference to [2]. Each numerical experiment is run 50 times.
In each test functions, the maximum number of iterations tmax
is 1500.
We compare the number that our proposed FA wins theconventional FA in the comparison of average error value,
when the parameter V = 2 and female percentage is 50%(seeTable II).
Table II shows our proposed methods are superior to theconventional FA. When three algorithms are compared, pattern
1 of our proposed methods is the most efficient algorithm.
However when we compare two our proposed methods to theconventional FA, the number that pattern 2 of our proposed
methods obtain is larger and the sum ranks that pattern 2 ofour proposed methods obtain is fewer.
In the case of comparing the numbers each algorithm
obtains the best result for the unimodal functions, pattern 1of our proposed methods is the most efficient algorithm of
three algorithms, the conventional FA is the second efficientalgorithm. We focus on the minimum value then pattern 1- 54 -TABLE II
N UMERICAL E XPERIMENTS

f

f1

f2

f3

f4

f5

f6

f7

f8

f9

f10

f11

f12

f13

f14

FA
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std

1.47 × 10−4
1.06 × 10−4
2.14 × 10−4
2.60 × 10−5
2.82 × 106
8.44 × 105
6.54 × 106
1.45 × 106
7.08 × 104
6.67 × 102
1.64 × 106
2.61 × 105
1.93 × 105
9.46 × 104
3.60 × 105
5.32 × 104
6.05 × 10−3
4.65 × 10−3
7.74 × 10−3
8.06 × 10−4
2.30 × 101
2.11 × 101
2.83 × 101
1.11 × 100
6.24 × 10−1
1.47 × 10−1
6.77 × 100
9.64 × 10−1
2.14 × 101
2.12 × 101
2.16 × 101
8.47 × 10−2
6.07 × 100
1.56 × 100
8.80 × 100
1.67 × 100
1.07 × 10−1
1.45 × 10−3
3.27 × 10−2
9.32 × 10−3
2.89 × 101
1.49 × 101
4.58 × 101
7.71 × 100
2.86 × 101
1.39 × 101
4.68 × 101
8.02 × 100
6.14 × 101
2.39 × 101
1.14 × 102
2.16 × 101
1.49 × 103
5.91 × 102
2.48 × 103
4.24 × 102

our proposed method
pattern 1
pattern 2
2.73 × 10−5
1.05 × 10−4
1.62 × 10−5
6.20 × 10−5
3.90 × 10−5
1.55 × 10−4
4.89 × 10−6
1.61 × 10−5
2.37 × 106
3.93 × 106
4.84 × 105
5.82 × 105
7.08 × 106
1.07 × 107
1.14 × 106
2.41 × 106
1.21 × 106
6.59 × 105
3.68 × 101
1.41 × 102
1.78 × 107
1.88 × 107
3.68 × 106
3.13 × 106
1.30 × 105
2.16 × 105
7.27 × 104
1.19 × 105
1.90 × 105
3.38 × 105
2.82 × 104
5.62 × 104
4.03 × 10−3
5.34 × 10−3
2.79 × 10−3
3.36 × 10−3
5.24 × 10−3
7.15 × 10−3
5.14 × 10−4
6.74 × 10−4
2.49 × 101
2.33 × 101
2.23 × 101
2.14 × 101
2.66 × 101
2.57 × 101
9.13 × 10−1
8.41 × 10−1
7.81 × 10−1
6.00 × 10−1
3.10 × 10−2
4.64 × 10−2
3.06 × 100
3.21 × 100
7.11 × 10−1
7.53 × 10−1
2.14 × 101
2.14 × 101
2.10 × 101
2.11 × 101
2.15 × 101
2.16 × 101
9.36 × 10−2
9.22 × 10−2
7.69 × 100
5.53 × 100
3.40 × 100
2.01 × 100
1.25 × 101
9.76 × 100
1.65 × 100
1.63 × 100
7.37 × 10−3
6.73 × 10−3
4.09 × 10−4
1.40 × 10−3
3.00 × 10−2
2.15 × 10−2
6.81 × 10−3
6.14 × 10−3
2.44 × 101
2.48 × 101
1.29 × 101
1.39 × 101
4.08 × 101
4.18 × 101
6.29 × 100
6.10 × 100
2.17 × 101
2.56 × 101
9.95 × 100
9.95 × 100
3.68 × 101
5.17 × 101
5.71 × 100
8.70 × 100
5.24 × 101
5.26 × 101
1.92 × 101
1.62 × 101
9.53 × 101
1.13 × 102
1.89 × 101
2.13 × 101
1.54 × 103
1.38 × 103
7.85 × 102
4.06 × 102
2.69 × 103
2.74 × 103
4.50 × 102
4.91 × 102- 55 -

f15

f16

f17

f18

f19

f20

f21

f22

f23

f24

f25

f26

f27

f28

f

avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std
avg
min
max
std

1.51 × 103
7.22 × 102
2.86 × 103
4.17 × 102
9.57 × 10−2
1.69 × 10−2
2.58 × 10−1
4.61 × 10−2
6.13 × 101
4.49 × 101
7.86 × 101
8.65 × 100
6.07 × 101
4.68 × 101
8.16 × 101
7.67 × 100
3.35 × 100
2.23 × 100
5.10 × 100
6.60 × 10−1
1.46 × 101
1.16 × 101
1.50 × 101
9.88 × 10−1
3.19 × 102
2.00 × 102
4.44 × 102
7.87 × 101
1.54 × 103
6.91 × 102
2.72 × 103
4.71 × 102
1.70 × 103
6.12 × 102
2.65 × 103
4.71 × 102
2.13 × 102
2.01 × 102
2.28 × 102
8.16 × 100
2.19 × 102
2.10 × 102
2.40 × 102
5.51 × 100
2.95 × 102
2.00 × 102
3.26 × 102
3.88 × 101
3.90 × 102
3.13 × 102
5.33 × 102
7.38 × 101
3.88 × 102
1.00 × 102
1.36 × 103
3.21 × 102
FA

best solution
4
sum ranks
54
more than the conventional FA
compare our proposed mothods

1.52 × 103
1.43 × 103
7.65 × 102
4.71 × 102
2.35 × 103
2.40 × 103
4.02 × 102
4.17 × 102
3.17 × 10−2
4.36 × 10−2
6.88 × 10−3
1.25 × 10−2
8.80 × 10−2
1.01 × 10−1
1.90 × 10−2
2.17 × 10−2
5.39 × 101
5.63 × 101
4.46 × 101
4.58 × 101
6.30 × 101
9.27 × 101
4.72 × 100
8.14 × 100
5.47 × 101
5.52 × 101
4.40 × 101
4.28 × 101
7.77 × 101
6.74 × 101
7.15 × 100
5.80 × 100
3.19 × 100
3.30 × 100
2.28 × 100
2.24 × 100
4.73 × 100
5.17 × 100
6.52 × 10−1
5.77 × 10−1
1.48 × 101
1.49 × 101
1.17 × 101
1.23 × 101
1.50 × 101
1.50 × 101
7.62 × 10−1
5.45 × 10−1
3.29 × 102
3.17 × 102
1.00 × 102
2.00 × 102
4.44 × 102
4.44 × 102
7.54 × 101
8.39 × 101
1.62 × 103
1.41 × 103
4.87 × 102
6.42 × 102
2.95 × 103
3.86 × 103
4.90 × 102
5.48 × 102
1.85 × 103
1.61 × 103
4.17 × 102
7.73 × 102
3.96 × 103
2.60 × 103
6.14 × 102
4.63 × 102
2.10 × 102
2.16 × 102
2.00 × 102
2.00 × 102
2.33 × 102
2.31 × 102
1.07 × 101
7.05 × 100
2.27 × 102
2.18 × 102
2.00 × 102
2.10 × 102
2.49 × 102
2.28 × 102
1.04 × 101
4.24 × 100
2.93 × 102
2.97 × 102
2.00 × 102
2.00 × 102
3.34 × 102
3.21 × 102
4.43 × 101
3.61 × 101
4.34 × 102
4.12 × 102
3.05 × 102
3.07 × 102
6.27 × 102
5.59 × 102
1.07 × 102
8.01 × 101
3.36 × 102
3.28 × 102
1.00 × 102
1.00 × 102
1.31 × 103
1.31 × 103
1.97 × 102
2.05 × 102
pattern 1
pattern 2
our proposed method
13
11
54
50
16
20
13
16

of our proposed methods obtains the smallest value in all unimodal functions. Therefore pattern 1 of our proposed methods
is the earliest convergence algorithm of three algorithms.
In the case of comparing the numbers each algorithm obtains the best result for the basic multimodal functions, pattern
1 of our proposed methods is the most efficient algorithmof three algorithms, pattern 2 of our proposed methods isthe second efficient algorithm. Sum rank of pattern 1 ofour proposed methods for basic multimodal functions is 28.
Sum rank of pattern 2 of our proposed methods for basic
multimodal functions is 25. Therefore we cannot say thatpattern 1 of our proposed methods easy to escape local optima.
In the case of comparing the numbers each algorithm
obtains the best result for the composition functions, pattern
2 of our proposed methods is the most efficient algorithmof three algorithms, pattern 1 of our proposed methods isthe second efficient algorithm. In addition, pattern 2 of our
proposed methods the smallest sum rank for basic multimodal
functions and composition functions. Therefore pattern 2 ofour proposed methods is the most efficient algorithm of threealgorithms.
V. C ONCLUSION
In this study, we have proposed two new FAs existing
fireflies flying slow. We applied these two FAs to CEC’13 test
functions. Numerical experiments indicate that our proposed
methods are more efficient algorithms than the conventional
FA. Pattern 1 of our proposed methods is the earliest conver-gence algorithm of three algorithms. Pattern 2 of our proposed
methods is the most efficient algorithm of three algorithms.
In the future work, we try to improve these two FAs, compare other improved algorithms and apply actual optimization
problems.
ACKNOWLEDGMENT
This work was partly supported by JSPS Grant-in-Aid for
Challenging Exploratory Research 26540127.
R EFERENCES[1] J. Kennedy, R. Eberhart, ”Particle Swarm Optimization”, Proceedingsof the IEEE international conference on neural networks, pp. 19421948,
1995.
[2] Yang, X.S., ”Nature-Inspired Metaheuristic Algorithms Second Edition”, Luniver Press, 2010.
[3] Yang, X.S., ”Firefly Algorithms for multimodal Optimization”, Int. J.
Bio-Inspired Computation, Vol. 2, No. 2, pp.78-84, 2010.
[4] H. Matsushita, ”Firefly Algorithm with Dynamically Changing Connections”, Proceedings of International Symposium on Nonlinear Theory
and its Application, pp.906-909, 2014.
[5] S. Lukasik, S. Zak, ”Firefly Algorithm for Continuous Constrained
Optimization Tasks”, Computational Collective Intelligence. Semantic
Web, Social Networks and Multiagent Systems, Vol. 5796 of the series
Lecture Notes in Computer Science, pp.97-106, 2009.
[6] J.J. Liang, B.Y. Qu, P.N. Suganthan, and A.G. Hernandez-Diaz, “Problem Definitions and Evaluation Criteria for the CEC 2013 Special Session on Real-Parameter Optimization”, Technical Report 201212, Computational Intelligence Laboratory, Zhengzhou University, Zhengzhou
China and Technical Report, Nanyang Technological University, Singapore, January 2013.

- 56 -