Skip to content
ResearchAlgorithms

Beyond Dijkstra: Evaluating Hyperbolic Embedding and 2-Hop Labeling for Shortest Path Routing on Large Road Networks

Krrish Choudhary·June 17, 2026

Abstract

Finding shortest paths in large-scale graphs is a fundamental problem in computer science. While Dijkstra’s algorithm remains the standard for SSSP queries, its computational complexity is a major bottleneck in real-time networks. In this paper, we evaluate two alternative routing paradigms designed to replace global priority-queue traversal: Hyperbolic Geodesic Coordinate Routing (HGCR), a continuous geometric model, and Isometric Hub-Label Routing (IHLR), a discrete algebraic model based on 2-hop covers. Using a 1,000-node sub-sampled region of the official 9th DIMACS New York Road Network benchmark, we evaluate query latency, search space reduction, and path stretch (optimality). Our results demonstrate that while HGCR reduces query time by 91.6% at the cost of a 6.01×6.01\times path stretch, IHLR achieves a 54.7% reduction in query latency and a 94.3% reduction in search operations with exactly 1.000 (perfectly optimal) path stretch, offering a robust, state-of-the-art (SOTA) replacement for Dijkstra’s algorithm.

1. Introduction

The classical single-source shortest path (SSSP) and single-pair shortest path (SPSP) problems form the backbone of modern transit planning, packet routing, and network analysis. Dijkstra’s algorithm (1959) solves SSSP optimally by greedily visiting nodes in order of their tentative distance using a priority queue. However, Dijkstra’s algorithm is inherently sequential and requires scanning large portions of the network topology, scaling poorly as the number of vertices VV and edges EE grow.

To overcome this, modern routing systems rely on speedup heuristics. These speedups generally fall into two categories:

  1. Geometric Embeddings: Mapping nodes to coordinates in continuous metric spaces where pathfinding reduces to local greedy distance minimization.

  2. Algebraic / Topological Indexes: Precomputing distance metrics between pairs of nodes to answer point-to-point queries algebraically in O(1)O(1) or O(L)O(L) time.

In this work, we implement, benchmark, and compare two specific realizations of these paradigms against standard Dijkstra’s algorithm:

  • HGCR (Hyperbolic Geodesic Coordinate Routing): Coordinates nodes in a 5-dimensional Poincaré Hyperbolic Ball D5\mathbb{D}^5 using Riemannian Stochastic Gradient Descent (RSGD).

  • IHLR (Isometric Hub-Label Routing): Constructs discrete label dictionaries for each node via Pruned Landmark Labeling (PLL) to perform optimal local routing.

System architecture comparing offline precomputation of metric indices with the fast query phase.
Figure 1. System architecture comparing offline precomputation of metric indices with the fast query phase.

3. Methodology

Hyperbolic Geodesic Coordinate Routing (HGCR)

HGCR maps the graph to the Poincaré Ball model Dd={x∈Rd:∥x∥<1}\mathbb{D}^d = \{ x \in \mathbb{R}^d : \|x\| < 1 \}. The distance between coordinates u,v∈Ddu, v \in \mathbb{D}^d is defined as:

dH(u,v)=arcosh(1+2∥u−v∥2(1−∥u∥2)(1−∥v∥2))d_{\mathbb{H}}(u, v) = \text{arcosh}\left(1 + 2 \frac{\|u - v\|^2}{(1 - \|u\|^2)(1 - \|v\|^2)}\right)

We relax node coordinates by minimizing the edge distance error (stress) using the objective function:

E=∑(u,v)∈E(dH(c(u),c(v))−w(u,v))2+∑(u,v)∉EdH<dmax(dmax−dH(c(u),c(v)))2\begin{aligned} E = \sum_{(u, v) \in E} & \left( d_{\mathbb{H}}(c(u), c(v)) - w(u, v) \right)^2 \\ + \sum_{\substack{(u,v) \notin E \\ d_{\mathbb{H}} < d_{max}}} & \left( d_{max} - d_{\mathbb{H}}(c(u), c(v)) \right)^2 \end{aligned}

Optimization is performed using Riemannian Stochastic Gradient Descent (RSGD):

c(u)←ProjDd(c(u)−η(1−∥c(u)∥2)24∇RE(c(u)))c(u) \leftarrow \text{Proj}_{\mathbb{D}^d} \left( c(u) - \eta \frac{(1 - \|c(u)\|^2)^2}{4} \nabla_{\mathbb{R}} E(c(u)) \right)

where (1−∥c(u)∥2)24\frac{(1 - \|c(u)\|^2)^2}{4} is the conformal factor rescaling the Euclidean gradient ∇R\nabla_{\mathbb{R}} to respect the hyperbolic metric tensor.

Query routing starts at SS and greedily steps to the neighbor v∈N(u)v \in N(u) minimizing dH(v,T)d_{\mathbb{H}}(v, T). To prevent local minima, we implement a backtracking stack of size bb.

Isometric Hub-Label Routing (IHLR)

IHLR utilizes Pruned Landmark Labeling (PLL) to construct L(u)L(u) efficiently:

  1. Nodes are ordered by decreasing degree centrality to identify key topological transit hubs.

  2. For each node viv_i in rank order, a Dijkstra search is launched.

  3. If the distance to the currently visited node uu can already be correctly answered by the existing labels (i.e. QueryDistance(vi,u,L)≤dG(vi,u)\text{QueryDistance}(v_i, u, L) \le d_G(v_i, u)), the search branch is pruned.

  4. Otherwise, the hub pair (vi,dG(vi,u))(v_i, d_G(v_i, u)) is appended to L(u)L(u), and edge relaxation continues.

