## 3 Case Study: Analysis of Urban Pipeline Sensor Placement Optimization
### Application of the Ant Colony Algorithm in Layout Optimization  
We can view the manholes in the gas pipeline as nodes and consider the concentration gradient decay of gas diffusion within these nodes as the decay of pheromone concentration, as shown in Figure 13. In this analogy, \(\tau_{ij}\left(t+1\right)\) in Equation (14) represents pheromone concentration, which is influenced by the evaporation rate of the pheromone concentration, denoted by \(\rho\). The relationship between gas diffusion in the soil and the evaporation rate (\(\rho\)) is based on a mapping system. When the diffusion of gas in the soil is easier, the value of \(\rho\) is smaller, indicating less need for attention, whereas when the gas diffusion is more difficult, the value of \(\rho\) is larger, requiring more focus and monitoring. Figure 12: Diffusion relationships in different soils. Figure 13: Concentration decay diagram. Since the gas diffusion in the soil affects the value of \(\rho\), it in turn influences the pheromone concentration. Therefore, the ease or difficulty of gas diffusion directly impacts the pheromone concentration through this mapping, which allows us to model the gas diffusion process using pheromone evaporation dynamics. In this analogy, changes in gas concentration within the pipeline network alter the evaporation rate, and thus the pheromone concentration, as gas diffusion becomes more or less effective depending on the surrounding environmental conditions such as soil type and moisture content. As shown in Figure 14, when a casing is present, the evaporation rate should be set relatively low (e.g., 0.5) to reflect the rapid movement of gas within the casing gaps. This setting helps the ant colony algorithm more accurately simulate the rapid diffusion of gas in the casing environment. Conversely, if no casing is present, the evaporation rate must take into account the specific characteristics of the soil type. For sandy soil, which has better permeability, a relatively higher evaporation rate (e.g., 0.7) should be set. For denser clay, the evaporation rate should be even higher (e.g., 0.9 or above) to reflect the slower diffusion speed in such environments. In the application of the ant colony algorithm for gas leak sensor placement in urban pipeline networks, the \(\alpha\) parameter is specifically used to represent the importance weight of each node. This weight allocation is based on the importance of locations near each node, such as schools, hospitals, and commercial areas, reflecting the priority for monitoring and response in emergency situations. In this way, the algorithm prioritizes areas with higher importance when optimizing sensor placement, thereby effectively enhancing the emergency response capabilities and safety of the entire monitoring system. Since the importance of locations near each node varies, the weights for each node must be defined, i.e., the \(\alpha\) value in Equation (15) must be determined. The value of \(\alpha\) is determined by the risk levels obtained from the clustering analysis, as shown in Table 4, to ensure the rational allocation of monitoring resources and improve overall system efficiency. The spacing of urban gas manholes is typically set between 50 and 100 m to ensure the proper operation and maintenance of the pipelines. Based on this, the distance between each manhole node and other nodes has been classified into levels. Figure 14: \(\rho\) Definition for each node. In the urban gas manhole monitoring system, the distance between nodes and the corresponding level coefficient \(\beta\) are key factors that ensure the proper operation and maintenance of the pipeline. These parameters influence the design and performance of the sensor network, particularly in the gas leak detection and response system. The distance between nodes is used to calculate the level coefficient \(\beta\), which reflects the quality of signal transmission or monitoring effectiveness as a function of distance.