2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 11: Route Planning
Vehicle navigation systems Main tasks: positioning : locating the vehicle using GPS and/or dead reckoning with distance and heading sensors routing : determining a good route from a source to a destination guidance : providing visual and audio feedback on the route
Positioning GPS: works well, except in “urban canyons” Urban canyons can give gross errors in position due to reflections from buildings Urban canyons can give loss of signal Especially problematic when driving out of parking garages
Positioning Dead reckoning: determine position from last known position using distance and heading sensors (relative position) Use map matching: the shape of the route taken and where it matches on the map, to correct dead reckoning
Guiding Top view, perspective view, overview Schematic information on exit lanes Spoken directions largely an Human-Computer-Interaction issue Algorithms for automated map construction
Routing Routing = “shortest” path computation Dijkstra’s algorithm solves the problem, so we can all go home now (after O(m + n log n) time for routing)? Can we do better?
Routing – Basic examples Based on Dijkstra’s shortest path algorithm Many improvements to deal with huge networks Improvements use preprocessing
Routing – Basic examples Based on Dijkstra’s shortest path algorithm Many improvements to deal with huge networks Improvements use preprocessing
Routing – Basic examples Based on Dijkstra’s shortest path algorithm Many improvements to deal with huge networks Improvements use preprocessing Bidirectional search (from Bayreuth and from Erlangen)
Routing – Basic examples Based on Dijkstra’s shortest path algorithm Many improvements to deal with huge networks Improvements use preprocessing Bidirectional search (from Bayreuth and from Erlangen)
Routing – Overview of techniques Goal-directed A*, ALT: A* with landmarks and triangle inequality Arc Flags Separator-based Hierarchical Highway hierarchies Contraction hierarchies Bounded hop Transit node routing For public transit networks: time-expanded vs time-dependent
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 2 10 6 9 4 2 3 9 7 6 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges ∞ 1 ∞ 2 10 6 ∞ 9 4 2 3 0 9 7 6 5 ∞ ∞ 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges ∞ 1 ∞ 2 10 6 ∞ 9 4 2 3 0 9 7 6 5 ∞ ∞ 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges ∞ 1 10 2 10 6 ∞ 9 4 2 3 0 9 7 6 5 ∞ 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges ∞ 1 10 2 10 6 ∞ 9 4 2 3 0 9 7 6 5 ∞ 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges ∞ 1 10 2 10 6 ∞ 9 4 2 3 0 9 7 6 5 ∞ 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 14 8 2 10 6 9 4 14 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 14 8 2 10 6 9 4 14 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 14 8 2 10 6 9 4 14 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 13 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 13 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 13 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges shortest path tree 1 9 8 2 10 6 9 4 13 2 3 0 9 7 6 5 7 5 2
Recap: Dijkstra’s algorithm Dijkstra’s algorithm takes O( m + n log n ) time for a graph with n nodes and m edges Every node is handled only once Its outgoing edges are considered only then Considering an edge may lower the cost of its destination node In theory: nodes are stored by distance in a Fibonacci heap (it allows for a very efficient decrease-value operation) In practice: use binary heap or generalization e.g. 4-heap: O((m+n) log n) time Road networks have m = O( n ), so it takes O( n log n ) time
A* algorithm A* is a simple variant of Dijkstra's algorithm Additionally: for each node u, a value h[u] that estimates dist(u, t), where t is the target h is often called the heuristic function of A* Difference to Dijkstra: value of a node u in the priority queue is not dist[u] but dist[u] + h[u] therefore, if h[u] = 0 for all u, then A* = Dijkstra Works if h is admissable and monotone ... later slide Best results when h[u] = dist(u, t) for all u then A* settles only the nodes on a shortest path
A* Example 2 2 2 10 1 10 1 1
A* Example h=1 h=3 2 2 h=0 2 h=5 h=7 10 1 10 h=6 1 1 h=7
A* Example h=1 h=3 2 2 h=0 2 h=5 h=7 10 0 +5 1 10 h=6 1 1 h=7
A* Example h=1 h=3 2 2 +3 2 h=0 2 h=5 h=7 10 0 1 10 h=6 1 1 +6 1 h=7
A* Example h=1 h=3 2 2 2 h=0 2 h=5 h=7 10 0 1 10 h=6 1 1 +6 1 h=7
A* Example h=1 h=3 2 4 +1 2 2 h=0 2 h=5 h=7 10 0 1 10 h=6 1 1 +6 1 h=7
A* Example h=1 h=3 2 4 2 2 h=0 2 h=5 h=7 10 0 1 10 h=6 1 1 +6 1 h=7
A* Example h=1 h=3 2 4 2 2 h=0 2 h=5 h=10 6 +0 10 0 1 10 h=9 1 1 +6 1 h=10
A* Example h=1 h=3 2 4 2 2 h=0 2 h=5 h=7 6 10 0 1 10 h=6 1 1 +6 1 h=7
A* algorithm — Conditions on h The heuristic h must be admissable For each node u it must hold: h(u) ≤ dist(u, t) Informally: the heuristic must never overestimate The heuristic h must be monotone For each arc (u,v) it must hold: h(u) ≤ cost(u,v) + h(v) Informally: heuristic must obey the triangle inequality How do we compute h?
A* algorithm — Two heuristics Straight-line distance (also: as-the-crow-flies distance) Take h(u) = eucl(u, t) / v max eucl(u,t) is the Euclidean distance from u to t v max is the maximum speed Admissible and monotone because of triangle inequality Landmark heuristic Informally: for every node u, precompute distances to a set of pre-selected nodes, called landmarks How to obtain a heuristic function from that ... next slides
Recommend
More recommend