117
INSTITUT F ¨ UR THEORETISCHE INFORMATIK · ALGORITHMIK · PROF.DR.DOROTHEA WAGNER Algorithmen f ¨ ur Routenplanung 8. Sitzung, Sommersemester 2014 Ben Strasser | 12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg and National Laboratory of the Helmholtz Association www.kit.edu

Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

INSTITUT FUR THEORETISCHE INFORMATIK · ALGORITHMIK · PROF. DR. DOROTHEA WAGNER

Algorithmen fur Routenplanung8. Sitzung, Sommersemester 2014

Ben Strasser | 12. Mai 2014

KIT – University of the State of Baden-Wuerttemberg andNational Laboratory of the Helmholtz Association

www.kit.edu

Page 2: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

A Bit of HistoryContraction Hierarchies (CH) are a speedup technique forshortest paths in graphs.

”First” introduced by [GSSD08].Exploits the edge weights.

Generalized to Weak CHs by [BCRW13].Basis for edge weight independent CH.Pure theoretic work.Connection to speed up technique for GaussianElimination [Geo73] discovered.

Customizable CH (CCH) by [DSW14].Continuation of [BCRW13].

For didactic reasons in this course:First CCH / weakCHThen metric-dependent CH

Design

Expe

ri me

nt

I mplem e tn

Ana

lyze

Algorithmics

Ben Strasser – Algorithmen fur Routenplanung

Slide 2 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 3: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

A Bit of HistoryContraction Hierarchies (CH) are a speedup technique forshortest paths in graphs.

”First” introduced by [GSSD08].Exploits the edge weights.

Generalized to Weak CHs by [BCRW13].Basis for edge weight independent CH.Pure theoretic work.Connection to speed up technique for GaussianElimination [Geo73] discovered.

Customizable CH (CCH) by [DSW14].Continuation of [BCRW13].

For didactic reasons in this course:First CCH / weakCHThen metric-dependent CH

Design

Expe

ri me

nt

I mplem e tn

Ana

lyze

Algorithmics

Ben Strasser – Algorithmen fur Routenplanung

Slide 2 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 4: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex-Contraction

V

Contraction of vertex v : Replace v with a full clique.

Ben Strasser – Algorithmen fur Routenplanung

Slide 3 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 5: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex-Contraction

Contraction of vertex v : Replace v with a full clique.

Ben Strasser – Algorithmen fur Routenplanung

Slide 3 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 6: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

cd e

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 7: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

d e

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 8: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

e

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 9: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

b

e

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 10: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

b

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 11: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

Order π: c, d, a, e, b

Contract vertices along the order π.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 12: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

cd e

Order π: c, d, a, e, b c

a

d

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 13: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

d e

Order π: c, d, a, e, b c

a

d

e

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 14: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Ordera

b

e

Order π: c, d, a, e, b c

a

d

e

b

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 15: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

b

e

Order π: c, d, a, e, b c

a

d

e

b

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 16: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

b

Order π: c, d, a, e, b c

a

d

e

b

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 17: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

Order π: c, d, a, e, b c

a

d

e

b

Build the search graph.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 18: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

Order π: c, d, a, e, b c

a

d

e

b

Definitions:

The search space of a vertex v is the subgraph of the searchgraph induced by the vertices reachable from v .The remaining graph is called the core.π−1 is called rank.Inserted arcs are called shortcuts.

Ben Strasser – Algorithmen fur Routenplanung

Slide 4 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 19: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

a b c d e fVertex-O

rder

1 2 2 3 1For each source-target-pair there is an up-down-path.

Ben Strasser – Algorithmen fur Routenplanung

Slide 5 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 20: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

Vertex-O

rder

ab

c

de

f

1 22

31

For each source-target-pair there is an up-down-path.

Ben Strasser – Algorithmen fur Routenplanung

Slide 5 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 21: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Contraction-Order

Vertex-O

rder

ab

c

de

f

1

4 31

22

For each source-target-pair there is an up-down-path.

Ben Strasser – Algorithmen fur Routenplanung

Slide 5 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 22: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Dijkstra-Query

Question:How to efficiently find an st-up-down-path?

Solution 1:Run a bidirectional Dijkstra in the search-graph from s and t .

Stop Criterion:The search in one direction can be stopped if its radius is larger thanthe current shortest path.Warning: This is weaker than the general stopping criterion, becauseit is possible that t is in the search space of s and therefore the wholeup-down path is found by the forward search from s.

Ben Strasser – Algorithmen fur Routenplanung

Slide 6 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 23: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Stall-on-Demand

Observation:Some tentative distances are larger than needed.

33

31 11 1

1 1 122

2

Optimization:Denote by d(v) the tentative distances and by x the vertex removedfrom the queue. Do not relax the outgoing arcs if an arc (x , y) existsfor which

