Sparrow Search Algorithm
Sparrow Search Algorithm (SSA-2)
- Year introduced
- 2020
- Original authors
- Jiankai Xue; Bo Shen
- Source of inspiration
- Producer and scrounger behaviour in sparrows
- Search space
- Continuous
- Optimization types
- Hyperparameter Optimization
- Applied research in the repository
- 0
Overview
The producers update their positions according to a global alarm value, the scroungers follow the best producer, and a fraction of individuals aware of danger move towards a safe area.
Source of inspiration and mechanism

Sparrows split into producers that search for food and scroungers that follow them, while some individuals watch for danger and warn the flock.
Initialization
Random.
Update mechanism
Three groups with different roles.
Exploration
The movement of the producers on alarm and of the individuals aware of danger.
Exploitation
The scroungers follow the best producer.
Mathematical description
The common abbreviation in the literature is SSA; SSA-2 is used here to distinguish it from the salp algorithm.
Producers
X_{i}^{t+1} = \begin{cases} X_i^{t}\exp\left(\frac{-i}{\alpha T}\right) & R_2 < ST\\ X_i^{t} + Q\cdot L & R_2\ge ST\end{cases}R₂ is the alarm value, ST the safety threshold.
Computational complexity: O(T\cdot N\cdot (D + C_f))
Flowchart
A simplified chart summarising the algorithm phases as described on its card in the lab; it is not the original figure published in the paper.
Pseudocode
Initialize sparrows
for t = 1..T:
rank; update producers (alarm value R2 vs ST)
update scroungers towards best producer
update danger-aware sparrows
return bestPython 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
| Parameter | Symbol | Typical value | Range | Description |
|---|---|---|---|---|
| Producers ratio | PD | 0.2 | ||
| Danger-aware ratio | SD | 0.1–0.2 | ||
| Safety threshold | ST | 0.8 | 0.5 – 1 |
Advantages
Fast convergence on unimodal functions.
Limitations
A known bias towards the origin because of the exponential term X·exp(·).
Use in artificial intelligence
Domains documented in the card: Machine learning, hyperparameter tuning
Continuous optimization, 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
Jiankai Xue; Bo Shen (2020). A novel swarm intelligence optimization approach: sparrow search algorithm. Systems Science & Control Engineering, Informa UK Limited.
Verified DOI: 10.1080/21642583.2019.1708830
External links collected from a search index and from paper abstracts; check that they are the original authors’ code and that they work before relying on them.
Its papers abbreviate it SSA, which clashes with the Salp Swarm Algorithm, so it appears here as SSA-2. There is no tested Python code for this algorithm in this version.
