Está en la página 1de 30

Motivation

Our Contributions
Contraction Hierarchies: Faster and Simpler
Hierarchical Routing in Road Networks
R. Geisberger P. Sanders D. Schultes D. Delling
7th International Workshop on Experimental Algorithms
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 1
Motivation
Our Contributions
Route Planning
Previous Work
Motivation
exact shortest paths calculation in large road networks
minimize:
query time
preprocessing time
space consumption
+ simplicity
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 2
Motivation
Our Contributions
Route Planning
Previous Work
Mobile Navigation
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 3
Motivation
Our Contributions
Route Planning
Previous Work
Logistics
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 4
Motivation
Our Contributions
Route Planning
Previous Work
Highway-Node Routing (HNR)
[Sanders and Schultes, WEA 07]
general approach
+ adopt correctness proofs
- relies on another method to create hierarchies
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 5
Motivation
Our Contributions
Route Planning
Previous Work
Highway Hierarchies (HH)
[Sanders and Schultes, ESA 05, 06]
two construction steps that are iteratively applied
removal of low degree nodes
removal of edges that only appear on shortest paths close
to source or target
Contraction Hierarchies (CH) are a radical simplication
s
t
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 6
Motivation
Our Contributions
Route Planning
Previous Work
Speedup Techniques
Transit-Node Routing (TNR) [BFSS07]
fastest speedup technique known today
higher preprocessing time
s
t
Goal-Directed Routing
can be combined with hierarchical speedup techniques
[DDSSSW08]
both techniques benet from Contraction Hierarchies (CH)
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 7
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Contraction Hierarchies (CH)
2
1
2
2
6
1
4
3
5
3
3
5
8
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 8
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Main Idea
Contraction Hierarchies (CH)
contract only one node at a time
local and cache-efcient operation
in more detail:
order nodes by importance, V = {1, 2, . . . , n}
contract nodes in this order, node v is contracted by
foreach pair (u, v) and (v, w) of edges do
if u, v, w is a unique shortest path then
add shortcut (u, w) with weight w(u, v, w)
query relaxes only edges to more important nodes
valid due to shortcuts
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 9
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2 3 2 1 2
2 6 1 3 5 4
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2
3 2
1 2
2 6
1
4 3 5
5
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2
1 2
2
6
1
4 3 5
5
3 2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2
1 2
2
6
1
4
3
5
5
3 2
3
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2
2
2
6
1
4
3
5
3
2
3
8
1
5
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Example: Construction
2
1
2
2
6
1
4
3
5
3
3
5
8
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 10
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Construction
to identify necessary shortcuts
local searches from all nodes u with incoming edge (u, v)
ignore node v at search
add shortcut (u, w) iff found distance
d(u, w) > w(u, v) +w(v, w)
1
1
1
1
1
v
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 11
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Construction
to identify necessary shortcuts
local searches from all nodes u with incoming edge (u, v)
ignore node v at search
add shortcut (u, w) iff found distance
d(u, w) > w(u, v) +w(v, w)
2
2
1
1
1
1
1
v
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 11
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Node Order
use priority queue of nodes, node v is weighted with a linear
combination of:
edge difference #shortcuts #edges incident to v
uniformity e.g. #deleted neighbors
. . .
2
2
1
1
1
1
1
v
2 3 = 1
integrated construction and ordering:
1
remove node v on top of the priority queue
2
contract node v
3
update weights of remaining nodes
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 12
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Query
modied bidirectional Dijkstra algorithm
upward graph G

:= (V, E

) with E

:= {(u, v) E : u < v}
downward graph G

:= (V, E

) with E

:= {(u, v) E : u > v}
forward search in G

and backward search in G

2
1
2
2
6
1
4
3
5
3
3
5
8
s
t
n
o
d
e
o
r
d
e
r
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 13
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Query
modied bidirectional Dijkstra algorithm
upward graph G

:= (V, E

) with E

:= {(u, v) E : u < v}
downward graph G

:= (V, E

) with E

:= {(u, v) E : u > v}
forward search in G

and backward search in G

