Highway Hierarchies Hasten Exact Shortest Path...
Transcript of Highway Hierarchies Hasten Exact Shortest Path...
Schultes: Highway Hierarchies 1
Highway Hierarchies Hasten
Exact Shortest Path QueriesMaster’s Thesis
Dominik Schultes
Universität des Saarlandes
July 2005
Referees:
Prof. Dr. Kurt Mehlhorn, MPII, Saarbrücken
Prof. Dr. Peter Sanders (supervisor), Universität Karlsruhe
Schultes: Highway Hierarchies 2
How do I get there from here ?
Applications
� route planning systems
in the internet
(e.g. www.map24.de)
� car navigation systems
� · · ·
Schultes: Highway Hierarchies 3
Goals
?
� exact shortest (i.e. fastest) paths in large road networks
� fast queries
� fast preprocessing
� low space consumption
� scale-invariant,
i.e., optimised not only for long paths
Schultes: Highway Hierarchies 4
Related Work
method query prepr. space scale source
basic A∗ − ++ ++ + [Hart et al. 68]
bidirected − ++ ++ + [Pohl 71]
heuristic hwy hier. + ++ + + [commercial]
separator hierarchies o ? − − [Wagner et al. 02]
geometric containers ++ −− + + [Wagner et al. 03]
bitvectors ++ − o − [Lauther. . . 04]
reach based o o + + [Gutman 04]
landmarks + ++ − − [Goldberg et al. 04]
highway hierarchies ++ + + + here
Schultes: Highway Hierarchies 5
DIJKSTRA ’s Algorithm
classic method from graph theoryto computeshortest paths
tsDijkstra
not practicable for large road networks
(e.g. Western Europe: ≈ 18 000 000 nodes)
Schultes: Highway Hierarchies 6
Bidirectional Search
Improvement of DIJKSTRA ’s Algorithm
tsbidirectionalDijkstra
bisection of the search space possible,
but still too slow
Schultes: Highway Hierarchies 7
Naive Route Planning
1. Look for the next reasonable motorway
Schultes: Highway Hierarchies 8
Naive Route Planning
1. Look for the next reasonable motorway
2. Drive on motorways to a location close to the target
Schultes: Highway Hierarchies 9
Naive Route Planning
1. Look for the next reasonable motorway
2. Drive on motorways to a location close to the target
3. Search the target starting from the motorway exit
Schultes: Highway Hierarchies 10
Commercial Systems
1. Search from the source and target node (‘bidirectional’)
within a certain radius (e.g. 20 km),
consider all roads
2. Continue the search within a larger radius (e.g. 100 km),
consider only national roads and motorways
3. Continue the search,
consider only motorways
fast, but not exact
Schultes: Highway Hierarchies 11
Exact Highway Hierarchies
s t
ts
� complete search within a local area
� search in a (thinner) highway network
= minimal graph that preserves all shortest paths
� contract trees and lines
� iterate highway hierarchy
Schultes: Highway Hierarchies 12
A Meaning of “Local”
� Dijkstra’s Algorithm from node s
nodes are settled in a fixed order
Dijkstra rank rs(v) of node v
= rank w.r.t. this order
� For a parameter H ,
dH(s) := d(s,u), where rs(u) = H
� H-neighbourhood of s:
NH(s) := {v ∈V | d(s,v) ≤ dH(s)}
6
520
1
3
4
8
9
7
s
N 5(s)rs =
Schultes: Highway Hierarchies 13
Highway Network
NH(s) NH(t)
s t
Highway
Edge (u,v) belongs to highway network iff
� (u,v) is on the “canonical” shortest path
from a node s to a node t and
� v 6∈ NH(s) and
� u 6∈ NH(t)
Schultes: Highway Hierarchies 14
Construction
Example: Western Europe, bounding box around Karlsruhe
Schultes: Highway Hierarchies 15
Complete Road Network
Schultes: Highway Hierarchies 16
Highway Network
Schultes: Highway Hierarchies 17
Attached Treesgy
Schultes: Highway Hierarchies 18
2-Coregy
Schultes: Highway Hierarchies 19
Contract Linesgy
Schultes: Highway Hierarchies 20
Highway Hierarchy: Level 1 and Level 2
Schultes: Highway Hierarchies 21
Fast Construction
Phase 1:Construction of Partial Shortest Path Trees
For each node s0, perform an SSSP search from s0.
� A node’s state is either active or passive.
� s0 is active.
� A node inherits the state of its parent
in the shortest path tree.
� If the abort condition is fulfilled for a node p,
p’s state is set to passive.
The search is aborted when all queued nodes are passive.
active
passives0
Schultes: Highway Hierarchies 22
Fast Construction
Abort Condition:
NH(p)
NH(s1)
s0 s1 p
p is set to passive iff
|NH(s1)∩NH(p)| ≤ 1
Schultes: Highway Hierarchies 23
Fast Construction, Phase 2
Theorem:The tree roots and leaves encountered in Phase 1
witness all highway edges.
The highway edges can be found in time linear in the tree sizes.
shortest path tree
leaf of partialNH(t0)NH(s0)
t0s0
Highway
Schultes: Highway Hierarchies 24
Query
Bidirectional version of Dijkstra’s Algorithm
Restrictions:
� Do not leave the neighbourhood of the
entrance point to the current level.
Instead: switch to the next level.
� Do not enter a tree or a line.
level 0
level 1
N (v)
N (s)
entrance point to level 1
entrance point to level 0
entrance point to level 2
sv
Schultes: Highway Hierarchies 25
Query
Theorem:we still find the shortest path
Schultes: Highway Hierarchies 26
Query
Example: from Karlsruhe, Am Fasanengarten 5
to Palma de Mallorca
Schultes: Highway Hierarchies 27
Bounding Box: 20 km Level 0 Search Space
Schultes: Highway Hierarchies 28
Bounding Box: 20 km Level 0 Search Space
Schultes: Highway Hierarchies 29
Bounding Box: 20 km Level 1 Search Space
Schultes: Highway Hierarchies 30
Bounding Box: 20 km Level 1 Search Space
Schultes: Highway Hierarchies 31
Bounding Box: 20 km Level 2 Search Space
Schultes: Highway Hierarchies 32
Bounding Box: 20 km Level 2 Search Space
Schultes: Highway Hierarchies 33
Bounding Box: 20 km Level 3 Search Space
Schultes: Highway Hierarchies 34
Bounding Box: 20 km Level 3 Search Space
Schultes: Highway Hierarchies 35
Bounding Box: 80 km Level 3 Search Space
Schultes: Highway Hierarchies 36
Bounding Box: 80 km Level 4 Search Space
Schultes: Highway Hierarchies 37
Bounding Box: 80 km Level 4 Search Space
Schultes: Highway Hierarchies 38
Bounding Box: 80 km Level 5 Search Space
Schultes: Highway Hierarchies 39
Bounding Box: 80 km Level 5 Search Space
Schultes: Highway Hierarchies 40
Bounding Box: 400 km Level 5 Search Space
Schultes: Highway Hierarchies 41
Bounding Box: 400 km Level 6 Search Space
Schultes: Highway Hierarchies 42
Bounding Box: 400 km Level 6 Search Space
Schultes: Highway Hierarchies 43
Bounding Box: 400 km Level 7 Search Space
Schultes: Highway Hierarchies 44
Bounding Box: 400 km Level 7 Search Space
Schultes: Highway Hierarchies 45
Level 7 Search Space
Schultes: Highway Hierarchies 46
Level 8 Search Space
Schultes: Highway Hierarchies 47
Level 8 Search Space
Schultes: Highway Hierarchies 48
Level 10 Search Space
Schultes: Highway Hierarchies 49
Experiments
1 using a faster method that computes supersets of the highway networks
W. Europe (PTV) Our Inputs USA (Tiger Line)
18 029 721 #nodes 24 278 285
22 217 686 #edges 29 106 596
13 #road categories 4
10–130 speed range [km/h] 40–100
2:43 preproc time1 [h] 4:20
Schultes: Highway Hierarchies 50
Shrinking of the Highway Networks — Europe
107
106
105
104
1000
100
10
1 0 2 4 6 8 10 12 14 16
#edg
es
level
H = 75H = 125H = 175H = 300
Schultes: Highway Hierarchies 51
Queries – Time
Dijkstra Rank
Que
ry T
ime
[ms]
212 214 216 218 220 222 224
02
46
810
12
02
46
810
12
USAEurope
Schultes: Highway Hierarchies 52
Queries – Speedup
Dijkstra Rank
Spe
edup
(#s
ettle
d no
des)
212 214 216 218 220 222 224
25
2020
010
0050
00
210
100
500
2000USA
Europe
Schultes: Highway Hierarchies 53
Worst Case Costs Europe
#settled nodes
Fre
quen
cy (
* 1
000
000)
1612 2000 2500 3000 3500 4000 4500 5163
00.
51
1.5
22.
5
Schultes: Highway Hierarchies 54
Conclusion
� exact shortest (i.e. fastest) paths in large road networks
highway network e.g. Europe ≈ 18 000 000 nodes
preserves shortest paths
� fast queries
< 8 ms on average
� fast preprocessing
3 hours
� reasonable space consumption
1.8 GB, improvable
� scale-invariant, i.e., optimised not only for long paths
multilevel approach
Schultes: Highway Hierarchies 55
Future Work
� implement for directed graphs
� speed up preprocessing (e.g. parallelisation)
� speed up queries (e.g. combination with goal directed approaches
like landmarks, geometric containers, or bit vectors)
s t
search space
of a goal-directed
approach
Schultes: Highway Hierarchies 56
Future Work
� implement for directed graphs
� speed up preprocessing (e.g. parallelisation)
� speed up queries (e.g. combination with goal directed approaches
like landmarks, geometric containers, or bit vectors)
s t
search space
of our approach
Schultes: Highway Hierarchies 57
Future Work
� implement for directed graphs
� speed up preprocessing (e.g. parallelisation)
� speed up queries (e.g. combination with goal directed approaches
like landmarks, geometric containers, or bit vectors)
Objective:
intersection
of both
search spaces
Schultes: Highway Hierarchies 58
Future Work
� implement for directed graphs
� speed up preprocessing (e.g. parallelisation)
� speed up queries (e.g. combination with goal directed approaches
like landmarks, geometric containers, or bit vectors)
� fast local updates of the highway network
(e.g. due to traffic jams)
� external memory
� · · ·
Schultes: Highway Hierarchies 59
Summary of the ResultsUSA Europe Germany
input
#nodes 24 278 285 18 029 721 4 345 567
#edges 29 106 596 22 217 686 5 446 916
#degree 2 nodes 7 316 573 2 375 778 604 540
#road categories 4 13 13
paramsaverage speeds [km/h] 40–100 10–130 10–130
H 225 125 100
constr.CPU time [h] 4.3 2.7 0.5
#levels 7 11 11
query
avg. CPU time [ms] 7.04 7.38 5.30
#settled nodes 3 912 4 065 3 286
speedup (CPU time) 2 654 2 645 680
speedup (#settled nodes) 3 033 2 187 658
efficiency 112% 34% 13%
main memory usage [MB] 2 443 1 850 466 (346)