## 4 System Model
### Proposed Algorithm  
Here, we have presented our proposed meta-heuristic based algorithms for distribution of load among all available servers evenly and minimizing the number of servers. Algorithm 1 is used to calculate the fitness value and is called by each algorithm. Algorithm 2 represents the proposed GWO-based algorithm, and Algorithm 3 represents the simulated annealing approach. This is used with all three algorithms: Genetic Algorithm [49], Particle Swarm Optimization [50], and proposed Grey Wolf Optimization. ```
Input: solution_list, population_size, Output: fitness value. 1: Initialize LV = 0, MS = 0. 2:for each solution_list do
3: Calculate \(MS=\sum_{i=1}^{n}\mathrm{CT}_{i}\). 4: Calculate \(L_{\mathrm{var}}=\frac{1}{m}\sum_{i=1}^{m}L_{j}-\mu\). 5:endfor
6: return \(MS\), \(L_{\mathrm{var}}\). ```  
**Algorithm 1** Fitness Function  
Grey Wolf Optimization is a meta-heuristic algorithm based on population and it imitates the hierarchy of a leadership and hunting mechanism of gray wolves in nature. They prefer to live in a pack that is divided into four different levels. The name of the level-1, level-2, level-3, and level-4 are alpha, beta, delta, and omega, respectively. Level-1 is the leader responsible for making a decision and it can be male or female. The level-2 category is the disciplinarian and adviser for the pack and assists the level-1 group in decision-making. The level-3 is consisting of scouts, sentinels, elders, hunters, and caretakers. The scouts are responsible for watching the boundaries, the pack is supposed to be protected by sentinels, elders are the ones who were sometimes alpha or beta, hunters are the ones who assist alpha in hunting, caretakers are responsible for taking care of weak, ill, and wounded wolves. Level-4 groups are scapegoats in the pack which are the last-allowed wolves for eating. According to the position of alpha, beta, and delta wolves, all other wolves search for prey. The best solution is produced by alpha, the second-best solution is the beta solution, and then the delta solution. All other remaining solutions produced by omega are categorized as omega solutions. To update the position, the following mathematical formulas are used by the omega group:  
\[\vec{D}=|\vec{Q}.S_{p}(\vec{i})-\vec{S}(i)| \tag{5}\]  
\[\vec{S}(i+1)=S_{p}(\vec{i})-\vec{P}.\vec{D} \tag{6}\]where \(\vec{P}\) and \(\vec{Q}\) are coefficient vectors and \(i\) represents the current iteration number, \(\vec{S}\) represents the position vector of grey wolf and \(\vec{S_{p}}\) indicates the position vector of the prey. The vectors \(\vec{P}\) and \(\vec{Q}\) can be calculated as  
\[\vec{P}=2.\vec{a}.\vec{r_{1}}-\vec{a} \tag{7}\]  
\[\vec{Q}=2.\vec{r_{2}} \tag{8}\]  
where \(\vec{r_{1}}\) and \(\vec{r_{2}}\) are random vectors. The vector component \(\vec{a}\) is linearly decreased from 2 to 0 using  
\[a=2-\frac{2.i}{Number\,of\,\,\,Iteration} \tag{9}\]  
where \(i\) is the current iteration number. The obtained solution by the Grey Wolf optimization Algorithm is represented as \(S=\{2,4,3,7,5\}\), where each entry in \(S\) represents the container number. If the obtained solution is \(S=\{2,4,3,7\}\), it says that task \(t_{1}\) is assigned to container \(C_{2}\), task \(t_{2}\) is assigned to container \(C_{4}\), task \(t_{3}\) is assigned to container \(C_{3}\), and task \(t_{4}\) is assigned to container \(C_{7}\). Then, based on the available VM and this task allocation to different containers, makespan and load variation are calculated. The three best solutions which minimize the load variation and makespan are considered as alpha, beta, and delta solutions. Based on the position of alpha, beta, and delta, the remaining solutions are updated. The flow of the algorithm is presented in Figure 7.  
Figure 7: Flowchart of the Proposed Algorithm. ```
1:Input:\(N,N_{p}\),\(p\_size\)
2:Output:\(solution\). 3:\(N\leftarrow\) Number of Iteration. 4:\(N_{p}\leftarrow\) Number of population. 5:\(p\_size\leftarrow\) Population Size. 6:\(N_{t}\leftarrow\) Number of task.