Animal and swarm-inspired algorithmsVerified

Butterfly Optimization Algorithm

Butterfly Optimization Algorithm (BOA)

Year introduced
2018
Original authors
Sankalap Arora; Satvir Singh
Source of inspiration
Butterflies and the sense of smell
Search space
Continuous
Optimization types
Hyperparameter Optimization, Feature Selection
Applied research in the repository
0

Overview

It imitates how butterflies use their sense of smell to search for nectar and mates. Each butterfly emits a "fragrance" whose intensity is proportional to its fitness, so the other butterflies move either towards the best butterfly (global search) or randomly between two butterflies (local search) according to a switch probability p.

Source of inspiration and mechanism

Image illustrating the source of inspiration of the BOA algorithm: Butterflies and the sense of smell
Butterflies and the sense of smellImage: fesoj · CC BY 2.0 · Wikimedia Commons

Butterflies have sensitive chemoreceptors that let them tell the scents of flowers and mates apart over long distances; the stronger the scent, the more butterflies are drawn to it.

Initialization

Uniform random.

Update mechanism

A direct position update, with c updated gradually.

Exploration

Local movement between two random butterflies.

Exploitation

Movement towards the best butterfly g* with p = 0.8.

Mathematical description

The fragrance is f = c·I^a, where I is the stimulus intensity (the fitness), a the response exponent and c the sensory modality. In global search the butterfly moves towards the best g* with a step proportional to the fragrance, and in local search between two random butterflies.

Fragrance

f_i = c\,I_i^{\,a}

c is the sensory modality (0.01), a the power exponent (0.1 in the paper).

Global search

x_i^{t+1} = x_i^t + \left(r^2 g^* - x_i^t\right) f_i

r is a random number in [0,1].

Local search

x_i^{t+1} = x_i^t + \left(r^2 x_j^t - x_k^t\right) f_i

j and k are two random butterflies.

Computational complexity: O(T\cdot N\cdot (D + C_f))

Pseudocode

Initialize; set c, a, p
for t = 1..T:
    for each butterfly: f_i = c*I_i^a
        if rand < p: x_i += (r^2*g - x_i)*f_i
        else:        x_i += (r^2*x_j - x_k)*f_i
    update g; update c
return g

Python implementation

There is currently no tested python implementation of this algorithm in the lab. We did not include untested code so that it is not used as a reference implementation.

Coefficients

ParameterSymbolTypical valueRangeDescription
Switch probability
p
0.8
Sensory modality
c
0.01
Power exponent
a
0.10.1–0.3

Advantages

  • Simple, with few parameters
  • The sensing concept is adjustable.

Limitations

  • Sensitive to the values of a and c
  • Later comparisons pointed to weaknesses on some multimodal functions.

Use in artificial intelligence

Domains documented in the card: Machine learning, Feature Selection, hyperparameter tuning

Continuous optimization, feature selection, parameter tuning.

Hybridization potential

These are partnerships suggested theoretically in the card; any resulting design is presented as a "proposed hybrid method" until its results are compared with the literature.

Applied research from the repository

An aspect that did not appear in the current search results within the repository. This does not mean there is no published research outside it.

Original reference

Sankalap Arora; Satvir Singh (2018). Butterfly optimization algorithm: a novel approach for global optimization. Soft Computing, Springer Science and Business Media LLC.

Verified DOI: 10.1007/s00500-018-3102-4

The bibliographic data match the Crossref record (checked 2026-11-20). There is no tested Python code for this algorithm in this version.