RISP

NCSP’16

International Workshop on
Nonlinear Circuits, Communications and Signal Processing

Honolulu, Hawaii, USA, March 6-9, 2016

Investigation of Firefly Algorithm Distinguishing between Males and Femalesfor Minimum Optimization Problems
Masaki Takeuchi,† Haruna Matsushita,‡ Yoko Uwate,† and Yoshifumi Nishio††Dept. of Electrical and Electronic Engineering, Tokushima University
2-1 Minami-Josanjima, Tokushima 770–8506, Japan
Email: {masaki,uwate,nishio}@ee.tokushima-u.ac.jp‡Dept. of Electronics and Information Engineering, Kagawa University
2217-20 Hayashi-cho, Takamatsu, Kagawa, 761-0396, Japan
Email: haruna@eng.kagawa-u.ac.jp

We have proposed Firefly Algorithm Distinguishing between
Males and Females. This algorithm exists together withmales and females. In this study, we investigate the feature of
our proposed algorithm by changing parameters and the rateof females. We compare our proposed Firefly Algorithm withthe conventional Firefly Algorithm by using famous four test
functions. Numerical experiments indicate that our proposed
Firefly Algorithm is superior to the conventional Firefly Algorithm under some conditions.

and females are defined from the physical differences. Therefore, the movements of males and females are different fromeach other. We investigate the feature of FA-DMF by using
famous four test functions. Numerical experiments indicatethat as increasing the rate of females, FA-DMF tends to increase randomness.
This study is organized as follows: first, we explain theconventional Firefly Algorithm in Section 2, and then, we describe in detail of FA-DMF in Section 3. Followed by, weshow numerical experiments. Finally, we conclude in thisstudy.

1. Introduction

2. The Conventional Firefly Algorithm (FA) [2]The optimization problems has been important more andmore, recently. Most optimization problems are nonlinearwith many constraints. Consequently, optimization algorithms require efficiency in order to find optimal solution.
Stochastic algorithms, one category of optimization algorithms, are efficient optimization problems. Stochastic algorithms have a deterministic component and a random component. Algorithms having only the deterministic component
are almost all local search algorithms. There is a risk to be
trapped at local optima such algorithms. However, stochastic
algorithms are possible to jump out such locality by having
random component.
One of stochastic algorithms is the swarm intelligence algorithms. The swarm intelligence algorithms are based on
the behavior of animals and insects. Representative examples are Particle Swarm Optimization (PSO) [1], Ant Colony
Optimization (ACO), and Firefly Algorithm (FA) [2–4].
On the conventional FA, all fireflies are unisex. However, in the real world, there are males and females. Therefore, we distinguish sex of fireflies. This proposed method iscalled Firefly Algorithm Distinguishing between Males andFemales (FA-DMF). On FA-DMF, the movements of males

Firefly Algorithm (FA) has been developed by Yang, andit was based on the idealized behavior of the flashing characteristics of fireflies. It is suitable for multi-peak optimization
problems. The conventional FA is idealized these flashing
characteristics as the following three rules

Abstract• All fireflies are unisex so that one firefly is attracted toother fireflies regardless of their sex;
• 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 decrease as
their distance increases. If no one is brighter than a particular 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- 534 -

β = β0 e−γrij
2(1)

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

