49
1 计算智能 9: 萤火虫算法 2017-5-2

计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

  • Upload
    phungtu

  • View
    219

  • Download
    5

Embed Size (px)

Citation preview

Page 1: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

1

计算智能

第9讲: 萤火虫算法

2017-5-2

Page 2: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

2

Firefly Algorithm

by Mr Zamani

& Hosseini

Page 3: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

3

Isfahan University of Technology. Fall 2010

Page 4: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

4

Outline

• Abstract

• Introduction

• Particle Swarm Optimization

• Firefly Algorithm

• Comparison of FA with PSO and GA

• Conclusions

• References

Isfahan University of Technology. Fall 2010

Page 5: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

5

Abstract

• Nature-inspired algorithms are among the most powerful algorithms for optimization

• We will try to provide a detailed description of a new Firefly Algorithm (FA) for multimodal optimization applications

• We will compare the proposed firefly algorithm with other metaheuristic algorithms such as particle swarm optimization

• Finally we will discuss its applications

and implications for further research

Isfahan University of Technology. Fall 2010

Page 6: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

6

Introduction

• PSO – Particle swarm optimization (PSO) was developed by Kennedy

and Eberhart in 1995

– based on the swarm behavior such as fish and bird schooling in nature, the so-called swarm intelligence

– Though particle swarm optimization has many similarities with genetic algorithms, but it is much simpler because it does not use mutation/crossover operators

– Instead, it uses the real-number randomness and the global communication among the swarming particles. In this sense, it is also easier to implement as it uses mainly real numbers

• FA – particle swarm optimization is just a special class of the

firefly algorithms

Isfahan University of Technology. Fall 2010

Page 7: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

7

Particle Swarm Optimization(PSO)

• The PSO algorithm searches the space of the objective functions by adjusting the trajectories of individual agents, called particles, as the piecewise paths formed by positional vectors in a quasi-stochastic manner

• The particle movement has two major components

– stochastic component

– deterministic component

Isfahan University of Technology. Fall 2010

Page 8: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

8

PSO

Isfahan University of Technology. Fall 2010

Page 9: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

9

PSO

Isfahan University of Technology. Fall 2010

Page 10: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

10

Behavior of Fireflies

• The flashing light of fireflies is an amazing

sight in the summer sky in the tropical and

temperate regions

• There are about two thousand firefly

species, and most fireflies produce short

and rhythmic flashes

• The pattern of flashes is often unique

for a particular species

Isfahan University of Technology. Fall 2010 Isfahan University of Technology. Fall 2010

Page 11: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

11

Behavior of Fireflies

• Two fundamental functions of such flashes are – to attract mating partners (communication)

– to attract potential prey

• Females respond to a male’s unique pattern of flashing in the same species

• We know that the light intensity at a particular distance ‘r’ from the light source obeys the inverse square law

• The air absorbs light which becomes weaker and weaker as the distance increases

• The flashing light can be formulated in such

a way that it is associated with the

objective function

Isfahan University of Technology. Fall 2010

Page 12: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

12

Firefly Algorithm

• For simplicity in describing our new FA we now use the following three idealized rules: – all fireflies are unisex so that one firefly will be

attracted to other 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. 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. For a maximization problem, the brightness can simply

be proportional to the value of the

objective function

Isfahan University of Technology. Fall 2010

Page 13: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

13

Firefly Algorithm

Isfahan University of Technology. Fall 2010

Page 14: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

14

Attractiveness

Isfahan University of Technology. Fall 2010

Page 15: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

15

Attractiveness

Isfahan University of Technology. Fall 2010

Page 16: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

16

Distance and Movement

Isfahan University of Technology. Fall 2010

Page 17: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

17

Scaling and Asymptotic Cases

• It is worth pointing out that the distance r

defined above is not limited to the

Euclidean distance

• There are two important limiting cases

when

Isfahan University of Technology. Fall 2010

Page 18: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

18

Validation

Isfahan University of Technology. Fall 2010

Page 19: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

19

Validation

Isfahan University of Technology. Fall 2010

Page 20: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

20

Validation

Isfahan University of Technology. Fall 2010

Page 21: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

21

Comparison of FA

with PSO and GA

Isfahan University of Technology. Fall 2010

Page 22: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

22

PSO vs. FA

• PSO has search velocities, determined by

inertia, personal influence and social influence

• FA lacks search velocities, it uses an inverse-

square law to guide interactions between all

search processes. This leads to more localised

interactions and a consequent tendency to form

multiple regions of search.

Isfahan University of Technology. Fall

2010

Page 23: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

23

GA vs. FA

• GA uses binary representation, has

mutation and crossover operations,

computational costly

• FA directly operates on real numerical

values, and does not have mutation and

crossover operations, it updates positions

by updating velocity, so is more efficient

