Firefly algorithm: Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
m typo
m Algorithm: MOS:INDENT; delete stray letters; decap "particle swarm optimization"
 
(47 intermediate revisions by 25 users not shown)
Line 1:
In [[Optimization (mathematics)|mathematical optimization]], the '''firefly algorithm''' is a [[metaheuristic]] proposed by [[Xin-She Yang]] and inspired by the flashing behaviourbehavior of [[firefly|fireflies]].<ref>{{cite book |first=X. S. |last=Yang |title=Nature-Inspired Metaheuristic Algorithms |publisher=[[Luniver Press]] |year=2008 |isbn=978-1-905986-10-61 }}</ref>
<!-- Please do not remove or change this AfD message until the issue is settled -->
{{Article for deletion/dated|page=Firefly algorithm|timestamp=20160715142505|year=2016|month=July|day=15|substed=yes|help=off}}
<!-- Once discussion is closed, please place on talk page: {{Old AfD multi|page=Firefly algorithm|date=15 July 2016|result='''keep'''}} -->
<!-- End of AfD message, feel free to edit beyond this point -->
In [[Optimization (mathematics)|mathematical optimization]], the '''firefly algorithm''' is a [[metaheuristic]] proposed by [[Xin-She Yang]] and inspired by the flashing behaviour of [[firefly|fireflies]].<ref>{{cite book |first=X. S. |last=Yang |title=Nature-Inspired Metaheuristic Algorithms |publisher=[[Luniver Press]] |year=2008 |isbn=1-905986-10-6 }}</ref>
 