Algorithm 2 Firefly Algorithm Distinguishing between
Males and Females
Objective function f (x), x = (x1 , ..., xd )T
Initialize a population of male fireflies xi (i = 1, 2, ..., n)
Initialize a population of female fireflies yi (i = 1, 2, ..., m)
Define light absorption coefficient γ
while t < M axGeneration dofor i = 1 to n, all n male fireflies dofor j = 1 to n, all n male fireflies doLight intensity Ixi at xi is determined by f (xi )if Ixi > Ixj thenMove male firefly i towards j in all d dimensions
end ifend forj
for k = 1 to m, all m female fireflies doLight intensity Iyk at yk is determined by f (yk )if Ixi > Iyk thenMove male firefly i towards k in all d dimensions
else
Move female firefly k towards i in all d dimensions
where γ is the light absorption coefficient, β0 is the attracend
iftiveness at rij = 0, and rij is the distance between any two
end
fork
fireflies i and j at xi and xj . The movement of the firefly i
Attractiveness varies with distance r via exp[−γr]is attracted to another more attractive firefly j, and is deterEvaluate new solutions and update light intensity
mined byend fori
Rank the fireflies and find the current best
xi = xi + ∆x,
(2)
end
while
∆x = β(xj − xi ) + αϵi ,(3)Postprocess results and visualization
where xi is the position vector of firefly i, ϵi is the vectorof random variable, and α(t) is the randomization parameter.
other distant fireflies. In addition, we change the randomizaThe parameter α(t) is defined bytion parameter of female.
( −4 )t/tmax
The female parameters α(t) and β, and the female move10α(t) = α(0),(4) ment x is determined with parameters V and W by
0.9
( 4 )t/2tmax
10
where t is the number of iteration.
α(t) = α(0)
,
(5)
0.9
Algorithm 1 shows pseudo code of the conventional FA for2minimum optimization problems.
β = β e−γrij /W ,(6)0x = x + ∆x/V.
(7)
3. Firefly Algorithm Distinguishing between Males andFemales (FA-DMF)
where ∆x is the same equation (3).
In the proposed method, males are attracted to all fireflies,
One of the rules of the conventional FA is that all fire- while females are attracted to only males. Males move theflies are unisex. However, males and females exist in the same as fireflies of the conventional FA. Algorithm 2 shows
real world. Therefore, we distinguish sex of fireflies, that is, pseudo code of FA-DMF for minimum optimization probthere are two swarms in our proposed method. We call our lems.
proposed method Firefly Algorithm Distinguishing between
Males and Females (FA-DMF). The movement of female ismodeled from the physical differences. In the real world, fe- 4. Numerical Experiments of FA-DMF
males are bigger than males and female eyes are smaller than
We compare FA-DMF to the conventional FA with four test
male. Thus, in our proposed method, females move slower
functions (see Table 1). These optimal solutions are f (x) = 0
than males, and females have difficulty finding the flashes ofat x = 0.

- 535 -

Table 1: The Test Functions
nameSphereRastrigin

Formulan∑f (x) =
x2i
f (x) =i=1n∑(x2i − 10 cos (2πxi ) + 10)

range[-5.12,5.12][-5.12,5.12]

ity easily. In addition, when the graph has gentle gradient,
FA-DMF is inferior to the conventional FA by numerical experiment results of Rastrigin and Greiwank functions.
5. Conclusion

i=1

n
n
1 ∑ 2 ∏xi
xi −cos ( √ ) + 1
4000 i=1
i
i=1
v


u d
u
∑
1
1
t
2
x 
f (x) = −20 exp −
5 d i=1 i
( d
)
1∑
− exp
cos (2πxi ) + 20 + e
d i=1In this study, we investigated the feature of Firefly Algorithm Distinguishing between Males and Females (FA-DMF).
We applied our proposed Firefly Algorithm to four test funcAckley[-30,30]
tions. Numerical experiments indicated that FA-DMF is superior to the conventional FA under some conditions. FADMF jump out locality more easily than the conventional FA,
while FA-DMF is inferior about absorption speed.
In the future work, we improve our proposed Firefly Algorithm,
compare to other improved Firefly Algorithms.
In case of solving minimum problem, Sphere and Ackley
functions are mono-peak optimization problem, while RasReferences
trigin and Greiwank functions are multi-peak optimization
problem. The graphic form of Sphere function is very simple. On the other hands, the graphic form of Ackley function [1] J. Kennedy, R. Eberhart, ”Particle Swarm Optimization”, Proceedings of the IEEE international conference
is more complex than Sphere function, because there are a lot
on neural networks, pp. 1942―1948, 1995.
of local minimum and local maximum. There are also a lotof local minimum and local maximum in Rastrigin and Grei- [2] Yang, X.S., ”Nature-Inspired Metaheuristic Algorithms
wank functions. The graph of Greiwank function has gentler
Second Edition”, Luniver Press, 2010.
gradient than Rastrigin function.
Numerical experiment results are shown in Table 2. Each[3] H. Matsushita, ”Firefly Algorithm with Dynamicallynumerical experiment is run 100 times. In each test function,
Changing Connections”, Proceedings of International
we define the number of dimensions N = 30, tmax = 1000,
Symposium on Nonlinear Theory and its Application,
V = 3 and W = 4. In this study, we change female percentpp.906-909, 2014.
age from 10 to 90 every 10 percentage.
[4] S. Lukasik, S. Zak, ”Firefly Algorithm for Continuous
Almost all of results of the conventional FA for Sphere andConstrained Optimization Tasks”, Computational ColGreiwank functions are better than FA-DMF. When females
lective Intelligence. Semantic Web, Social Networks
exist 10 percent, FA-DMF obtains better results about averand Multiagent Systems, Vol. 5796 of the series Lecture
age and minimum. In the case of Greiwank function, FANotes in Computer Science, pp.97-106, 2009.
DMF obtains better results about 10 percent, and minimum
and maximum of 20 percent. FA-DMF obtains better results [5] M. Takeuchi, H. Matsushita, Y. Uwate, and Y. Nishio,
except minimum when 90 percent of swarm are females. FA“Firefly Algorithm Distinguishing between Males andDMF obtains better results of Ackley function about average
Females for Minimum Optimization Problems”, IEEEand maximum, while the conventional FA obtains better reWorkshop on Nonlinear Circuit Networks (NCN’15),
sults about minimum. Therefore, our proposed method is fitpp.50-51, 2015.
ted for Rastrigin and Ackley functions.
We make a line graph: the vertical axis shows averagesof solutions (log scale) and the horizontal axis shows female
percentages (see Fig.1).
As increasing female percentage, the graphs of average ofSphere, Greiwank and Ackley functions are continuously increasing. On the other hands, the graph of average of Rastirigin function decrease slowly from 10 to 30, and the graphincrease slightly from 30. According to Fig. 1, FA-DMF issuitable for Rastrigin and Ackley functions. Numerical experiments of Sphere function show that fireflies of the conventional FA converge faster than FA-DMF. FA-DMF obtains
better results than the conventional FA about Ackley function.
Therefore, we find that fireflies of FA-DMF jump out localGriewankf (x) =[-600,600]- 536 -

