Skip to content
Leo Hanisch edited this page Nov 9, 2020 · 2 revisions

This repository includes the firefly algorithm like Xin-She Yang introduced in his paper Firefly Algorithms for Multimodal Optimization in 2009 (DOI: 10.1007/978-3-642-04944-6_14).
The implementation was part of the course Natural computing for learning and optimisation at Charles University Prague in winter 2018/2019.

Features

Enables to apply the firefly algorithm to a 2D function. The algorithm tries to find the global minimum of the selected function. Any of landscapes' 2D or nD functions can be selected.

CLI

To print all available options execute:

swarm fireflies -h

API

In addition to the cli you can also use the API:

from swarmlib import FireflyProblem, FUNCTIONS

problem = FireflyProblem(function=FUNCTIONS['michalewicz'], firefly_number=14)
best_firefly = problem.solve()
problem.replay()

Example

firefly algorithm