## 6 Experiments
### Results
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Algorithm**} & \multicolumn{2}{c}{**Objective Function**} & \multicolumn{2}{c}{**Generation**} & \multicolumn{2}{c}{**Infeasible Allocation**} \\ \cline{2-7}  & **Avg** & **Std** & **Avg** & **Std** & **Avg** & **Std** \\ \hline PPO & 4.1004 & 0.1567 & – & – & 21.43 (18) & 18.83 & 6.39 \\ DQN & 3.7895 & 0.51762 & – & – & 24.17 (40.95) & 448.43 & 83.27 \\ GA & 4.4288 & 0.0027 & 28.07 & 14.9088 & 3593 & 476.27 & 34.20 \\ PSO & 4.3221 & 0.0051 & 34.73 & 10.4977 & 1389 & 425.67 & 38.67 \\ QPSO & 4.4255 & 0.0074 & 30.9 & 14.1941 & 1236 & 482.53 & 204.10 \\ MPSO & 4.4313 & 0.0060 & 32.3667 & 12.7617 & 6473 & 406.07 & 209.89 \\ GWO & 4.4279 & 0.00600 & 31.17 & 14.1326 & 935 & 287.03 & 32.66 \\ GA-ECT & 4.1467 & 0.2829 & 39.7 & 8.0049 & 5082 & 204.40 & 11.83 \\ PSO-ECT & 4.3325 & 0.1014 & 49.57 & 0.6789 & 1983 & 31.97 & 8.28 \\ QPSO-ECT & 4.3589 & 0.0560 & 44.63 & 6.4513 & 1785 & 0.0 & 0.0 \\ MPSO-ECT & 4.3981 & 0.0254 & 41.9 & 7.8052 & 8380 & 0.0 & 0.0 \\ GWO-ECT & 4.3856 & 0.0324 & 46.9 & 2.3540 & 1407 & 0.0 & 0.0 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Comparison of the average best solutions and the sample efficiency for the chosen algorithms. Figure 7: An illustrative snapshot of the optimization process using CI. The GA, PSO, QPSO, MPSO, GWO (on the **top**) and their constrained (ECT) versions (on the **bottom**). The constrained versions take into account a penalty component in the fitness function. function against the number of infeasible allocations. This trend highlights that using a penalty component to guide the optimization process of CI algorithms can provide higher efficiency in exploring the search space. On the other hand, the RL algorithms exhibited competitive results compared to the CI algorithms in terms of maximizing the objective function. Specifically, PPO was the quickest to reach its best result, with a great objective function alongside a particularly low number of infeasible allocations (the lowest if we exclude the ECT variants). The DQN was demonstrated to not be as effective as the PPO. Despite requiring the second-fewest generations to find its best solution, all metaheuristic implementations in this analysis outperformed it in both the objective function value and total infeasible allocations. In our opinion, the main reason behind this lies in the implementation of the DQN provided by Stable Baselines3, which does not integrate any prioritized experience replay or improved versions like the Double-DQN. Consequentially, it was not capable of dealing with more-complex observation spaces, such as the multi-discrete action space of PPO. With a sophisticated problem like the one we are dealing with in this manuscript, the Stable Baseline3 DQN implementation appeared to lack the tools to reach the same performance as PPO. The last step of this experimentation was to analyze the performance of the best solutions presented previously, thus showing how the different solutions perform in terms of the PSR and average latency. Even if the problem formulation does not take into account latency minimization, it is still interesting to analyze how the various algorithms can distribute the service load across the Cloud Continuum and to see which offers the highest-quality solution. It is expected that solutions that make use of Edge and Fog computing devices should be capable of reducing the overall latency. However, given the limited computing resources, there is a need to exploit the Cloud layer for deploying service instances. Specifically, for each algorithm and each measure, we report both the average and the standard deviation of the best solutions found during the 30 optimization runs grouped by service in Table 8. From these data, it is easy to note that most of the metaheuristic approaches can find an allocation that nearly maximizes the PSR of the mission-critical services (identified in healthcare, video, and safety as mentioned in Table 3) and the other as well.