Large-Scale Distance Matrix Calculation Method Based on Contraction Hierarchies
Weijun Wang, Haixia Pan, Yefan Cao · 2022
With the rapid development and popularization of mobile positioning devices such as mobile phones, location-based services play an increasingly important role in people’s production and life, which makes high-performance large-scale distance matrix calculation a key part of the optimization of many business scenarios. The distance matrix is used to calculate the shortest road distance of a group of starting and ending points in batches. Based on the Contraction Hierarchies algorithm, this paper proposes a method to quickly calculate the distance matrix between source nodes s and target nodes t, where the source nodes s $\in$ S and target nodes t $\in$ T. Under the scale of the road network in mainland China, take $|\mathrm{S}|=|\mathbf{T}|=10000$, the average solution time of the algorithm is only 7.2 minutes, which can meet the needs of various application scenarios.