# Fish School Search

Fish School Search (FSS), proposed by Bastos Filho and Lima Neto in 2008 is, in its basic version,[1] an unimodal optimization algorithm inspired on the collective behavior of fish schools. The mechanisms of feeding and coordinated movement were used as inspiration to create the search operators. The core idea is to make the fishes “swim” toward the positive gradient in order to “eat” and “gain weight”. Collectively, the heavier fishes have more influence on the search process as a whole, what makes the barycenter of the fish school moves toward better places in the search space over the iterations.[2]

The FSS uses the following principles:[3]

1. Simple computations in all individuals (i.e. fish)
2. Various means of storing information (i.e. weights of fish and school barycenter)
3. Local computations (i.e. swimming is composed of distinct components)
4. Low communications between neighboring individuals (i.e. fish are to think local but also be socially aware)
5. Minimum centralized control (mainly for self-controlling of the school radius)
6. Some distinct diversity mechanisms (this to avoid undesirable flocking behavior)
7. Scalability (in terms of complexity of the optimization/search tasks)
8. Autonomy (i.e. ability to self-control functioning)

## Algorithm

FSS is a population based search algorithm inspired in the behavior of swimming fishes that expand and contract while looking for food. Each fish ${\displaystyle n}$-dimensional location represents a possible solution for the optimization problem. The algorithm makes use of weights for all the fishes which represents cumulative account on how successful has been the search for each fish in the school. FSS is composed of the feeding and movement operators, the latter being divided into three sub-components, which are:[4]

### Individual component of the movement

Every fish in the school performs a local search looking for promising regions in the search space. It is done as represented below:

${\displaystyle x_{i}(t+1)=x_{i}(t)+rand(-1,1)step_{ind},}$

where ${\displaystyle x_{i}(t)}$ and ${\displaystyle x_{i}(t+1)}$ represent the position of the fish ${\displaystyle i}$ before and after the individual movement operator, respectively. ${\displaystyle rand(-1,1)}$ is a uniformly distributed random number varying from -1 up to 1 and ${\displaystyle step_{ind}}$ is a parameter that defines the maximum displacement for this movement. The new position ${\displaystyle x_{i}(t+1)}$ is only accepted if the fitness of the fish improves with the position change. If it is not the case, the fish remains in the same position and ${\displaystyle x_{i}(t+1)=x_{i}(t)}$.

### Collective-instinctive component of the movement

An average of the individual movements is calculated based on the following:

${\displaystyle I={\frac {\sum _{i=1}^{N}\Delta x_{i}\Delta f_{i}}{\sum _{i=1}^{N}\Delta f_{i}}}.}$

The vector ${\displaystyle I}$ represents the weighted average of the displacements of each fish. It means that the fishes that experienced a higher improvement will attract fishes into its position. After the vector ${\displaystyle I}$ computation, every fish will be encouraged to move according to:

${\displaystyle x_{i}(t+1)=x_{i}(t)+I.}$

### Collective-volitive component of the movement

This operator is used in order to regulate the exploration/exploitation ability of the school during the search process. First of all, the barycenter ${\displaystyle B}$ of the school is calculated based on the position ${\displaystyle x_{i}}$ and the weight ${\displaystyle W_{i}}$ of each fish:

${\displaystyle B(t)={\frac {\sum _{i=1}^{N}x_{i}(t)W_{i}(t)}{\sum _{i=1}^{N}W_{i}(t)}},}$

and then, if the total school weight ${\displaystyle \sum _{i=1}^{N}W_{i}}$ has increased from the last to the current iteration, the fishes are attracted to the barycenter according to equation A. If the total school weight has not improved, the fishes are spread away from the barycenter according to equation B:

Eq. A:

${\displaystyle x_{i}(t+1)=x_{i}(t)-step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}$

Eq. B:

${\displaystyle x_{i}(t+1)=x_{i}(t)+step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}$