2
1
2
2
6
1
4
3
5
3
3
5
8
s
t
n
o
d
e
o
r
d
e
r
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 13
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Query
modied bidirectional Dijkstra algorithm
upward graph G

:= (V, E

) with E

:= {(u, v) E : u < v}
downward graph G

:= (V, E

) with E

:= {(u, v) E : u > v}
forward search in G

and backward search in G

2
1
2
2
6
1
4
3
5
3
3
5
8
s
t
n
o
d
e
o
r
d
e
r
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 13
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Query
modied bidirectional Dijkstra algorithm
upward graph G

:= (V, E

) with E

:= {(u, v) E : u < v}
downward graph G

:= (V, E

) with E

:= {(u, v) E : u > v}
forward search in G

and backward search in G

2
1
2
2
6
1
4
3
5
3
3
5
8
s
t
n
o
d
e
o
r
d
e
r
2
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 13
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Outputting Paths
for a shortcut (u, w) of a path u, v, w,
store middle node v with the edge
expand path by recursively replacing a
shortcut with its originating edges
2
3
2
5
1
2
3
8
n
o
d
e
o
r
d
e
r
2
5
s
t
6
1
4
3
s t
u
n
p
a
c
k
p
a
t
h
2 8
2
2
2
5 3
3
3
2
2 1 2
3
2 6 1 3 5 4
2 6 1 5 4
2 6 5 4
2 6 5
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 14
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Stall-on-Demand
v can be stalled by u (if d(u) +w(u, v) < d(v))
stalling can propagate to adjacent nodes
search is not continued from stalled nodes
3
6
1
s
n
o
d
e
o
r
d
e
r
v
2
u
w
7
does not invalidate correctness (only suboptimal paths are
stalled)
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 15
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Experiments
environment
AMD Opteron Processor 270 at 2.0 GHz
8 GB main memory
GNU C++ compiler 4.2.1
test instance
road network of Western Europe (PTV)
18 029721 nodes
42 199587 directed edges
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 16
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Performance
E ED EDL EDSL EDS5 EDS1235 EVSQL EVSWQL
economical aggressive
5
0
0
1
0
0
0
2
0
0
0
4
0
0
0
8
0
0
0
1
6
0
0
0
1
0
0
1
5
0
2
0
0
3
0
0
4
0
0
6
0
0
n
o
d
e

o
r
d
e
r
i
n
g

[
s
]
q
u
e
r
y

[

s
]
method
E
D
L
S
i
V
Q
W
edge difference
deleted neighbors
limit search space on weight calculation
search space size
(digits) hop limits for testing shortcuts
Voronoi region size
upper bound on edges in search path
relative betweenness
HNR: 594 s / 802 s
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 17
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Worst Case Costs
1
1
0
0
1
0

1
2
1
0

1
0
1
0

8
1
0

6
1
0

4
1
0

2
0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200
settled nodes
%

o
f

s
e
a
r
c
h
e
s
CH aggr. (max. 884)
CH eco. (max. 1012)
HNR (max. 2148)
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 18
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Additional Results
space overhead
HNR 9.5 B/node
CH economical 0.6 B/node
CH aggressive -2.7 B/node
Many-to-Many Shortest Paths [KSSSW07]
10 000 10 000 table 23.2 10.2 s
Transit Node Routing [BFSS07]
query time 4.3 3.4 s
s
t
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 19
Motivation
Our Contributions
Contraction Hierarchies
Experiments
Graph Representation
search graph
usually store edge (v, w) in the adjacency array of v and w
for the search, we need to store it only at node min{v, w}
possibly negative space overhead
v
w
u
shortcut
stored at u
stored at w
n
o
d
e
o
r
d
e
r
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 20
Motivation
Our Contributions
Summary
Contraction Hierarchies are simple
less space overhead
5 faster queries than the best previous hierarchical
Dijkstra-based speedup techniques
new foundation for other routing algorithms like
Transit-Node Routing
Future work
test other priority terms
time-dependent routing
dynamization
f (x) =
R. Geisberger, P. Sanders, D. Schultes, D. Delling Contraction Hierarchies 21

También podría gustarte