many-to-many shortest paths using highway...

19
Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 1 Many-to-Many Shortest Paths Using Highway Hierarchies Sebastian Knopp Peter Sanders Dominik Schultes Frank Schulz Dorothea Wagner Universität Karlsruhe (TH) – Algorithmik I/II PTV AG, Karlsruhe http://algo2.iti.uka.de/schultes/hwy/ New Orleans, January 6, 2007

Upload: others

Post on 02-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 1

Many-to-Many Shortest PathsUsing Highway Hierarchies

Sebastian Knopp Peter SandersDominik Schultes Frank Schulz Dorothea Wagner

Universität Karlsruhe (TH) – Algorithmik I/II

PTV AG, Karlsruhe

http://algo2.iti.uka.de/schultes/hwy/

New Orleans, January 6, 2007

Page 2: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 2

Many-to-Many Shortest Path Problem

Given:

� graph G = (V,E)

� set of source nodes S⊆V

� set of target nodes T ⊆V

Task: compute |S|× |T| distance table

containing the shortest path distances

Here: concentrate on road networks

S

T

Page 3: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 3

Applications

� Logistics

– vehicle routing problem

– input for traveling salesman solver

� Preprocessing for Point-to-Point Techniques

– Precomputed Cluster Distances [MaueSandersMatijevic2006]

– Transit Node Routing [next talk]

Page 4: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 4

Simple Solutions

Example: 10 000 × 10 000 table

in Western Europe

� apply SSSP algorithm︸ ︷︷ ︸

|S| times

(e.g. DIJKSTRA)≈ 10 000 × 10 s ≈ one day

� apply P2P algorithm︸ ︷︷ ︸

|S|× |T| times

(e.g. highway hierarchies1)≈ 10 0002 × 1 ms ≈ one day

1requires about 15 minutes preprocessing time

Page 5: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 5

pOur Solution

Example: 10 000 × 10 000 table

in Western Europe

� many-to-many algorithm

based on highway hierarchies1≈ one minute

ts

1requires about 15 minutes preprocessing time

Page 6: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 6

Highway Hierarchies2

s t

ts

� complete search within a local area

� search in a (thinner) highway network

= minimal graph that preserves all shortest paths

� contract network, e.g.,

� iterate highway hierarchy

2presented at ESA 2005 and ESA 2006

Page 7: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 7

Local Area

� choose neighbourhood radius r(s)(by a heuristic)

� define neighbourhood of s

N (s) := {v∈V | d(s,v) ≤ r(s)}

N (s)

s

r(s)

Page 8: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 8

Highway Network

N (s) N (t)

s t

Highway

Edge (u,v) belongs to highway network iff there are nodes sand t s.t.

� (u,v) is on the shortest path from s to t

and

� (u,v) is not entirely within N (s) or N (t)

Page 9: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 9

Example: New Orleans

Level 0–1

Level 2

Level 3

Level 4

Page 10: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 10

Search Space Example

Page 11: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

S

T

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 11

Main Idea

� instead of |S|×|T| bidirectional highway queries

� perform |S|+ |T| unidirectional highway queries

Algorithm

� maintain an |S|× |T| table D of tentative distances

(initialize all entries to ∞)

Page 12: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 12

� for each t ∈ T , perform backward search up to the top level,

store search space entries (t,u,d(u, t))

� arrange search spaces: create a bucket for each u

� for each s∈ S, perform forward search up to and including the top level,

at each node u, scan all entries (t,u,d(u, t)) and

compute d(s,u)+d(u, t), update D[s, t]

Page 13: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 13

Asymmetry

for large distance tables, most time spent on bucket scanning

Solution: use less levels strengthen the asymmetry

� backward search spaces get smaller less bucket entries

� forward search spaces get bigger

Page 14: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 14

ExperimentsInput:

� Western European road network (18 million nodes)

� random source/target node sets

Results:

table size time speedup(↔ DIJKSTRA)

1 000 × 1 000 2.5 s 4 680

10 000 × 10 000 58 s 2 017

Break Even Point (w.r.t. preprocessing costs): table size 100 × 100

Real-World Instances:similar performance

Page 15: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Topmost Level

Tim

e [m

s]

|S|

05

1015

2025

05

1015

2025

05

1015

2025

05

1015

2025

05

1015

2025

5 6 7 8 9 5 6 7 8 9 5 6 7 8 9 5 6 7 8 9 5 6 7 8 9

100 x 100 500 x 500 2000 x 2000 8000 x 8000 20000 x 20000

05

1015

2025

Bucket ScanningForward SearchSortingBackward Search

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 15

Symmetric Instances

Page 16: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

100 200 500 1000 2000 5000 10000 20000

110

010

000

Table Size (|S| = |T |)

Tim

e [µ

s]

|S| *

|T|

110

100

1000

0

550

500

5000

5000

0

Highway Hierarchies2

DijkstraMany−to−Many HH (Level 6)Many−to−Many HH (Level 7)

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 16

Comparisons

Page 17: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Topmost Level

Tim

e [s

]

010

2030

4050

6070

010

2030

4050

6070

010

2030

4050

6070

010

2030

4050

6070

010

2030

4050

6070

1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 5 6 7 8 6 7 8 9

20 x 162000 50 x 64800 100 x 32400 400 x 8100 1000 x 3240 1800 x 1800

010

2030

4050

6070

Bucket ScanningForward SearchSortingBackward Search

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 17

Asymmetric Instances

Page 18: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 18

Summary

� very efficient solution to the

many-to-many shortest path problem

� requires little preprocessing time ≈ 15 minutes

� computes 10 000 × 10 000 table in ≈ 1 minute

(0.6 µs per entry)

Page 19: Many-to-Many Shortest Paths Using Highway Hierarchiesalgo2.iti.kit.edu/schultes/hwy/distTableSlides.pdfLogistics – vehicle routing problem – input for traveling salesman solver

Knopp/Sanders/Schultes/Schulz/Wagner: Many-to-Many Shortest Paths 19

Additional Issues

� outputting paths

� incremental computation

� parallelization

Future Work

� adapt preprocessing to specific source/target node sets

� approach can be generalized to other

– non-goal-directed

– bidirectional

speedup techniques

ts