Isfahan University of Technology. Fall

2010

Page 24: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

24

Conclusions

• we have formulated a new firefly algorithm and analyzed its similarities and differences with particle swarm optimization

• We then implemented and compared these algorithms

• Our simulation results for finding the global optima of various test functions suggest that particle swarm often outperforms traditional algorithms such as genetic algorithms, while the new

firefly algorithm is superior to both PSO and

GA in terms of both efficiency and

success rate

Isfahan University of Technology. Fall 2010

Page 25: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

25

Levy Flights

• Flight behavior of many animals and

insects

• Fruit flies explore their landscape using a

series of straight flight paths punctuated

by a sudden 90 degree turn.

• Applied to optimization and optimal search

Isfahan University of Technology. Fall 2010

Page 26: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

26

Levy Flights (Cont.)

Isfahan University of Technology. Fall 2010

Page 27: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

27

Levy Flights Example

• Left: example of 1000 steps of levy flight

• Right: example of 1000 steps of an approximation to a Brownian motion type of Levy flight

Isfahan University of Technology. Fall 2010

Page 28: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

28

Levy-Flight Firefly Algorithm (LFA)

Isfahan University of Technology. Fall 2010

Page 29: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

29

LFA Tests

• Initial locations of 40 fireflies (left) and their locations after 5 iterations (right) on 2D Ackley function.

Isfahan University of Technology. Fall 2010

Page 30: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

30

LFA vs. PSO

Isfahan University of Technology. Fall 2010

Page 31: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

31

Eagle Strategy (ES)

• Based on the foraging behavior of eagles such as golden eagles.

• An eagle forages in its own territory by flying freely in a random manner much like the Levy flights.

• Once the prey is sighted, the eagle will change its search strategy to an intensive chasing tactics so as to catch the prey as efficiently as possible.

Isfahan University of Technology. Fall 2010

Page 32: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

32

ES

• Perform Levy walks in whole domain.

• If find a prey change to a chase strategy.

• Chase strategy can be considered as an

intensive local search.

• We can use any optimization technique.

• We can use FA.

Isfahan University of Technology. Fall 2010

Page 33: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

33

Isfahan University of Technology. Fall 2010

Page 34: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

34

ES vs. PSO

Isfahan University of Technology. Fall 2010

Page 35: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

35

Glowworm Swarm Optimization

(GSO)

• Glowworm == immature

firefly

• Similar to FA but with little

differences.

• introduced by K.N.

Krishnanand and D. Ghose

in 2005.

• Multimodal optimization

Isfahan University of Technology. Fall 2010

Page 36: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

36

Dynamic Decision Range

• Effect of distant glowworms are

discounted when a glowworm has

sufficient number of neighbors or the

range goes beyond the range of

perception of the glowworms.

• Every glowworm has a neighborhood

range

• Agents depend only on information

available in their neighborhood

Isfahan University of Technology. Fall 2010

Page 37: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

37

Dynamic Decision Range(Cont.)

• Neighborhood is bounded by a radial sensor range.

Isfahan University of Technology. Fall 2010

Page 38: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

38

Dynamic Decision Range(Cont.)

Isfahan University of Technology. Fall 2010

Page 39: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

39

Isfahan University of Technology. Fall 2010

Page 40: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

40

Isfahan University of Technology. Fall 2010

Page 41: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

41

GSO vs. PSO

Isfahan University of Technology. Fall 2010

Page 42: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

42

GSO vs. PSO (Cont.)

Isfahan University of Technology. Fall 2010

Page 43: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

43

flow shop scheduling problem

(FSSP)

• a complex combinatorial optimization

problem

• set of n jobs (1, …, n)

• set of m machines (1, …, m)

• Set of n jobs to be processed in a set of m

machines in the same order

• minimization of makespan, mean flow, etc.

Isfahan University of Technology. Fall 2010

Page 44: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

44

FSSP Cont.

• NP-Complete

• (n!)m schedules need to be considered

• Many attempts to solve this problem using

different methods including EAs.

• FA can be used

Isfahan University of Technology. Fall 2010

Page 45: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

45

Discretization of FA

Isfahan University of Technology. Fall 2010

Page 46: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

46

Discrete Firefly Algorithm (DFA)

• Use the sigmoid function to convert real values

to binary values

• Outperforms an ACO implementation named

MHD-ACS.

Isfahan University of Technology. Fall 2010

Page 47: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

47

References

Isfahan University of Technology. Fall 2010

Page 48: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

48

References

Isfahan University of Technology. Fall 2010

Page 49: 计算智能 第9讲 萤火虫算法 - Shuigeng Zhou-Professor …admis.fudan.edu.cn/courses/2017/CI/Lecture 9-Firefly...4 Outline • Abstract • Introduction • Particle Swarm

49

Isfahan University of Technology. Fall 2010