## 3 Case Study: Analysis of Urban Pipeline Sensor Placement Optimization
### Gas Diffusion Analysis in Different Areas  
After analyzing the porosity and humidity of 19 areas in Figures 10 and 11, it was observed that these physical properties significantly affect the diffusion behavior of methane in different soil types. A porosity value of 100 indicates that there are no barriers to diffusion within the casing pipe, allowing methane to diffuse freely. The wide distribution of porosity and varying soil humidity patterns further influenced the adsorption and desorption dynamics of methane, directly impacting its diffusion capacity. In addition, soil humidity affects the diffusion behavior by altering the moisture content in the soil, which can either enhance or hinder the diffusion process. Higher moisture content generally increases the resistance to methane diffusion, as the water content fills the pore spaces and reduces the air volume available for gas movement. Therefore, the combination of both porosity and humidity plays a crucial role in determining the methane diffusion behavior in different soil environments.  
Figure 10: Porosity at each node.  
Figure 9: Extracted map.  
Porosity and humidity directly affect methane's diffusion capacity and therefore determine the adjustment of the pheromone evaporation rate \(\rho\) in the ant colony algorithm. The pheromone evaporation rate \(\rho\) is a key parameter in the algorithm, reflecting the behavior of ants releasing pheromones to find food paths in nature. This is crucial for optimizing methane leak detection and response strategies. By precisely adjusting \(\rho\), the behavior of methane in complex soil environments can be more effectively simulated.  
To gain a deeper understanding of this process, we employed a one-dimensional continuous source diffusion model based on Darcy's law to simulate methane leakage behavior, specifically analyzing three main diffusion pathways of methane from the pipeline leak point to the detection point: one through a clay medium, another through a parallel casing system, and the third through a sandy soil medium. The model simulates the migration of methane in soil and pipelines by accurately calculating the volumetric flow rate Q and the diffusion coefficient K in different media.  
Figure 12 demonstrates that methane diffusion behaves significantly differently across various media. Diffusion in the air within a casing pipe occurs with fewer physical obstructions, resulting in the fastest diffusion speed and the longest diffusion distance. Diffusion in clay is slowed down due to higher resistance and a more complex physical structure. Diffusion in sandy soil, which has properties between clay and air, reflects the impact of soil density and humidity on methane diffusion. These diffusion curves not only provide a clear understanding of methane's behavior under different environmental conditions but also emphasize the critical influence of environmental characteristics on the diffusion process.  
Although the proposed method accounts for soil types and gas diffusion characteristics, it is important to acknowledge that other external factors, such as weather conditions and land use changes, could influence the effectiveness of the system. These variables may affect gas diffusion and sensor performance, but due to practical constraints, they were not included in this study. However, addressing these factors in future research could further enhance the robustness and adaptability of the proposed method in diverse urban environments.  
Figure 11: Humidity at each node.