∃(x , y) ∈ search graph : d(x) > w(x , y) + d(y)

holds.

Ben Strasser – Algorithmen fur Routenplanung

Slide 7 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 24: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Stall-on-Demand

Observation:Some tentative distances are larger than needed.

33

31 11 1

1 1 122

2

0

Optimization:Denote by d(v) the tentative distances and by x the vertex removedfrom the queue. Do not relax the outgoing arcs if an arc (x , y) existsfor which

∃(x , y) ∈ search graph : d(x) > w(x , y) + d(y)

holds.

Ben Strasser – Algorithmen fur Routenplanung

Slide 7 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 25: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Stall-on-Demand

Observation:Some tentative distances are larger than needed.

33

31 11 1

1 1 122

2

03

6

31

1

Optimization:Denote by d(v) the tentative distances and by x the vertex removedfrom the queue. Do not relax the outgoing arcs if an arc (x , y) existsfor which

∃(x , y) ∈ search graph : d(x) > w(x , y) + d(y)

holds.

Ben Strasser – Algorithmen fur Routenplanung

Slide 7 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 26: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Stall-on-Demand

Observation:Some tentative distances are larger than needed.

33

31 11 1

1 1 122

2

03

6

31

1

Optimization:Denote by d(v) the tentative distances and by x the vertex removedfrom the queue. Do not relax the outgoing arcs if an arc (x , y) existsfor which

∃(x , y) ∈ search graph : d(x) > w(x , y) + d(y)

holds.

Ben Strasser – Algorithmen fur Routenplanung

Slide 7 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 27: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Stall-on-Demand

Observation:Some tentative distances are larger than needed.

33

31 11 1

1 1 122

2

0

31

1

3

Optimization:Denote by d(v) the tentative distances and by x the vertex removedfrom the queue. Do not relax the outgoing arcs if an arc (x , y) existsfor which

∃(x , y) ∈ search graph : d(x) > w(x , y) + d(y)

holds.

Ben Strasser – Algorithmen fur Routenplanung

Slide 7 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 28: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-TreeThe elimination-tree is defined as following:

parent(x) = arg min(x, y) is in search graph

(π−1(y)

)Ancestors of x = vertices reachable from x in the search graph.

Proof by contraction:

Ben Strasser – Algorithmen fur Routenplanung

Slide 8 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 29: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-TreeThe elimination-tree is defined as following:

parent(x) = arg min(x, y) is in search graph

(π−1(y)

)Ancestors of x = vertices reachable from x in the search graph.

Proof by contraction:

xThe search space of x .

Ben Strasser – Algorithmen fur Routenplanung

Slide 8 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 30: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-TreeThe elimination-tree is defined as following:

parent(x) = arg min(x, y) is in search graph

(π−1(y)

)Ancestors of x = vertices reachable from x in the search graph.

Proof by contraction:

x

y

z

Let parent(x) = y .Assume that z is in the search space of x but not of y .

Ben Strasser – Algorithmen fur Routenplanung

Slide 8 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 31: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-TreeThe elimination-tree is defined as following:

parent(x) = arg min(x, y) is in search graph

(π−1(y)

)Ancestors of x = vertices reachable from x in the search graph.

Proof by contraction:

x

y

z

By construction this arc must exist.

Ben Strasser – Algorithmen fur Routenplanung

Slide 8 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 32: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-TreeThe elimination-tree is defined as following:

parent(x) = arg min(x, y) is in search graph

(π−1(y)

)Ancestors of x = vertices reachable from x in the search graph.

Proof by contraction:

x

y

z

z must be in the search space of y .

Ben Strasser – Algorithmen fur Routenplanung

Slide 8 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 33: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Elimination-Tree-Query

While not at root:If s comes before t in order:

Relax all outgoing arcs of s in the search graph.s ← parent(s)

Else:Relax all outgoing arcs of t in the search graph.t ← parent(t)

Bonus:No priority queue.Works with negative weights.

Ben Strasser – Algorithmen fur Routenplanung

Slide 9 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 34: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex Separators

Vertex SeparatorA vertex separator S of a graph G = (V ,E) is a vertex subset suchthat S’s removal divides G into two parts G1 = (V1,E1) andG2 = (V2,E2).

Balanced Vertex SeparatorFor a balanced vertex separator we require |V1| ≤ 2

3 n and |V2| ≤ 23 n.

Recursive Balanced Vertex SeparatorA graph G has recursive balanced vertex separators of size O(|V |α) ifG has a balanced vertex separator with at most O(|V |α) vertices andG1 and G2 have recursive balanced vertex separators of sizesO(|V1|α) and O(|V2|α).

Ben Strasser – Algorithmen fur Routenplanung

Slide 10 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 35: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex Separators

