## 5 Simulation Result and Discussion
### Simulation Based on Different Numbers of Tasks  
In Figure 4 on the left side, we compare the performance of total latency on average in terms of different number of tasks. The number of tasks being offloaded to an edge server can affect the performance of latency, energy, and computation costs. Offloading a large number of tasks to an edge server can increase the overall latency of the system, as the edge server has to process all the tasks it receives. This can result in increased waiting times for users, which can negatively impact user experience. Offloading a large number of tasks to an edge server can also increase the energy consumption of the system as well as the computation cost of the system. This can result in increased power consumption and reduced battery life, which can be particularly important for user devices. The figure shows the total latency in ms obtained by each approach. The proposed Lagrange approach achieves a total latency of 6.40, 12.80, 24.45, 38.40, 51.20, and 64.00 ms according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively. These results demonstrate that as the number of tasks increases, the proposed algorithm still performs well in reducing latency. In contrast, the conventional approaches show different results: Greedy Latency has total latencies of 35.14, 39.56, 77.96, 118.67, 158.23, and 197.79 ms according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively. Load Balancing can obtain total latencies of 35.54, 42.93, 84.70, 128.77, 171.70, and 214.62 ms according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively. Finally, Random Offloading has a total latency of 23.66, 47.32, 93.48, 141.95, 189.26, and 236.58 ms according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively, which is less efficient than the other approaches. If we compare the performance of total latency on average in terms of different numbers of tasks, when the task number increases from 20 to 200, the total latency of our proposed approach is 218.05% better than that of Greedy Latency, 243.86% better than that of Load Balancing, and 271.23% better than that of Random Offloading. Overall, the results show that the proposed Lagrange approach still outperforms conventional approaches in terms of reducing latency, especially as the number of tasks increases.  
In Figure 4 on the right side, we compare the performance of total cost on average in terms of different numbers of tasks. The proposed Lagrange approach achieves total costs of 0.0072, 0.0144, 0.0255, 0.0432, 0.0576, and 0.0720 according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively. These results indicate that the proposed algorithm effectively reduces computation costs even as the number of tasks increases. On the other hand, the conventional approaches yield different outcomes: Greedy Latency has total costs of 0.0386, 0.0474, 0.0934, 0.1421, 0.1894, and 0.2368 according to the task numbers of 20, 40, 80, 120, 160, and 200, respectively, while Load Balancing can obtain a total cost of 0.0395, 0.0516, 0.1020, 0.1534, 0.2066, and 0.2582. Lastly, Random Offloading yields a total cost of 0.0296, 0.0592, 0.1171, 0.1776, 0.2368, and 0.2959 as the number of tasks ranges from 20 to 200, respectively. If we compare the performance of total cost on average in terms of different numbers of tasks, when the task number increases from 20 to 200, the total cost of our proposed approach is 240.02% better than that of Greedy Latency, 268.94% better than that of Load Balancing, and 316.64% better than that of Random Offloading. Overall, these findings suggest that the proposed Lagrange approach outperforms conventional methods in terms of reducing costs, particularly as the number of tasks increases.