Using Multi-Level Graphs for Timetable Information Frank Schulz, - - PowerPoint PPT Presentation
Using Multi-Level Graphs for Timetable Information Frank Schulz, - - PowerPoint PPT Presentation
Using Multi-Level Graphs for Timetable Information Frank Schulz, Dorothea Wagner, and Christos Zaroliagis 1 Overview 1. Introduction Timetable Information - A Shortest Path Problem 2. Multi-Level Graphs Speed-Up Technique for Shortest
1
Overview
- 1. Introduction
⊲ Timetable Information - A Shortest Path Problem
- 2. Multi-Level Graphs
⊲ Speed-Up Technique for Shortest Path Algorithms
- 3. Timetable Information Graphs
- 4. Experiments
- 5. Conclusion & Outlook
2
Overview
- 1. Introduction
⊲ Timetable Information - A Shortest Path Problem
- 2. Multi-Level Graphs
⊲ Speed-Up Technique for Shortest Path Algorithms
- 3. Timetable Information Graphs
- 4. Experiments
- 5. Conclusion & Outlook
3
Application Scenario
Timetable Information System
- Large timetable
(e.g., 500.000 departures, 7.000 stations)
- Central server
(e.g., 100 on-line queries per second) → Fast Algorithm Simple Queries
- Input: departure and arrival station, departure time
- Output: train connection with earliest arrival time
4
Shortest Path Problem
Graph model
- Solving a query ⇔ finding a shortest path
Speed-up techniques needed
- Commercial products
⊲ Heuristics that don’t guarantee optimality
- Scientific work
⊲ Geometric techniques ⊲ Hierarchical graph decomposition
5
Contribution
Multi-Level Graph Approach
- Hierarchical graph decomposition technique
- For general digraphs
- Idea
⊲ Preprocessing: Construct multiple levels of additional edges ⊲ On-Line Phase: Compute shortest paths in small subgraphs
Experimental Evaluation
- For the given application scenario
- With real data
6
Overview
- 1. Introduction √
- 2. Multi-Level Graphs
- 3. Timetable Information Graphs
- 4. Experiments
- 5. Conclusion & Outlook
7
Multi-Level Graphs
Given
- a weighted digraph G = (V, E)
- a sequence of subsets of V
V ⊃ S1 ⊃ . . . ⊃ Sl Outline
- Construct l levels of additional edges → M(G)
- Component Tree
- Define subgraph of M(G) for a pair s, t ∈ V
- Use subgraph to compute s-t shortest path
7
Multi-Level Graphs
Given
- a weighted digraph G = (V, E)
- a sequence of subsets of V
V ⊃ S1 ⊃ . . . ⊃ Sl Outline
- Construct l levels of additional edges → M(G)
- Component Tree
- Define subgraph of M(G) for a pair s, t ∈ V
- Use subgraph to compute s-t shortest path
8
Level Construction
G a b c
G = (V, E), S1 = {a, b, c}, S2 = {a, c}
8
Level Construction
G a b c Level 1 Level 0
Connected Components in G − S1
8
Level Construction
G a b c Level 1 Level 0
No internal vertex of path belongs to S1
8
Level Construction
G a b c Level 1 Level 0
⇒ Edge in level 1
8
Level Construction
G a b c Level 1 Level 0
No internal vertex of path belongs to S1
8
Level Construction
G a b c Level 1 Level 0
⇒ Edge in level 1
8
Level Construction
G a b c Level 1 Level 0
No internal vertex of path belongs to S1
8
Level Construction
G a b c Level 1 Level 0
⇒ Edge in level 1
8
Level Construction
E G a b c
1
Level 1 Level 0
All edges in level 1
8
Level Construction
E
1
Level 1
Consider now iteratively graph (S1, E1)
8
Level Construction
E E
2 1
Level 2 Level 1
Connected components in G − S2
8
Level Construction
E E
2 1
Level 2 Level 1
No internal vertex of path belongs to S2
8
Level Construction
E E
2 1
Level 2 Level 1
⇒ Edge in level 2
8
Level Construction
E E
2 1
Level 2 Level 1
All edges in level 2
8
Level Construction
Level 2 Level 1 Level 0 E E G a b c
2 1
3-Level Graph M(G, S1, S2)
9
Multi-Level Graphs
Given
- a weighted digraph G = (V, E)
- a sequence of subsets of V
V ⊃ S1 ⊃ . . . ⊃ Sl Outline
- Construct l levels of additional edges → M(G) √
- Component Tree
- Define subgraph of M(G) for a pair s, t ∈ V
- Use subgraph to compute s-t shortest path
10
Component Tree
Level 2 Level 1 Level 0 E E G
2 1
10
Component Tree
Level 2 Level 1 Level 0
10
Component Tree
root Level 2 Level 1 Level 0
10
Component Tree
root Level 2 Level 1 Level 0
10
Component Tree
root Level 2 Level 1 Level 0
10
Component Tree
root Level 2 Level 1 Level 0
11
Multi-Level Graphs
Given
- a weighted digraph G = (V, E)
- a sequence of subsets of V
V ⊃ S1 ⊃ . . . ⊃ Sl Outline
- Construct l levels of additional edges → M(G) √
- Component Tree √
- Define subgraph of M(G) for a pair s, t ∈ V
- Use subgraph to compute s-t shortest path
12
Define Subgraph
root Level 2 Level 1
t s
Level 0
12
Define Subgraph
root Level 2 Level 1
t s
Level 0
12
Define Subgraph
G
t s
root E E
2 1
Level 2 Level 1 Level 0
12
Define Subgraph
G
t s
root E E
2 1
Level 2 Level 1 Level 0
12
Define Subgraph
G
t s
root E E
2 1
Level 2 Level 1 Level 0
12
Define Subgraph
t s
root E E
2 1
Level 2 Level 1 G Level 0
13
Multi-Level Graphs
Given
- a weighted digraph G = (V, E)
- a sequence of subsets of V
V ⊃ S1 ⊃ . . . ⊃ Sl Outline
- Construct l levels of additional edges → M(G) √
- Component Tree √
- Define subgraph of M(G) for a pair s, t ∈ V √
- Use subgraph to compute s-t shortest path
14
Lemma
The length of a shortest s-t path is the same in the s-t subgraph of M(G) and G. Subgraph of M(G):
s t
Original Graph G:
G
15
A Different Pair s, t
root Level 2 Level 1 Level 0
s t
15
A Different Pair s, t
E E G
2 1
Level 2 Level 1 Level 0
s t
15
A Different Pair s, t
Level 2 Level 1 Level 0 E
1
t s
16
Overview
- 1. Introduction √
- 2. Multi-Level Graphs √
- 3. Timetable Information Graphs
- 4. Experiments
- 5. Conclusion & Outlook
17
Station Graph
Patras Korinthos Athens
18
Train Graph
Athens Korinthos Patras
18
Train Graph
Athens Korinthos Patras
00:00 24:00
time
18
Train Graph
Athens Korinthos Patras
00:00 24:00
time
18
Train Graph
Athens Korinthos Patras
00:00 24:00
time
19
Query
Single-source some-targets shortest path problem
Athens Korinthos Patras
00:00 24:00
time departure arrival
10:00
20
Multi-Level Train Graph
- Given l subsets of stations Σ1 ⊃ . . . ⊃ Σl
- Component tree in station graph
- Define subgraph for a pair of stations
21
Overview
- 1. Introduction √
- 2. Multi-Level Graphs √
- 3. Timetable Information Graphs √
- 4. Experiments
- 5. Conclusion & Outlook
22
Experiments
Given one instance G of a traingraph
- Timetable of German trains, winter 1996/97
- ∼ 500000 vertices, ∼ 7000 stations
Evaluate multi-level train graph M(G, Σ1, . . . , Σl) Investigate dependence on
- number of levels
- input sequence Σ1 ⊃ . . . ⊃ Σl
23
Sets of stations Σi
Three criteria to sort stations A Importance regarding train changes B Degree in station graph C Random Consider the first nj stations according to A, B, C
- n1 = 1974, . . . , n10 = 50
❀ Sets of stations ΣA
j , ΣB j , ΣC j
24
2-Level Graphs M(G, ΣX
j )
Number of Additional Edges
1e+06 2e+06 3e+06 4e+06 5e+06 6e+06 7e+06 200 400 600 800 1000 1200 1400 1600 1800 2000 importance degree random
25
Evaluation of M(G, Σ1, . . . , Σl)
Consider only criterion A in the following Average Speed-up over 100000 queries
- r = Runtime for Dijkstra in G
- q = Runtime for Dijkstra in subgraph of M
- Speed-up = r/q
26
2-Level Graphs M(G, ΣA
j )
Average Speed-up
1 1.5 2 2.5 3 3.5 4 200 400 600 800 1000 1200 1400 1600 1800 2000 speedup
27
Problem with small ΣA
j
Big components ⇒ Level 1 rarely used
E G
1
s t
Level 1 Level 0
28
2-Level Graphs M(G, ΣA
j )
Queries Using Level 1
2 4 6 8 10 12 14 200 400 600 800 1000 1200 1400 1600 1800 2000 40 50 60 70 80 90 100 110 speedup of queries using level 1 percentage of queries using level 1
29
3-Level Graphs M(G, ΣA
j , ΣA k )
Average Speed-up
4 5 6 7 8 9 10 11 50 100 150 200 250 300 350 400 450 500 1 7 8 9
30
l-Level Graphs M(G, Σ1, . . . , Σl−1)
Best Average Speed-up (CPU-time, #Edges hit)
2 4 6 8 10 12 14 16 18 1 2 3 4 5 6 CPU-speedup edge-speedup
31
Overview
- 1. Introduction √
- 2. Multi-Level Graphs √
- 3. Timetable Information Graphs √
- 4. Experiments √
- 5. Conclusion & Outlook
32
Conclusion & Outlook
Experimental evaluation of multi-level graphs
- Input graph from timetable information
- Best number of levels: 4, 5
- Sizes of Σi are crucial
Outlook
- Other input graphs
- Relation
(Σ1, . . . , Σl) ↔ speed-up
⊲ Here: Criteria A, B, C; Sizes of Σi
- Theoretical analysis
33
Overview
- 1. Introduction √
- 2. Multi-Level Graphs √
- 3. Timetable Information Graphs √
- 4. Experiments √
- 5. Conclusion & Outlook √