Example

All planar graphs have O(n12 ) recursive balanced vertex separators.

Proof: See planar separator theorem in lecture on planar graphs.

Ben Strasser – Algorithmen fur Routenplanung

Slide 11 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 36: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex Separators

●●

●●

●●

●●●●●●●●●

●●

●●

●●●

●●

●●●●●

●●●●

●●●●●●●●●●●●●

●●●●

●●●

●●●

●●●●●

●●●●

●●●●●●●

●●●●●●●●

●●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●

●●

●●●

●●●●

●●●●●

●●

●●●●●●●●●

●●●●

●●

●●

●●

●●●

●●●

●●●●●●●

●●●

●●

●●●●

●●●●●●

●●●

●●

●●

●●●

●●

●●

●●●

●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●●

●●●●

●●●

●●●

●●

●●

●●●

●●

●●●

●●●●

●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●●●●

●●

●●●●●●●●●●●●●

●●●

●●

●●

●●●

●●

●●

●●●●●

●●●●

●●●●●

●●●●

●●●●●●

●●●

●●●●

●●

●●

●●●

●●●

●●

●●

●●●●●●

●●

●●●

●●

●●●

●●

●●

●●

●●●●●●

●●

●●●

●●

●●●●

●●

●●

●●●●●●

●●

●●

●●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●

●●

●●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●

●●

●●●●

●●●

●●●●●

●●●●●

●●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●●

●●

●●●

●●●●●●

●●●●

●●●●

●●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●

●●

●●●

●●

●●●●●

●●

●●●

●●

●●●

●●

●●●●●

●●

●●●●

●●

●●●●●●

●●

●●●●●

●●●●

●●

●●

●●●●●●

●●●

●●

●●

●●●●●

●●●●●●●●●●

●●

●●

●●●●●●●●●

●●

●●●●●

●●

●●●●●●●

●●

●●

●●

●●●●●

●●

●●●

●●●●

●●

●●

●●●

●●●●

●●

●●●●

●●

●●

●●

●●

●●●●●●●

●●●●

●●●●●●●●●

●●●

●●

●●●●

●●

●●

●●●

●●

●●

●●●●

●●●●●

●●●

●●

●●●●●●●●

●●

●●●

●●

●●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●●●●

●●

●●●●

●●●

●●

●●●

●●

●●●

●●●●●

●●●●

●●

●●

●●

●●●●●

●●

●●●

●●

●●

●●●●●●●●●●

●●●●●●●●●●●●●●

●●●●●●●

●●

●●

●●●●

●●●

●●

●●

●●●

●●●●

●●

●●

●●●●

●●

●●

●●●●

●●

●●●●

●●●

●●●●●

●●●●

●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●●●●●●●

●●●

●●

●●

●●

●●●●

●●

●●

●●

●●●

●●●

●●●●●

●●●

●●●

●●●●

●●●

●●

●●

●●●●

●●

●●

●●●●●

●●●●

●●

●●●●

●●●

●●●

●●

●●

●●

●●●●

●●●●

●●

●●●

●●

●●●●

●●●

●●

●●●●

●●●

●●●●

●●●●●

●●●●●

●●●●●●●

●●●

●●●●

●●

●●●

●●

●●

●●

●●●

●●

●●●●

●●●●●●

●●●

●●●●●

●●

●●●●

●●

●●

●●●

●●●

●●●

●●●

●●

●●●●●●●●●●●●

●●●

●●

●●

0

10

20

30

40

50

0 25,000 50,000 75,000 100,000 125,000Vertices in graph

Ver

tices

in s

epar

ator

Separators for road graph around Karlsruhe.The blue function is y = 3

√x .

Assumption: road graphs have O( 3√

x) recursive balancedseparators.

Ben Strasser – Algorithmen fur Routenplanung

Slide 12 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 37: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Vertex Separators

●●

●●

●●

●●●●●●●●●

●●

●●

●●●

●●

●●●●●

●●●●

●●●●●●●●●●●●●

●●●●

●●●

●●●

●●●●●

●●●●

●●●●●●●

●●●●●●●●

●●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●

●●

●●●

●●●●

●●●●●

●●

●●●●●●●●●

●●●●

●●

●●

●●

●●●

●●●

●●●●●●●

●●●

●●

●●●●

●●●●●●

●●●

●●

●●

●●●

●●

●●

●●●

●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●●

●●●●

●●●

●●●

●●

●●

●●●

●●

●●●

●●●●

●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●●●●

●●

●●●●●●●●●●●●●

●●●

●●

●●

●●●

●●

●●

●●●●●

●●●●

●●●●●

●●●●

●●●●●●

●●●

●●●●

●●

●●

●●●

●●●

●●

●●

●●●●●●

●●

●●●

●●

