## 3 Case Study: Analysis of Urban Pipeline Sensor Placement Optimization
### System Clustering for Risk Level Classification
Table 2 details the clustering merge process from the first to the eighteenth stage. At each stage, two specific clusters were selected and merged based on a predefined similarity standard. For example, in the first stage, clusters 2 and 13 were merged with a coefficient of 40.000. The table also records the stage at which each cluster first appeared as a result of a merge, as well as the stages in which they participated in further merges. Figure 7: Original GIS map. Additionally, after each cluster merge, the newly formed cluster will be involved in another merge at a designated later stage, until ultimately all clusters are merged into a single cluster, marking the completion of the clustering process. For example, the new cluster formed by merging cluster 2 and cluster 13 is merged again in the sixth stage. Using the hierarchical clustering method, nodes can be effectively classified into four risk levels: high risk, medium risk, low risk, and negligible risk, as recorded in Table 3. The classification is based on factors such as the presence of key facilities, historical safety data, geographical features, and environmental factors. This allows for customized monitoring strategies for each risk level, optimizing the placement of sensors. This method not only scientifically reflects the relationships and differences between nodes but also provides an effective strategic tool for the safety monitoring of the pipeline network. To optimize sensor placement and improve monitoring efficiency, the dendrogram provides a detailed depiction of the clustering process of these nodes based on similarity and features. The horizontal axis in the diagram shows the distance or similarity metric at the time of cluster merging, with larger values indicating greater differences between \begin{table}
\begin{tabular}{c c c c c c c} \hline \multirow{2}{*}{**Stage**} & \multicolumn{2}{c}{**Agglomerative**} & \multicolumn{4}{c}{**Stage of First**} \\  & \multicolumn{2}{c}{**Clustering**} & \multirow{2}{*}{**Coefficient**} & \multicolumn{2}{c}{**Appearance of Cluster**} & **Next** \\  & **Cluster 1** & & **Cluster 2** & & **Cluster 1** & **Cluster 2** & **Stage** \\ \hline  
\hline \end{tabular}
\end{table} 
Table 2: Centralized planning schedule. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Well Number** & **Risk Level** & **Well Number** & **Risk Level** \\ \hline
1 & 1 & 11 & 2 \\
2 & 2 & 12 & 4 \\
3 & 2 & 13 & 2 \\
4 & 3 & 14 & 3 \\
5 & 3 & 15 & 2 \\
6 & 2 & 16 & 3 \\
7 & 2 & 17 & 2 \\
8 & 2 & 18 & 3 \\
9 & 3 & 19 & 2 \\ \hline \end{tabular}
\end{table} 
Table 3: Risk levels corresponding to inspection wells. merged clusters, signifying more distinct characteristics among these nodes. The vertical axis clearly lists the node numbers involved in the clustering process, ranging from 1 to 19. In Figure 8, each vertical line represents an individual node, while horizontal lines signify the merging of two nodes or existing clusters. These nodes are connected by horizontal lines, with the position of the connection (the value on the horizontal axis) directly reflecting the similarity or distance between them. From left to right, the merging sequence of clusters is visible, with the leftmost merges representing the closest clusters, indicating the initial steps with minimal differences between them. By analyzing when and how nodes merge, one can infer the similarity between nodes and their potential risk levels within the gas pipeline network. For instance, nodes that merge later into the main group may have unique characteristics or higher risks, requiring more attention. Additionally, by selecting different horizontal cut points on the dendrogram, one can determine various numbers of clusters, which can then be used to define different monitoring strategies for each risk level. This hierarchical clustering visualization method not only provides a scientific basis for node risk assessment and sensor placement but also helps identify key nodes that require focused monitoring.