Overview
Contraction hierarchies preprocess a road-like graph into levels so queries can search mostly upward through shortcut edges instead of exploring the full graph.
Speeds shortest-path queries by contracting less important nodes and adding shortcut edges.
Compact metadata for implementation and discovery.
Contraction hierarchies preprocess a road-like graph into levels so queries can search mostly upward through shortcut edges instead of exploring the full graph.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log V)
Average
O(log V)
Worst
O(E log V)
Space
O(V + E)
shortcut(u, w) needed if dist_without_v(u, w) > cost(u, v) + cost(v, w)Adds a shortcut when removing v would otherwise hide a shortest path.
Show the frontier, settled nodes, and the final path over the search space.
Contraction Hierarchies should be used with the assumptions and tradeoffs of route Planning in mind.
What each reference supports for this entry.
Reference for node contraction and shortcut-based road-network shortest paths.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Both speed up shortest-path queries through preprocessing.
Contraction hierarchies preprocess shortcuts to accelerate shortest-path queries.