Nature-inspired metaheuristics in general have started to attract criticism in the research community for hiding their lack of novelty behind an elaborate metaphor.<ref>{{cite journal|last=Weyland|first=Dennis|title=A Rigorous Analysis of the Harmony Search Algorithm: How the Research Community can be Misled by a "Novel" Methodology|journal=[[International Journal of Applied Metaheuristic Computing]]|volume=1|issue=2|year=2010|pages=50–60|doi=10.4018/jamc.2010040104}}</ref><ref>{{cite journal|first=Kenneth|last=Sörensen|title=Metaheuristics—the metaphor exposed|journal=[[International Transactions in Operational Research]]|doi=10.1111/itor.12001|volume=22|pages=3–18|year=2013|quote=In recent years, the field of combinatorial optimization has witnessed a true tsunami of "novel" metaheuristic methods, most of them based on a metaphor of some natural or man-made process. The behavior of virtually any species of insects, the flow of water, musicians playing together – it seems that no idea is too far-fetched to serve as inspiration to launch yet another metaheuristic. In this paper, we will argue that this line of research is threatening to lead the area of metaheuristics away from scientific rigor.}}</ref><ref>{{scholarpedia|title=Metaheuristics|urlname=Metaheuristics|curator=[[Fred W. Glover|Fred Glover]] and Kenneth Sörensen}} "A large (and increasing) number of publications focuses on the development of (supposedly) new metaheuristic frameworks based on metaphors. The list of natural or man-made processes that has been used as the basis for a metaheuristic framework now includes such diverse processes as bacterial foraging, river formation, biogeography, musicians playing together, electromagnetism, gravity, colonization by an empire, mine blasts, league championships, clouds, and so forth. An important subcategory is found in metaheuristics based on animal behavior. Ants, bees, bats, wolves, cats, fireflies, eagles, vultures, dolphins, frogs, salmon, vultures, termites, flies, and many others, have all been used to inspire a "novel" metaheuristic. [...] As a general rule, publication of papers on metaphor-based metaheuristics has been limited to second-tier journals and conferences, but some recent exceptions to this rule can be found. Sörensen (2013) states that research in this direction is fundamentally flawed. Most importantly, the author contends that the novelty of the underlying metaphor does not automatically render the resulting framework "novel". On the contrary, there is increasing evidence that very few of the metaphor-based methods are new in any interesting sense."</ref><ref>Jerry Swan, Steven Adriaensen, Mohamed Bishr, Edmund K. Burke, John A. Clark, Patrick De Causmaecker, Juanjo Durillo, Kevin Hammond, Emma Hart, Colin G. Johnson, Zoltan A. Kocsis, Ben Kovitz, Krzysztof Krawiec, Simon Martin, J. J. Merelo, Leandro L. Minku, Ender Özcan, Gisele L. Pappa, Erwin Pesch, Pablo Garcáa-Sánchez, Andrea Schaerf, Kevin Sim, Jim E. Smith, Thomas Stützle, Stefan Voß, Stefan Wagner, Xin Yao. [http://www.cs.nott.ac.uk/~exo/docs/publications/research-agenda-metaheuristic.pdf "A Research Agenda for Metaheuristic Standardization"]. "Metaphors often inspire new metaheuristics, but without mathematical rigor, it can be hard to tell if a new metaheuristic is really distinct from a familiar one. For example, mathematically, '[[Harmony search]]' turned out to be a simple variant of '[[Evolution Strategies]]' even though the metaphors that inspired them were quite different. Formally describing state, representation, and operators allows genuine novelty to be distinguished from minor variation."</ref><ref>Alexander Brownlee and John R. Woodward (2015). [http://theconversation.com/why-we-fell-out-of-love-with-algorithms-inspired-by-nature-42718 "Why we fell out of love with algorithms inspired by nature"]. ''[[The Conversation (website)|The Conversation]]''.</ref> In response, [[Springer Science+Business Media|Springer]]'s ''Journal of Heuristics'' has updated their editorial policy to state that:<ref>[http://www.springer.com/cda/content/document/cda_downloaddocument/Journal+of+Heuristic+Policies+on+Heuristic+Search.pdf?SGWID=0-0-45-1483502-p35487524 Journal of Heuristic Policies on Heuristic Search Research]. Springer. "Proposing new paradigms is only acceptable if they contain innovative basic ideas, such as those that are embedded in classical frameworks like [[genetic algorithm]]s, [[tabu search]], and [[simulated annealing]]. The Journal of Heuristics avoids the publication of articles that repackage and embed old ideas in methods that are claimed to be based on metaphors of natural or manmade systems and processes. These so-called "novel" methods employ analogies that range from intelligent water drops, musicians playing jazz, imperialist societies, leapfrogs, kangaroos, all types of swarms and insects and even mine blast processes (Sörensen, 2013). If a researcher uses a metaphor to stimulate his or her own ideas about a new method, the method must nevertheless be translated into metaphor-free language, so that the strategies employed can be clearly understood, and their novelty is made clearly visible. (See items 2 and 3 below.) Metaphors are cheap and easy to come by. Their use to "window dress" a method is not acceptable."</ref>
<blockquote>
Implementations should be explained by employing standard optimization terminology, where a solution is called a "solution" and not something else related to some obscure metaphor (e.g., [[harmony search|harmony]], flies, [[bat algorithm|bats]], countries, etc.).
</blockquote>
The firefly algorithm specifically has been criticized as differing from the well-established [[particle swarm optimization]] only in a negligible way.<ref>{{cite journal|first=Michael A.|last=Lones|year=2014|title=Metaheuristics in Nature-Inspired Algorithms|journal=[[Genetic and Evolutionary Computation Conference|GECCO '14]]|url=http://www.macs.hw.ac.uk/~ml355/common/papers/lones-gecco2014-metaheuristics.pdf|doi=10.1145/2598394.2609841|quote=FA, on the other hand, has little to distinguish it from PSO, with the inverse-square law having a similar effect to crowding and fitness sharing in EAs, and the use of multi-swarms in PSO.}}</ref><ref>{{cite journal|first=Dennis|last=Weyland|year=2015|url=http://www.sciencedirect.com/science/article/pii/S221471601500010X|title=A critical analysis of the harmony search algorithm—How not to solve sudoku|journal=Operations Research Perspectives|volume=2|pages=97–105|doi=10.1016/j.orp.2015.04.001|quote=For example, the differences between the particle swarm optimization metaheuristic and "novel" metaheuristics like the firefly algorithm, the fruit fly optimization algorithm, the fish swarm optimization algorithm or the cat swarm optimization algorithm seem negligible.}}</ref>
 
== Metaphor ==
The primary purpose for a firefly's flash is to act as a signal system to attract other fireflies. Xin-She Yang formulated this firefly algorithm by assuming:
 
#All fireflies are unisexual, so that any individual firefly will be attracted to all other fireflies;
#Attractiveness is proportional to their brightness, and for any two fireflies, the less bright one will be attracted by (and thus move towards) the brighter one; however, the intensity (apparent brightness) decrease as their mutual distance increases;
#If there are no fireflies brighter than a given firefly, it will move randomly.
 
The brightness should be associated with the objective function.
 
== Algorithm ==
Line 24 ⟶ 5:
 
'''Begin'''
1) Objective function: {{nowrap|<math>f(\mathbf{x}), \quad \mathbf{x}=(x_1,x_2,...,x_d) </math>;}}
2) Generate an initial population of fireflies {{nowrap|<math> \mathbf{x}_i \quad (i=1,2,\dots,n)</math>;.}}
3) Formulate light intensity {{mvar|I}} so that it is associated with {{nowrap|<math>f(\mathbf{x})</math>}}
(for example, for maximization problems, {{nowrap|<math>I \propto f(\mathbf{x})</math> or simply <math>I=f(\mathbf{x})</math>;)}}
4) Define absorption coefficient {{mvar|&gamma;}}
'''While''' (t < MaxGeneration)
'''for''' i = 1 : n (all n fireflies)
'''for''' j = 1 : n (n fireflies)
{{nowrap|'''if''' (<math>I_j>I_i </math>),}}
move firefly i towards j;
Vary attractiveness with distance r via {{nowrap|<math> \exp(-\gamma \; r) </math>;}}
Evaluate new solutions and update light intensity;
'''end if'''
'''end for''' j
'''end for''' i
Rank fireflies and find the current best;
'''end while'''
Post-processing the results and visualization;
'''Whilewhile''' (t < MaxGeneration)
'''for''' i = 1 : n (all n fireflies)
'''for''' j = 1 : ni (n fireflies)
{{nowrap|'''if''' (<math>I_j>I_i </math>),}}
Vary attractiveness with distance r via {{nowrap|<math> \exp(-\gamma \; r) </math>;}}
move firefly i towards j;
Evaluate new solutions and update light intensity;
'''end if'''
'''end for''' ij
'''end for''' ji
Rank fireflies and find the current best;
'''end while'''
'''end'''
 
Note that the number of objective function evaluations per loop is one evaluation per firefly, even though the above pseudocode suggests it is ''n''×''n''. (Based on Yang's [[MATLAB]] code.) Thus the total number of objective function evaluations is (number of generations) × (number of fireflies).
 
The main update formula for any pair of two fireflies <math>\mathbf{x}_i </math> and <math>\mathbf{x}_j </math> is
:: <math display="block">\mathbf{x}_i^{t+1}=\mathbf{x}_i^t + \beta \exp[-\gamma r_{ij}^2] (\mathbf{x}_j^t - \mathbf{x}_i^t) +\alpha_t \boldsymbol{\epsilon}_t </math>
where <math>\alpha_t </math> is a parameter controlling the step size, while <math>\boldsymbol{\epsilon}_t </math> is a vector drawn from a Gaussian or other
distribution.
 
It can be shown that the limiting case <math>\gamma \rightarrow 0 </math> corresponds to the standard [[Particleparticle Swarmswarm Optimizationoptimization]] (PSO). In fact, if the inner loop (for j) is removed and the brightness <math>I_j</math> is replaced by the current global best <math>g^*</math>, then FA essentially becomes the standard PSO.
 
== Criticism ==
 
Nature-inspired [[metaheuristic]]s in general have attracted [[List of metaphor-inspired metaheuristics#Criticism of the metaphor methodology|criticism in the research community]] for hiding their lack of novelty behind metaphors. The firefly algorithm specifically has been criticized as differing from the well-established [[particle swarm optimization]] only in a negligible way.<ref>{{cite journal|firstfirst1=MichaelOmid AN.|lastlast1=LonesAlmasi| first2=Modjtaba|last2= Rouhani|year=20142016|title=MetaheuristicsA innew Nature-Inspiredfuzzy Algorithmsmembership assignment and model selection approach based on dynamic class centers for fuzzy SVM family using the firefly algorithm|journal=[[Turkish Journal of Electrical Engineering & Computer Sciences|volume=4| pages=1–19|doi=10.3906/elk-1310-253|quote= Practical application of FA on UCI datasets.|doi-access=free}}</ref><ref>{{cite book|first=Michael A.|last=Lones|title=Proceedings of the Companion Publication of the 2014 Annual Conference on Genetic and Evolutionary Computation Conference|GECCOchapter=Metaheuristics in nature-inspired algorithms '14]]|year=2014|pages=1419–1422|chapter-url=http://www.macs.hw.ac.uk/~ml355/common/papers/lones-gecco2014-metaheuristics.pdf|doi=10.1145/2598394.2609841|quote=FA, on the other hand, has little to distinguish it from PSO, with the inverse-square law having a similar effect to crowding and fitness sharing in EAs, and the use of multi-swarms in PSO.|isbn=9781450328814|citeseerx=10.1.1.699.1825|s2cid=14997975 }}</ref><ref>{{cite journal|first=Dennis|last=Weyland|year=2015|url=http://www.sciencedirect.com/science/article/pii/S221471601500010X|title=A critical analysis of the harmony search algorithm—How not to solve sudoku|journal=Operations Research Perspectives|volume=2|pages=97–105|doi=10.1016/j.orp.2015.04.001|quote=For example, the differences between the particle swarm optimization metaheuristic and "novel" metaheuristics like the firefly algorithm, the fruit fly optimization algorithm, the fish swarm optimization algorithm or the cat swarm optimization algorithm seem negligible.|doi-access=free|hdl=10419/178253|hdl-access=free}}</ref>
 
==See also==
Line 58 ⟶ 42:
 
== References ==
{{Reflist|<ref>Ariyaratne MKA, Pemarathne WPJ (2015) A review of recent advancements of firefly algorithm: a modern nature inspired algorithm. In: Proceedings of the 8th international research conference, 61–66, KDU, Published November 2015, http://ir.kdu.ac.lk/bitstream/handle/345/1038/com-047.pdf?sequence=1&isAllowed=y</ref>}}
{{Reflist|2}}
 
==External links==
* [https://www.mathworks.com/matlabcentral/fileexchange/29693-firefly-algorithm] Files of the Matlab programs included in the book: Xin-She Yang, Nature-Inspired Metaheuristic Algorithms, Second Edition, Luniver Press, (2010).
 
{{Optimization algorithms}}