## 5 Performance Evaluation
### Experimental Results
#### 5.2.2 Scenario 2: Task Scheduling in Cloud-Fog Environment  
In this case, we conducted experiments on the complete Cloud-Fog system, which consisted of 10 Fog nodes and three remote Cloud nodes. Unlike in Scenario 1, Fog nodes had similar values of attributes; tasks seemed to be evenly distributed to nodes. In this case, the processing nodes were divided into two categories. Cloud nodes were much more powerful than Fog nodes, thus were responsible for processing more tasks. Therefore, finding an optimal solution was more difficult. Figure 6 compares the time-cost trade-off between our proposed TCaS algorithm and the three others as the number of tasks changed. The average results were obtained by running two algorithms on each dataset over 30 times with 500 generations (or iterations) and the coefficient balance \(\alpha=0.5\). Compared to Scenario 1, the ranking of solution quality of the four algorithms achieved in this case were quite similar; however, the fitness values were generally smaller. TCaS algorithm still overwhelmed the remaining algorithms on all datasets, especially on small datasets including from 40 to 200 tasks. The result achieved by TCaS was on average better than that of MPSO by 11.04%, BLA by 15.11% and RR by 44.17%. Observing three evolutionary algorithms, the fitness value slightly decreased as the number of tasks increased. This can be explained as the bigger the dataset was, the larger search the space was, thus the three algorithms could not converge in the limited iterations or could not explore the whole large space with a small number of individuals. MPSO performed better than BLA in this complex environment, while achieving higher fitness value than BLA on every datasets and was better than BLA on average by 3.66%. The fitness value RR algorithm achieved remained the lowest level of four algorithms, which was around 0.55. Table 8 compares the four algorithms in terms of execution time and processing cost. TCaS algorithm represented the superiority of scheduling length on every dataset; it saved on average 35.73% of processing time compared to MPSO, 42.20% compared to BLA and 176.25% compared to RR. However, in terms of monetary cost, our algorithm was not the best. MPSO demonstrated its cost effectiveness when holding the first position on almost all datasets except the 40-task dataset where BLA was slightly better. TCaS consumed 5.96% more money than MPSO, the most cost effective algorithm; however, this number is very small compared to the execution time benefit shown by TCaS. Actually, response time is very important in guaranteeing QoS as it directly affects a user's experience, thus users are willing to spend a small amount of money to experience much higher performance service. Based on the analysis of the results of the two scenarios, TCaS, our proposed algorithm, could reach better trade-off between makespan and total cost than the three other algorithms, together with  
Figure 6: Time–cost trade-off comparison of the four algorithms. showing the superiority of time optimization. MPSO demonstrated more power than BLA in complex environments. RR algorithm with simple mechanism gave poor results. Next, we considered the convergence of the three evolutionary algorithms TCaS, BLA and MPSO. They were performed on a dataset of 120 tasks over 500 generations with coefficient balance \(\alpha=0.5\). We observed the population every 20 generations. The fitness values of all individuals were synthesized, as shown in Figure 7. The middle point in line indicates the average fitness value of whole population while the bottom and top of the error bar present the fitness value of the worst and best individual, respectively. It was observed that BLA and MPSO expressed fast convergences after 100 generations, however, the found solutions had small fitness values at 0.69 and 0.72 compared with 0.84 achieved by TCaS algorithm. In some first generations, individuals of TCaS algorithm were distributed with a wide range of fitness value.