Download presentation
Presentation is loading. Please wait.
Published byAugust Dean Modified over 6 years ago
1
Route Planning Tabulation Dijkstra Bidirectional A* Landmarks Reach
ArcFlags Transit Nodes Contraction Hierarchies Hub-based labelling Good overview in JEA10 paper Bauer,Delling,Sanders,Schieferdecker,Schultes,Wagner. Combining Hierarchical and Goal-Directed Speed-Up Techniques for Dijkstra’s algorithm. Slides with more detailed proofs: [ADGW11] Ittai Abraham, Daniel Delling, Andrew V. Goldberg, Renato Fonseca F. Werneck. A Hub-Based Labeling Algorithm for Shortest Paths in Road Networks. Proc. 10th International Symposium on Experimental Algorithms (SEA), LNCS 6630, 2011, [BFMSS07] Holger Bast, Stefan Funke, Domagoj Matijevic, Peter Sanders, and Dominik Schultes. In Transit to Constant Time Shortest-Path Queries in Road Networks. Proceedings of the Ninth Workshop on Algorithm Engineering and Experiments (ALENEX), 2007. [GSSD08] Robert Geisberger, Peter Sanders, Dominik Schultes, and Daniel Delling. Contraction Hierarchies: Faster and Simpler Hierarchical Routing in Road Networks. Proc. 7th International Workshop on Experimental Algorithms (WEA), LNCS 5038, 2008,
2
Route Planning Input: Directed weighted graph G Query(s,t) – find shortest route in G from s to t Lot of algorithm engineering work for road networks Example: US Tigerline, 58 M edges & 24 M vertices No preprocessing With preprocessing Fast query time Variations of Dijksta’s algorithm Query Time ↔ Space trade-off Trivial: Distance table O(1) time & O(n2) space Practice: Try to exploit graph properties
3
Route Planning – no preprocessing (non-negative edge weights)
Dijkstra Build shortest path tree T Visit vertices in increasing distance to s Bidirectional Dijkstra Grow s.p. tree Tf from s and Tb to t Maintain best so far s→t distance μ Termination condition: nextf + nextb μ Dijkstra – uses efficient priority queue to find next vertex to include into T; maintain for each vertex tentative distance Bidirectional Dijkstra: μ initially , update when relaxing eges nextf + nextb are the distance to the next vertices to be included in Tf and Tb Correctness of termination: The shortest path p has lengthμ and contains an edge (v,w), where v is in Tf, but w has distance nextf. But then distance w to t is μ-nextfnextb and w must be in Tb, i.e. the edge (v,w) has been relaxed to dist(p) when vTf and wTb Tf s t G Tb u
4
Dijkstra vs Bidirectional Dijkstra
Bidirectional Dijkstra (example area Washington state)
5
A* Goal directed Input: Weighted graph G with non-negative edges
Query(s,t): Shortest route queries Idea Let h(v) be ”heights” & define w’(u,v) = w(u,v) + h(v) - h(u) Fact w’(s→v1vk→t) = w(s→v1vk→t) + h(t) - h(s) G and G’ have identical shortest paths Fact If w’0 we can use Dijkstra’s algorithm If w’0 and h(t)=0 h(v) lower bound on distance v→t Ex. 1 Planar graphs with L2 distance, let h(v) = |t-v|2 triangle inequality ensures w’ non-negative Ex. 2 h(v) = dG(v,t) w’(s,t) = Dijkstra’s algorithm would only explore the shortest path Note Bidirectional A* Bidirectional Dijkstra and A* combined Intuitive idea: We would like to run ”downhill”, i.e. t should have low height and s high height Height can also be thought of as a potential Ex. 2 – not practical example: Knowing dG(v,t) would require computing the shortest paths. But it motivates landmarks. Bidirectional A* can also use two different height functions, but then definition and termination condition more envolved, and the height functions must be consistent t v u h(u) h(v) w(u,v)
6
A* Washington DC -> Los Angeles, h = spherical distance
7
Landmarks Select a small number of vertices L (Landmarks)
For all nodes v store distance vector d(v,l) to all landmarks lL Idea In A* algorithm fix one landmark lL, and use h(v) = d(v,l) (valid by triangle inequality) Practice: Use more than one landmark to find lower bounds on d(v,t) Dynamicly increase landmark set during search Bidirectional A* s l t v d(t,l) d(v,l) d(v,t) w’=0 Space increases with number of landmarks !
8
Bidirectional A* with Landmarks
Werneck & Goldberg were at MicroSoft Yellow & Red = landmarks, Yellow = used landmarks during the bidirectional search
9
Reach For all nodes v store
Reach(v) = max(s,t) : v on shortest path s→t min{ d(s,v), d(v,t) } Idea Reach(v) defines ball around v. If both s and t outside ball, v is not on shortest path Query Prune edges (u,v) in Dijkstra, when relaxing (u,v) and Reach(v) < min{ d(s,u)+w(u,v) , LowerBound(v,t) } Practice: Approximate Reach for fast preprocessing d(s,v) v d(v,t) s t
10
Reach(v) Previous examples: Colors did not illustrate visited edges, but vertices visited were very close
11
Shortcuts A directed path u→v can be shortcut by a new edge (u,v) Idea: Shortcuts reduce Reach(x) of vertices x along the shortcut path (s→t distances are unchanged) u x s v t shortcut
12
Reach(v) + Shortcuts
13
Reach(v) + Shortcuts + Landmarks
14
Experiments – Northwest US
15
Arc Flags Queries Prune edges e where Afe[i] = false and tCi
Partition vertices into k components C1,...,Ck. For all edges e = (u,v) store a bitvector Afe[1..k], where Afe[i] = true Exist shortest path u→t where e is first edge and tCi Queries Prune edges e where Afe[i] = false and tCi Preprocessing Expensive ! C4 C2 C3 Ci G C1 u v t e Ck
16
Practice: Combine recursively with Highway Hierarchies
Transit Node Routing recurse u v Idea All shortest paths s→t, where s and t are far away, must cross few possible transit nodes Identify few transit nodes in graph ~ n Compute All-Pair-Shortest-Path matrix for transit nodes For each vertex s find very few transit node distances (US ~10) Query(s,t) far away queries For all (u,v), transit nodes u and v for s and t respectively, find d(s,t)=d(s,u)+d(u,v)+d(v,t) using table lookup Locality filter = table over when to switch to other algorithm Practice: Combine recursively with Highway Hierarchies s t
17
Transit Node Routing Holger Bast, Stefan Funke, Domagoj Matijevic, Peter Sanders, and Dominik Schultes. In Transit to Constant Time Shortest-Path Queries in Road Networks. Proceedings of the Ninth Workshop on Algorithm Engineering and Experiments (ALENEX), 2007.
18
Highway Hierachies For each node find H closest nodes (Neighborhood)
Highway edge (u,v) exist some shortest path s→t containing (u,v), where sH and tH Contract & Recurse Hierarchy Queries Heuristics similar to Reach Bidrectional Dijkstra (skipping lower level edges)
19
Contraction Hierarchies
Order nodes v1,...,vn in increasing order of importance Repeatedly contract unimportant nodes by adding shortcuts required by shortest paths Many heuristics in construction phase Query: Bidirectional – only go to more important nodes
20
Hub Labelling For all nodes v store two lists Lf(v) and Lb(v), such that for all (s,t) pairs, the shortest path s→t contains a node u, where uLf(s)Lb(t) Trivially exist; hard part is to limit space usage u s t Lf(s) u d(s,u) Lb(t) u d(u,t) small small
21
Hub Labelling comparison
Contraction hierarchies Arc flags Transit node Table from page 239 Conclusion: Best query time for Hub labelling approach ~ time for 5 memory access (cache lines); space still reasonable HL = Hub Labelling (prefix = space optimized; global/local = optimized for global/local queries) CH = Contraction Hierarchies CHASE = Contraction Hierarchies + Arc flags HPML = High Performance Multi Level Routing TNR = Transit Node Routing (TNR+AF = Transit Node Routing + ArcFlags + Contraction Hierarchies) Hub labelling Ittai Abraham, Daniel Delling, Andrew V. Goldberg, Renato Fonseca F. Werneck. A Hub-Based Labeling Algorithm for Shortest Paths in Road Networks. Symposium on Experimental Algorithms (SEA), Lecture Notes in Computer Science, Volume 6630, 2011, pp
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.