Вы находитесь на странице: 1из 17

106

CHAPTER 8

FIREFLY ALGORITHM

8.1 INTRODUCTION

The Firefly Algorithm (FA) is a nature - inspired algorithm which is


based on the social flashing behavior of fireflies. A significant advantage of
the algorithm is the fact that it uses mainly real random numbers, and it is
based on the global communication among the swarming particles i.e., the
fireflies, and as a result, it seems more effective multi objective optimization.
In this algorithm, the flashing light helps fireflies for finding mates, attracting
their potential prey and protecting themselves from their predators. The
swarm of fireflies will move to brighter and more attractive locations by the
flashing light intensity that associated with the objective function of problem
considered in order to obtain efficient optimal solutions.

The development of firefly-inspired algorithm was based on three


idealized rules:

i) Artificial fireflies are unisex so that sex is not an issue for


attraction.

ii) Attractiveness is proportional to their flashing brightness


which decreases as the distance from the other firefly
increases due to the fact that the air absorbs light. Since the
most attractive firefly is the brightest one, to which it
convinces neighbours moving toward. In case of no brighter
one, it freely moves any direction
107

iii) The brightness of the flashing light can be considered as


objective function to be optimized.

The main steps of the FA start from initializing a swarm of fireflies,


each of which is determined the flashing light intensity. During the loop of
pair wise comparison of light intensity, the firefly with lower light intensity
will move toward the higher one. The moving distance depends on the
attractiveness. After moving, the new firefly is evaluated and updated for the
light intensity. During pair wise comparison loop, the best-so-far solution is
iteratively updated. The pair wise comparison process is repeated until
termination criteria are satisfied. Finally, the best-so-far solution is visualized.

In this work, the evaluation on the goodness of schedules is


measured by the makespan, which can be calculated using equation (8.1),
where Ck is completed time of job k.

Minimize: Cmax = max (C1, C2…Ck) (8.1)

8.2 IMPORTANT DEFINITONS IN FIREFLY ALGORITHM

There are some definitions in FA namely, Distance, Attractiveness


and Movement.

(a) Distance:

The distance between any two fireflies i and j at positions xi and xj,
respectively, can be defined as a Cartesian or Euclidean distance (rij) using
equation (8.2), where xi,k is the kth component of the spatial coordinate xi of the
ith firefly and d is the number of dimensions.

rij = i - xj = ( , , ) (8.2)
108

(b) Attractiveness:

The calculation of attractiveness function of a firefly is shown in


equation (8.3),

m
(r) 0 × exp (- ), with m 1 (8.3)

(c) Movement:

The movement of a firefly i which is attracted by a more attractive


(i.e., brighter) firefly j is given by the following equation (8.4),

2
xi = xi + 0 × exp (- ij ) × (xj – xi - ) (8.4)

Where the first term is the current position of a firefly, the second
term is used for considering a firefly’s attractiveness to light intensity seen by
adjacent fireflies, and the third term is used for the random movement of a
firefly in case there are not any brighter ones.

The settings of FA parameters: Light absorption coefficient


( ) = 1.0, Randomization parameter ( ) = 0.3, Attractiveness value ( 0) = 1.0
and random number (rand) generator uniformly distributed in the space
[0, 1] = 0.2.
109

8.3 GENERAL SCHEMA OF FA

Objective function makespan, z = (C1, C2...Cn)

Generate machines (i = 1, 2... m)

Generate job sequences (j = 1, 2... n)

Evaluate makespan (C1, C2, C3….Cn) for all population

While Gen. < Max Gen.

For each job sequence j = (1, 2, 3…, n)

For each lot sizes (Xij)

Move firefly in d-dimensional space

Determine the attractiveness based on distance rij

Evaluate makespan

End For

End For

Assess light intensity

Select job sequences and lot sizes for Gen. +1

End While

Rank and choose the best job sequences and Sub lot sizes

8.4 FLOW CHART OF FA

The frame work of the proposed FA is illustrated in Figure 8.1. The


various steps involved in FA is explained in this section.
110

Start

Initialize a population of fireflies


xi (i = 1,2,…n)

Define light absorption co- efficient ( )

Move firefly i towards j in all d dimensions

Yes
Is there is any
good location?

No

Find location attractiveness

Location
found Go to that location

Evaluate new solutions and update


light intensity

Rank the fireflies and find the current best

Stop

Figure 8.1 Flow chart of FA


111

8.5 NUMERICAL ILLUSTRTION OF FA (EQUAL SUB LOTS)

The algorithm is illustrated with an example problem (5 jobs- 2


machines) in this section. Table 4.1 provides the data of the example
problem.