●●●

●●

●●

●●

●●●●●●

●●

●●●

●●

●●●●

●●

●●

●●●●●●

●●

●●

●●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●

●●

●●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●

●●

●●●●

●●●

●●●●●

●●●●●

●●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●●

●●

●●●

●●●●●●

●●●●

●●●●

●●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●●●

●●

●●

●●●

●●

●●●●●

●●

●●●

●●

●●●

●●

●●●●●

●●

●●●●

●●

●●●●●●

●●

●●●●●

●●●●

●●

●●

●●●●●●

●●●

●●

●●

●●●●●

●●●●●●●●●●

●●

●●

●●●●●●●●●

●●

●●●●●

●●

●●●●●●●

●●

●●

●●

●●●●●

●●

●●●

●●●●

●●

●●

●●●

●●●●

●●

●●●●

●●

●●

●●

●●

●●●●●●●

●●●●

●●●●●●●●●

●●●

●●

●●●●

●●

●●

●●●

●●

●●

●●●●

●●●●●

●●●

●●

●●●●●●●●

●●

●●●

●●

●●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●●●●

●●

●●●●

●●●

●●

●●●

●●

●●●

●●●●●

●●●●

●●

●●

●●

●●●●●

●●

●●●

●●

●●

●●●●●●●●●●

●●●●●●●●●●●●●●

●●●●●●●

●●

●●

●●●●

●●●

●●

●●

●●●

●●●●

●●

●●

●●●●

●●

●●

●●●●

●●

●●●●

●●●

●●●●●

●●●●

●●

●●

●●●●●

●●

●●

●●●

●●

●●

●●●●●●●●●●●●

●●●

●●

●●

●●

●●●●

●●

●●

●●

●●●

●●●

●●●●●

●●●

●●●

●●●●

●●●

●●

●●

●●●●

●●

●●

●●●●●

●●●●

●●

●●●●

●●●

●●●

●●

●●

●●

●●●●

●●●●

●●

●●●

●●

●●●●

●●●

●●

●●●●

●●●

●●●●

●●●●●

●●●●●

●●●●●●●

●●●

●●●●

●●

●●●

●●

●●

●●

●●●

●●

●●●●

●●●●●●

●●●

●●●●●

●●

●●●●

●●

●●

●●●

●●●

●●●

●●●

●●

●●●●●●●●●●●●

●●●

●●

●●

0

10

20

30

40

50

0 25,000 50,000 75,000 100,000 125,000Vertices in graph

Ver

tices

in s

epar

ator

Separators for road graph around Karlsruhe.The blue function is y = 3

√x .

Assumption: road graphs have O( 3√

x) recursive balancedseparators.

Ben Strasser – Algorithmen fur Routenplanung

Slide 12 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 38: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 39: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

Find a small balanced vertex separator.

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 40: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

The last vertices in the order are the separator.

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 41: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

Remove the separator.

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 42: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

Recurse on both parts.

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 43: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

Order:

The contraction order.

Ben Strasser – Algorithmen fur Routenplanung

Slide 13 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 44: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Search Space Sizes

At each dissection level the search space contains at most oneseparator. The number of vertices in the search space is thereforebounded by:

∞∑i=0

O

3

√(23

)i

n

= O

3√

n ·∞∑i=0

(3

√23

)i

= O(

3√

n)

Ben Strasser – Algorithmen fur Routenplanung

Slide 14 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 45: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Nested Dissection

ApproximationLet G be a n-vertex graph with

a minimum balanced separator with Θ(nα) verticesrecursive minimum balanced separators with O(nα) vertices

then a ND-order approximates the average and maximum searchspace in terms of vertices and arcs within a constant factor.

Key ideas:The separators form full cliques in the CH.The top level separator is the biggest and dominates all otherseparators.

Detailed in Section 4 of [DSW14].

Ben Strasser – Algorithmen fur Routenplanung

Slide 15 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 46: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search Graph

Option 1:Use a dynamic adjacency array (i.e. one where arcs can be inserted).

Works, but one can do better.

Ben Strasser – Algorithmen fur Routenplanung

Slide 16 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 47: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search Graph

Option 1:Use a dynamic adjacency array (i.e. one where arcs can be inserted).

Works, but one can do better.

Ben Strasser – Algorithmen fur Routenplanung

Slide 16 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 48: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search GraphOption 2: Maintain an independent set of virtually contractedvertices. The neighborhood of v in the core is the union of v ’s actualneighborhood and the neighborhoods of all virtually contractedneighbors of v .

When two virtual vertices become neighbors, then remove one andrewire the edges. Advantage: Faster than Option 1 and linearmemory usage as no edges are inserted.

Ben Strasser – Algorithmen fur Routenplanung

