# Modeling and Optimization of NO2 Stations in the Smart City of Barcelona
## 5 Computational Results
### Optimization of Location of Stations  
Lastly, the obtained results of the proposed optimization algorithm for the optimal location of air quality stations are presented. First, the results of the Pareto frontier are shown to obtain the optimal number of stations to maximize the percentage of area coverage and minimize the percentage of overlap between stations. In addition, a scenario with minimal changes is considered, in which a total of 10 stations are placed throughout the city, ensuring that they are as far apart from each other as possible. Figure 10 illustrates the results of the Pareto frontier, depicting two key relationships concerning the number of open air quality stations. The left sub-plot displays the number of open stations alongside the percentage coverage achieved by each configuration. As expected, increasing the number of open stations generally leads to improved coverage across the air quality monitoring network. The right sub-plot exhibits the number of open stations concerning the percentage of overlap between these stations. As the number of open stations increases, so does the likelihood of overlap between their coverage areas. Initially, as the number of stations grows, the overlap percentage remains at 0%. However, beyond a certain threshold, the percentage of overlap escalates rapidly. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline \multirow{2}{*}{**Station**} & \multicolumn{4}{c}{**50**} & \multicolumn{4}{c}{**43**} & \multicolumn{2}{c}{**44**} \\ \cline{2-9}  & **MAE** & **RMSE** & **R2** & **MAE** & **RMSE** & **R2** & **MAE** & **RMSE** & **R2** \\ \hline KNN & 0.1221 & 0.1575 & 0.2723 & 0.1090 & 0.1431 & 0.3197 & 0.1112 & 0.1470 & 0.3056 \\ Decision Tree & 0.0023 & 0.0065 & 0.9987 & 0.0016 & 0.0035 & 0.9996 & 0.0017 & 0.0033 & 0.9996 \\ SVR & 0.1442 & 0.1874 & \(-\)0.0295 & 0.1368 & 0.1740 & \(-\)0.0057 & 0.1399 & 0.1781 & \(-\)0.0201 \\ Random Forest & **0.0016** & **0.0057** & **0.9991** & **0.0009** & **0.0027** & **0.9998** & **0.0011** & **0.0030** & **0.9997** \\ ANN & 0.1524 & 0.2031 & \(-\)0.2094 & 0.1304 & 0.1668 & 0.0767 & 0.1641 & 0.1957 & \(-\)0.2306 \\ \hline \hline \multirow{2}{*}{**Station**} & \multicolumn{4}{c}{**4**} & \multicolumn{4}{c}{**42**} & \multicolumn{4}{c}{**54**} \\ \cline{2-9}  & **MAE** & **RMSE** & **R2** & **MAE** & **RMSE** & **R2** & **MAE** & **RMSE** & **R2** \\ \hline KNN & 0.1175 & 0.1544 & 0.2932 & 0.1001 & 0.1332 & 0.3130 & 0.0989 & 0.1293 & 0.2864 \\ Decision Tree & 0.0015 & **0.0025** & **0.9998** & 0.0018 & 0.0050 & 0.9990 & 0.0013 & 0.0030 & 0.9996 \\ SVR & 0.1467 & 0.1851 & -0.0161 & 0.1250 & 0.1619 & \(-\)0.0151 & 0.1165 & 0.1541 & \(-\)0.0139 \\ Random Forest & **0.0011** & 0.0028 & **0.9998** & **0.0009** & **0.0024** & **0.9998** & **0.0008** & **0.0021** & **0.9998** \\ ANN & 0.1506 & 0.1952 & \(-\)0.1296 & 0.1267 & 0.1697 & \(-\)0.1153 & 0.1320 & 0.1741 & \(-\)0.2942 \\ \hline \hline \multirow{2}{*}{**Station**} & \multicolumn{4}{c}{**57**} & \multicolumn{4}{c}{**58**} \\ \cline{2-9}  & **MAE** & **RMSE** & **R2** & **MAE** & **RMSE** & **R2** \\ \hline KNN & 0.0891 & 0.1206 & 0.3603 & 0.0768 & 0.0980 & 0.2597 & \\ Decision Tree & 0.0016 & 0.0042 & 0.9992 & 0.0009 & 0.0020 & 0.9997 & \\ SVR & 0.1152 & 0.1511 & \(-\)0.0048 & 0.0878 & 0.1139 & 0.0015 & \\ Random Forest & **0.0008** & **0.0017** & **0.9999** & **0.0006** & **0.0016** & **0.9998** & \\ ANN & 0.1013 & 0.1391 & 0.1482 & 0.1370 & 0.1630 & \(-\)1.046 & \\ \hline \hline \end{tabular} Note. Values in bold represent the best results for each metric across models.  
\end{table} 
Table 4: Errors of ML models used to predict NO\({}_{2}\) concentrations by station. Figure 9: Relationship between average NO\({}_{2}\) concentration of stations and MAE error. (**a**) With all station. (**b**) Without station 50. Observe that the Pareto frontier demonstrates the trade-off between increasing the number of open stations to enhance coverage and the consequent rise in overlap, which may lead to redundant monitoring and inefficient resource allocation.