The query phase answers a specific shortest-path request after a contraction hierarchy has been built. Preprocessing supplies an augmented graph and a node order; the query uses them to avoid searching many less important nodes. This trades preprocessing time for faster queries, including on large road networks. section 4.3.4
To answer a source-to-target query:
- Run bidirectional Dijkstra’s search on the preprocessed graph, following edges toward increasingly important nodes. section 4.3.4
- Use the resulting route’s shortcut edges where needed, then unpack them to recover the route through the original graph. section 4.3.4
Figure 4.46 The solution path after unpacking the contracted edges. The original route returned by bidirectional Dijkstra's passes through the contracted edge (8,5), which is then unpacked into (8,3) and (3,5).
The route uses shortcut edge (8,5); unpacking it restores the original segments (8,3) and (3,5). section 4.3.4