Table 2: Numerical Experiment Results of FA-DMF
namefemale percentage
ave
Sphereminmax
ave
Rastrigin min
max
ave
Griewank min
max
ave
Ackleyminmax

conventional FA
2.80 × 10−7
1.69 × 10−7
3.90 × 10−7
2.63 × 101
1.21 × 101
4.66 × 101
3.71 × 10−4
1.29 × 10−4
8.59 × 10−3
6.35 × 100
9.82 × 10−4
2.00 × 101

102.79 × 10−7
1.53 × 10−7
4.08 × 10−7
2.22 × 101
9.95 × 100
4.28 × 101
2.83 × 10−4
1.23 × 10−4
7.68 × 10−3
2.29 × 10−3
1.83 × 10−3
2.80 × 10−3

20
3.03 × 10−7
1.83 × 10−7
4.12 × 10−7
2.07 × 101
1.09 × 101
3.68 × 101
5.23 × 10−4
1.21 × 10−4
7.65 × 10−3
2.41 × 10−3
1.83 × 10−3
2.84 × 10−330
3.33 × 10−7
2.21 × 10−7
4.43 × 10−7
1.83 × 101
7.96 × 100
2.79 × 101
7.39 × 10−4
1.41 × 10−4
1.02 × 10−2
2.49 × 10−3
1.80 × 10−3
2.97 × 10−340
3.55 × 10−7
2.30 × 10−7
5.13 × 10−7
1.93 × 101
1.09 × 101
3.48 × 101
1.00 × 10−3
1.50 × 10−3
7.75 × 10−3
2.58 × 10−3
2.11 × 10−3
3.21 × 10−3

FA-DMF50
4.04 × 10−7
1.88 × 10−7
6.01 × 10−7
1.90 × 101
7.96 × 100
3.18 × 101
1.02 × 10−3
1.58 × 10−4
1.51 × 10−2
2.68 × 10−3
1.74 × 10−3
3.26 × 10−360
4.36 × 10−7
2.50 × 10−7
6.78 × 10−7
1.88 × 101
1.09 × 101
2.98 × 101
1.97 × 10−3
2.07 × 10−4
1.27 × 10−2
2.83 × 10−3
2.01 × 10−3
3.54 × 10−370
5.64 × 10−7
3.21 × 10−7
8.24 × 10−7
1.97 × 101
1.09 × 101
3.28 × 101
2.82 × 10−3
1.77 × 10−4
2.00 × 10−2
3.16 × 10−3
2.47 × 10−3
4.00 × 10−3(a) Sphere function.

(b) Rastrigin function.

(c) Greiwank function.

(d) Ackley function.

Figure 1: Example of numerical experiments.

- 537 -

80
7.09 × 10−7
3.67 × 10−7
1.10 × 10−6
2.10 × 101
1.19 × 101
3.48 × 101
5.13 × 10−3
3.75 × 10−4
2.55 × 10−2
1.72 × 10−2
2.86 × 10−3
1.34 × 10090
2.90 × 10−6
1.35 × 10−6
5.85 × 10−6
2.34 × 101
1.39 × 101
4.08 × 101
1.04 × 100
1.03 × 100
1.06 × 100
4.39 × 100
2.66 × 100
5.62 × 100