HLSearch: Hierarchical Shortest Path Search
- HLSearch is a hierarchical search method that partitions large graphs into subgraphs and organizes them into a multi-tier skeleton graph to support efficient shortest path queries.
- It employs SGNNs to predict inter-node distances and hop counts within each subgraph, enabling effective learned pruning and sublinear search times.
- The framework integrates local SGNN estimates with precomputed inter-access distances, achieving over 99% accuracy and rapid query performance on massive graphs.
HLSearch is the hierarchical search component of the framework introduced in "Skeleton-Guided Learning for Shortest Path Search" (Liu et al., 4 Aug 2025). It targets shortest path search on generic graphs that are too large for a single learned model, and extends LSearch by partitioning into subgraphs, training one Skeleton Graph Neural Network (SGNN) per subgraph, organizing subgraphs into a bottom-up hierarchy, and searching across partitions via learned estimates and precomputed inter-partition distances. Within the overall three-layer framework, the bottom layer builds a multi-tier skeleton graph , the middle layer trains SGNN to predict shortest-path distance and hop-count , and the top layer executes either LSearch on moderate-size graphs or HLSearch on very large graphs (Liu et al., 4 Aug 2025).
1. Problem setting and framework position
Shortest path search is described as a core operation in graph-based applications, with three limitations motivating HLSearch. Classical algorithms such as Dijkstra's and A* become inefficient as graphs grow more complex; index-based techniques often require substantial preprocessing and storage; and recent learning-based approaches typically focus on spatial graphs and rely on context-specific features like geographic coordinates, limiting their general applicability (Liu et al., 4 Aug 2025).
HLSearch is explicitly positioned as the large-graph extension of LSearch rather than as an unrelated algorithmic family. LSearch assumes a single SGNN on the entire graph. HLSearch invokes LSearch inside leaf partitions and uses the hierarchy plus precomputed “access” distances to avoid global expansion. The framework therefore separates representation learning from global graph decomposition: the learned component remains local to subgraphs, while the hierarchy supplies the cross-partition routing structure.
A common misunderstanding is to treat HLSearch as a replacement for all shortest-path methods. The paper instead states a division of labor: LSearch applies to moderate-size graphs, whereas HLSearch applies to very large graphs. Another possible misunderstanding is to read it as a spatial-graph method. The stated design goal is broader: shortest path search on generic graphs, without requiring domain-specific features.
2. Graph partitioning and hierarchical organization
When is too large for a single SGNN, HLSearch first partitions into roughly balanced subgraphs using a standard multilevel partitioner. Seeds of highest degree initialize each block; local refinement then balances block sizes and minimizes cut edges (Liu et al., 4 Aug 2025). Each subgraph becomes a leaf of a tree, and adjacent subgraphs—those with inter-block edges—are recursively grouped into higher-level blocks until a single root remains.
Each node in this merge-tree stores a set of member vertices 0 and a set of “access vertices” 1 that connect 2 to its siblings. The access-vertex abstraction is central to the hierarchy: it reduces inter-partition search to a bounded interface rather than requiring unrestricted expansion across cut edges.
Leaf and non-leaf nodes store different information. If 3 is a leaf, it stores the trained SGNN for 4 and the distances 5, 6. If 7 is non-leaf, it stores, for every pair 8 of its children’s access vertices, the exact 9 and the associated shortest-path segment. This organization makes the hierarchy a search-time data structure rather than a trainable end-to-end differentiable stack.
The paper states that no back-prop between levels is needed: hierarchy is for search only. This is important for interpretation. It means hierarchical organization is not a multi-level GNN training pipeline; instead, it is a decomposition that constrains search and caches exact inter-access connectivity.
3. Multi-level skeleton graph
The representational basis of HLSearch is the multi-level skeleton graph 0. Each original vertex 1 is equipped with an 2-tier skeleton label
3
where
4
The overall label is 5 (Liu et al., 4 Aug 2025).
Within each 6, bucket 7 is linked to bucket 8 by edges 9 of weight 0. The construction also connects 1 to every label member by a “label-link” of weight 2. The union of these links over all 3 yields the skeleton graph.
Two structural properties are highlighted. First, any 4-tier skeleton path from 5 to 6 is a subsequence of the true shortest path. Second, skeleton links at tier 7 lie within tier 8 labels. These properties explain why the skeleton graph can support pruning without discarding the shortest-path structure that the model is intended to estimate.
This suggests that the skeleton graph is not merely a sparsifier in the conventional sense. It is a structured encoding of hop- and distance-information across scales, with tiered bucket connectivity designed to preserve shortest-path subsequences while compressing the graph into a learning-friendly form.
4. SGNN architecture and training objectives
SGNN operates on the skeleton graph to learn node embeddings and to predict distances and hop lengths between node pairs (Liu et al., 4 Aug 2025). The input features for each 9 include graph statistics such as degree and clustering coefficient, and label statistics for each bucket 0: 1, 2, 3, and 4.
Message-passing is performed over 5, with 6 defined as 7’s tier-8 skeleton bucket. After 9 layers, the final embedding is 0. For a source-target pair 1, the model forms 2 and passes it through two separate MLPs: 3
The training objective is multi-task: 4
5
The model therefore learns shortest-path distance and hop-count jointly rather than as separate models.
In the hierarchical regime, each leaf subgraph 6 is trained independently using only intra-block skeleton graph. After convergence, the distances 7 for 8 to its leaf-access vertices 9 are recorded. These are then assembled into non-leaf nodes by computing all-pairs shortest distances among child-access sets via a small Dijkstra per child-pair. The absence of cross-level back-propagation reinforces the interpretation that SGNN is a local estimator, while the hierarchy performs exact inter-access composition.
5. HLSearch query procedure
HLSearch takes as input a hierarchy 0, source 1, and target 2 (Liu et al., 4 Aug 2025). It first finds the leaf nodes 3 and 4 that contain 5 and 6. If 7, the algorithm returns LSearch on that leaf. Otherwise it computes the lowest common ancestor 8, identifies the child 9 of 0 on the path to 1 and the child 2 on the path to 3, and extracts the corresponding access sets 4 and 5.
For each 6, HLSearch computes 7 using either SGNN-based 8 when 9 is a leaf or precomputed 0 otherwise; it computes 1 analogously for 2. The pseudocode then selects an access-vertex pair 3. A plausible reading of the selection rule is that it minimizes the sum of source-to-access cost, precomputed distance between the two access vertices in the lowest common ancestor, and access-to-target cost.
Path reconstruction concatenates three segments: 4, 5, and 6. The first and third segments are obtained either by LSearch inside a leaf or by a stored leaf-access path, while the middle segment uses a precomputed Path in 7. The output is the concatenation of these three segments.
Model-driven pruning remains active through the LSearch calls used inside HLSearch. The paper states that Strategies 4.1 and 4.2 skip vertices whose partial-path cost minus predicted cost exceeds a buffered error threshold, and defer heuristic guidance until a minimum hop length 8 is reached. This design indicates that learning is used for guided pruning and local prioritization, whereas the hierarchy constrains the global routing envelope.
6. Complexity, experimental results, and interpretation
The reported time and space complexity separate construction, training, hierarchy build, and query phases (Liu et al., 4 Aug 2025). Skeleton-graph construction is
9
for small 0. SGNN training per block is 1 per epoch, total 2. Hierarchy build stores inter-access distances at cost 3 where 4. Query time of HLSearch is
5
with the dominant term stated as the two leaf-search calls, i.e. 6, since 7. Space is reported as 8 for the skeleton graph, plus 9 for leaf distance tables, plus higher-level access-pair storage; in practice this is linear in 00.
The experiments use five real-world graphs:
| Dataset | Size |
|---|---|
| Brain | 503 v / 24 k e |
| Bio | 2 k / 20 k |
| Web | 4 k / 9 k |
| Power | 5 k / 6 k |
| Road-NA | 176 k / 179 k |
On a test set of 10 k pairs, SGNN outperforms GNN and Node2Vec on both distance and hop prediction. The reported numbers are SGNN MAPE01 6–8% vs GNN 10–19% vs n2v 10–42%, SGNN MAPE02 4–8% vs GNN 6–18% vs n2v 8–43%, with RMSE improvements of 2–5×. On small graphs and 100 queries, LSearch reports query time 20–40 ms vs Dijkstra 14–280 ms, described as 5–10× faster, while Landmark gives 5–8 ms but uses 2–3× more memory; LSearch reports Accuracy 03 and Hit-rate 04 vs Landmark’s 9–70%.
For HLSearch specifically on Road-NA, the graph is partitioned into 43 blocks of 05 k vertices and hierarchy depth 06. The reported average query is 07 ms and memory 08 MB, 5× faster than Dijkstra on full graph, with Accuracy 09 and Hit-rate 10 over random source–target pairs up to 550 hops. The paper’s summary characterizes the resulting behavior as sublinear search time, linear storage, and 11 distance accuracy on very large graphs.
Several interpretive points follow directly from these results. HLSearch is not a fully learned replacement for exact routing; it combines learned estimates, exact inter-access distances, and stored shortest-path segments. It is also not merely a partitioned Dijkstra variant; the reported gains depend on compact skeleton graphs, SGNN’s accurate distance/hop estimates, learned-pruning in LSearch, and a bottom-up partition hierarchy. Finally, the empirical evidence is not confined to road networks: the reported datasets span Brain, Bio, Web, Power, and Road-NA, which supports the claim of applicability across graph types.