Slide 17 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 49: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search GraphOption 2: Maintain an independent set of virtually contractedvertices. The neighborhood of v in the core is the union of v ’s actualneighborhood and the neighborhoods of all virtually contractedneighbors of v .

When two virtual vertices become neighbors, then remove one andrewire the edges. Advantage: Faster than Option 1 and linearmemory usage as no edges are inserted.

Ben Strasser – Algorithmen fur Routenplanung

Slide 17 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 50: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search GraphOption 2: Maintain an independent set of virtually contractedvertices. The neighborhood of v in the core is the union of v ’s actualneighborhood and the neighborhoods of all virtually contractedneighbors of v .

When two virtual vertices become neighbors, then remove one andrewire the edges. Advantage: Faster than Option 1 and linearmemory usage as no edges are inserted.

Ben Strasser – Algorithmen fur Routenplanung

Slide 17 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 51: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search GraphOption 2: Maintain an independent set of virtually contractedvertices. The neighborhood of v in the core is the union of v ’s actualneighborhood and the neighborhoods of all virtually contractedneighbors of v .

When two virtual vertices become neighbors, then remove one andrewire the edges. Advantage: Faster than Option 1 and linearmemory usage as no edges are inserted.

Ben Strasser – Algorithmen fur Routenplanung

Slide 17 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 52: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Constructing the Search GraphOption 2: Maintain an independent set of virtually contractedvertices. The neighborhood of v in the core is the union of v ’s actualneighborhood and the neighborhoods of all virtually contractedneighbors of v .

When two virtual vertices become neighbors, then remove one andrewire the edges. Advantage: Faster than Option 1 and linearmemory usage as no edges are inserted.

Ben Strasser – Algorithmen fur Routenplanung

Slide 17 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 53: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Triangles

TriangleA triangle (x , y , z) is a subgraph such that edges {x , y}, {x , z} and{y , z} exist.

Lower TriangleA lower triangle (x , y , z) of the edge {x , y} is one where z has a ranksmaller than x and y .

Intermediate & Upper TrianglesSimilar but z ’s rank is between those of x and y or the largest.

Ben Strasser – Algorithmen fur Routenplanung

Slide 18 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 54: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Some arc in the CH.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 55: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

44

For every lower triangle the triangle inequality must hold.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 56: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

44

8

For every lower triangle the triangle inequality must hold.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 57: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

8

For every arc enumerate all lower triangles.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 58: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Iterate over all arcs increasing by level.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 59: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Iterate over all arcs increasing by level.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 60: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Iterate over all arcs increasing by level.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 61: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Iterate over all arcs increasing by level.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 62: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

Iterate over all arcs increasing by level.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 63: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Normal Customization

CH-query now works.

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 64: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Perfect Customization

8

For every arc enumerate all intermediate & upper triangles.Iterate over all arcs decreasing by level.

If there is an arc, its weight is the shortest path.(A perfect customization is not needed for correct queries).

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 65: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Perfect Customization

83

3

For every arc enumerate all intermediate & upper triangles.Iterate over all arcs decreasing by level.

If there is an arc, its weight is the shortest path.(A perfect customization is not needed for correct queries).

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 66: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Customization

Perfect Customization

3

3

6

For every arc enumerate all intermediate & upper triangles.Iterate over all arcs decreasing by level.

If there is an arc, its weight is the shortest path.(A perfect customization is not needed for correct queries).

Ben Strasser – Algorithmen fur Routenplanung

Slide 19 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 67: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Enumerating all Lower Triangles

Option 1: Store for each arc a lower triangle list.Problem: Needs a lot of memory.

Option 2:Store the reverse search graph.Order the outgoing arcs by head node ID.To enumerate all lower triangles xyz of the arc xy do amerge-sort-like scan over the outgoing arcs of x and y . If thearcs xz and yz exist the a new triangle has been found.

Problem: Somewhat slower than Option 1.

Ben Strasser – Algorithmen fur Routenplanung

Slide 20 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 68: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Path Unpacking

Basic Algorithm:Extract an up-down path.Iteratively replace all shortcuts with the original arcs.

Question: Which are the two original arcs of a shortcut?

Option 1: Store for each shortcut the pair of original arcs.Problem: Depends on the metric.Option 2: Enumerate for each arc the lower triangles, and pickone such that the weights match.

Ben Strasser – Algorithmen fur Routenplanung

Slide 21 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 69: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

One-Way Streets

To support one-way streets:Store two metrics.Use one in the forward search and the other one in the backwardsearch.One-way streets have weight∞.The search graph is stored only once. Each arc has 2 weights.

Ben Strasser – Algorithmen fur Routenplanung

Slide 22 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 70: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Goal: Upper triangle matrix using Gauß elinimation1 −1 1 1 11 1 0 0 −21 0 −1 −1 0−1 0 −1 −2 0

