2.3.2. Whale Optimization Algorithm (WOA)

The whale optimization algorithm is a population-based optimization algorithm that mimics the social behaviour of humpback whales and was proposed by Mirjalili and Lewis in 2016. Humpback whales are long in size and have an interesting food searching capability: they attack their prey (krill and small fishes) by a bubble-net hunting strategy. WOA is inspired by this hunting behaviour, and works in three phases. First, it searches for prey then encircles the prey and lastly, attacks the prey. Humpback whales swim around the prey either following a shrinking path or through a spiral movement. A probability factor *p* assumed to be 50% simultaneously choose either of the two movements.

Shrinking Movement

Initially in the exploration phase, humpback whales search around a prey chosen randomly in the search space with the following mathematical model:

$$
\overrightarrow{D} = \left| \overrightarrow{\mathbf{C}} \times \overrightarrow{X}\_{rand} - \overrightarrow{X} \right| \tag{8}
$$

$$
\stackrel{\rightarrow}{X}(t+1) = \stackrel{\rightarrow}{X}\_{rand} - \stackrel{\rightarrow}{A} \times \stackrel{\rightarrow}{D} \tag{9}
$$

where *t* is the current iteration and (*t* + 1)th is the next iteration, → *Xrand* is the random position of the prey, → *A* and → *C* are the coefficient vectors and is defined as:

$$
\overrightarrow{\vec{A}} = \mathbf{2}\,\overrightarrow{\vec{a}}\,\overrightarrow{\vec{r}} - \overrightarrow{\vec{a}}\tag{10}
$$

$$
\vec{\tilde{C}} = \mathbf{2} \times \vec{r} \tag{11}
$$

where <sup>→</sup> *a* is decreased from 2 to 0 over the course of iterations and <sup>→</sup> *r* is the random number in the range [0, 1]. In the exploitation phase the position of whales are updated based on the position of the best search prey → *X* ∗ . Mathematically it is defined as:

$$
\stackrel{\rightarrow}{D} = \begin{vmatrix} \stackrel{\rightarrow}{\mathcal{C}} \times \stackrel{\rightarrow}{X^\*} - \stackrel{\rightarrow}{X} \\\\ \end{vmatrix} \tag{12}
$$

$$
\stackrel{\rightarrow}{X}(t+1) = \stackrel{\rightarrow}{X^\*} - \stackrel{\rightarrow}{A} \times \stackrel{\rightarrow}{D} \tag{13}
$$

Spiral Movement

In the spiral movement of the humpback whale, first the distance is evaluated between the whale located at (*X*, *Y*) and best search prey located at (*X\**, *Y\**). Once the distance is evaluated then the helix-shaped movement of whale around the prey is defined with following mathematical equation:

$$
\stackrel{\rightarrow}{X}(t+1) = \stackrel{\rightarrow}{D'} \cdot e^{bl} \cdot \cos(2\pi l) + \stackrel{\rightarrow}{X^\*}(t) \tag{14}
$$

where → *D*′ = | → *X* ∗ (*t*) − → *X*(*t*)| is the distance between the whale and best searched prey, *b* is the constant which maintains the shape of the logarithmic spiral and l is the random number defined in the range [–1, 1].

In WOA, coefficient vector 'A' maintains the balance in exploration and exploitation, when the value of *p* < 0.5 and *A* > 1 then the positions are updated by Equations (9) and (13) while when *p* < 0.5 and *A* < 1 the positions are updated by Equations (13) and (14) and when the *p* ≥ 0.5 then the positions are updated using Equation (14).
