File Exchange

image thumbnail

SSA: Salp Swarm Algorithm

version (109 KB) by Seyedali Mirjalili
SSA is a novel algorithm for solving single-objective optimization problems


Updated 22 May 2018

View License

The main inspiration of SSA is the swarming behaviour of salps when navigating and foraging in oceans. Read this webpage to know more about the inspiration:

This is the source codes of the paper:

S. Mirjalili, A.H. Gandomi, S.Z. Mirjalili, S. Saremi, H. Faris, S.M. Mirjalili, Salp Swarm Algorithm: A bio-inspired optimizer for engineering design problems, Advances in Engineering Software, in-press, DOI:

If you have no access to the paper, please drop me an email at and I will send you the paper.

All of the source codes and extra information as well as more optimization techniques can be found in my personal website at
I have a number of relevant courses in this area. You can enrol via the following links with 95% discount:

A course on “Optimization Problems and Algorithms: how to understand, formulation, and solve optimization problems”:

A course on “Introduction to Genetic Algorithms: Theory and Applications”

Comments and Ratings (10)

@ sush mhatugade: you have to add constraints in the objective function.
@ Mohammed: you have to add constraints in the objective function.
@ Premkumar: It is difficult for me to debug your code given this short description. Please use the Matlab debugger and run the code line by line until you find the error.

James Too

Mai I know the reason for the SSA algorithm to use " if i <= N/2 " , but not "i==1" for the leader salp to update? Thank you

I thought of using this algorithm for detecting global peak (Solar PV MPPT). While running the code, it is showing that "N" is Undefined function or variable 'N', Undefined function or variable 'newindex' and Undefined function or variable 'Sorted_salps'. The first assignment to a local variable determines its class. Please help me in this regard.

How to add constraints in the code?

how do we enter equality constraints in the code?

I am working on other projects now.

Weimin Xiao

would you consider evaluating the SI with cec2013 or later benchmark functions?

Yes, it is a swarm intelligence technique

naidu talada

is this algorithm comes under the category of PSO?

Hossam Faris


MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

MATLAB Online Live Editor Challenge

View the winning live scripts from faculty and students who participated in the recent challenge.

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video