1 −1 0 0 1

Notice: 4 zeros in upper triangle part.

Ben Strasser – Algorithmen fur Routenplanung

Slide 23 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 71: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Goal: Upper triangle matrix using Gauß elinimation1 −1 1 1 10 2 −1 −1 −30 1 −2 −2 −10 −1 0 −1 10 0 −1 −1 0

Ben Strasser – Algorithmen fur Routenplanung

Slide 23 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 72: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Goal: Upper triangle matrix using Gauß elinimation1 −1 1 1 10 2 −1 −1 −30 0 − 3

2 − 32

12

0 0 − 12 − 3

2 − 12

0 0 −1 −1 0

Ben Strasser – Algorithmen fur Routenplanung

Slide 23 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 73: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Goal: Upper triangle matrix using Gauß elinimation1 −1 1 1 10 2 −1 −1 −30 0 − 3

2 − 32

12

0 0 0 −1 − 23

0 0 0 0 − 13

Notice: No zero left in upper triangle part. → :(

Ben Strasser – Algorithmen fur Routenplanung

Slide 23 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 74: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Idea: Reorder first and last column and row.1 −1 1 1 11 1 0 0 −21 0 −1 −1 0−1 0 −1 −2 0

1 −1 0 0 1

Notice: All 4 zeros conserved→ :)

Ben Strasser – Algorithmen fur Routenplanung

Slide 24 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 75: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Idea: Reorder first and last column and row.1 −1 0 0 1−2 1 0 0 1

0 0 −1 −1 10 0 −1 −2 −11 −1 1 1 1

Notice: All 4 zeros conserved→ :)

Ben Strasser – Algorithmen fur Routenplanung

Slide 24 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 76: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Idea: Reorder first and last column and row.1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 −1 −2 −10 0 1 1 0

Notice: All 4 zeros conserved→ :)

Ben Strasser – Algorithmen fur Routenplanung

Slide 24 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 77: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Idea: Reorder first and last column and row.1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 0 −1 −20 0 0 0 1

Notice: All 4 zeros conserved→ :)

Ben Strasser – Algorithmen fur Routenplanung

Slide 24 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 78: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Idea: Reorder first and last column and row.1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 0 −1 −20 0 0 0 1

Notice: All 4 zeros conserved→ :)

Ben Strasser – Algorithmen fur Routenplanung

Slide 24 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 79: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Why does this work?

Ben Strasser – Algorithmen fur Routenplanung

Slide 25 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 80: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 1 1 11 1 0 0 −21 0 −1 −1 0−1 0 −1 −2 0

1 −1 0 0 1

0

1

2

3

4Column elimination↔ Vertex contraction

Every shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 81: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 1 1 10 2 −1 −1 −30 1 −2 −2 −10 −1 0 −1 10 0 −1 −1 0

1

2

3

4Column elimination↔ Vertex contraction

Every shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 82: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 1 1 10 2 −1 −1 −30 0 − 3

2 − 32

12

0 0 − 12 − 3

2 − 12

0 0 −1 −1 0

2

3

4Column elimination↔ Vertex contraction

Every shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 83: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 1 1 10 2 −1 −1 −30 0 − 3

2 − 32

12

0 0 0 −1 − 23

0 0 0 0 − 13

3

4Column elimination↔ Vertex contraction

Every shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 84: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 1 1 10 2 −1 −1 −30 0 − 3

2 − 32

12

0 0 0 −1 − 23

0 0 0 0 − 13

4

Column elimination↔ Vertex contractionEvery shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 85: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 0 0 1−2 1 0 0 1

0 0 −1 −1 10 0 −1 −2 −11 −1 1 1 1

4

1

2

3

0Column elimination↔ Vertex contraction

Every shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 86: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 −1 −2 −10 0 1 1 0

4

1

2

3

Column elimination↔ Vertex contractionEvery shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 87: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 −1 −2 −10 0 1 1 0

4

2

3

Column elimination↔ Vertex contractionEvery shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 88: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 0 −1 −20 0 0 0 1

4

3

Column elimination↔ Vertex contractionEvery shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 89: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Sparse Matrices

Interpret every non-zero as edge of an adjacency matrix.

1 −1 0 0 10 −1 0 0 30 0 −1 −1 10 0 0 −1 −20 0 0 0 1

4

Column elimination↔ Vertex contractionEvery shortcut destroys a zero.

Ben Strasser – Algorithmen fur Routenplanung

Slide 26 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 90: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Are all shortcuts needed?

V

1

21

510

11

Insert an only if all paths through the core are longer.

Ben Strasser – Algorithmen fur Routenplanung

Slide 27 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 91: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Are all shortcuts needed?

1

12

15

117

6

11

Insert an only if all paths through the core are longer.

