## 4 Results and Discussion
### Actual Urban Pipeline Sensor Layout Optimization  
Through analysis of the actual urban pipeline network, the number of sensors is reduced from 90 potential nodes to 60 key nodes. Clustering analysis is used to evaluate the importance of each node, providing the ant colony algorithm with a decision-making basis for the optimization process. This method allows for the precise identification of the most critical nodes in maintaining the integrity of regional monitoring while also achieving efficient resource utilization. Since the detection range of sensors in real-world applications is not fixed, this study conducted a detailed analysis of the detection capabilities at different nodes. Based on the analysis in Section 3.3, it is found that under different environmental conditions, the maximum diffusion distance of gas within a fixed 5000 s time window determines the maximum detection range. As shown in Figures 3-18, shorter detection distances are primarily due to low porosity in the soil, which hinders gas diffusion, and the use of sensors in parallel pipeline wells. On the other hand, the detection distance of around 70 m is attributed to gas diffusion first reaching the surface and then being detected by open-path laser sensors. The thinner soil layers the gas passes through enable faster detection, resulting in a larger detection range. Figure 17: Relationship between number of sensors and coverage rate. Figure 19 shows the analysis of the relationship between response time and the number of sensors, revealing that effective monitoring begins with 15 sensors, with an initial response time of 3245 s. As the number of sensors increases to 70, the response time significantly decreases to 314 s. Additionally, coverage rate analysis indicates that as the number of sensors increases from 0 to 70, the coverage rate rises rapidly from 0% to over 90%. However, when the number of sensors approaches 60, the growth in coverage rate begins to plateau. This suggests that while increasing the number of sensors can effectively reduce response time, its contribution to coverage rate diminishes after reaching a certain threshold, especially when the coverage rate approaches 90%. Beyond this point, adding more sensors has minimal impact on further improving coverage. These findings highlight the importance of identifying the optimal number of sensors in practical deployment to achieve the best balance between cost and benefit. Considering both coverage rate and response time, 60 sensors are shown to be a reasonable choice, maximizing coverage while avoiding resource waste. This offers valuable practical guidance for designing sensor networks in urban infrastructure management and environmental monitoring. Figure 19: Relationship between 70 sensors and coverage rate. Figure 18: Sensor coverage distance for each node. and enhancing system efficiency. By thoroughly evaluating the risk levels of each node and the diffusion characteristics of the soil, this method optimized the sensor layout, significantly reducing the number of sensors required, thus saving costs and improving system operation efficiency. The research explored the relationship between node importance and the pheromone concentration gradient \(\alpha\) in the ant colony algorithm, the impact of physical distances between nodes on the pheromone concentration gradient \(\beta\), and the adjustment of the pheromone evaporation rate \(\rho\) based on methane diffusion mechanisms in the soil. These factors collectively optimized the sensor layout strategy, enhancing the practicality and realism of the model. The optimized sensor network not only ensured coverage but also significantly improved system diagnostic efficiency and response time. Additionally, it reduced outliers during the monitoring process, enhancing the stability and reliability of the system. This technology has been proven effective in urban gas safety management, providing strong scientific decision support and advancing the development of smart city infrastructure.