0% found this document useful (0 votes)
18 views31 pages

Firefly Optimization by Endalew

This document describes a course titled "Advanced Optimization Techniques" that is part of the MSc in Electrical Power and Control Engineering program at Adama Science and Technology University. The course covers the firefly algorithm, which is an optimization technique inspired by the flashing patterns of fireflies. It involves fireflies moving towards more attractive, brighter fireflies within their sight in order to find mates or prey. Variations of the algorithm include discrete, chaotic, Lagrangian, and memetic forms. The firefly algorithm has applications in areas like image compression, antenna design, and scheduling optimization.

Uploaded by

Birhex Feye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views31 pages

Firefly Optimization by Endalew

This document describes a course titled "Advanced Optimization Techniques" that is part of the MSc in Electrical Power and Control Engineering program at Adama Science and Technology University. The course covers the firefly algorithm, which is an optimization technique inspired by the flashing patterns of fireflies. It involves fireflies moving towards more attractive, brighter fireflies within their sight in order to find mates or prey. Variations of the algorithm include discrete, chaotic, Lagrangian, and memetic forms. The firefly algorithm has applications in areas like image compression, antenna design, and scheduling optimization.

Uploaded by

Birhex Feye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Degree Program MSc in Electrical Power and Control

Engineering (Control Engineering)


Course Title: Advanced Optimization Techniques (Course
Code EPCE6302) Credits 3; Contact Hours/week Lecture 2,
Tutorial Practice/Laboratory 3

Course Instructor: Dr Endalew Ayenew, Address SoEEC


Building Room 8: E-mail:[email protected]
Adama Science and Technology University School of
Electrical Engineering and Computing Department of
Electrical Power and Control Engineering

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
ፋየርቢሮ
ፋየርቢሮ

2.2 Firefly Algorithms (FA)


A flying insect with a tail that shines in the dark.
(የምታበራ ተኩስ ወይም ፋየርቢሮ)

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2 The Firefly Algorithm

• FA was based on the flashing patterns and


behavior of fireflies.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.1 Firefly Behavior
• Two fundamental functions of such flashes

– Attract mating partners

– Attract potential prey

• Two combined factors make most fireflies visible to a limit


distance

– The light intensity (brightness)-I decreases as the distance r


increases in terms of I ∝ 1/r2.

– The air absorbs light, which becomes weaker and weaker as


the distance increases.
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.2 Standard Firefly Algorithm
• Three idealized rules

– All fireflies are unisex

• One firefly will be attracted to other fireflies regardless of


their sex.

– Attractiveness is proportional to a firefly’s brightness.

• For any two flashing fireflies, the less brighter one will move
toward the brighter one.

• The attractiveness is proportional to the brightness, both of


which decrease as their distance increases.
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.2 Standard Firefly Algorithm

• If there is no brighter one than a particular


firefly, it will move randomly.

– The brightness of a firefly is affected or


determined by the landscape of the objective
function.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Variations of Light Intensity and
Attractiveness
• There are two important issues

– Variation of light intensity

• The brightness (attractiveness)-β of a firefly at a

particular location x can be chosen as I(x) ∝ f(x)

– Formulation of the attractiveness

• The attractiveness β is relative; it should be seen in the

eyes of the beholder or judged by the other fireflies.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Variations of Light Intensity and
Attractiveness

• Light attenuation

• Light absorption

• The light intensity I(r ) varies according to the inverse


square law
I(r ) = Is /r2

where Is is the intensity at the source.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Variations of Light Intensity and
Attractiveness

• For a given medium with a fixed light absorption


coefficient γ , the light intensity I varies with the
distance r. That is,
2
I =I0 e-γr

where β0 is the original light intensity at zero

distance r = 0

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Variations of Light Intensity and
Attractiveness

• The combined effect of both the inverse-square


law and absorption can be approximated as the
following Gaussian form:

I(r) = I0 e-γr2

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Variations of Light Intensity and
Attractiveness

• Because a firefly’s attractiveness is proportional


to the light intensity seen by adjacent fireflies, we
can now define the attractiveness β of a firefly by

where β0 is the attractiveness at r = 0.


By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Firefly Algorithm Modeling and
Position Update
• The distance between any two fireflies i and j at xi
and xj , respectively, is the Cartesian distance