Ben Strasser – Algorithmen fur Routenplanung

Slide 27 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 92: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Are all shortcuts needed?

1

12

117

6

11

Insert an only if all paths through the core are longer.

Ben Strasser – Algorithmen fur Routenplanung

Slide 27 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 93: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Are all shortcuts needed?

1

12

117

6

11

Insert an only if all paths through the core are longer.

Ben Strasser – Algorithmen fur Routenplanung

Slide 27 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 94: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

WeakCH

Observation:

For a fixed metric not all search graph arcs are needed.

Definitions:A weakCH is a CH that contains for a given order and metric atleast the arcs needed for query.A maximum weakCH contain all arcs inserted for a given order.Notice: A maximum weakCH is metric independent.(This is what we computed up to now.)

For the rest of this lecture:

We merge preprocessing and customization.In the preprocessing phase the metric and graph are known.

Ben Strasser – Algorithmen fur Routenplanung

Slide 28 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 95: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

Algorithm:Before inserting an arc (x , y) run a bidirectional Dijkstrarestricted to the core.If the shortest xy -path is longer than the new arc’s weight, thenthe new arc is not needed.

Optimization:Stop the search after a fixed amount of steps.CH bigger than needed but witness search is faster.Common optimization, but the algorithm is feasible without.

Ben Strasser – Algorithmen fur Routenplanung

Slide 29 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 96: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

Consider this graph.Contract v .

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 97: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2100101

v

2

v

Two potential shortcuts.In which order should we test them?

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 98: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

Option 1: First the long arc then the short one.No witness for the long one→ insertNo witness for the short one→ insert

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 99: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2100101

v

Option 1: First the long arc then the short one.No witness for the long one→ insertNo witness for the short one→ insert

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 100: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2100101

v

2

v

Option 1: First the long arc then the short one.No witness for the long one→ insertNo witness for the short one→ insert

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 101: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

Option 2: First the short arc then the long one.No witness for the short one→ insert

Witness found for the long one→ prune

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 102: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

2

v

Option 2: First the short arc then the long one.No witness for the short one→ insert

Witness found for the long one→ prune

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 103: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

2

v

Option 2: First the short arc then the long one.No witness for the short one→ insert

Witness found for the long one→ prune

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 104: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Witness Search

100

11

2v

2

v

→ Test the arcs increasing by weight to insert as few arcs as possible.

Ben Strasser – Algorithmen fur Routenplanung

Slide 30 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 105: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Metric-Dependent-Orders

Question: Can we get better orders for a fixed metric?

Intuition:The node contracted first (last) is the least (most) important one.

Two approaches:Bottom-Up [GSSD08]: Guess the least important vertex.Top-Down [ADGW12]: Guess the most important vertex.

Ben Strasser – Algorithmen fur Routenplanung

Slide 31 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 106: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Bottom-UpFor each vertex we define its importance as:

I(v) = `(v) +|A(v)||D(v)| +

∑a∈A(v) h(a)∑a∈D(v) h(a)

where`(v) is an estimate for the level of v in the search graph.A(v) is the set of arcs inserted if we would contract v .D(v) is the set of arcs removed if we would contract v .h(a) is the number of original arcs in the path represented by theshortcut a.

Details:Initially `(v) = 0.If v is contracted then for each neighbor u we do`(u)← max(`(u), `(v) + 1).To determine A(v) and D(v) we need to run witness searches.Many other ”importance” heuristics exist.

Ben Strasser – Algorithmen fur Routenplanung

Slide 32 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 107: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Bottom-Up

Algorithm:Maintain a priority queue of vertices weighted by theirimportance.Pop the min vertex v .Put v into the order.Contract v .Recompute the importances of all neighbors of v anddecrease/increase their key in the priority queue.Repeat until the queue is empty.

Why does this work?No one knows for sure. . .

but it works . . .and scales to large road graphs.

Ben Strasser – Algorithmen fur Routenplanung

Slide 33 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 108: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Bottom-Up

Algorithm:Maintain a priority queue of vertices weighted by theirimportance.Pop the min vertex v .Put v into the order.Contract v .Recompute the importances of all neighbors of v anddecrease/increase their key in the priority queue.Repeat until the queue is empty.

Why does this work?No one knows for sure. . .

but it works . . .and scales to large road graphs.

Ben Strasser – Algorithmen fur Routenplanung

Slide 33 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 109: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Top-DownIdea:

The most important vertex is the one that is part of the mostshortest paths.We say that v covers a st-shortest path if v is on the path.

Basic Algorithm:Denote by U the set of uncovered paths.(Initially U is the set of all shortest paths.)Find the vertex v that covers the most paths in U.Put v into the order.Remove all paths from U covered by v .

