Beyond Dijkstra: Evaluating Hyperbolic Embedding and 2-Hop Labeling for Shortest Path Routing on Large Road Networks
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 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 and edges grow.
To overcome this, modern routing systems rely on speedup heuristics. These speedups generally fall into two categories:
Geometric Embeddings: Mapping nodes to coordinates in continuous metric spaces where pathfinding reduces to local greedy distance minimization.
Algebraic / Topological Indexes: Precomputing distance metrics between pairs of nodes to answer point-to-point queries algebraically in or 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 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.

3. Methodology
Hyperbolic Geodesic Coordinate Routing (HGCR)
HGCR maps the graph to the Poincaré Ball model . The distance between coordinates is defined as:
We relax node coordinates by minimizing the edge distance error (stress) using the objective function:
Optimization is performed using Riemannian Stochastic Gradient Descent (RSGD):
where is the conformal factor rescaling the Euclidean gradient to respect the hyperbolic metric tensor.
Query routing starts at and greedily steps to the neighbor minimizing . To prevent local minima, we implement a backtracking stack of size .
Isometric Hub-Label Routing (IHLR)
IHLR utilizes Pruned Landmark Labeling (PLL) to construct efficiently:
Nodes are ordered by decreasing degree centrality to identify key topological transit hubs.
For each node in rank order, a Dijkstra search is launched.
If the distance to the currently visited node can already be correctly answered by the existing labels (i.e. ), the search branch is pruned.
Otherwise, the hub pair is appended to , and edge relaxation continues.
At query time, the next hop from the current node is chosen by evaluating:
Since 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: , (undirected road segments).
HGCR Config: space (), 500 epochs of RSGD precomputation, learning rate .
IHLR Config: Node-degree ordering, complete PLL precomputation.
Benchmark Results
| Metric | Dijkstra | HGCR | IHLR |
|---|---|---|---|
| Path Stretch (Optimality) | 1.000 | 6.015 | 1.000 |
| Avg Query Latency (s) | |||
| Search Space (Edge Checks) | 41,254 | 27,432 | 2,337 |
| Success Rate (%) | 100.0% | 100.0% | 100.0% |
| Precomputation Time (s) | 0.00s | 14.50s | 0.076s |
| Source Target | Dijkstra Time (s) | IHLR Time (s) | Dijkstra Ops | IHLR Ops | Stretch | Ops Reduction (%) | Status |
|---|---|---|---|---|---|---|---|
| 468.4 | 178.5 | 2,059 | 107 | 1.000 | 94.8% | SUCCESS | |
| 303.3 | 169.6 | 1,317 | 78 | 1.000 | 94.1% | SUCCESS | |
| 540.9 | 275.1 | 2,258 | 120 | 1.000 | 94.7% | SUCCESS | |
| 583.1 | 230.9 | 2,343 | 113 | 1.000 | 95.2% | SUCCESS | |
| 59.9 | 68.4 | 268 | 38 | 1.000 | 85.8% | SUCCESS | |
| 365.4 | 145.7 | 1,692 | 78 | 1.000 | 95.4% | SUCCESS | |
| 412.1 | 101.7 | 1,916 | 102 | 1.000 | 94.7% | SUCCESS | |
| 350.9 | 90.2 | 1,738 | 78 | 1.000 | 95.5% | SUCCESS | |
| 334.2 | 156.6 | 1,554 | 74 | 1.000 | 95.2% | SUCCESS | |
| 158.5 | 72.2 | 721 | 38 | 1.000 | 94.7% | SUCCESS | |
| 78.9 | 52.9 | 366 | 36 | 1.000 | 90.2% | SUCCESS | |
| 2.4 | 7.5 | 6 | 3 | 1.000 | 50.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:
The Distortion Problem of HGCR: While HGCR achieves outstanding query latency wins ( vs in earlier benchmarks), it suffers from a high average path stretch (). This is due to metric distortion from mapping cyclical road networks onto a low-dimensional space, forcing packets onto sub-optimal, roundabout paths.
The Domination of IHLR: IHLR completely outperforms Dijkstra and HGCR in quality. It achieves a 1.000 stretch factor (perfect shortest paths), runs 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 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
- Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269-271.
- Gavoille, C., Peleg, D., Pérennes, S., & Raz, R. (2004). Distance labeling in graphs. Journal of Algorithms, 53(1), 85-112.
- 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.
- Kleinberg, R. (2007). Geographic routing using hyperbolic space. IEEE INFOCOM 2007-26th IEEE International Conference on Computer Communications, 1902-1909.
- Bourgain, J. (1985). On Lipschitz embedding of finite metric spaces in Hilbert space. Israel Journal of Mathematics, 52(1-2), 46-52.
- 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.0This 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.
