# An Arch-Bridge Topology-Based Expressway Network Structure and Automatic Generation
## 3 Methodology
### Automatic Generation of Expressway Network Topology
#### 3.2.2 Candidate Topology Set Optimization  
We must clean up the abnormal topology mentioned in Section 4.1. Therefore, we need to conduct a detailed analysis of different types of abnormalities and design corresponding optimization rules. Loop Topology Optimization  
As shown in Figure 4a, data redundancy causes the formation of self-loops in the gantry nodes. However, according to actual expressway traffic rules, this type of candidate topology edge cannot exist. To solve this type of anomaly, it is obvious that we only need to directly delete the topologies with the same nodes from the topology candidate edge set \(\mathbf{cE}\) to complete the cleaning. The following constraint conditions can be designed:  
\[\mathbf{cE}=\big{\{}\mathbf{ce}_{ij}=\big{<}g_{i},g_{j}\big{>}\big{|}g_{i}!=g_{j}\wedge \mathbf{ce}_{ij}\in\mathbf{cE}\big{\}} \tag{5}\]  
Reverse Topology Optimization  
According to the different types of gantries on the expressway, there are three types of reverse topologies:  
1. \(\big{<}g_{i},g_{j}\big{>},g_{i}\in G_{r},g_{j}\in G_{en}\): From the gantry nodes on the road section to the gantry entrance nodes or province entrance gantry;
2. \(\big{<}g_{i},g_{j}\big{>},g_{i}\in G_{ex},\ g_{j}\in G_{r}\): From the exit gantry nodes or province exit gantry nodes to the normal gantry nodes on the road section;
3. \(\big{<}g_{i},g_{j}\big{>},g_{i},g_{j}\in G_{r}\): From normal gantry nodes on the road section to normal gantry nodes on the road section. According to Definition 2, the indegree of the gantry or nodes at the entrance of the province or gantry station is \(\pi_{in}(g_{i})=0,g_{i}\in G_{en}\). Of course, there is no topology from the normal gantry node to the entrance gantry node or provincial entrance gantry node. Similarly, the outdegree of exit gantry nodes at the province border exit gantry is \(\pi_{out}(g_{j})=0,g_{j}\in G_{ex}\), and there is also no exit gantry or provincial border exit gantry node to normal gantry node topology. Therefore, the following constraint condition can be designed:  
\[\mathbf{cE}=\big{\{}\mathbf{ce}_{ij}=\big{<}g_{i},g_{j}\big{>}\big{|}g_{i,type}\
otin[ 3,4]\lor g_{j,type}\
otin[0,1]\wedge\mathbf{ce}_{ij}\in\mathbf{cE}\big{\}} \tag{6}\]  
Figure 4: Schematic diagram of the abnormal topology. (**a**) loop topology; (**b**) missing topology; (**c**) opposite topology; (**d**) reverse topology. For the optimization method from normal gantry to normal gantry, please refer to part d.
3. Missing Topology Optimization  
To address the issue of missing data, Figure 4b shows that in the distance-weighted graph \(\mathbf{\hat{G}}_{\text{D}}\)=\(<G\), \(\epsilon\mathbf{E}\), \(D>\) of the expressway network, except for the candidate edge \(\mathbf{ce_{i}}=\langle g_{i},g_{j}\rangle\) itself, if there exists a path \(path=\langle g_{k},g_{k+1},\ldots,g_{n}\rangle,g_{k}=g_{i},g_{n}=g_{j}\), where \(g_{k}=g_{i}\) and \(g_{n}=g_{j}\) and the total accumulated distance of this path \(d_{path}=\sum_{k=1}^{n-1}d\left(\mathbf{ce_{k(k-1)}}\right)\) is equal to the total distance of the candidate edge \(d\left(\mathbf{ce_{ij}}\right)\), then the candidate edge \(\mathbf{ce_{ij}}\) is a redundant edge and can be directly deleted. However, there may be multiple paths available between two gantry nodes in the expressway network, which we refer to as ambiguous paths. If we want to find all ambiguous paths between each pair of gantry nodes, the time and space complexity of the path search method will grow exponentially with the increase of gantry nodes, which is clearly impractical. As defined in Definition 3, the candidate edge distance \(d\left(\mathbf{ce_{ij}}\right)\) is the shortest mileage between two gantry nodes obtained through the Gaode map path planning API. Therefore, we only need to obtain the shortest one from all the ambiguous paths in the constructed distance-weighted graph \(\mathbf{\hat{G}}_{\text{D}}\)=\(<G\), \(\epsilon\mathbf{E}\), \(D>\). Of course, this is a typical shortest-path problem.