# Resource Scheduling in Cloud Computing Based on a Hybridized Whale Optimization Algorithm
## 4 Original and Hybrid Whale Optimization Algorithm
### Original Whale Optimization Algorithm Overview
#### 4.1.1 Exploitation Process  
During the phase of exploitation, each candidate solution performs a search in its neighborhood and it is directed towards the position of the current global best solution.  
After every solution in the population, a fitness is calculated, and positions of all solutions in the population are updated with respect to the position of the global best solution (individual that has the greatest fitness value) [22]:  
\[\vec{D}=|\vec{C}\cdot\vec{X}^{*}(t)-\vec{X}(t)| \tag{24}\]  
\[\vec{X}(t+1)=\vec{X}^{*}(t)-\vec{A}\cdot\vec{D}, \tag{25}\]  
where \(\vec{X}(t)\) and \(\vec{X}^{*}(t)\) denote candidate and current best solutions in iteration \(t\), respectively, \(\vec{A}\) and \(\vec{C}\) represent coefficient vectors, while the symbol \(\cdot\) is element-wise multiplication operator.  
The following expressions are used for calculating coefficient vectors \(\vec{A}\) and \(\vec{C}\)[22]:  
\[\vec{A}=2\vec{a}\cdot\vec{r}-\vec{a} \tag{26}\]  
\[\vec{C}=2\cdot\vec{r}. \tag{27}\]  
In Equations (26) and (27), \(\vec{r}\) represents a uniformly distributed pseudo-random vector in the interval \([0,1]\), while \(\vec{a}\) is a vector that is in the basic WOA implementation that is linearly decreased from 2 to 0 during the algorithm's execution.  
Based on the Equations (24)-(27), the candidate solution \(\vec{X}\) in each iteration can be directed towards any position within the neighborhood of the current best solution \(\vec{X}^{*}\) by adjusting the values of coefficient vectors \(\vec{A}\) and \(\vec{C}\) by using the pseudo-random vector \(\vec{r}\).  
The shrinking encircling mechanism and spiral-shaped path mathematical models are used for the purpose of emulating the bubble-net attack strategy.  
By linearly decreasing vector \(\alpha\) from 2 to 0, in every iteration of algorithm's run, the shrinking encircling mechanism is modeled. In the original WOA version, the following expression is used [22]:  
\[\vec{a}=2-t\frac{2}{maxIter}, \tag{28}\]  
where \(t\) and \(maxIter\) denote the current and maximum number of iterations in one run, respectively.  
Also, in the very first WOA paper [22], the authors recommended that the value of \(\vec{A}\) should be adjusted within the interval \([-1,1]\). In this way, an updated position of the current solution can be set anywhere between its current position and the position of the global best solution from the population.  
The second mechanism that guides the process of exploitation (a spiral-shaped path) is executed in two steps: First, the distance between the global best solution (\(\vec{X}^{*}(t)\)) and current solution (\(\vec{X}(t)\)) in iteration \(t\) is calculated, and then, a new (updated) position of candidate solution (\(\vec{X}(t+1)\)) is determined by using a spiral equation [22]:  
\[\vec{X}(t+1)=\vec{D^{\prime}}\cdot e^{bl}\cdot\cos(2\pi l)+\vec{X}^{*}(t), \tag{29}\]  
where \(\vec{D^{\prime}}\), as distance between the \(i\)-th candidate solution and the global best solution, can be expressed as \(\vec{D^{\prime}}=|\vec{X}^{*}(t)-\vec{X}(t)|\), and \(b\) represents a constant that defines a shape of logarithmic spiral, while \(l\) denotes pseudo-random number within the range of \(-1\) and \(1\).  
The fact that the humpback whales move around the prey along a spiral-shaped path and shrinking circle simultaneously, is simulated by choosing between shrinking encircling and spiral-shaped path mechanisms in each iteration with equal probability \(p\):  
\[\vec{X}(t+1)=\begin{cases}\vec{X}^{*}(t)-\vec{A}\cdot\vec{D}\,\text{if}\ p<0.5\\ \vec{D^{\prime}}\cdot e^{bl}\cdot\cos(2\pi l)+\vec{X}^{*}(t)\,\text{if}\ p\geq 0.5 \end{cases}. \tag{30}\]In each iteration, probability \(p\) is drawn from a random distribution between 0 and 1.