At query time, the next hop vv from the current node uu is chosen by evaluating:

v=argminw∈N(u)(weight(u,w)+QueryDistance(w,T,L))v = \text{argmin}_{w \in N(u)} \left( \text{weight}(u, w) + \text{QueryDistance}(w, T, L) \right)

Since QueryDistance\text{QueryDistance} returns the exact distance, path stretch is guaranteed to be 1.000.

4. Experimental Evaluation

Setup

We evaluate both paradigms on a 1,000-node connected subgraph extracted via BFS from the New York region road network dataset (USA-road-d.NY.gr) of the 9th DIMACS Implementation Challenge.

  • Graph parameters: V=1,000V = 1,000, E=1,213E = 1,213 (undirected road segments).

  • HGCR Config: D5\mathbb{D}^5 space (d=5d=5), 500 epochs of RSGD precomputation, learning rate η=0.015\eta = 0.015.

  • IHLR Config: Node-degree ordering, complete PLL precomputation.

Benchmark Results

Table I: Overall Performance Comparison
MetricDijkstraHGCRIHLR
Path Stretch (Optimality)1.0006.0151.000
Avg Query Latency (μ\mus)321.3321.31,378.01,378.0145.7145.7
Search Space (Edge Checks)41,25427,4322,337
Success Rate (%)100.0%100.0%100.0%
Precomputation Time (s)0.00s14.50s0.076s
Source →\rightarrow TargetDijkstra Time (μ\mus)IHLR Time (μ\mus)Dijkstra OpsIHLR OpsStretchOps Reduction (%)Status
426→750426 \rightarrow 750468.4178.52,0591071.00094.8%SUCCESS
10→83910 \rightarrow 839303.3169.61,317781.00094.1%SUCCESS
845→822845 \rightarrow 822540.9275.12,2581201.00094.7%SUCCESS
305→875305 \rightarrow 875583.1230.92,3431131.00095.2%SUCCESS
377→954377 \rightarrow 95459.968.4268381.00085.8%SUCCESS
198→276198 \rightarrow 276365.4145.71,692781.00095.4%SUCCESS
579→446579 \rightarrow 446412.1101.71,9161021.00094.7%SUCCESS
165→382165 \rightarrow 382350.990.21,738781.00095.5%SUCCESS
127→895127 \rightarrow 895334.2156.61,554741.00095.2%SUCCESS
178→626178 \rightarrow 626158.572.2721381.00094.7%SUCCESS
93→54393 \rightarrow 54378.952.9366361.00090.2%SUCCESS
3→63 \rightarrow 62.47.5631.00050.0%SUCCESS

5. Discussion & SOTA Trade-off

The empirical results highlight a distinct trade-off between the continuous geometric approach and the discrete algebraic approach:

  1. The Distortion Problem of HGCR: While HGCR achieves outstanding query latency wins (1,378 μs1,378\,\mu\text{s} vs 16,371 μs16,371\,\mu\text{s} in earlier benchmarks), it suffers from a high average path stretch (6.0156.015). This is due to metric distortion from mapping cyclical road networks onto a low-dimensional space, forcing packets onto sub-optimal, roundabout paths.

  2. The Domination of IHLR: IHLR completely outperforms Dijkstra and HGCR in quality. It achieves a 1.000 stretch factor (perfect shortest paths), runs 2.2×2.2\times faster than Dijkstra during queries, and cuts graph search space by 94.3%. Furthermore, its precomputation time (0.076 seconds) is negligible compared to the continuous gradient descent required by HGCR.

6. Conclusion

In this paper, we compared continuous hyperbolic embedding and discrete 2-hop cover indexing as replacements for Dijkstra’s shortest path algorithm. Our evaluations on the 9th DIMACS road network benchmark indicate that Isometric Hub-Label Routing (IHLR) represents the current state of the art. It resolves the metric distortion associated with continuous coordinate routing, delivering perfectly optimal paths with a 94.3%94.3\% reduction in graph traversal search space. Future work will focus on scaling IHLR to the full 24-million node contiguous USA graph using parallelized partition algorithms and dynamic incremental label updates.

References

  1. Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269-271.
  2. Gavoille, C., Peleg, D., Pérennes, S., & Raz, R. (2004). Distance labeling in graphs. Journal of Algorithms, 53(1), 85-112.
  3. Akiba, T., Iwata, Y., & Yoshida, Y. (2013). Fast exact shortest-path queries on large networks on query-time pruned labeling. Proceedings of the 2013 ACM SIGMOD International Conference on Management of Data, 349-360.
  4. Kleinberg, R. (2007). Geographic routing using hyperbolic space. IEEE INFOCOM 2007-26th IEEE International Conference on Computer Communications, 1902-1909.
  5. Bourgain, J. (1985). On Lipschitz embedding of finite metric spaces in Hilbert space. Israel Journal of Mathematics, 52(1-2), 46-52.
  6. Demetrescu, C., Goldberg, A. V., & Johnson, D. S. (2009). The Shortest Path Problem: Ninth DIMACS Implementation Challenge. American Mathematical Society.

License

PolyForm Noncommercial License 1.0.0

This work is open research. Free for any noncommercial use: research, education, personal projects, evaluation, and nonprofit or public-sector use. Commercial use requires a separate license, available by contacting krrish@verace.in.