where xi,k is the kth component of the spatial


coordinate xi of ith firefly.
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Firefly Algorithm Modeling and
Position Update
• The movement of a firefly i attracted to another, more attractive

(brighter) firefly j is determined by

where the second term is due to the attraction.

• The third term is randomization, with α being the randomization

parameter, and ϵi is a vector of random numbers drawn from a

Gaussian distribution or uniform distribution.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Firefly Algorithm Modeling and Position Update

(randomness reduction)

More attractiveness (brighter) = fitness function= f(x)


By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.3 Firefly Algorithm Modeling and Position Update

Where

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.4 Controlling Randomization
• A further improvement on the convergence of the
algorithm is to vary the randomization parameter-α so that
it decreases gradually as the optima are approaching

or

where θ ∈ (0, 1]

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.4 Controlling Randomization

• Simulations indicated that the efficiency may


improve if we add an extra term λ ϵi (g∗−xi ) to
the updating formula, where g∗ is the current
global optimum.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.5 Scaling and Limiting Cases
• In fact, any measure that can effectively characterize the
quantities of interest in the optimization problem can be
used as the “distance-r ” .
• The initial locations of these n fireflies distribute
relatively uniformly over the entire search space. As the
iterations proceed, the fireflies would converge into all
the local optima (including the global ones).

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.5 Scaling and Limiting Cases
Note: from position update equation

• For γ → 0, the attractiveness is constant β = β0,  FA  PSO.


• For γ → ∞, the attractiveness is zero in the sight of other fireflies
 FA  Simulated Annealing (SA).
Thus, Special Cases of FA are: differential evolution (DE),
Adaptive PSO, SA, and Harmony Search Algorithm (HSA)
Because the firefly algorithm is usually a case between these two
extremes, it is possible to adjust the parameter γ and α so that it
can outperform both simulated annealing and PSO.
By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.5 Scaling and Limiting Cases

• A further advantage of FA is that different fireflies


will work almost independently. It is thus
particularly suitable for parallel implementation.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.6 Implementation

as shown in the figures on next slides.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.6 Implementation
• α0 = 0.5, γ = 1 and β0 = 1
• 25 fireflies in 20 generations (iterations)

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.6 Implementation

(right)

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.7 Types of the Firefly Algorithm
• Discrete firefly algorithm (DFA)

• Chaotic firefly algorithm (CFA)

• Lagrangian firefly algorithm (LFA)

• Memetic firefly algorithm (MFA)

• Multiobjective discrete firefly algorithm (MDFA)

• Mulitobjective firefly algorithm (MOFA)

• Multi-objective enhanced firefly algorithm (MOEFA)

• Hybrid firefly algorithms (HFA)

• Parallel firefly algorithm with predation (PFAP)

• Controller tuning By Dr Endalew Ayenew


2023/5/4
EPCE, SoEEC, ASTU
2.2.8 Firefly Algorithms in Applications
• Digital image compression

• Highly nonlinear, multimodal design problems

• Antenna design optimization

• Discrete version of FA that can efficiently solve


NP-hard scheduling problems

• Multi-objective load dispatch problems

• Classifications and clustering

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.8 Firefly Algorithms in Applications
• Non-convex economic dispatch problem with valve-loading
effect

• Economic load dispatch problems with reduced power losses

• Traveling salesman problem by discrete FA

• Scheduling jobs on grid computing

• Mixed integer programming and load dispatch problems

• Training neural networks

• spectral spring-mass systems

• Support vector regression with the chaos-based FA for stock


market price forecasting By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.9 Why the Firefly Algorithm is
Efficient
• FA has two major advantages over other algorithms:
– Automatic subdivision
– Ability to deal with multimodality

• First, FA is based on attraction and attractiveness. This


leads to the fact that the whole population can
automatically subdivide into subgroups, and each
group can swarm around each mode or local optimum.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU
2.2.9 Why the Firefly Algorithm is
Efficient
• Second, this subdivision allows the fireflies to be able
to find all optima simultaneously if the population
size is sufficiently higher than the number of modes.

• This automatic subdivision ability makes FA


particularly suitable for highly nonlinear, multimodal
optimization problems.

By Dr Endalew Ayenew
2023/5/4
EPCE, SoEEC, ASTU

You might also like