8.5.1 Calculation of Distance, Attractiveness and Movement

(i) For sequence 2-3-5-1-4

rij = i - xj = ( , , ) = (0 0.6) = 0.6

m
(r) = 0 × exp (- ), with m 1 ; (here, 0=1, = 1, m = 1)

= 1× exp [- 1× (0.6)1] = 0.55

2
xi = xi + 0 × exp (- ij ) × (xj – xi - ); (here, 0.3, rand = 0.2)

= 0.6 + 1× exp [- 1× (0.6)2] × (0.6 –0) + 0.3(0.2 -0.5) = 0.9986

(ii) For sequence 3-2-5-1-4

ri j = i - xj = ( , , ) = (0.6 1.3) = 0.7

m
(r) = 0 × exp (- ), with m 1 ; (here, 0=1, = 1, m = 1)

= 1× exp [- 1× (0.7)1] = 0.4966

2
xi = xi + 0 × exp (- ij ) × (xj – xi - ); (here, 0.3, rand = 0.2)

= 1.3 + 1× exp [- 1× (0.7)2] × (1.3 –0.6) + 0.3(0.2 -0.5)


= 1.6388
112

(iii) For sequence 2-4-3-5-1

rij = i - xj = ( , , ) = (1.3 0.9) = 0.4

m
(r) = 0 × exp (- ), with m 1 ; (here, 0=1, = 1, m = 1)

= 1× exp [- 1× (0.4)1] = 0.6703

2
xi = xi + 0 × exp (- ij ) × (xj – xi - ); (here, 0.3, rand = 0.2)

= 0.9 + 1× exp [- 1× (0.4)2] × (0.9 –1.3) + 0.3(0.2 -0.5)


= 0.4692

(iv) For sequence 1-5-2-3-4

rij = i - xj = ( , , ) = (0.9 2.1) = 1.2

m
(r) 0 × exp (- ), with m 1 ; (here, 0=1, = 1, m = 1)

= 1× exp [- 1× (1.2)1] = 0.3012

2
xi = xi + 0 × exp (- ij ) × (xj – xi - ) ; (here, 0.3, rand = 0.2)

= 2.1 + 1× exp [- 1× (1.2)2] × (2.1 –0.9) + 0.3(0.2 -0.5)


= 2.2943

8.5.2 FA for makespan criterion

The illustration of FA (for equal sub lots) is shown in Table 8.1


113

Table 8.1 FA Illustration (equal sub lots)

Sequence
Seed Distance Attractiveness Movement
for next makespan
Sequence (rij) r) (xi)
generation
23514 0.6 0.55 0.9986 23514 48
32514 0.7 0.497 1.6388 32514 48
24351 0.4 0.6703 0.4692 24351 45
15234 1.2 0.3012 2.2943 12534 45*

The final job sequence is 1- 2 -5 -3- 4, the corresponding makespan


time is 45 and it is shown in Figure 7.2.

8.5.3 FA for total flow time criterion

The method to find total flow time is illustrated in this section. The
final result is 2-5-4-1-3 and the corresponding total flow time is 144. It is
shown in Figure 8.2.Total flow time calculation for the sequence 2-5-4-1-3 =
14+22+27+35+46 = 144. The following Figure 8.2 shows the time schedule
of the optimal solution.

The following fig. shows the time schedule of the optimal solution.
114

Figure 8.2 Schedule for the sequence 2-5-4-1-3 in FA (total flow time
objective for equal sub lots)

8.6 NUMERICAL ILLUSTRTION OF FA (VARIABLE SUB


LOTS)

The algorithm is illustrated with an example problem (5 jobs- 2


machines) in this section. Table 4.4 provides the data of the example problem.

8.6.1 FA for makespan criterion

The illustration of FA (for variable sub lots) is shown in Table 8.2.

Table 8.2 FA Illustration (variable sub lots)

Movement Sequence
Seed Distance Attractiveness
(xi) for next makespan Sub lot size
Sequence (rij) r)
generation

54231 1.2 0.3012 2.2943 53124 85* {132}{543}{46}{3212}{1233}

31452 0.4 0.6703 1.2692 31452 88 {453}{64}{2133}{231}{2132}

45132 0.2 0.8187 1.2178 45132 89 {2133}{231}{64}{453}{2132}

34125 0.3 0.7408 0.8358 34125 89 {453}{2133}{64}{2132}{231}


115

The final result is 5-3-1-2-4, the corresponding makespan time is 85,


sub lot size is {132}{543}{46}{3212}{1233} and it is shown in Figure 6.7.