where ${\displaystyle step_{vol}}$ defines the size of the maximum displacement performed with the use of this operator. ${\displaystyle distance(x_{i}(t),B(t))}$ is the euclidean distance between the fish ${\displaystyle i}$ position and the school barycenter. ${\displaystyle rand(0,1)}$ is a uniformly distributed random number varying from 0 up to 1.

Besides the movement operators, it was also defined a feeding operator used in order to update the weights of every fish according to:

${\displaystyle W_{i}(t+1)=W_{i}(t)+{\frac {\Delta f_{i}}{max(|\Delta f_{i}|)}},}$

where ${\displaystyle W_{i}(t)}$ is the weight parameter for fish ${\displaystyle i}$, ${\displaystyle \Delta f_{i}}$ is the fitness variation between the last and the new position, and ${\displaystyle max(|\Delta f_{i}|)}$ represents the maximum absolute value of the fitness variation among all the fishes in the school. ${\displaystyle W}$ is only allowed to vary from 1 up to ${\displaystyle W_{scale}/2}$, which is a user defined attribute. The weights of all fishes are initialized with the value ${\displaystyle W_{scale}/2}$.

### The pseudo-code for FSS

1. Initialize user parameters
2. Initialize fishes positions randomly
3. while Stopping condition is not met do
4. Calculate fitness for each fish
5. Run individual operator movement
6. Calculate fitness for each fish
7. Run feeding operator
8. Run collective-instinctive movement operator
9. Run collective-volitive movement operator
10. end while

The parameters ${\displaystyle step_{ind}}$ and ${\displaystyle step_{vol}}$ decay linearly according to:

${\displaystyle step_{ind}(t+1)=step_{ind}(t)-{\frac {step_{ind}(initial)}{It_{max}}},}$

and similarly:

${\displaystyle step_{vol}(t+1)=step_{vol}(t)-{\frac {step_{vol}(initial)}{It_{max}}},}$

where ${\displaystyle step_{ind}(initial)}$ and ${\displaystyle step_{vol}(initial)}$ are user defined initial values for ${\displaystyle step_{ind}}$ and ${\displaystyle step_{vol}}$, respectively. ${\displaystyle It_{max}}$ is the maximum number of iterations allowed in the search process.

## Variations of FSS

### dFSS(Density based Fish School Search)

This version excels for multimodal hyper-dimensional functions. It includes modifications in the previous operators: Feeding and Swimming, as well as new: Memory and Partition operators. The latter two were introduced to account for the partition of the main school into subgroups. Some changes were also included in the stop conditions that now also have to consider subswarms.[5]

### wFSS(Weight based Fish School Search)

wFSS is a weight based niching version of FSS intended to produce multiple solutions. The niching strategy is based on a new operator called link formator. This operator is used to define leaders for the fishes in order to form sub-schools.[6]

### FSS-SAR(Stagnation Avoidance Routine Fish School Search)

In the original version of the algorithm, the individual movement component is only allowed to move a fish if it improves the fitness. However, in a very smooth search space, there would be many moving trials with no success and the algorithm could fail to converge. To solve these issues, was introduced a parameter X for which 0 <= X <= 1 in the individual component of the movement. X decays exponentially along with the iterations and measures a probability for a worsening allowance for each fish. It means that, every time a fish tries to move to a position that does not improve its fitness, a random number is chosen and if it is smaller than X the movement is allowed.[7]

### bFSS(Binary Fish School Search)

The bFSS intended to cope with premature convergence. Proposing the use of a binary encoding scheme for the internal mechanisms of the fish school search. It combined the FSS with fuzzy modeling in a wrapper approach for Feature Selection.[8]

### MOFSS(Multi-Objective Fish School Search)

In the MOFSS the operators are adapted to solve multi-objective problems. The algorithm deploys an External Archive to store the best non-dominated solutions found during the search process. This approach has been extensively used for different bio-inspired multiobjective optimizers.[9][10] Furthermore, the solutions within the External Archive are used to guide the fish movements in the proposal version.[11]