# Resource Scheduling in Cloud Computing Based on a Hybridized Whale Optimization Algorithm
## 3 Proposed Models
### The Model Utilized in Simulations with a Real Data Set (First Model)  
As already mentioned, the first model was utilized in simulations with a real data set and it is similar to the model presented in [75]. This model includes only the MS objective.  
The mathematical formulation of the single-objective resource scheduling model includes the following. Let \(CI\) denote the cloud infrastructure that consists of \(N_{ph}\) physical hosts (\(PH\)), where in turn each host is composed by the \(N_{vm}\) virtual machines (\(VM\)):  
\[CI=\{PH_{1},PH_{2},...,PH_{i},...,PH_{N_{ph}}\}, \tag{1}\]  
where each \(PH_{i}(i=1,2,3,...,N_{ph})\) can be denoted as:  
\[PH_{i}=\{VM_{1},VM_{2},...,VM_{j},...,VM_{N_{vm}}\}, \tag{2}\]  
where \(VM_{j}\) represents the \(j\)-th VM that is allocated within the particular physical host. Each \(VM_{j}\) is defined with the following set of properties (attributes):  
\[VM_{j}=\{VMID_{j},MIPS_{j}\}, \tag{3}\]  
where \(VMID_{j}\) and \(MIPS_{j}\) denote the unique identifier (serial number) and processing performance in terms of MIPS units of \(VM_{j}\), respectively.  
The end-users submit set of tasks (\(TSK\)) that should be mapped and processed on a available and adequate VM:  
\[TSK=\{T_{1},T_{2},T_{3},...,T_{k},...,T_{N_{ks}}\}, \tag{4}\]  
where the \(N_{ks}\) presents the total number of tasks submitted by the end-users, and task \(T_{k}\) represents the \(k\)-th task in the sequence, which can be more accurately defined as:  
\[T_{k}=\{TID_{k},length_{k},ETC_{k},P_{k}\}, \tag{5}\]  
where \(TID_{k}\) and \(length_{k}\) denote the unique identifier and the length expressed in million instruction (MI) units of the task \(k\). The \(P_{k}\) represents the priority of the task \(k\), while the \(ETC_{k}\) denotes the expected time to complete for a task \(k\).  
The allocation (mapping) of \(T_{tsk}\) tasks to \(N_{vm}\) VMs has a immense impact on the general cloud system performance.  
The expected time to complete (ETC) of the \(k\)-th task on the \(j\)-th VM can be calculated as follows:  
\[ETC_{k,j}=\frac{length_{k}}{MIPS_{j}}, \tag{6}\]  
where \(j=1,...,N_{vm}\) and \(k=1,...,N_{tsk}\).  
The ETC matrix could be considered and used as a task model for a cloud environment with heterogeneous resources [29].  
The ETC matrix of a size \(N_{tsk}xN_{vm}\) denote the execution time required to complete each task on a each VM machine [75]:  
\[ETC=\left[\begin{array}{cccccc}ETC_{1,1}&ETC_{1,2}&ETC_{1,3}&\cdots&ETC_{1,j} &\cdots&ETC_{1,N_{vm}}\\ ETC_{2,1}&ETC_{2,2}&ETC_{2,3}&\cdots&ETC_{2,j}&\cdots&ETC_{2,N_{vm}}\\ ETC_{3,1}&ETC_{3,2}&ETC_{3,3}&\cdots&ETC_{3,j}&\cdots&ETC_{3,N_{vm}}\\ \cdots&\cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\ ETC_{N_{tsk},1}&ETC_{N_{tsk},2}&ETC_{N_{tsk},3}&\cdots&ETC_{N_{tsk},j}&\cdots&ETC _{N_{tsk},N_{vm}}\end{array}\right].\]  
If we ought to establish the MS objective as in [75], first the execution time (ET) of all VMs has to be calculated. The execution time of the \(j\)-th VM (\(ET_{j}\)) for the task \(k\) depends on the decision variable \(x_{k,j}\)[29]:  
\[x_{k,j}=\begin{cases}1,\text{ if }C_{k}\text{ }\text{ is allocated to }\ VM_{j},\\ 0,\text{ if }C_{k}\text{ }\text{ is not allocated to }\ VM_{j}.\end{cases} \tag{7}\]  
Then, the \(ET_{j}\), where \(j\) is in the range \([1,N_{vm}]\), can be calculated as:  
\[ET_{j}=\sum_{k=1}^{N_{tsk}}x_{k,j}\cdot ETC_{k,j}. \tag{8}\]  
The MS objective is the maximum of \(ET\) for all VMs:  
\[MS=\max[ET_{j}]_{j=1}^{N_{vm}}, \tag{9}\]  
\[\forall k\in[1,N_{tsk}]\text{mapped to }\ j\text{th VM},j=1,2,3,...,N_{vm}. \tag{10}\]  
In order to more adequately evaluate the performance of the proposed metaheuristics, we have considered the degree of imbalance (\(DI\)) which can be calculated as:  
\[DI=\frac{T_{max}-T_{min}}{T_{avg}}, \tag{11}\]  
where \(T_{max}\), \(T_{min}\) and \(T_{avg}\) defines the maximum, minimum, and average execution time of all VMs, respectively. The degree of imbalance (\(DI\)) was employed as well in [75].