Salp Swarm Algorithm
Salp Swarm Algorithm (SSA)
- Year introduced
- 2017
- Original authors
- Seyedali Mirjalili; Amir H. Gandomi; Seyedeh Zahra Mirjalili; Shahrzad Saremi; Hossam Faris; Seyed Mohammad Mirjalili
- Source of inspiration
- Marine salp chains
- Search space
- Continuous
- Optimization types
- Hyperparameter Optimization, Feature Selection
- Applied research in the repository
- 0
Overview
The group is split into leaders that move around the food source (the best solution) and followers, each of which moves to the midpoint between itself and the one before it in the chain.
Source of inspiration and mechanism

Marine salps form chains in which the leader moves towards food and the others follow.
Initialization
Random.
Update mechanism
A sequential chain.
Exploration
A large c₁ early on.
Exploitation
Decreasing c₁ and the chain of followers.
Mathematical description
Leader
x_j^1 = \begin{cases}F_j + c_1\left((ub_j-lb_j)c_2 + lb_j\right) & c_3\ge 0.5\\ F_j - c_1\left((ub_j-lb_j)c_2 + lb_j\right) & c_3<0.5\end{cases}Coefficient c₁
c_1 = 2e^{-\left(\frac{4l}{L}\right)^{2}}Follower
x_j^{i} = \tfrac{1}{2}\left(x_j^{i} + x_j^{i-1}\right)Computational complexity: O(L\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 salps; F = best
for l = 1..L:
c1 = 2*exp(-(4l/L)^2)
leaders: move around F ; followers: x_i = (x_i + x_{i-1})/2
clip, evaluate, update F
return FPython implementation
This code was actually run while building the lab (NumPy) on the sphere function to make sure it works; this is a run test, not a performance claim.
import numpy as np
def salp(f, lb, ub, dim, n=30, iters=200, seed=0):
"""Salp Swarm Algorithm (Mirjalili et al., 2017): a leader follows the food source, followers chain."""
rng = np.random.default_rng(seed)
x = rng.uniform(lb, ub, (n, dim)); F = np.apply_along_axis(f, 1, x)
food = x[F.argmin()].copy(); fval = F.min(); curve = []
for t in range(1, iters + 1):
c1 = 2 * np.exp(-(4 * t / iters) ** 2)
for i in range(n):
if i < n // 2: # leaders
c2, c3 = rng.random(dim), rng.random(dim)
step = c1 * ((ub - lb) * c2 + lb)
x[i] = np.where(c3 >= 0.5, food + step, food - step)
else: # followers
x[i] = 0.5 * (x[i] + x[i - 1])
x = np.clip(x, lb, ub); F = np.apply_along_axis(f, 1, x)
if F.min() < fval:
fval = F.min(); food = x[F.argmin()].copy()
curve.append(fval)
return food, fval, curve
if __name__ == "__main__":
sphere = lambda z: float(np.sum(z ** 2))
best, val, curve = salp(sphere, -100, 100, dim=10)
print("best fitness:", val)
Coefficients
| Parameter | Symbol | Typical value | Range | Description |
|---|---|---|---|---|
| c1 schedule | c₁ | 2e^{-(4l/L)^2} | ||
| Population | N | 30 |
Advantages
Simple, with one adaptive parameter.
Limitations
The leader formula depends on lb in a way that may be biased in asymmetric spaces.
Use in artificial intelligence
Domains documented in the card: Machine learning, Feature Selection, hyperparameter tuning
Continuous and engineering optimization, feature selection.
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
Seyedali Mirjalili; Amir H. Gandomi; Seyedeh Zahra Mirjalili; Shahrzad Saremi; Hossam Faris; Seyed Mohammad Mirjalili (2017). Salp Swarm Algorithm: A bio-inspired optimizer for engineering design problems. Advances in Engineering Software, Elsevier BV.
Verified DOI: 10.1016/j.advengsoft.2017.07.002
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.
