An Empirical Survey and Benchmark of Learned Distance Indexes for Road Networks Gautam Choudhary, Libin Zhou, Yeasir Rayhan, Walid G. Aref Abstract . The calculation of shortest-path distances in road networks is a core operation in navigation systems, location-based services, and spatial analytics. Although classical algorithms, e.g., Dijkstra’s algorithm, provide exact answers, their latency is prohibitive for modern real-time, large-scale deployments. Over the past two decades, numerous distance indexes have been proposed to speed up query processing for shortest distance queries. More recently, with the advancement in machine learning (ML), researchers have designed and proposed ML-based distance indexes to answer approximate shortest path and distance queries efficiently. However, a comprehensive and systematic evaluation of these ML-based approaches is lacking. This paper presents the first empirical survey of ML-based distance indexes on road networks, evaluating them along four key dimensions: Training time, query latency, storage, and accuracy. Using seven real-world road networks and workload-driven query datasets derived from trajectory data, we benchmark ten representative ML techniques and compare them against strong classical non-ML baselines, highlighting key insights and practical trade-offs. We release a unified open-source codebase to support reproducibility and future research on learned distance indexes. 1. Introduction Road networks are ubiquitous. The calculation of the shortest-path distance is a fundamental operation underlying a wide range of road-network applications, including navigation (e.g., Google Maps), route planning (e.g., ( 14 ; 65 ; 66 ; 74 ) ), traffic monitoring (e.g., ( 33 ) ), and location-based recommendation (e.g., ( 24 ; 73 ) ). Road networks are typically modeled as weighted graphs. Dijkstra’s algorithm computes exact distances with no preprocessing but is too slow for large-scale systems that operate over large graphs and serve millions of queries in real-time. Alternatively, precomputing all-pairs distances enables constant-time queries but is infeasible due to its O(n^{3}) preprocessing time and O(n^{2}) storage cost. Classical Distance Indexes. To navigate this space–time tradeoff, a large body of work has proposed preprocessing-based techniques that accelerate distance queries by storing auxiliary data in both general graphs and road networks. Although the literature uses various terms (e.g., distance oracles, path oracles, and indexes), we use the term distance index to refer to any such technique. Over the past two decades, research has produced a wide range of classical distance indexes that construct compact data structures to exploit structural properties of road networks, including graph hierarchies ( 54 ; 17 ; 13 ; 69 ) , separators ( 55 ; 56 ; 57 ) , landmarks ( 6 ; 21 ; 50 ) , and hub labeling ( 4 ; 3 ; 42 ; 15 ) . These methods achieve microsecond-level query latency ( 4 ; 3 ; 42 ; 15 ) by trading increased preprocessing time and storage for faster queries. Their performance may depend on the distance between the queried vertices ( 54 ; 17 ; 69 ; 55 ) . Learned Distance Indexes. More recently, researchers have explored learned distance indexes that use ML to approximate shortest-path distances rather than relying on explicit structural decompositions. These approaches span neural networks ( 29 ; 52 ; 51 ; 49 ; 9 ) , graph neural networks ( 37 ) , representation learning methods ( 34 ; 43 ; 77 ) , and tree-based models ( 27 ) . By accepting approximate answers, learned indexes trade exactness for reduced storage and simpler index structures, and leverage modern hardware accelerators, e.g., GPUs for training/inference. In optimized settings, these models can achieve low query latency—down to tens of nanoseconds ( 77 ) , significantly faster than classical distance indexes (at the cost of approximation error and training overhead). Research Gap. Despite growing interest, the space of learned distance indexes has received little attention, and specifically, in the context of road networks. No prior work has systematically evaluated ML-based distance indexes in the road-network setting. Existing surveys focus on shortest-path algorithms ( 60 ; 36 ) or classical distance indexes ( 45 ; 70 ; 35 ; 76 ) . Recent evaluations on general unweighted graphs ( 38 ) provide a thorough comparison of node embedding approaches for distance estimation, but their scope does not extend to the learned distance indexes considered in this paper. This gap is important because road networks differ fundamentally from social or information networks. They are sparse, nearly planar, and exhibit low and near-uniform degree distributions but much larger diameters ( 72 ; 59 ) . These structural properties can be leveraged to accelerate distance computation, e.g., California road network has 1.9M vertices with an Average Degree 1.4 and Diameter 849, whereas the Pokec social network of comparable size has an Average Degree of 18.8 and Diameter 11. Objectives. Learned distance indexes introduce their own challenges and tradeoffs. A learned index must balance accuracy, query latency, storage footprint, training cost, scalability to large road networks, and robustness to updates. This paper systematically evaluates existing learned distance indexes along these dimensions and compares them against classical baselines to analyze their tradeoffs, relative strengths, and weaknesses. The contributions of this paper are as follows: • Empirical Survey of Learned Distance Indexes. We present the first systematic survey and experimental study of learned distance indexes for shortest-path distance estimation on road networks. Our study covers 10 ML methods spanning NNs, GNNs, and gradient-boosted trees, and contrasts them with four non-ML baselines: three classical approximate indexes and one state-of-the-art exact index, evaluated across 7 real-world road networks. • Encoder–Decoder Abstraction. We introduce a unified encoder-decoder abstraction that structures the design space of learned distance indexes and provides a common conceptual framework for understanding existing and future methods. • Workload-driven Benchmark and Key Insights. We introduce a workload-driven benchmark derived from real query workloads, rather than synthetic queries used in prior studies, to reflect practical use in real-world settings. The benchmark evaluates all methods along key dimensions—approximation error, preprocessing time, query latency, and storage overhead—and reveals tradeoffs that guide the design and comparison of learned and non-ML distance indexes. • Open-source. We provide open-source code that provides a unified evaluation framework for benchmarking learned distance indexes, addressing the sparsity of existing implementations and enabling reproducibility and integration of new techniques. The rest of this paper proceeds as follows. Section 2 formalizes the problem and introduces relevant background on ML and neural networks. Section 3 surveys existing ML–based distance indexes. Section 4 presents the experimental evaluation and analysis. Section 5 reviews related work, and Section 6 concludes the paper. 2. Preliminaries Problem Definition. We model a road network as an undirected, weighted graph G=(\mathcal{V},\mathcal{E},w) , where \mathcal{V} is the set of n vertices (or nodes), representing road intersections, and \mathcal{E} is the set of m edges, representing road segments. Each edge (u,v)\in\mathcal{E} has a positive weight w(u,v)\in\mathbb{R}_{+} denoting the road distance between u and v . Each vertex v\in\mathcal{V} is also associated with geographic coordinates (latitude and longitude). A path P(s,t) from Vertex s to t is an ordered sequence \langle v_{0},v_{1},\dots,v_{x}\rangle such that (v_{i},v_{i+1})\in\mathcal{E} , v_{0}=s , and v_{x}=t . The length (or cost) of a path is |P(s,t)|=\sum_{i=0}^{x-1}w(v_{i},v_{i+1}). The shortest path SP(s,t) is the path minimizing this total cost, and the corresponding shortest distance query returns only its length d(s,t)=|SP(s,t)| . Approximate shortest distance returns an estimate \hat{d}(s,t) that may deviate slightly from the true distance d(s,t) . An ML distance index trains a model on vertex-pair samples \mathcal{D}=\{(u_{i},v_{i},d_{u_{i}v_{i}})\}_{i=1}^{N} and learns low-dimensional embeddings for vertices. The model approximates the true distance function, \hat{d}(u,v)\approx d(u,v) , thereby compressing the full O(n^{2}) distance matrix into O(nd) space, where d is the embedding dimension. At query time, the trained model estimates \hat{d}(u,v) directly from the vertex embeddings and model parameters. This paper focuses on distance queries —rather than path reconstruction—and evaluates ML-based distance indexes across several dimensions. The symbols used in the paper are given in Table 1 . Table 1. List of symbols. Nodes u and v are example vertices. Symbol Description G=(\mathcal{V},\mathcal{E},w) Weighted undirected graph \boldsymbol{A} Adjacency matrix of G \mathcal{V} Set of vertices (road intersections) \mathcal{E} Set of edges (road segments) w(u,v) Edge weight (segment distance) n=|\mathcal{V}| Number of nodes m=|\mathcal{E}| Number of edges d(u,v) or d_{uv} True shortest distance between u,v \hat{d}(u,v) or \hat{d}_{uv} Predicted (approximate) distance \mathcal{D}=\{(u_{i},v_{i},d_{i})\}_{i=1}^{N} Training/query dataset \mathcal{L} Loss function used during training N=|\mathcal{D}| Number of samples (node pairs) l Number of landmarks d Embedding dimension \phi Encoder function \psi Decoder function \boldsymbol{X} Input feature matrix \boldsymbol{H} Learned node embedding matrix \phi(u)=\boldsymbol{\mathrm{h}}_{u} Embedding vector of node u Neural Networks (NN). An NN is a parameterized, differentiable function composed of multiple layers of linear transformations followed by non-linear activations. In theory, NNs are universal function approximators , i.e., given sufficient capacity and appropriate loss functions, they can approximate any continuous function to any desired accuracy. For a single hidden layer, the transformation can be written as: (1) \boldsymbol{H}_{i}=f_{\text{NN}}(\boldsymbol{H}_{i-1};\boldsymbol{W}_{i},\boldsymbol{X})=\sigma(\boldsymbol{H}_{i-1}\boldsymbol{W}_{i}), where \boldsymbol{H}_{i-1} and \boldsymbol{H}_{i} are the input and output activations, \boldsymbol{W}_{i} are the learnable parameters, and \sigma(\cdot) is a non-linear activation function, e.g., ReLU or tanh. The input layer is \boldsymbol{H}_{0}=\boldsymbol{X} , where \boldsymbol{X} is the input feature matrix, either learned during training or initialized from pretrained embeddings. The NN is trained as a regression model to approximate the shortest distance between node pairs, i.e., f_{\text{NN}}(u,v)\approx d(u,v) where the embeddings of u and v are fused (e.g., concatenated) to form a single input vector to the network. Graph Neural Networks (GNN). GNNs extend traditional NNs to graph-structured data by incorporating the topological dependencies and connectivity between vertices. A GNN layer updates node representations through message passing expressed as: (2) \boldsymbol{H}_{i}=f_{\text{GNN}}(\boldsymbol{H}_{i-1};\boldsymbol{A},\boldsymbol{W}_{i},\boldsymbol{X})=\sigma(\boldsymbol{A}\boldsymbol{H}_{i-1}\boldsymbol{W}_{i}), where \boldsymbol{A} is the (possibly normalized) adjacency matrix encoding graph connectivity, \boldsymbol{H}_{i} represents node features at Layer i , \boldsymbol{W}_{i} is the layer-specific weight matrix, and \sigma(\cdot) is a non-linear activation. The input features are initialized as \boldsymbol{H}_{0}=\boldsymbol{X} , either learned or pretrained. By repeated propagation, GNNs aggregate information from multi-hop neighborhoods, enabling them to learn representations that capture both spatial proximity and structural patterns in the road network that are key factors for estimating pairwise distances. 3. Methods 3.1. Model Architectures Learned distance indexes can be viewed under a unified encoder-decoder framework. Given a node pair, the encoder maps each node to a vector, and the decoder maps the pair of vectors to a scalar distance estimate. Figure 1 illustrates this abstraction. Figure 1. Encoder-decoder for shortest-distance estimation. The encoder is a function \phi:\mathcal{V}\rightarrow\mathbb{R}^{d} that maps each node v\in\mathcal{V} to a d -dimensional embedding vector \boldsymbol{\mathrm{h}}_{v}=\phi(v) . This mapping can be realized in multiple ways, ranging from simple lookup tables to GNNs that capture structural and spatial dependencies within the graph. Lookup tables may store either fixed representations, e.g., coordinates or landmark distances, or trainable embeddings. The resulting embeddings for all nodes form an n\times d matrix. The decoder is a function \psi:\mathbb{R}^{d}\times\mathbb{R}^{d}\rightarrow\mathbb{R}_{\geq 0} that takes a pair of node embeddings \boldsymbol{\mathrm{h}}_{u} and \boldsymbol{\mathrm{h}}_{v} and produces a scalar estimate \hat{d}_{uv}=\psi(\boldsymbol{\mathrm{h}}_{u},\boldsymbol{\mathrm{h}}_{v}) of the shortest-path distance between the corresponding nodes. Decoding involves two steps: a fusion operator combines the embeddings into a joint representation (e.g., concatenation), and a scoring function maps this representation to a distance value. The scoring function can be a fixed form, e.g., an \ell_{1} or \ell_{2} norm, or a parameterized model, e.g., a small NN. Table 2 gives a summary of commonly used fusion operators in prior work. Next, we present existing models using this encoder–decoder abstraction. Each method is evaluated along three key dimensions: (a) scalability to large graphs, (b) adaptability to evolving road networks, and (c) computational trade-offs in time and space. Across all approaches, the majority of parameters reside in the encoder’s embedding table that scales with both the number of nodes and the embedding dimension, whereas the decoder remains comparatively lightweight. These trade-offs are empirically analyzed in Section 4 . Table 2. Fusion operators for combining node embeddings. Operator Description Equation Concat Concatenation of embeddings \boldsymbol{\mathrm{h}}_{u}\oplus\boldsymbol{\mathrm{h}}_{v} Average Element-wise average (\boldsymbol{\mathrm{h}}_{u}+\boldsymbol{\mathrm{h}}_{v})/2 Sum Element-wise sum \boldsymbol{\mathrm{h}}_{u}+\boldsymbol{\mathrm{h}}_{v} Subtract Element-wise difference \boldsymbol{\mathrm{h}}_{u}-\boldsymbol{\mathrm{h}}_{v} Hadamard Element-wise product \boldsymbol{\mathrm{h}}_{u}\odot\boldsymbol{\mathrm{h}}_{v} M1. Landmarks (Non-ML) ( 62 ; 48 ) . Although non-ML in nature, the landmark-based approach fits naturally into the encoder–decoder abstraction and serves as a useful reference point for subsequent learned indexes. The key idea is to precompute distances from every node to a small subset of nodes, termed landmarks , and use these as a compact surrogate for the full distance matrix. Selecting the optimal landmarks is NP-hard ( 48 ) , so heuristics based on node centrality (e.g., degree, closeness, betweenness, etc.) are used. The encoder corresponds to a fixed n\times d embedding matrix \boldsymbol{H} , where each entry H_{ij} stores the shortest distance between Node i and Landmark j , and d is the number of selected landmarks. The decoder estimates the distance between two nodes by minimizing over landmark indices: \hat{d}_{uv}=\psi(\boldsymbol{\mathrm{h}}_{u},\boldsymbol{\mathrm{h}}_{v})=\min_{i}\big(\phi(u)_{i}+\phi(v)_{i}\big) . This formulation follows from the triangle inequality that bounds the true distance d_{uv} as |d_{ui}-d_{iv}|\leq d_{uv}\leq d_{ui}+d_{iv},\quad\forall i\in\mathcal{V}. Several variants use alternative estimators within this range (e.g., lower bound, mean, or geometric mean), but the upper bound is most commonly adopted due to its empirical accuracy. While originally proposed for large social networks, this approach will be evaluated for road networks. As no learning is involved, the method only requires index construction to compute shortest paths from each landmark to all nodes, typically via BFS or Dijkstra traversals. Handling large networks and updates. The method scales well to large graphs, since distances from each landmark can be computed independently and in parallel. However, it lacks an update mechanism, so network changes (e.g., added or modified edges) require recomputation of these distances. Time and Space Complexity. The method requires \mathcal{O}(nd) space to store landmark embeddings and \mathcal{O}(d) time per query, as all landmarks are scanned during decoding. M2. GeoDNN ( 29 ) . As the earliest NN–based approach for distance estimation, GeoDNN adopts a unified NN architecture, originally proposed as ST-NN, for jointly estimating travel time and distance in taxi-trip data. For this study, we focus on its distance sub-module DistNN that predicts the travel distance between a source and destination. The fixed geo-coordinates serve as node features for the encoder, defined as \phi(u)=\boldsymbol{\mathrm{h}}_{u}=[\text{long}_{u},\text{lat}_{u}] . For a given node pair (u,v) , the corresponding embeddings are concatenated using the Concat fusion operator and are passed to a four-layer feed-forward NN that acts as the decoder. As the model operates directly on geographic coordinates, it is referred to as GeoDNN. Formally, \hat{d}(u,v)=f_{\text{NN}}(\boldsymbol{\mathrm{h}}_{u}\oplus\boldsymbol{\mathrm{h}}_{v}), where \boldsymbol{\mathrm{h}}_{u} and \boldsymbol{\mathrm{h}}_{v} represent the fixed coordinate embeddings of Nodes u and v , respectively. The model is trained using the mean squared error loss (MSE). The authors evaluate GeoDNN on the NYC Taxi dataset, a workload-driven dataset containing pickup and dropoff coordinates, timestamps, trip distances, and durations. Handling Large Networks and Updates. The model remains scalable as long as the underlying query workload is tractable, since no explicit mechanism is proposed for handling large-scale graphs or network updates. Consequently, when the network structure changes, the model must be retrained from scratch. Time and Space Complexity. The model requires \mathcal{O}(2n) space to store the (\text{lat},\text{long}) coordinates of all nodes and \mathcal{O}(1) space for the network parameters, with the latter being independent of the number of nodes. Each query is answered in \mathcal{O}(1) time, as the model directly computes distances from coordinate inputs without performing any graph traversal. M3. DistanceNN ( 52 ) . This method is among the first to leverage pre-trained graph embeddings for supervised distance prediction. Node embeddings are first learned in an unsupervised manner using a graph embedding method, e.g., Node2Vec ( 22 ) or Poincaré embeddings ( 41 ) , and are frozen to serve as the encoder \phi(u)=\boldsymbol{\mathrm{h}}_{u} . The decoder is a three-layer feed-forward NN trained to predict the shortest-path distance for a node pair, after first combining the two embeddings with a fusion operator; common choices are listed in Table 2 . The design is functionally similar to GeoDNN in architecture and objective, differing primarily in the source of its input features—graph embeddings instead of spatial coordinates. The authors find that Node2Vec embeddings combined with the Average fusion operator yield most accurate results. Experiments are conducted on social network graphs rather than road networks, where the maximum shortest-path length spans only a few hops. Handling Large Networks and Updates. The authors propose a landmark-based strategy for generating training pairs that keeps the dataset size linear rather than quadratic in the number of nodes. However, no mechanism is proposed for dynamic updates, so the model must be retrained from scratch when the network changes. Time and Space Complexity. For an embedding dimension d , the model requires \mathcal{O}(nd) space to store pre-trained node embeddings and negligible \mathcal{O}(d) space for decoder parameters. Each query incurs \mathcal{O}(d) computation for forward propagation that is effectively constant for fixed embedding dimension and network architecture. M4. EmbedNN ( 51 ) . As in DistanceNN, node embeddings are learned in an unsupervised manner from graph structure using Node2Vec ( 22 ) or LINE ( 63 ) , and is frozen to serve as the encoder \phi(u)=\boldsymbol{\mathrm{h}}_{u} . The decoder is a lightweight 2-layer feed-forward NN that predicts the shortest-path distance between nodes, after fusing their embeddings using one of several operators listed in Table 2 . Unlike GeoDNN, DistanceNN and EmbedNN are evaluated on graphs, e.g., social networks, where the maximum shortest-path length rarely exceeds five to six hops. In this setting, EmbedNN investigates regression and classification formulations of distance prediction and reports that Node2Vec embeddings combined with the Hadamard fusion operator yield better overall performance. Handling Large Networks and Updates. Although no explicit strategy is proposed for scaling to large networks, the model can in principle handle them as long as the underlying embedding algorithm can be executed. The authors introduce a heuristic for handling incremental updates. For each modified edge (s,t)\in\mathcal{E}^{\prime} , the predicted distance \hat{d}_{uv} for a query pair (u,v) is compared against an alternative route passing through (s,t) , computed as \hat{d}^{*}_{uv}=\hat{d}_{us}+d_{st}+\hat{d}_{tv} , and the smaller of the two is returned. While this heuristic effectively filters out irrelevant updates, where modified edges are spatially distant from the queried path, it incurs additional overhead proportional to the number of modified edges ( 2|\mathcal{E}^{\prime}| extra predictions for \hat{d}_{us} and \hat{d}_{tv} ). The same idea can be readily extended to other distance indexes. Time and Space Complexity. The model takes \mathcal{O}(nd) space to store pre-trained node embeddings and negligible extra space for the decoder weights. At inference, a query takes \mathcal{O}(d) computation for fusion and NN evaluation, effectively constant for fixed d . M5. Vdist2vec ( 49 ) . Vdist2vec is the first end-to-end trainable model for shortest-path distance prediction, where the encoder and decoder are unified and optimized jointly. Unlike previous methods that use fixed or pre-trained embeddings, this model learns node embeddings as part of training. Each node u is associated with a learnable embedding vector \boldsymbol{\mathrm{h}}_{u}=\phi(u)\in\mathbb{R}^{d} that is concatenated with that of another node to form the pair representation \boldsymbol{\mathrm{h}}_{u}\oplus\boldsymbol{\mathrm{h}}_{v} . This fused representation is passed to a three-layer feed-forward NN decoder that outputs the predicted distance: \hat{d}(u,v)=f_{\text{NN}}(\boldsymbol{\mathrm{h}}_{u}\oplus\boldsymbol{\mathrm{h}}_{v}). The model is trained end-to-end using mean squared error loss (MSE) with all encoder parameters (node embeddings) and decoder weights optimized jointly. To improve prediction robustness, two variants are proposed. Vdist2vec-L replaces the MSE loss with the Huber loss to make it robust to outliers, where the threshold parameter \delta is adaptively set to the top 1% largest prediction errors after each epoch. Vdist2vec-S adopts an ensemble-style architecture by replacing the decoder network with four parallel sub-networks that share the same input features, each specialized for a specific distance range (short, mid, or long). The outputs of these sub-networks are aggregated to produce final distance estimates. This multi-branch design improves prediction accuracy across varying distance scales. Handling Large Networks and Updates. To scale training to larger graphs, a clustering-based sampling strategy is proposed that reduces the quadratic all-pairs dataset to \mathcal{O}(nl) training samples. Nodes are partitioned into l\ll n clusters based on geographic proximity, and the model is trained to predict distances between each node and its cluster center. At query time, the predicted distance between arbitrary nodes (u,v) is approximated as: \hat{d}(u,v)=\lambda_{1}\hat{d}(u,c_{u})+d(c_{u},c_{v})+\lambda_{2}\hat{d}(v,c_{v}), where c_{u} and c_{v} are the nearest cluster centers of u and v , respectively, d(c_{u},c_{v}) is the precomputed inter-cluster distance between these centers, and \lambda_{1} , \lambda_{2} are learnable weighting factors. This strategy significantly reduces training cost while maintaining high prediction accuracy. Though presented within Vdist2vec, this clustering-based scaling generalizes to other learned distance indexes. No update mechanism is provided, so graph changes require retraining the model. Time and Space Complexity. Given an embedding dimension d , the model requires \mathcal{O}(nd) space for node embeddings and \mathcal{O}(d) for decoder parameters. A query incurs \mathcal{O}(d) computation for NN inference that remains constant for a fixed d and architecture. M6. Ndist2vec ( 9 ) . Ndist2vec extends Vdist2vec-S to improve training efficiency and scalability for large road networks. The model retains the same encoder–decoder structure as Vdist2vec-S, comprising learnable node embeddings and a multi-branch decoder, but differs in two key aspects; learning aggregation parameters and training strategy. Unlike Vdist2vec-S, where branch aggregation weights are fixed, Ndist2vec learns them jointly with the model, allowing data-driven calibration across distance ranges. For training, Ndist2vec introduces hybrid data generation that combines all-pairs and adaptive landmark-based sampling. The model is initially trained on all node pairs ( \mathcal{O}(n^{2}) samples) to capture global structure. In subsequent epochs, the training data is restricted to node–landmark pairs ( \mathcal{O}(nl) samples), where the landmark set is randomly refreshed in each epoch to ensure broader coverage while significantly reducing training cost. This adaptive strategy lowers the overall training burden with marginal loss in accuracy, as in their experiments, making it more practical for large-scale road networks. Empirically, Ndist2vec reduces training time by more than 75% while incurring marginal degradation in accuracy: across datasets, MRE increases by roughly 1–2 absolute percentage points compared to Vdist2vec. Handling Large Networks and Updates. The proposed adaptive landmark-based sampling strategy enables efficient training on large graphs. No explicit update strategy is provided; retraining is required when the network changes. Time and Space Complexity. The time and space complexity are identical to Vdist2vec, with \mathcal{O}(nd) space and \mathcal{O}(d) inference cost per query for an embedding dimension d . M7. Path2vec ( 34 ) . This method learns dense node embeddings that preserve user-defined graph similarity or distance measures sim:\mathcal{V}\times\mathcal{V}\rightarrow\mathbb{R} . Originally proposed for NLP tasks, e.g., word sense disambiguation and semantic similarity, it generalizes naturally to graph metrics, e.g., shortest-path distance. Path2vec differs from previous neural approaches by using a (fixed) functional decoder instead of a neural one, enabling substantially faster inference. The encoder consists of a learnable embedding matrix \boldsymbol{\mathrm{H}}\in\mathbb{R}^{n\times d} , where each node u is assigned an embedding \boldsymbol{\mathrm{h}}_{u}=\phi(u) . Embeddings are optimized using a modified loss function that combines distance reconstruction with a neighborhood-similarity regularizer: (3) \mathcal{L}=\sum_{(u,v)\in\mathcal{D}}\Big[(\hat{d}_{uv}-d_{uv})^{2}-\alpha(\boldsymbol{\mathrm{h}}_{u}^{\top}\boldsymbol{\mathrm{h}}_{i}+\boldsymbol{\mathrm{h}}_{v}^{\top}\boldsymbol{\mathrm{h}}_{j})\Big], where i and j are randomly sampled neighbors of u and v respectively, and \alpha controls the regularization strength. The first term minimizes reconstruction error, while the second encourages neighboring nodes to have similar embeddings, nudging the optimization appropriately. In the original formulation, the decoder computes similarity as a dot product, \boldsymbol{\mathrm{h}}_{u}^{\top}\boldsymbol{\mathrm{h}}_{v} . For distance estimation, we modify it to interpret similarity as the inverse of distance: \hat{d}_{uv}=\big(1-\boldsymbol{\mathrm{h}}_{u}^{\top}\boldsymbol{\mathrm{h}}_{v}\big)\cdot\frac{d_{\max}}{2} , where d_{\max} serves as a scaling factor corresponding to the graph’s maximum observed distance, yielding accurate empirical results. This design resembles skip-gram models ( 39 ) (capturing local structure) and GloVe ( 46 ) embeddings (capturing global relationships), offering a balance between locality and globality in graph representation learning. Handling Large Networks and Updates. To handle large graphs, Path2Vec suggests pruning training data by retaining only the top- k (typically 50–100) most similar node pairs for each node, keeping the dataset linear rather than quadratic in number of nodes. However, as the original work focuses on knowledge graphs and linguistic networks (e.g., WordNet, Freebase, DBpedia), incremental updates are not discussed. Hence, the model must be retrained upon update. Time and Space Complexity. For embedding dimension d , the model requires \mathcal{O}(nd) space and \mathcal{O}(d) inference time per query. By performing computations entirely in the vector space, Path2vec enables lightweight and highly parallelizable operations that are orders of magnitude faster than graph traversal methods. Also, its functional decoder is considerably faster than the NN–based decoders, highlighting the efficiency of functional decoders for scalable distance estimation. M8. ANEDA ( 43 ) . ANEDA extends Path2vec with a simpler learning objective and systematic evaluation of functional distance measures. The encoder has a learnable embedding matrix \mathbf{H}\in\mathbb{R}^{n\times d} , where each node u is assigned an embedding \boldsymbol{\mathrm{h}}_{u}=\phi(u) . The decoder is non-parametric, using analytical distance functions, e.g., \ell_{p} -norms, hyperbolic, elliptic, Minkowski, and inverse dot-product measures to compute pairwise distances between embeddings. Unlike Path2vec that randomly initializes embeddings and employs an additional neighborhood-similarity regularizer, ANEDA trains embeddings using MSE loss and explores various initialization strategies, e.g., Node2Vec ( 22 ) , GraRep ( 8 ) , and geographic coordinates. Empirical results indicate that Node2Vec initialization offers the most consistent gains, although random initialization remains competitive. Among all distance functions evaluated, the simplest inverse dot-product decoder achieves the best performance on road network datasets, followed by the \ell_{6} -norm. Although ANEDA achieves results comparable to Vdist2vec-S, its accuracy remains slightly lower due to the absence of a learnable decoder. Handling Large Networks and Updates. The authors generate distance queries between all node-pairs, which restricts experiments to small graphs due to quadratic complexity. Thus, the paper does not address large-scale training or incremental updates, requiring retraining from scratch when the network changes. Time and Space Complexity. For embedding dimension d and a non-parametric functional decoder, the model requires \mathcal{O}(nd) space and \mathcal{O}(d) inference time per query. Like other functional decoders, it is lightweight and highly efficient at query time. M9. RNE ( 77 ) . Road Network Embedding (RNE) introduces a hierarchical embedding framework that partitions the road network into progressively smaller subgraphs, forming a multi-level hierarchy (e.g., city-, regional-, and local-level). Each level is trained sequentially using a simple MSE loss, starting from the topmost level downwards until each node becomes its own partition. The encoder comprises the embeddings learned at each level, while the decoder computes pairwise distances using the \ell_{1} -norm (Manhattan distance). Hierarchical training captures global and local structural characteristics of the road network, with partitions encoding connectivity across spatial scales–a critical aspect for accurate distance estimation. After training, embeddings from all hierarchical levels are aggregated (e.g., summed across parent partitions) to produce a single embedding per node for inference. RNE combines elegant training with simple querying, achieving strong effectiveness among learned distance estimators. Handling Large Networks and Updates. RNE uses three-stage sampling to generate informative node pairs, followed by active fine-tuning that makes retraining computationally efficient for large networks. However, it has no mechanism for incremental updates. Thus, model must be retrained from scratch when network changes. Time and Space Complexity. For embedding dimension d and a non-parametric \ell_{1} decoder, the model requires \mathcal{O}(nd) space and \mathcal{O}(d) inference time per query. M10. CatBoost ( 27 ) . CatBoost adopts a non-neural approach to distance prediction, employing gradient-boosted decision trees instead of fixed neural architectures. Unlike previous models whose structure remains static once defined, CatBoost incrementally constructs its model by sequentially adding trees during training. Each new tree is trained to reduce the residual errors of the previous ensemble. The encoder consists of fixed, hand-crafted features derived from node pairs, including landmark distance vectors, geographic coordinates (latitude and longitude), the Euclidean distance between coordinates, and the cosine similarity between landmark distance vectors. Landmark distances and coordinates act as global features, while similarity-based features capture local pairwise relationships. The decoder is implemented as a two-stage CatBoost regressor, where the output of the first stage serves as an additional feature for the second stage’s final prediction. Handling Large Networks and Updates. CatBoost adopts a landmark-based query generation strategy to handle large networks, but does not address incremental updates. Hence, the model must be retrained upon network updates. Time and Space Complexity. Given node coordinates and l landmark distances as input features, the model size is \mathcal{O}((l+2)n) , where the additional 2 is for latitude and longitude features. Other pairwise features (e.g., Euclidean distance, cosine similarity) are computed on the fly during inference. Query latency has two components: feature computation \mathcal{O}(l+2) and CatBoost inference cost \mathcal{O}(c) , where c is the number of trees evaluated per query. M11. RGCNdist2vec ( 37 ) . This is the most recent and the first method to incorporate GNNs into shortest-path distance estimation. It extends the encoder–decoder abstraction by replacing the conventional embedding lookup with a relational graph convolutional network (GCN) ( 32 ) that learns node embeddings directly from graph structure. The encoder follows the generic GNN formulation in Equation ( 2 ), propagating and aggregating information across neighboring nodes through multiple layers. After L layers of message passing, each node obtains an embedding \phi(u)=\boldsymbol{H}_{L}(u)\in\mathbb{R}^{d} . The embeddings of a node pair (u,v) are passed to a lightweight decoder to estimate distance using the \ell_{1} -norm: \hat{d}_{uv}=||\phi(u)-\phi(v)||_{1} . The model is trained end-to-end using the Smooth L1 loss that combines robustness of the \ell_{1} loss to outliers with the stability of the \ell_{2} loss for small residuals (errors). Handling Large Networks and Updates. The authors propose a three-stage sampling strategy to partition the graph to reduce training data redundancy and improve scalability on large networks. However, no explicit mechanism is provided for handling network updates, implying retraining when the graph structure changes. Time and Space Complexity. After training, the GNN weights and input features (e.g., node coordinates and adjacency list) can be stored instead of the full embedding matrix, reducing storage from \mathcal{O}(nd) to \mathcal{O}(n+d) –effectively \mathcal{O}(n) for small d in planar road networks. During inference, node embeddings are reconstructed on demand using the stored features and cached thereafter, amortizing their computation cost. As other functional decoders, the lightweight decoder design yields a query latency of \mathcal{O}(d) . 3.2. Query Dataset Preparation Having introduced the model architectures, next we describe how the supervision data, i.e., node pairs (u,v) and their corresponding ground-truth shortest-path distances d_{uv} , are prepared from road networks for training and evaluating the models. The ground-truth distances d_{uv} can be obtained using a state-of-the-art exact distance index, e.g., HCL ( 15 ) . The main design choice lies in how to select the node pairs (u,v) that constitute the training and testing query set. Two paradigms exist: workload-driven , where queries are derived from real-world trajectories or trip data, and synthetic , where they are systematically generated through sampling strategies. Each strategy carries distinct objectives, assumptions, and trade-offs, and the appropriate choice depends on the intended application, available resources, and scalability requirements. 3.2.1. Workload-driven Sampling This approach derives query pairs from real-world trajectories, e.g., taxi trips and GPS logs ( 1 ; 64 ; 18 ) . Each trajectory contributes one or more queries formed by mapping pickup and drop-off locations to their nearest road-network vertices. Unlike synthetic sampling, workload-driven datasets reflect the inherent bias of real systems, where certain intersections or routes are queried more frequently. This data emphasizes practically relevant node pairs and yields models that generalize better to realistic queries. Only a small subset of the full distance matrix is used, focusing learning on frequently traveled routes. While GeoDNN ( 29 ) adopts a similar idea, most prior studies rely on synthetic workloads; our evaluation is among the first systematic workload-driven comparisons of learned distance indexes. 3.2.2. Synthetic Sampling When real query workloads are unavailable, node pairs can be synthetically generated to approximate the underlying query distribution. Common strategies include: • All-pairs: It computes distances for every possible node pair, producing |\mathcal{V}|^{2} samples that form the full distance matrix. This exhaustive approach is the most intuitive and straightforward choice for small networks, as it assumes all nodes are equally important and provides complete coverage. However, its quadratic growth in dataset size imposes a substantial burden on training and storage, rendering it impractical for large-scale networks. • Landmark-based: It selects a small set of landmark nodes and computes distances between all nodes and each landmark. This reduces the dataset size to |\mathcal{V}|l , scales linearly with the number of landmarks l\ll n , and accelerates training on large graphs. It approximates the all-pairs distribution by capturing the network’s structural diversity. While selecting optimal landmarks is NP-Hard ( 48 ) , random or heuristic selection provides a simple yet effective alternative. This strategy simulates workloads with hotspots or frequently accessed regions, and is the most widely adopted sampling approach in prior work ( 49 ; 9 ) . • Heuristic-based: It designs custom sampling schemes ( 37 ; 77 ) using partitioning, clustering, or adaptive resampling of node pairs to balance coverage, by approximating all-pairs distribution, and efficiency, by selecting high-quality samples for training. A unique aspect of shortest distance estimation is that the entire graph is known a priori. This makes the dataset space fixed and fully enumerable , yet practically infeasible to exhaust due to the \mathcal{O}(n^{2}) possible pairs, making the learning task non-trivial. Synthetic datasets aim for representative coverage, whereas workload-driven datasets focus on relevance. Our study emphasizes the latter. Real query workloads reflect operational bias and evaluates learned distance indexes in practical settings. 3.3. Training and Optimization The optimization setup for learning shortest-path distance estimators includes the choice of loss functions and the overall training strategy, e.g., mini-batch learning in NN and GNNs. Loss Functions. Shortest-path distance estimation is formulated as a regression problem, where the goal is to minimize the discrepancy between predicted and true distances, \hat{d}_{i} and d_{i} , over N training samples. The objective is the Mean Squared Error (MSE), or \ell_{2} loss, \mathcal{L}_{\text{MSE}}=\frac{1}{N}\sum_{i=1}^{N}(\hat{d}_{i}-d_{i})^{2}, that penalizes larger deviations more strongly and works well when the training data is relatively clean. The Mean Absolute Error (MAE), or \ell_{1} loss, \mathcal{L}_{\text{MAE}}=\frac{1}{N}\sum_{i=1}^{N}|\hat{d}_{i}-d_{i}|, is less sensitive to outliers but provides weaker gradients near zero. To combine the stability of \ell_{2} with the robustness of \ell_{1} , several models (e.g., Vdist2vec-L) employ the Huber loss: \mathcal{L}_{\text{Huber}}(\hat{d}_{i},d_{i};\delta)=\begin{cases}\frac{1}{2}(\hat{d}_{i}-d_{i})^{2},&\text{if }|\hat{d}_{i}-d_{i}|\leq\delta,\\[4.0pt] \delta(|\hat{d}_{i}-d_{i}|-\tfrac{1}{2}\delta),&\text{otherwise,}\end{cases} where \delta is a tunable threshold that controls the transition between quadratic and linear regimes. The Smooth \ell_{1} variant ( 37 ) is a special case of the Huber loss with \delta{=}1 . Training. Neural models are optimized end-to-end using stochastic gradient-based optimizers, e.g., Adam ( 5 ) or SGD ( 31 ; 53 ) . We adopt mini-batch training instead of full-batch optimization to balance convergence speed and memory efficiency on CPU and GPU. Each mini-batch contains sampled node pairs (u,v) , and only the embeddings corresponding to these nodes are updated. This ensures scalability to large graphs by avoiding gradient computation over all node embeddings. For GNN models, training efficiency is improved by L -hop subgraph extraction. For each mini-batch of node pairs, we extract the induced subgraph formed by the union of their L -hop neighborhoods, where L is the number of GNN layers. Message passing is performed only on this subgraph that possesses complete neighborhood information required for the mini-batch, while reducing unnecessary computation. This procedure computes exact losses and gradients—it merely restricts message passing to relevant subgraphs—thereby preserving the correctness of training while substantially reducing computation and memory overhead. This makes GNN training time comparable to that of standard NN models. In hierarchical models, e.g., RNE , training begins with multi-level graph partitioning using a clustering algorithm, e.g., METIS ( 30 ) , where the number of partitions increases at finer levels. Training progresses from coarser to finer partitions. At each level, node pairs are mapped to their corresponding partition IDs, and a separate embedding matrix of size (#partitions \times embedding dimension) is maintained. This enables the model to capture both global and local structural patterns. The procedure resembles mini-batch training except that embeddings are learned independently at each hierarchical level. To obtain the final node embedding, we aggregate its embeddings across all parent partitions in the hierarchy. 4. Experiments To systematically evaluate ML–based distance indexes, we design a unified experimental framework that spans diverse datasets, models, and evaluation metrics. We examine performance along four axes: accuracy, query latency, preprocessing time, and model size. Only a few original implementations are publicly available, and many are outdated, incomplete, or are built on different frameworks. Thus, we have reimplemented all models in PyTorch ( 44 ) and PyTorch Geometric ( 16 ) using Python 3.10, adhering to their original architectures where available. This unified implementation ensures fair comparison across models by eliminating discrepancies arising from framework or dependency differences. All implementations are open-source 1 1 1 https://github.com/purduedb/shortest-distance-survey to facilitate reproducibility and future research. Experiments are run on a single-node high-performance computing cluster managed by Slurm, equipped with 16 CPU cores, 32 GB of memory, and one NVIDIA A30 GPU (24 GB VRAM) running CUDA 12.7 on Rocky Linux 9.5 (Blue Onyx). We fix the random seed across runs to ensure reproducibility and benchmarking. 4.1. Datasets We use seven real-world road-network datasets of varying scales and geographies, summarized in Table 3 . Each dataset is modeled as an undirected, weighted graph, where vertices correspond to road intersections and edges represent road segments with travel distance as the weight. Geographic coordinates are available for all nodes, enabling methods that incorporate spatial features. We construct workload-driven shortest distance queries from real-world trajectory datasets. We extract start–end locations from GeoLife ( 18 ) trajectories for Beijing, taxi trip records for New York ( 1 ) and Chicago ( 64 ) , traffic camera trajectories for Jinan and Shenzhen ( 11 ) , and taxi trajectories for Chengdu ( 12 ; 68 ) and Shanghai ( 58 ) . For each trajectory, the origin and destination coordinates are map-matched to their nearest road-network vertices, and the resulting vertex pairs are used as shortest distance queries. Table 3. Summary statistics for real-world road network datasets. k_{\text{max}} and k_{\text{avg}} are maximum and average node degrees; d_{\text{max}} is maximum shortest distance (in km). Data Region Nodes Edges k_{\text{max}} k_{\text{avg}} d_{\text{max}} JN ( 11 ) Jinan 8.9k 14.1k 10 3.16 29.1 SZ ( 11 ) Shenzhen 11.9k 18.9k 12 3.17 41.3 CD ( 68 ) Chengdu 17.6k 25.3k 11 2.88 149.0 BJ ( 78 ; 18 ) Beijing 74.4k 103.4k 29 2.78 188.3 SH ( 58 ) Shanghai 74.9k 103.0k 9 2.75 95.3 NY ( 1 ) NewYork 334.9k 445.9k 11 2.66 164.6 CH ( 64 ) Chicago 386.5k 549.6k 9 2.84 77.9 Data Preprocessing. For each network, we retain only the largest connected component to guarantee reachability among all queried vertex pairs. Node identifiers are re-indexed sequentially from 1 to n for compactness. To enrich the workload, we augment unique real queries by perturbing endpoints with spatially proximate (2-hop neighborhood) nodes, resulting in 500K distance queries per dataset. Data is partitioned 80% training and 20% testing (400K/100K queries). Ground-truth distances are computed using non-ML distance index HCL ( 15 ) that gives exact shortest-path distances. 4.2. Models The evaluated models are grouped into five categories: (1) non-ML baselines, (2) feed-forward NNs, (3) GNNs, (4) functional methods, and (5) gradient-boosted decision trees. The encoder–decoder configurations of all models are listed in Table 4 . 4.2.1. Baselines (Non-ML) We test against four baselines: • Manhattan : Estimate distance by \ell_{1} -norm over coordinates; • Landmark rn : Landmark-based estimation using randomly selected landmarks sampled from training vertices; • Landmark km : Similar to Landmark rn but selects landmarks nearest to k -Means cluster centroids (in Euclidean space); • HCL (Exact) ( 15 ) : Provides exact shortest-path distances. The number of landmarks is fixed to 64 for all landmark-based baselines and datasets to ensure comparability. These methods require no learning and serve as strong analytical baselines relying solely on coordinates or precomputed distances to reference nodes. Table 4. Encoder and decoder architectures for all models evaluated. Shaded labels denote learnable modules. Model Encoder Decoder Baselines Manhattan Coordinates \ell_{1} -norm Landmark Landmark distance vectors minimum Neural Network (NN) Methods GeoDNN Coordinates NN(20, 100, 20) DistanceNN Pretrained embeddings NN(64, 12) EmbedNN Pretrained embeddings NN(500) Vdist2vec Learnable embeddings NN(100, 20) Ndist2vec Learnable embeddings NN(100, 20) LandmarkNN Landmarks + coordinates NN(1024, 512) Graph Neural Network (GNN) Methods RGCNdist2vec GCN Layer (coordinates) \ell_{1} -norm RSAGEdist2vec SAGE Layer (coordinates) \ell_{1} -norm RGATdist2vec GAT Layer (coordinates) \ell_{1} -norm Functional Methods Path2Vec Learnable embeddings dot product ANEDA Learnable embeddings dot product RNE Hierarchical embeddings \ell_{1} -norm Gradient-Boosted Decision Tree (GBDT) Methods CatBoost Landmarks + coordinates GBDT 4.2.2. NNs We examine six neural architectures implemented following their respective papers: • GeoDNN ( 29 ) : uses geographic coordinates as input, with three hidden layers (20–100–20 neurons); • DistanceNN ( 52 ) : uses pre-trained Node2Vec embeddings fused via subtraction with two hidden layers (64–12 neurons), ReLU activation, and dropout ( p{=}0.4 ); • EmbedNN ( 51 ) : uses pre-trained Node2Vec embeddings fused by averaging and a 500-neuron hidden layer with ReLU activation; • Vdist2vec ( 49 ) : learns node embeddings from scratch and has two hidden layers (100–20 neurons); • Ndist2vec ( 9 ) : learns node embeddings from scratch and has a four-branch ensemble architecture, with each branch comprising 2 fully connected layers (100–20 neurons); • LandmarkNN : A NN adaptation of CatBoost ( 27 ) , replaces trees with 2 fully-connected layers (1024–512 neurons) with ReLU. Models use ReLU activation in hidden layers. Each network ends with a single scalar output neuron, employing either a sigmoid (scaled by the maximum distance) or ReLU (without scaling) activation; DistanceNN instead uses a SoftPlus output. Models are trained with MSE loss to predict shortest distance. The embedding dimension is 64. Training is conducted for 5 minutes using the Adam optimizer ( 5 ) (learning rate 0.01, except 0.0003 for LandmarkNN that requires a slower rate) and a 1024 batch size. Results are given for the best validation epoch based on test-set performance. For Vdist2vec and Ndist2vec, the node-embedding tables and linear layer weights are initialized by a truncated normal distribution ( \mu{=}0 , \sigma{=}0.01 ), and biases are 0 ( 49 ; 9 ) . For all other models, we retain PyTorch’s default Xavier uniform initialization ( 20 ) . We obtain Node2Vec embeddings by performing 10 unbiased random walks of Length 80 per node on the undirected graph ( p{=}q{=}1 ) and training a skip-gram model with Window Size 10 for 1 epoch at Learning Rate 0.05 to produce 64-dimensional embeddings. 4.2.3. GNNs We evaluate three message-passing architectures that operate on graph topology using node coordinates as features: • RGCNdist2vec ( 37 ) : The original two-layer (512–64) GCN encoder with Leaky-ReLU activations and an \ell_{1} -norm decoder; • RSAGEdist2vec : Our variant of RGCNdist2vec that replaces GCN layers with GraphSAGE ( 25 ) layers; • RGATdist2vec : Our variant of RGCNdist2vec that replaces GCN layers with graph attention (GAT) ( 67 ) layers. GNNs are trained by the Smooth \ell_{1} loss under the same optimizer and training configuration as the NN models. 4.2.4. Functional Methods These models compute distances by functional decoders applied to trainable node embeddings: • Path2vec ( 34 ) : learns randomly initialized embeddings by the modified loss function defined in Equation ( 3 ), and decodes distances by the inverse dot product; • ANEDA ( 43 ) : learns embeddings initialized with pre-trained Node2Vec, and predicts distance by inverse dot product; • RNE ( 77 ) : trains hierarchical node embeddings with an \ell_{1} -norm distance function between embedding pairs. ANEDA and Path2vec use a learning rate of 0.03, while RNE uses 0.003 (reduced to 0.001 for the largest datasets, NewYork and Chicago). Learning rates are determined by hyperparameter tuning, with all other training settings identical to the NN models. 4.2.5. Gradient-Boosted Decision Trees (GBDT) We evaluate CatBoost ( 27 ) by precomputing distances to 61 landmarks, complemented by two coordinate features (longitude and latitude) and one similarity feature, resulting in a 64-dimensional feature vector per node. CatBoost is trained on CPU–where it converges faster and yields lower query latency than on GPU–using RMSE loss, Learning Rate 0.3, 12K iterations, with a 5-minute training budget. 4.3. Evaluation Metrics We evaluate all models under a unified setup to assess their accuracy-efficiency trade-offs. Each model is trained (or indexed, as applicable) and evaluated on the same query dataset to ensure fairness across methods. We consider four primary metrics: approximation error, preprocessing time, query latency, and storage overhead. The first two are learning-dependent quality metrics that improve with better optimization, whereas the latter two are architecture-dependent efficiency metrics that remain fixed for a given model design. Longer training or better convergence can improve accuracy but cannot reduce the model’s inference latency or memory footprint–training only alters parameter values not their count or the number of computations required during inference. An exception is CatBoost whose size can vary slightly with additional training. Except for CatBoost, efficiency metrics are largely invariant to the learning process. The 4 dimensions characterize the fundamental trade-offs between estimation quality and computational cost. Measurement protocols for each metric are summarized below. 4.3.1. Approximation Error (MRE) MRE quantifies how closely the model’s predictions match the true shortest-path distances. We measure approximation quality using Mean Relative Error (MRE): \mathrm{MRE}=\frac{1}{N}\sum_{i=1}^{N}\frac{|\hat{d}_{i}-d_{i}|}{d_{i}} . MRE, also known as the Mean Absolute Percentage Error (MAPE), is scale-invariant and thus enables meaningful comparison across graphs with differing edge-weight or distance distributions. Thus, we adopt MRE instead of MAE. 4.3.2. Precomputation Time (PT) PT measures offline cost (training or index construction). We record the wall-clock time for a model to reach convergence or to exhaust a fixed training budget. PT per epoch depends on the number of query samples N and the model’s architectural complexity M (e.g., M_{\text{GNN}}>M_{\text{MLP}} due to message-passing overhead in GNNs). It does not directly depend on the underlying graph size, although N may vary with graph scale depending on how the query workload is generated. \mathrm{PT} per epoch scales as \mathcal{O}(MN) , where M reflects per-sample computation cost. 4.3.3. Query Latency (QT) QT captures the average inference time per query in an online setting. We measure QT as total inference time divided by the number of evaluated node pairs. Query time (QT), or query latency, depends on decoder complexity M and embedding dimension d , roughly scaling as \mathcal{O}(Md) . For a fixed architecture and embedding size, this cost remains effectively constant and is independent of training, graph size, or source–destination distance, unlike classical non-ML indexes whose QT typically increases with the distance between nodes in the road network. 4.3.4. Storage Overhead (MS) MS represents the memory footprint of the learned model or index. Across all methods, most parameters reside in the encoder’s embedding matrix that scales linearly with Embedding Dimension d and the number of nodes n . Decoder parameters contribute negligibly (at most \mathcal{O}(d) if a neural decoder is used, or zero if the decoder is functional). Hence, model size scales as \mathcal{O}(dn) . Once the embedding dimension and architecture are fixed, MS remains constant–independent of training duration or quality, mirroring the invariance observed for query latency. 4.4. Results Table 5. Comparison of test MRE (%) among all methods and baselines across datasets. Lower values indicate better performance. First , second , and third lowest values are highlighted. Model JN SZ CD BJ SH NY CH Mean \pm Std Baselines Manhattan 9.73 12.05 11.09 9.64 10.12 20.60 9.72 11.85 \pm 3.67 Landmark rn 122.80 32.35 20.36 54.69 36.55 19.81 10.28 42.41 \pm 35.41 Landmark km 64.69 20.95 21.54 66.68 29.02 16.16 5.62 32.09 \pm 22.23 Neural Network Methods GeoDNN 7.63 6.83 6.31 7.71 5.63 4.94 1.71 5.82 \pm 1.92 DistanceNN 25.17 26.85 46.84 85.91 99.82 136.45 52.84 67.70 \pm 38.22 EmbedNN 19.78 11.81 16.36 29.32 43.22 63.21 7.57 27.32 \pm 18.33 Vdist2vec 4.30 3.79 4.29 16.16 13.63 12.59 1.72 8.07 \pm 5.40 Ndist2vec 7.31 3.18 5.53 15.45 13.69 17.25 28.28 12.96 \pm 7.95 LandmarkNN 4.05 2.92 2.17 3.66 2.36 1.89 0.52 2.51 \pm 1.09 Graph Neural Network Methods RGCNdist2vec 23.92 19.74 12.29 23.41 14.42 18.09 5.54 16.77 \pm 6.06 RSAGEdist2vec 9.12 6.86 5.84 5.38 4.77 4.80 1.80 5.51 \pm 2.06 RGATdist2vec 7.65 6.49 5.56 5.19 4.61 4.63 1.88 5.14 \pm 1.67 Functional Methods Path2vec 3.80 2.82 8.15 33.60 28.69 37.36 3.07 16.78 \pm 14.51 ANEDA 2.86 2.11 5.28 22.28 16.84 21.78 1.67 10.40 \pm 8.78 RNE 3.82 2.51 2.63 8.37 3.81 3.51 0.39 3.58 \pm 2.25 Tree-based Gradient Boosting Methods CatBoost 2.33 2.02 1.28 1.59 1.47 1.40 0.33 1.49 \pm 0.58 4.4.1. Approximation Error (MRE) Table 5 reports test MRE under a fixed 5-minute training budget. CatBoost achieves the lowest error on all datasets, followed by LandmarkNN and RNE . We attribute CatBoost’s advantage to its ability to exploit both global features (coordinates, landmark distances) and local features (similarity) while remaining robust across different datasets. LandmarkNN, our neural surrogate of CatBoost over the same feature space, is consistently competitive and often second best. RNE performs strongly among functional methods, especially on medium and large graphs. Interestingly, as datasets grow larger from left to right, error reduces for the same training budget, suggesting that ML-based distance indexes scale favorably to larger networks. Our workload-driven evaluation yields rankings that differ slightly from prior studies since they evaluate models on all (or uniformly sampled) node pairs ( 49 ; 9 ; 43 ; 37 ) or landmark-generated ( 52 ; 77 ) synthetic queries. While RNE remains state of the art on these synthetic workloads, it is not consistently superior on workload- or trajectory-based queries, although highly competitive. Real-world workloads do not weigh all vertices equally and are strongly biased towards short-range distances, where local features tend to dominate. In contrast, synthetic query sets tend to over-represent long-range distances that are well captured by global features, explaining the observed differences from prior results. Among the baselines, Manhattan remains a strong reference, outperforming landmark-based methods on most datasets except NewYork (NY) and Chicago (CH). To reflect workload awareness, we select landmarks from the training-query vertex set rather than from all vertices, which noticeably improves landmark accuracy. Centrality-based selections (betweenness, degree, closeness, etc.), advocated in earlier work for other graph families, offer no benefit on road networks. Simple random or k -means selections are competitive, but rarely surpass Manhattan. We omit HCL from this table since it is an exact index (zero error). Among NN methods, LandmarkNN leads consistently, due to its combination of global (coordinates, landmarks) and local (similarity) features. Vdist2vec and Ndist2vec perform well on smaller graphs but degrade on larger ones, where the simpler GeoDNN surpasses them while offering favorable memory and latency trade-offs (as discussed later). EmbedNN and DistanceNN underperform even the baselines on workload queries despite learning-rate tuning. We experiment with alternative fusion operators (sum, concatenation, etc.) and pretrained embeddings (e.g., LINE ( 63 ) ), but the overall ranking remains unchanged. Within message-passing GNNs, RGATdist2vec typically outperforms other variants, including the original GCN encoder ( 37 ) . Incorporating edge weights provides no improvement. Thus, we report results on unweighted graphs. Attention mechanisms in GAT layers appear to implicitly capture effective weighting. Notably, under complex trajectories and topologies in Beijing (BJ) and Shanghai (SH), where most models exhibit higher error, GNNs remain comparatively more robust. Among functional methods, ANEDA performs well on smaller graphs but deteriorates on larger ones. RNE is the most stable in this category and often ranks immediately behind LandmarkNN, suggesting that hierarchical structures integrate local and global effects in road networks. Figure 2 plots error versus training time on three representative datasets. Most models reduce error with more training, but several (e.g., RNE) exhibit overfitting beyond an early epoch. Thus, we report MRE for the best validation epoch on the test set. 4.4.2. Precomputation Time (PT) All models are trained under a fixed five-minute budget. Figure 2 gives prediction error as a function of training time on 3 representative datasets. CatBoost , the best-performing model, converges rapidly, followed by LandmarkNN and RNE . While the trend is less pronounced on smaller graphs, larger graphs more clearly distinguish competitive methods, as weaker ones plateau early or fail to improve. As expected, error generally decreases with additional training. However, RNE attains its best validation performance soon after the hierarchical training phase and begins to overfit thereafter. In contrast, the exact non-ML index HCL requires less than 30 seconds of preprocessing even for the largest network (Chicago), illustrating how rapidly classical indexing methods can be constructed, though at the cost of higher storage and slower queries. Figure 2. Test MRE as function of training time for three representative datasets (small, medium, and large road networks). 4.4.3. Query Latency (QT) Table 6 summarizes per-query latency on CPU and GPU, grouped by decoder complexity (Table 4 ). For fair comparison, we reimplement the querying component of HCL , originally implemented in C++, in Python. Overall, GPU acceleration yields substantial gains–up to \sim 200 \times for LandmarkNN –reducing latency from microseconds in exact methods (e.g., HCL) to nanoseconds in learned indexes. This highlights the benefit of leveraging GPU in indexes for real-time distance estimation. In general, latency increases with decoder complexity–from simple functional decoders to shallow and then deeper NNs. HCL , the state-of-the-art exact non-ML method, not only exhibits high latency but also the greatest variability, as its query cost increases with the distance between the queried nodes. In contrast, ML models execute a fixed number of floating-point operations determined solely by network depth and dimensionality, yielding near-constant latency that is independent of graph distance—a key practical advantage. Within functional decoders, all methods show similar latencies, governed mainly by embedding dimensionality (e.g., 2-dimensional coordinates for Manhattan vs. 64-dimensional inputs for landmark-based methods). GNN models are placed in this category as their node embeddings are precomputed once and cached at inference time; thus, their QT reflects only the functional decoder cost. Among neural architectures, latency varies more widely depending on network depth, width, and activation functions. LandmarkNN , with its wider hidden layers, has the highest QT among NN methods, while simpler models, e.g., GeoDNN achieve faster inference. CatBoost exhibits query latency comparable to NN methods. It does not benefit from GPU execution—neither during training nor inference—so only CPU results are reported. Extending GPU-parallelized tree inference remains a direction for future work. Table 6. Comparison of CPU and GPU query times (in \mu s ), and GPU speedup, for all methods. Lower is better. Model CPU GPU Speedup Baselines Manhattan 0.189 \pm 0 0.008 \pm 0 24x Landmark rn 0.408 \pm 0 0.011 \pm 0 37x Landmark km 0.405 \pm 0 0.011 \pm 0 37x HCL 7.966 \pm 3.816 — — Shallow Functional Decoder RGCNdist2vec 0.647 \pm 0 0.009 \pm 0 72x RSAGEdist2vec 0.649 \pm 0 0.009 \pm 0 72x RGATdist2vec 0.722 \pm 0 0.009 \pm 0 80x Path2vec 0.524 \pm 0 0.013 \pm 0 40x ANEDA 0.551 \pm 0 0.013 \pm 0 42x RNE 0.392 \pm 0 0.011 \pm 0 36x Neural Network Decoder GeoDNN 0.655 \pm 0 0.023 \pm 0.001 28x DistanceNN 0.702 \pm 0 0.020 \pm 0 35x EmbedNN 3.308 \pm 0 0.032 \pm 0 103x Vdist2vec 1.331 \pm 0 0.023 \pm 0 58x Ndist2vec 4.237 \pm 0 0.056 \pm 0.002 76x LandmarkNN 28.252 \pm 0 0.143 \pm 0.001 198x Tree-based Decoder CatBoost 2.127 \pm 0 — — 4.4.4. Storage Overhead (MS) Table 7 reports the storage size of each distance index. As discussed earlier, index size is primarily determined by the encoder–specifically the embedding dimension and the number of stored embeddings (i.e., number of nodes). While Table 4 summarizes encoder–decoder configurations, Table 7 reorganizes methods by embedding dimensionality, with the last row showing the relative dataset size (number of nodes). Across datasets (left to right), index size grows roughly in proportion to the number of nodes, confirming the expected linear dependence. HCL , the exact non-ML index, is an exception: its size increases superlinearly with graph scale–e.g., the number of nodes grows by 43 \times from Jinan to Chicago, while HCL expands by over 150 \times . Across models (top to bottom), index size scales linearly with embedding dimensionality. Methods storing only coordinates (dim=2), e.g., Manhattan and GeoDNN , occupy minimal space followed by GNN methods that require slightly more storage due to additional edge-lists for message passing. However, models with 64-dimensional embeddings (e.g., landmark baselines) consume about 32 \times more memory than coordinate-only models, consistent with the expected \mathcal{O}(dn) scaling. CatBoost and LandmarkNN deviate marginally from this trend, with constant offsets of roughly 20–25 MB and 1–2 MB, respectively, due to their complex decoders. Table 7. Comparison of index sizes (in MB) among methods and baselines for each dataset. Lower is better. Model JN SZ CD BJ SH NY CH Baselines Manhattan 0.1 0.1 0.2 0.9 0.9 3.8 4.4 Landmark rn 2.2 2.9 4.3 18.2 18.3 81.8 94.4 Landmark km 2.2 2.9 4.3 18.2 18.3 81.8 94.4 HCL 3 5 8 89 91 211 501 Store coordinate vectors (dim=2) GeoDNN 0.1 0.1 0.2 0.6 0.6 2.6 3.0 Store coordinate vectors (dim=2) and edges RGCNdist2vec 0.6 0.8 1.0 3.9 3.9 16.3 19.9 RSAGEdist2vec 0.8 0.9 1.2 4.0 4.0 16.4 20.0 RGATdist2vec 0.6 0.8 1.1 3.9 3.9 16.3 19.9 Store embedding vectors (dim=64) DistanceNN 2.2 2.9 4.3 18.2 18.3 81.8 94.4 EmbedNN 2.3 3.0 4.4 18.3 18.4 81.9 94.5 Vdist2vec 2.2 3.0 4.4 18.2 18.4 81.8 94.4 Ndist2vec 2.4 3.2 4.5 18.4 18.5 82.0 94.6 Path2vec 2.2 2.9 4.3 18.2 18.3 81.8 94.4 ANEDA 2.2 2.9 4.3 18.2 18.3 81.8 94.4 RNE 2.2 2.9 4.3 18.2 18.3 81.8 94.4 LandmarkNN 4.7 5.4 6.7 20.4 20.5 83.0 95.4 CatBoost 27 28 29 43 43 108 120 No. of Nodes 1x 1.3x 2.0x 8.4x 8.4x 37.6x 43.4x 4.5. Discussion and Lessons Learned There is no single model that dominates in all settings; the optimal choice depends on the query workload and operational constraints. Workload Sensitivity Our findings are particularly relevant for real-world query workloads, where short-range queries are more common than long-range ones. For long-range distance estimation, even classical landmark-based baselines achieve sub-1% error. However, short-range predictions remain more challenging and benefit from more sophisticated learning-based distance indexes. Accuracy–Latency Trade-off Under trajectory-based workloads, CatBoost achieves the highest accuracy but incurs higher query latency. RNE offers the lowest latency with a modest increase in error, while LandmarkNN provides a balanced middle ground between the two. With longer training budgets, LandmarkNN’s accuracy can be further improved while maintaining low latency. Functional methods are preferred to NNs when latency is the bottleneck. GPU inference consistently yields up to two orders of magnitude speedup, making learned indexes feasible for real-time applications. Latency in ML-based indexes is deterministic while non-ML methods, e.g., HCL , exhibit significant variance. For GNNs, training efficiency is enhanced by constructing the induced subgraph of nodes appearing in each mini-batch (and their L -hop neighbors) for message propagation while caching precomputed embeddings during inference to reuse node representations. Storage Constraints Storage for learned indexes scales predictably with \mathcal{O}(dn) , whereas exact two-hop labeling HCL may require significantly more storage on large road networks. Increasing training time improves accuracy but does not affect efficiency metrics (QT & MS), except for tree-based models, e.g., CatBoost. Among learned methods, LandmarkNN , RNE , and CatBoost maintain comparable storage footprints as graph size grows. For memory-constrained environments, GeoDNN and GNN models are appealing due to their compact representations, despite slightly higher error rates. Generalization Capability Methods that learn node embeddings directly (e.g., Vdist2vec, Ndist2vec) are transductive and cannot handle unseen nodes without retraining as each node must be observed during training for its embedding to be learned. In contrast, feature-driven or inductive approaches, e.g., GeoDNN, LandmarkNN, GNNs, and CatBoost, generalize naturally to unseen nodes and edges. Summary In practice, CatBoost remains the most accurate choice, RNE the fastest, and LandmarkNN offers a balanced trade-off between the two. Learned indexes consistently outperform classical methods, e.g., HCL, in terms of query latency and model size while achieving acceptable approximation errors (typically within 3%). However, learned embeddings introduce scalability and overfitting challenges that warrant further research. Moreover, the model trained on one road network (and their embeddings) may not transfer well to another road network. A potential solution to this problem is to use GNNs that can generalize well to unseen nodes and edges. 5. Related Work This paper relates to prior work on shortest-path and shortest-distance computation, distance indexing, learned distance approximation, and representation learning on graphs. Shortest Path vs. Shortest Distance. The classical shortest path problem returns the full sequence of vertices between a source and a destination, whereas a shortest distance query returns only the corresponding path length. Many applications, including ranking, filtering, and spatial analytics, require distances but not explicit paths. Thus, numerous approaches in the literature focus on computing shortest distances directly, without explicitly reconstructing the corresponding paths. Exact vs. Approximate Shortest Distance. Exact shortest distance methods, including classical graph algorithms and distance indexes, guarantee optimal results but often incur substantial preprocessing cost or storage overhead on large road networks. Approximate approaches relax exactness guarantees to improve efficiency and include both non-ML techniques ( 6 ; 21 ; 50 ; 57 ; 48 ; 62 ) and ML-based ( 29 ; 52 ; 51 ; 49 ; 9 ; 34 ; 43 ; 77 ; 27 ; 37 ) methods that learn compact representations of the distance function. These approaches expose trade-offs among accuracy, query latency, preprocessing time, and storage, that are central to this benchmark. Related Problems and Graph Domains. Learning on road networks has been studied in related problems, e.g., travel time estimation ( 26 ; 19 ; 75 ) , next-location and destination prediction ( 71 ) , traffic flow forecasting ( 2 ) , and road segment classification ( 71 ; 10 ) . These problems are closely related to representation learning on general purpose graphs, where a large body of work has proposed methods based on random walks (e.g., Node2vec ( 22 ) , LINE ( 63 ) , DeepWalk ( 47 ) ), as well as GNNs, e.g., GCN ( 32 ) , GraphSAGE ( 25 ) , GAT ( 67 ) . Moreover, distance or similarity learning has been explored on other graph domains, including social networks ( 23 ; 62 ; 52 ; 51 ) , communication networks ( 61 ; 28 ) , knowledge graphs ( 34 ; 7 ) , and biological networks ( 40 ) . 6. Conclusion and Future Work In this paper, we present the first unified empirical evaluation of ML-based distance indexes for road networks, benchmarking ten representative models across seven real-world datasets. Our study compare accuracy, query latency, preprocessing time, and storage, revealing clear trade-offs: CatBoost delivers the highest accuracy, functional methods, e.g., RNE, offer excellent latency–accuracy balance, and NN models, e.g., LandmarkNN, provide strong middle-ground performance under workload-driven queries. This benchmark establishes a foundation for advancing learned distance indexes. Promising directions for future work include developing update-efficient models for dynamic road networks, strengthening GNN-based approaches, and addressing scalability challenges on large graphs.