8.6.2 FA for total flow time criterion

The method to find total flow time is illustrated in this section. The
final result is 3-1-4-5-2 and the corresponding total flow time is 299, sub lot
size is {453}{64}{2133}{231}{2132}. Total flow time calculation for the
sequence 3-1-4-5-2 = 22+44+64+79+90 = 299. The following Figure 8.3
shows the time schedule of the optimal solution.

Figure 8.3 Schedule for the sequence 3-1-4-5-2 in FA (Total Flow Time
objective for variable sub lots)
116

8.7 PERFORMANCE EVALUATION

8.7.1 Proposed methodology illustrated with makespan criterion

The makespan results of FA algorithm for equal sub lots (Table 8.3 -
Table 8.6) and for variable sub lots (Table 8.10 - Table 8.12) is given in this
section.

8.7.2 Proposed methodology illustrated with total flow time criterion

The total flow time results of FA algorithm for equal sub lots
(Table 8.7 - Table 8.9) and for variable sub lots (Table 8.13 - Table 8.15) is
given in this section.
o Nt es mel bor P .
118

Table 8.4 Makespan value for three – machine cases in FA (equal sub
lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 160 380 410 570 632 794
2 168 388 412 568 648 688
3 154 378 408 564 642 620
4 164 384 412 570 640 618

Table 8.5 Makespan value for five – machine cases in FA (equal sub
lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 180 382 410 650 700 842
2 188 388 428 670 698 744
3 180 380 420 668 700 622
4 174 378 415 664 702 674

Table 8.6 Makespan value for seven – machine cases in FA (equal sub
lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 200 202 460 590 709 854
2 202 204 504 600 708 745
3 198 208 508 608 714 698
4 200 198 498 594 722 676
119

Table 8.7 Total flow time value for three – machine cases in FA (equal
sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 432 528 3012 5712 7498 10878
2 448 532 3152 5845 7523 8545
3 425 530 3098 5523 7618 8417
4 428 524 3124 5512 7609 8098

Table 8.8 Total flow time value for five – machine cases in FA (equal
sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 478 2250 3142 11285 11252 12644
2 460 2276 3196 9512 11318 9618
3 500 2000 3109 9004 11316 9434
4 502 2068 3032 9325 11312 9518

Table 8.9 Total flow time value for seven – machine cases in FA (equal
sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 568 2200 4027 9126 9812 12756
2 598 2509 4008 9377 9989 10518
3 592 2404 4002 9318 9787 10275
4 588 2208 4012 9315 9957 10164
120

Table 8.10 Makespan value for three – machine cases in FA (variable


sub lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 608 708 818 918 1007 1017
2 1025 3276 3512 4012 4098 4909
3 1002 3289 3398 3998 4078 4989
4 975 3298 3494 3889 4099 5004

Table 8.11 Makespan value for five – machine cases in FA (variable sub
lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 704 829 1121 1305 1508 1699
2 3475 4004 4712 7178 7812 8287
3 4004 4098 5008 7004 7409 8256
4 4012 4095 5012 7314 7676 8102

Table 8.12 Makespan value for seven – machine cases in FA (variable


sub lots)

Makespan
Problem set
Number of jobs
number
5 10 15 20 25 30
1 790 1009 1212 1321 1908 1878
2 4134 4927 6334 7298 9823 9989
3 4212 4909 6289 7389 10245 9993
4 4018 4927 6209 7042 10432 9945
121

Table 8.13 Total flow time value for three – machine cases in FA
(variable sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 3342 3972 8324 9871 23102 27564
2 15100 15150 26547 69562 91175 142875
3 15212 16356 26542 73108 140004 172121
4 15316 15432 26321 72002 130028 166523

Table 8.14 Total flow time value for five – machine cases in FA
(variable sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 3398 4212 8108 12457 24032 30012
2 14323 16024 24417 70034 95089 174623
3 14112 18512 26012 72389 154132 192978
4 15002 18316 27023 73451 140997 166421

Table 8.15 Total flow time value for seven – machine cases in FA
(variable sub lots)

Total flow time


Problem set
Number of jobs
number
5 10 15 20 25 30
1 4189 5027 9285 14012 25188 28098
2 14108 20012 29112 72025 96118 165113
3 14235 21000 30089 73112 157225 165580
4 14323 19764 30004 73997 163123 167772
122

8.8 SUMMARY

The numerical illustration and computational results of proposed FA


for equal size sub lots (from Table 8.3 – Table 8.9) and variable size sub lots
(from Table 8.10 - Table 8.15) are discussed.