Optimal Route Planning on Mobile Systems Adrian Batzill Structure - - PowerPoint PPT Presentation

optimal route planning on mobile systems
SMART_READER_LITE
LIVE PREVIEW

Optimal Route Planning on Mobile Systems Adrian Batzill Structure - - PowerPoint PPT Presentation

M A S T E R T H E S I S Optimal Route Planning on Mobile Systems Adrian Batzill Structure Route Planning Unidirectional, Bidirectional, Hierarchical External Memory Results Optimal Route Planning on Mobile Systems 2/22


slide-1
SLIDE 1

Optimal Route Planning on Mobile Systems

Adrian Batzill

M A S T E R T H E S I S

slide-2
SLIDE 2

Optimal Route Planning on Mobile Systems Adrian Batzill

2/22

Structure

  • Route Planning

– Unidirectional, Bidirectional, Hierarchical

  • External Memory
  • Results
slide-3
SLIDE 3

Optimal Route Planning on Mobile Systems Adrian Batzill

3/22

Route Planning

  • Road network as weighted, directed graph
  • Shortest path algorithms to find best route
  • Best?

– Shortest (distance) – Fastest (traveltime) – Most beautiful – Curvy – Fuel saving – …. – A mix of multiple criteria

slide-4
SLIDE 4

Optimal Route Planning on Mobile Systems Adrian Batzill

4/22

Dijkstra‘s Algorithm

  • Similar to breadth-first search
  • Incrementally construct all shortest paths from

source

  • Stop when target is visited
  • Priority queue with tentative distance
slide-5
SLIDE 5

Optimal Route Planning on Mobile Systems Adrian Batzill

5/22 s t 7 4 1 1 1 1 3

slide-6
SLIDE 6

6/22

slide-7
SLIDE 7

Optimal Route Planning on Mobile Systems Adrian Batzill

7/22

A* Algorithm

  • Very similar to Dijkstra
  • Goal-directed with heuristic
  • Optimal for monotonic (underestimating)

heuristics

  • Simple: Use straight line

– At least for a distance-weighting – For traveltime-weighting:

dist max−speed

slide-8
SLIDE 8

Optimal Route Planning on Mobile Systems Adrian Batzill

8/22

ALT (A*, Landmarks, Triangle inequality)

  • Heuristic for A*
  • Two-phase algorithm
  • Preprocessing on dev machine

– Pick set of landmarks – Precompute distances to/from all nodes to all landmarks

  • Use as heuristic during runtime

c(s,l)≤c(s,t)+c(t ,l) c(s,l)−c(t ,l)≤c(s ,t) c(l,t)≤c(s,t)+c(l, s) c(l,t)−c(l,s)≤c(s ,t)

slide-9
SLIDE 9

9/22

Query Times BW:

  • Dijkstra: 171 ms
  • A*-straight: 110 ms
  • A*-lm20: 17 ms
slide-10
SLIDE 10

Optimal Route Planning on Mobile Systems Adrian Batzill

10/22

Bidirectional search

  • Invert graph, search from target to source

→ search from both directions

  • Stop when searches meet
  • For Dijkstra: two circles with radius
  • A*: not as simple

c(s,t ) 2

slide-11
SLIDE 11

11/22

Query Times BW:

  • Dijkstra: 171 ms
  • A*-straight: 110 ms
  • A*-lm20: 17 ms

Bidirectional:

  • Dijkstra: 121 ms
  • A*-straight: 89 ms
  • A*-lm20: 10 ms
slide-12
SLIDE 12

Optimal Route Planning on Mobile Systems Adrian Batzill

12/22

Contraction Hierarchies

  • Node Contraction:

v 1 1 2 1 3

slide-13
SLIDE 13

Optimal Route Planning on Mobile Systems Adrian Batzill

13/22

Contraction Hierarchies

  • Precomputation:

– Assume nodes ordered by importance – Contract nodes in this order:

→Mark node contracted →Add required shortcuts

  • Bidirectional Dijkstra

– Only search upwards by importance – Unpack shortcuts to retrieve path

slide-14
SLIDE 14

14/22

Query Times BW:

  • CH: 0.5 ms
slide-15
SLIDE 15

Optimal Route Planning on Mobile Systems Adrian Batzill

15/22

External Memory

  • Secondary storage for working data

– Persistent – Cheap – Slow

slide-16
SLIDE 16

Optimal Route Planning on Mobile Systems Adrian Batzill

16/22

Memory mapped files

slide-17
SLIDE 17

Optimal Route Planning on Mobile Systems Adrian Batzill

17/22

Chunked/Managed mmap

  • Problem: 32 bit systems

– Not enough address space (Windows: max 2Gb)

→ Chunked mmap

  • Problem: management

– Managed memory mapped files – Custom C++ Allocator with placement-new – Custom pointer-type – Custom containers

→ auto graph = InMemoryAllocator<Graph>().allocate() → auto graph = MmapAllocator<Graph>().allocate()

slide-18
SLIDE 18

Optimal Route Planning on Mobile Systems Adrian Batzill

18/22

Graph Optimization

  • Sort nodes by

– Breadth-first search – Locality (Z-order/Geohash, Hilbert curve) – CH-level (importance)

  • Sort edges by

– Breadth-first search – Source node

slide-19
SLIDE 19

Optimal Route Planning on Mobile Systems Adrian Batzill

19/22

Performance

Baseline performance

slide-20
SLIDE 20

Optimal Route Planning on Mobile Systems Adrian Batzill

20/22

Performance

Best: Geohash/Sourcenode

slide-21
SLIDE 21

Optimal Route Planning on Mobile Systems Adrian Batzill

21/22

Performance

  • CH slower than landmarks

– Node order suboptimal – Sorting by CH-level:

→ 589 ms on lowend-hdd (vs. 4568 ms)

slide-22
SLIDE 22

Optimal Route Planning on Mobile Systems Adrian Batzill

22/22

Demo