## 3 Our Proposed Algorithm
To conduct the experimental testing, three different scenarios were created with different values of priority to check the system performance in different cases to be sure if it was potentially influenced by fortuitous initial conditions or not. **Scenario 1**: There are numerous tasks of high priority, accompanied by a smaller number of tasks with medium and low priority. **Scenario 2**: There are numerous tasks of medium priority, along with a few tasks of high and low priority. **Scenario 3**: There are numerous tasks of low priority, along with a few tasks of high and medium priority. Tables 2 and 3 show the cloud and fog characteristics, respectively, and the simulation and algorithm of GWO parameters are shown in Table 4. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline Cloud nodes number & 5 \\ Processing rate of the cloud nodes & [20,000, 40,000] MIPS \\ Cloud nodes bandwidth & [1500, 4000] MBPS \\ Latency from fog to cloud (ms) & 100 \\ Power consumption in idle mode & (65–75) \% of the active dynamic mode \\ Power consumption in dynamic mode & (100–200) Watts \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Cloud Parameters. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline Fog nodes number & (10, 20, 30) \\ Processing rate of the fog nodes & [5000, 20,000] MIPS \\ Fog nodes bandwidth & [5000, 10,000] MBPS \\ Latency from the device to fog layers (ms) & 20 \\ Deadlines of tasks (ms) & [50–150] \\ Power consumption in idle mode & (65–75) \% of the active dynamic mode \\ Power consumption in dynamic mode & (75–150) Watts \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Fog Parameters. For the purpose of demonstrating the efficacy of our proposed algorithms, we compared them with the benchmarks that follow. 1. **Performance and Cost Algorithm (PCA):** Performance and cost scheduling algorithm for cloud services. The (PCA) algorithm is introduced, which prioritizes tasks based on profits to optimize resource utilization and minimize Makespan. The PCA considers both completion time and cost priority to provide cost-effective services with enhanced performance for cloud users. 2. **The Gray Wolf Optimizer:** The gray wolf optimizer (GWO) algorithm is a meta-heuristic algorithm that was inspired by gray wolves' social structure and hunting activity. Gray wolves have a hierarchical structure in nature, with an alpha leader and lower-ranking beta and delta wolves. 3. **Particle Swarm Optimization (PSO):** PSO is a clever approach that mimics the behavior of a flock of birds. Particles represent the birds in the context of the issue being addressed in this technique, and a multidimensional velocity governs their movement. A particle's position is impacted at each iteration by both the best position identified thus far and the best position among all particles in the whole problem space. A fitness function evaluates each particle's fitness value, showing its proximity to the desired aim in the search space and, hence, its relevance. Furthermore, each particle has a velocity that influences its path. Each particle successfully explores the issue space by continually pursuing the most promising particles at any given time [32]. The results of our experiments are presented on this page. First, we look into the impact of the algorithms we propose on performance. Following that, we compare these algorithms to existing methods by altering the number of tasks, fog nodes, and cloud nodes. Figure 2 depicts the Makespan for the four approaches under the conditions mentioned above. We note that our algorithm minimizes the Makespan compared with the GWO, PCA, and PSO algorithms, 16.72%, 16.38%, and 14.107%, respectively. Our proposed technique beats the other three algorithms (GWO, PCA, and PSO) in all circumstances.