Running Time:Basic algorithm has running time in O(n3).Can be improved to O(n2). (See [ADGW12])

Ben Strasser – Algorithmen fur Routenplanung

Slide 34 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 110: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

One-Way Streets

To support one-way streets:Some arcs are pruned only for the forward or the backwardsearch.Store two different search graphs.

Ben Strasser – Algorithmen fur Routenplanung

Slide 35 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 111: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Experimentsaverage travel-time metric query running times

CCH-Dijkstra : 0.81 msCCH-Stall : 0.85 msCCH-Tree : 0.41 msCH-Dijkstra : 0.28 msCH-Stall : 0.11 ms

average distance metric query running timesCCH-Dijkstra : 0.87 msCCH-Stall : 1.00 msCCH-Tree : 0.42 msCH-Dijkstra : 2.66 msCH-Stall : 0.54 ms

as always: instance is DIMACS Europesequential unless mentioned

Ben Strasser – Algorithmen fur Routenplanung

Slide 36 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 112: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Experimentscustomization

running time: 0.4sparallelized with 16 cores and SIMD/SSE.details not covered in this course, see [DSW14]

search graph construction time (no order)dynamic adjacency array : 305.8 scontraction graph : 15.5 s

as always: instance is DIMACS Europesequential unless mentioned

Ben Strasser – Algorithmen fur Routenplanung

Slide 36 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 113: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Experimentsnested dissection order computation time

Depends on the partitioner used to do the bisection.Metis is faster than KaHip but separators are larger.KaHip: 2.8 daysMetis: 2.2 mindetails not covered in this course, see [DSW14]

metric-dependent order computation timeBottom-Up: 10-100 min (depending on importance heuristic)Top-Down: 29.75 h (uses tricks not covered, see [ADGW12])

as always: instance is DIMACS Europesequential unless mentioned

Ben Strasser – Algorithmen fur Routenplanung

Slide 36 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 114: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Overview

0.1 1 10 100 1,000 10,000

0.0001

0.001

0.01

0.1

1

10

100

1,000

Table Lookup(PHAST)

Dijkstras AlgorithmusBidirektionale Suche

Arc Flags

SHARC

CALT

ALT

ReachCRP(nur Customization)

CCH-Metis

CCH-KaHIP

Vorberechnungszeit [min]

Anfragezeit[m

s]

Ben Strasser – Algorithmen fur Routenplanung

Slide 37 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 115: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Overview

100 1,000 10,000 100,000

0.0001

0.001

0.01

0.1

1

10

100

1,000

Dijkstras Algorithmus

Bidirektionale Suche

Table Lookup(> 1 000 000 GiB)

Arc Flags

SHARC

CALT

ALT(nur Overlay)

(nur Metrik) CRPReach

CH

CCH(nur Metrik)

Platzverbrauch [MiB]

Anfragezeit[m

s]

Ben Strasser – Algorithmen fur Routenplanung

Slide 37 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 116: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Literatur I

Ittai Abraham, Daniel Delling, Andrew V. Goldberg, and Renato F. Werneck.Hierarchical hub labelings for shortest paths.In Proceedings of the 20th Annual European Symposium on Algorithms (ESA’12),volume 7501 of Lecture Notes in Computer Science, pages 24–35. Springer,2012.

Reinhard Bauer, Tobias Columbus, Ignaz Rutter, and Dorothea Wagner.Search-space size in contraction hierarchies.In Proceedings of the 40th International Colloquium on Automata, Languages,and Programming (ICALP’13), volume 7965 of Lecture Notes in ComputerScience, pages 93–104. Springer, 2013.

Julian Dibbelt, Ben Strasser, and Dorothea Wagner.Customizable contraction hierarchies.Technical report, ITI Wagner, Department of Informatics, Karlsruhe Institute ofTechnology (KIT), 2014.Technical Report on arXiv.

Ben Strasser – Algorithmen fur Routenplanung

Slide 38 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner

Page 117: Algorithmen fur¨ Routenplanung - KIT - ITI Algorithmik I€¦ · 8. Sitzung, Sommersemester 2014 Ben Strasser j12. Mai 2014 KIT – University of the State of Baden-Wuerttemberg

Literatur II

Alan George.Nested dissection of a regular finite element mesh.SIAM Journal on Numerical Analysis, 1973.

Robert Geisberger, Peter Sanders, Dominik Schultes, and Daniel Delling.Contraction hierarchies: Faster and simpler hierarchical routing in road networks.In Proceedings of the 7th Workshop on Experimental Algorithms (WEA’08),volume 5038 of Lecture Notes in Computer Science, pages 319–333. Springer,June 2008.

Ben Strasser – Algorithmen fur Routenplanung

Slide 39 – 12. Mai 2014

Institute for Theoretical InformaticsChair Algorithmics Wagner