SlideShare a Scribd company logo
Highway Dimension and
              Provably Efficient
       Shortest Paths Algorithms

                  Andrew V. Goldberg
           Microsoft Research – Silicon Valley
         www.research.microsoft.com/∼goldberg/

Joint with Ittai Abraham, Amos Fiat, and Renato Werneck
Theory & Practice

[Anonymous]
  • Theory is when you know something, but it doesn’t work.
  • Practice is when something works, but you don’t know why.
  • Programmers combine theory and practice: Nothing works
    and they don’t know why.




Highway dimension                                             1
Theory & Practice

[Anonymous]
  • Theory is when you know something, but it doesn’t work.
  • Practice is when something works, but you don’t know why.
  • Programmers combine theory and practice: Nothing works
    and they don’t know why.

Algorithm Engineering:
Know something ⇒ make it work.


Reverse Engineering:
Something works ⇒ explain why (this talk).




Highway dimension                                             2
Theory & Practice

[Anonymous]
  • Theory is when you know something, but it doesn’t work.
  • Practice is when something works, but you don’t know why.
  • Programmers combine theory and practice: Nothing works
    and they don’t know why.

Algorithm Engineering:
Know something ⇒ make it work.


Reverse Engineering:
Something works ⇒ explain why (this talk).


Efficient driving directions: How and why modern routing al-
gorithms work.

Highway dimension                                             3
Motivation

Computing driving directions.
Recent shortest path algorithms (exact):

  • Arc flags [Lauther 04, K¨hler et al. 06].
                           o
  • A∗ with landmarks [Goldberg & Harrelson 05].
  • Reach [Gutman 04, Goldberg et al. 06].
  • Highway [Sanders & Schultes 05] and contraction [Geisberger
    08] hierarchies.
  • Transit nodes [Bast et al. 06].
  • Combinations (pruning and directing algorithms).

Good performance on continent-sized road networks:
Tens of millions of vertices, a few hundred vertices scanned,
under a millisecond on a server, about 0.1 second on a mobile
device. Used in practice.

Highway dimension                                             4
Result Summary

Elegant and practical algorithms, but...


Until now: No analysis for non-trivial network classes and no
understanding of what makes the algorithms work.


Our results:
  • We define highway dimension (HD).
  • Give provably efficient implementations of several recent al-
    gorithms under the small HD assumption.
  • Analysis highlights algorithm similarities.
  • Give a generative model of small HD networks (road network
    formation).

Compare to the small world model [Milgram 67, Kleinberg 99].

Highway dimension                                             5
Outline




  • Dijkstra’s algorithm review.
  • Shortcuts and CH algorithm.
  • Reach and RE algorithm.
  • Transit nodes and TN algorithm.
  • Highway dimension and sparse covers.
  • Analysis of RE and CH.
  • Generative model.
  • Concluding remarks.




Highway dimension                          6
Definitions

  • Undirected graph G = (V, E), |V | = n, |E| = m.
  • ℓ : E → N , minimum length 1, diameter D.
  • Maximum degree ∆. Small for road networks, assume con-
    stant for this talk.
  • Ball Bv,r induced by vertices within distance r from v.
  • For a path P , |P | denotes the length of P .
  • Query: find the shortest path from s to t.

Algorithms with preprocessing:
  • Two phases, preprocessing and query.
  • Preprocessing output not much bigger than the input.
  • Preprocessing may use more resources than queries.
  • Practical preprocessing, fast queries.
Highway dimension                                             7
Three Intuitive Methods


  • Reach pruning (RE): Local intersections far from origin/destination
    can be ignored.
  • Transit nodes (TN): All long shortest paths to/from a region
    pass through a small number of nodes.
  • Highway/contraction hierarchies (CH): Shortest path goes
    from local roads to local highways to global highways to
    local highways to local roads.

These ideas can be mathematically formalized and lead to prov-
ably correct algorithms which work very well on road networks.

HD intuition based on TN; all preprocessing is based on CH;
query analysis in this talk is for RE.


Highway dimension                                               8
Scanning Method


  • For each vertex v maintain its distance label ds(v) and status
    S(v) ∈ {unreached, labeled, scanned}.

  • Unreached vertices have ds(v) = ∞.

  • If ds(v) decreases, v becomes labeled.

  • To scan a labeled vertex v, for each arc (v, w),
    if ds(w) > ds(v) + ℓ(v, w) set ds(w) = ds(v) + ℓ(v, w).

  • Initially all vertices are unreached.

  • Start by decreasing ds(s) to 0.

  • While there are labeled vertices, pick one and scan it.

  • Different selection rules lead to different algorithms.


Highway dimension                                                9
Dijkstra’s Algorithm


[Dijkstra 1959], [Dantzig 1963].
  • At each step scan a labeled vertex with the minimum label.
  • Stop when t is selected for scanning.

Work almost linear in the visited subgraph size.


Reverse Algorithm: Run algorithm from t in the graph with all
arcs reversed, stop when s is selected for scanning.


Bidirectional Algorithm
  • Run forward Dijkstra from s and backward from t.
  • Stopping criteria (careful!).


Highway dimension                                           10
Example Graph




            1.6M vertices, 3.8M arcs, travel time metric.

Highway dimension                                           11
Dijkstra’s Algorithm




                      Searched area
Highway dimension                     12
Bidirectional Algorithm




                    forward search/ reverse search

Highway dimension                                    13
Contraction Hierarchies


[Geisberget et al. 08] Based on preprocessing that orders vertices
and adds shortcuts. Fast and simple!


Shortcuts:



                        100
                                      101        110

                    1         10



                                            11



A shortcut arc can be omitted if redundant (alternative path
exists).


Highway dimension                                               14
CH Preprocessing




(1) Heuristically order vertices.
(2) Shortcut vertices in that order.
(3) To the original graph, add all shortcuts introduced in step 2.

For road networks, a good heuristic ordering is fast and increases
the number of arcs by a small constant factor.


Intuition: Higher-order vertices are more important (“global”).
Query is bidirectional, each search goes from lower to higher
order vertices.




Highway dimension                                               15
CH Query

Let (V, E ∪ E +) be the graph augmented by shortcuts, recall that
the vertices are ordered. Let Gf be the directed graph induced
by
(v, w) : (v, w) ∈ E ∪ E +, v < w
and Gr – by
(w, v) : (v, w) ∈ E ∪ E +, v > w.

Given a query, run a modified bidirectional Dijkstra’s algorithm,
with the forward search in Gf and the reverse search in Gr . (Both
searches go “up”.)

Upon termination dist(s, t) = minv (d(s, v) + d(v, t)).

Experiments show that for road networks queries look at a very
small subgraph, even in the worst case.

Highway dimension                                               16
Reach Intuition




Identify local intersections and prune them when searching far
from s and t.



Highway dimension                                           17
Reach Definition


[Gutman 04]
  • Consider a vertex v that splits a path P into P1 and P2.
    rP (v) = min(ℓ(P1), ℓ(P2)).
  • r(v) = maxP (rP (v)) over all shortest paths P through v.

Using reaches to prune Dijkstra:


                                     LB(w,t)
                    d(s,v)   v   w

            s                                           t



If r(w) < min(d(v) + ℓ(v, w), LB(w, t)) then prune w.


Highway dimension                                               18
Lower Bounds for Nothing




Bidirectional search gives implicit bounds (Rt below).


                                     LB(w,t)
                    d(s,v)   v   w

            s                                     Rt     t



Reach-based query algorithm is Dijkstra’s algorithm with prun-
ing based on reaches. Given a lower-bound subroutine, a small
change to Dijkstra’s algorithm.




Highway dimension                                            19
Shortcuts

    • Consider the graph below.
    • Many vertices have large reach.




       1000                                                   1000

                   10   10   10   10   10   10   10   10
s              1000 1010 1020 1030 1040 1030 1020 1010 1000           t

Highway dimension                                                    20
Shortcuts

    • Consider the graph below.
    • Many vertices have large reach.
    • Add a shortcut arc, break ties by the number of hops.




                                        80
       1000                                                      1000

                    10   10   10   10        10   10   10   10
s                                                                        t

Highway dimension                                                       21
Shortcuts

    • Consider the graph below.
    • Many vertices have large reach.
    • Add a shortcut arc, break ties by the number of hops.
    • Reaches decrease.




s              1000   60   50   40   30   40   50   60   1000    t

Highway dimension                                               22
Shortcuts

    • Consider the graph below.
    • Many vertices have large reach.
    • Add a shortcut arc, break ties by the number of hops.
    • Reaches decrease.
    • Repeat.




s               1000   20   10   20   30   20   10   20   1000    t

Highway dimension                                                23
Reach Algorithm

    • Consider the graph below.
    • Many vertices have large reach.
    • Add a shortcut arc, break ties by the number of hops.
    • Reaches decrease.
    • Repeat.
    • A small number of shortcuts can greatly decrease many reaches.

RE algorithm: reaches with shortcuts, bidirectional Dijkstra,
balance the searches by the search radius.




s               1000   0   10   0   30   0   10   0   1000       t

Highway dimension                                               24
Reach Algorithm




Highway dimension           25
TN Algorithm: Intuition




For a region, there is a small set of nodes such that all sufficiently
long shortest paths out of the region pass a vertex in the set.

Highway dimension                                                 26
Transit Node (TN) Algorithm

[Bast et. al 06]
  • Divide a map into regions.
  • For each region, paths to far away places pass through a
    small number of access points.
  • The union of all access nodes is the set of transit nodes.
  • Preprocessing: find all access points, connect each vertex
    to its access nodes, compute all pairs of shortest paths be-
    tween transit nodes.
  • Query: Look for a “local” shortest path or a shortest path
    of the form origin – transit node – transit node – destination.
  • Various ways to speed up local queries.
  • 10 access nodes per region on the average.
  • Leads to the fastest algorithms.
Highway dimension                                                27
Highway Dimension: Intuition




TN algorithm works because for a region, there is a small set
of nodes such that all sufficiently long shortest paths out of the
region pass a vertex in the set.

Highway dimension                                             28
Highway Dimension



                                  P

                                         u


                                        4r




Highway dimension (HD) h:

       ∀ r ∈ ℜ, ∀u ∈ V, ∃S ⊆ Bu,4r , |S| ≤ h, such that
       ∀ v, w ∈ Bu,4r ,
                    if P is a SP: |P (v, w)| > r and P (v, w) ⊆ Bu,4r ,
                         then P (v, w) ∩ S = ∅.
Locally, a small set covers all long SPs.

Highway dimension                                                         29
Shortest Path Cover


                         P

                                   u
                                   2r




(r, k) Shortest path cover ((r, k)-SPC): a set C such that
                    ∀    SP P : r < |P | ≤ 2r ⇒
                        P ∩ C = ∅ and
                        ∀u ∈ V, |C ∩ Bu,2r | ≤ k
All SPs in a range can be covered by a sparse set.

Can use constants different from 4 and 2, but the constants are
related.
Highway dimension                                            30
Highway vs. Doubling Dimension




A metric space has a doubling dimension α if every ball or radius
r can be covered by 2α balls of radius r/2.


Line: Small HD


                               v

A line has HD 7 and doubling dimension 1.




Highway dimension                                              31
Grid: High HD




                      √
      A grid has HD Θ( n) and the doubling dimension 2.

Highway dimension                                         32
HD vs. SPC


Theorem. If G has highway dimension h, then for any r there
exists an (r, h)-SPC.
Proof idea: Show that S ∗, the smallest set that covers all short-
est paths P : r < |P | ≤ 2r, is an (r, h)-SPC.

Finding S ∗ is NP-hard. Efficient construction?


Theorem. If G has highway dimension h, then for any r we can
construct, in polynomial time, an (r, O(h log n))-SPC.
Proof idea: Use the greedy set-cover algorithm to get an O(log n)
approximation of S ∗.

Proofs depend on the choice of constants in the definitions.


Highway dimension                                               33
Generic Preprocessing

Let k denote h or O(h log n) (for poly-time preprocessing).
  • Let S0 = V . For 1 ≤ i ≤ log D build (2i, k)-SPC covers Si.
  • Let Li = Si − log D Sj (vertex layers).
                  i+1
  • Order vertices so that Li comes before Li+1; ordering inside
    layers is arbitrary.
  • Do shortcutting in this order to get E +.

Lemma. Let v ∈ Li and j ≥ i. Then the number of (v, w) ∈ E +
with w ∈ Lj is at most k.
Proof. (v, w) corresponds to P with internal vertices less than
v, w. Thus w ∈ Bv,2·2i . The SPC definition implies the lemma.


Theorem. In (V, E ∪ E +) vertex degrees are bounded by
∆ + k log D and |E ∪ E +| = O(m + nk log D).

Highway dimension                                                 34
Additional RE Preprocessing




Reach bounds are in the graph with shortcuts.


Lemma: If v ∈ Li then reach(v) ≤ 2 · 2i.
Proof: Suppose the reach is greater. Then there is a shortest
path P that v divides into P1 and P2 with |P1|, |P2| > 2 · 2i. Both
P1 and P2 contain vertices in Lj with j > i, so there is a shortcut
from P1 to P2. But then P is not a shortest path.

Additional work is linear.




Highway dimension                                                35
RE Query Bound




Theorem: RE query takes O((k log D)2) time.
Proof: Consider a forward search from s. In Bs,2·2i , the search
scans only vertices of Li in Bs,2·2i . Thus O(k log D) scans.


  • Shortest path can be extracted in time linear in the number
    of its arcs.
  • Similar analysis for CH yields the same bound.
  • Also develop a faster version of TN: O(k log D) query.




Highway dimension                                               36
Network Formation

Natural networks with constant highway dimension?

Attempt to model road networks:
 • Build on the Earth surface (low doubling dimension).
  • Build in decentralized and incremental manner.
  • Highways are faster than local roads.
Capture some, but not all, real-life properties.

Setting:
 • Metric space (M, d), doubling dimension log α, diameter D.
  • Speedup parameter δ ∈ (0, 1).
  • Edge {v, w} has length d(v, w) and transit time τ (v, w) =
    d1−δ (v, w). (Long roads are fast.)
  • On-line network formation, adversarial (or random) vertex
    placement.
Highway dimension                                           37
Network Formation (cont.)


In the spirit of dynamic spanners [Gottlieb & Roditty 08].
  • Adversary adds vertices, we connect them.
  • Intuition: connect a new village to all nearby villages and to
    the closest town.
  • Formally: maintain covers Ci for 0 ≤ i ≤ log D.
    C0 = V , Ci+1 ⊆ Ci, vertices in Ci are at least 2i apart.
  • When adding a new vertex v, add v to C0, . . . , Ci for appro-
    priate i. (The first vertex added to all C’s.)
  • For 0 ≤ j ≤ i, connect v to Cj ∩ Bv,6·2j .
  • If i < log D, connect v to the closest element of Ci+1.

Theorem: The network has highway dimension of αO(1).


Highway dimension                                               38
Concluding Remarks


  • Highway dimension explains why intuitive algorithms work
    well on a non-trivial graph class.
  • Unified view of several different-looking algorithms.
  • Extensions for directed graphs.
  • Additional assumptions, such as small separators, may lead
    to better bounds.
  • For real road networks, small HD condition may not hold for
    some r and some v.
  • Does low HD make other problems simpler?
  • Computing HD dimension of road networks (work in progress
    with Daniel Delling): USA/Europe highway dimension is ≈
    1, 000, access dimension ≈ 20.


Highway dimension                                            39
Thank You!




Highway dimension      40

More Related Content

PPTX
distance_matrix_ch
PDF
Development of Routing for Car Navigation Systems
PPTX
IOEfficientParalleMatrixMultiplication_present
PDF
Lecture set 5
PDF
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
DOC
Bode
PDF
Graph Regularised Hashing
PDF
Cordic Code
distance_matrix_ch
Development of Routing for Car Navigation Systems
IOEfficientParalleMatrixMultiplication_present
Lecture set 5
Implementation of Thorup's Linear Time Algorithm for Undirected Single Source...
Bode
Graph Regularised Hashing
Cordic Code

What's hot (20)

PPTX
Dijkstra's algorithm presentation
PPTX
VHDL and Cordic Algorithim
PPTX
Rendering of Complex 3D Treemaps (GRAPP 2013)
PDF
(Paper Review)3D shape reconstruction from sketches via multi view convolutio...
PDF
FPGA Implementation of CORDIC Algorithm Architecture
PDF
A Hough Transform Based On a Map-Reduce Algorithm
PPTX
2.5D Clip-Surfaces for Technical Visualization
PDF
Graph Regularised Hashing (ECIR'15 Talk)
PPTX
Geometry Batching Using Texture-Arrays
PDF
Implementation of Efficiency CORDIC Algorithmfor Sine & Cosine Generation
PDF
A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)
PDF
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
PPT
32-bit unsigned multiplier by using CSLA & CLAA
PDF
FPGA Implementation of High Speed Architecture of CSLA using D-Latches
PDF
Parallel Algorithms
PPTX
PPTX
Unit ix graph
PDF
DASH: A C++ PGAS Library for Distributed Data Structures and Parallel Algorit...
PDF
Design and Implementation of Low-Power and Area-Efficient 64 bit CSLA using VHDL
PPTX
Md2k 0219 shang
Dijkstra's algorithm presentation
VHDL and Cordic Algorithim
Rendering of Complex 3D Treemaps (GRAPP 2013)
(Paper Review)3D shape reconstruction from sketches via multi view convolutio...
FPGA Implementation of CORDIC Algorithm Architecture
A Hough Transform Based On a Map-Reduce Algorithm
2.5D Clip-Surfaces for Technical Visualization
Graph Regularised Hashing (ECIR'15 Talk)
Geometry Batching Using Texture-Arrays
Implementation of Efficiency CORDIC Algorithmfor Sine & Cosine Generation
A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)
Efficient Design of Ripple Carry Adder and Carry Skip Adder with Low Quantum ...
32-bit unsigned multiplier by using CSLA & CLAA
FPGA Implementation of High Speed Architecture of CSLA using D-Latches
Parallel Algorithms
Unit ix graph
DASH: A C++ PGAS Library for Distributed Data Structures and Parallel Algorit...
Design and Implementation of Low-Power and Area-Efficient 64 bit CSLA using VHDL
Md2k 0219 shang
Ad

Similar to Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algorithms (20)

PPTX
dms slide discrete mathematics sem 2 engineering
PPTX
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
PDF
Lecture 16 - Dijkstra's Algorithm.pdf
PPTX
Dijkstra’s Algorithm in modern navigation and autonomous vehicles
PDF
testpang
PPTX
Shortest path algorithm
PDF
TINET_FRnOG_2008_public
PDF
Joint CSI Estimation, Beamforming and Scheduling Design for Wideband Massive ...
PPTX
141222 graphulo ingraphblas
 
PPTX
141205 graphulo ingraphblas
PDF
Graph Algorithms - Map-Reduce Graph Processing
PDF
Realtime Analytics
PPTX
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
PPTX
SCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATION
PPTX
Lecture 8 about data mining and how to use it.pptx
PDF
Goldbergetal2006 211024102451
PDF
Goldberg etal 2006
PDF
1 chayes
PPTX
Crossing patterns in Nonplanar Road networks
dms slide discrete mathematics sem 2 engineering
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
Lecture 16 - Dijkstra's Algorithm.pdf
Dijkstra’s Algorithm in modern navigation and autonomous vehicles
testpang
Shortest path algorithm
TINET_FRnOG_2008_public
Joint CSI Estimation, Beamforming and Scheduling Design for Wideband Massive ...
141222 graphulo ingraphblas
 
141205 graphulo ingraphblas
Graph Algorithms - Map-Reduce Graph Processing
Realtime Analytics
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
SCALABLE PATTERN MATCHING OVER COMPRESSED GRAPHS VIA DE-DENSIFICATION
Lecture 8 about data mining and how to use it.pptx
Goldbergetal2006 211024102451
Goldberg etal 2006
1 chayes
Crossing patterns in Nonplanar Road networks
Ad

More from Computer Science Club (20)

PDF
20141223 kuznetsov distributed
PDF
Computer Vision
PDF
20140531 serebryany lecture01_fantastic_cpp_bugs
PDF
20140531 serebryany lecture02_find_scary_cpp_bugs
PDF
20140531 serebryany lecture01_fantastic_cpp_bugs
PDF
20140511 parallel programming_kalishenko_lecture12
PDF
20140427 parallel programming_zlobin_lecture11
PDF
20140420 parallel programming_kalishenko_lecture10
PDF
20140413 parallel programming_kalishenko_lecture09
PDF
20140329 graph drawing_dainiak_lecture02
PDF
20140329 graph drawing_dainiak_lecture01
PDF
20140310 parallel programming_kalishenko_lecture03-04
PDF
20140223-SuffixTrees-lecture01-03
PDF
20140216 parallel programming_kalishenko_lecture01
PDF
20131106 h10 lecture6_matiyasevich
PDF
20131027 h10 lecture5_matiyasevich
PDF
20131027 h10 lecture5_matiyasevich
PDF
20131013 h10 lecture4_matiyasevich
PDF
20131006 h10 lecture3_matiyasevich
PDF
20131006 h10 lecture3_matiyasevich
20141223 kuznetsov distributed
Computer Vision
20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture02_find_scary_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs
20140511 parallel programming_kalishenko_lecture12
20140427 parallel programming_zlobin_lecture11
20140420 parallel programming_kalishenko_lecture10
20140413 parallel programming_kalishenko_lecture09
20140329 graph drawing_dainiak_lecture02
20140329 graph drawing_dainiak_lecture01
20140310 parallel programming_kalishenko_lecture03-04
20140223-SuffixTrees-lecture01-03
20140216 parallel programming_kalishenko_lecture01
20131106 h10 lecture6_matiyasevich
20131027 h10 lecture5_matiyasevich
20131027 h10 lecture5_matiyasevich
20131013 h10 lecture4_matiyasevich
20131006 h10 lecture3_matiyasevich
20131006 h10 lecture3_matiyasevich

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Yogi Goddess Pres Conference Studio Updates
PDF
Trump Administration's workforce development strategy
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
Computing-Curriculum for Schools in Ghana
GDM (1) (1).pptx small presentation for students
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Module 4: Burden of Disease Tutorial Slides S2 2025
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
2.FourierTransform-ShortQuestionswithAnswers.pdf
Orientation - ARALprogram of Deped to the Parents.pptx
Yogi Goddess Pres Conference Studio Updates
Trump Administration's workforce development strategy
Anesthesia in Laparoscopic Surgery in India
Final Presentation General Medicine 03-08-2024.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems

Andrew Goldberg. Highway Dimension and Provably Efficient Shortest Path Algorithms

  • 1. Highway Dimension and Provably Efficient Shortest Paths Algorithms Andrew V. Goldberg Microsoft Research – Silicon Valley www.research.microsoft.com/∼goldberg/ Joint with Ittai Abraham, Amos Fiat, and Renato Werneck
  • 2. Theory & Practice [Anonymous] • Theory is when you know something, but it doesn’t work. • Practice is when something works, but you don’t know why. • Programmers combine theory and practice: Nothing works and they don’t know why. Highway dimension 1
  • 3. Theory & Practice [Anonymous] • Theory is when you know something, but it doesn’t work. • Practice is when something works, but you don’t know why. • Programmers combine theory and practice: Nothing works and they don’t know why. Algorithm Engineering: Know something ⇒ make it work. Reverse Engineering: Something works ⇒ explain why (this talk). Highway dimension 2
  • 4. Theory & Practice [Anonymous] • Theory is when you know something, but it doesn’t work. • Practice is when something works, but you don’t know why. • Programmers combine theory and practice: Nothing works and they don’t know why. Algorithm Engineering: Know something ⇒ make it work. Reverse Engineering: Something works ⇒ explain why (this talk). Efficient driving directions: How and why modern routing al- gorithms work. Highway dimension 3
  • 5. Motivation Computing driving directions. Recent shortest path algorithms (exact): • Arc flags [Lauther 04, K¨hler et al. 06]. o • A∗ with landmarks [Goldberg & Harrelson 05]. • Reach [Gutman 04, Goldberg et al. 06]. • Highway [Sanders & Schultes 05] and contraction [Geisberger 08] hierarchies. • Transit nodes [Bast et al. 06]. • Combinations (pruning and directing algorithms). Good performance on continent-sized road networks: Tens of millions of vertices, a few hundred vertices scanned, under a millisecond on a server, about 0.1 second on a mobile device. Used in practice. Highway dimension 4
  • 6. Result Summary Elegant and practical algorithms, but... Until now: No analysis for non-trivial network classes and no understanding of what makes the algorithms work. Our results: • We define highway dimension (HD). • Give provably efficient implementations of several recent al- gorithms under the small HD assumption. • Analysis highlights algorithm similarities. • Give a generative model of small HD networks (road network formation). Compare to the small world model [Milgram 67, Kleinberg 99]. Highway dimension 5
  • 7. Outline • Dijkstra’s algorithm review. • Shortcuts and CH algorithm. • Reach and RE algorithm. • Transit nodes and TN algorithm. • Highway dimension and sparse covers. • Analysis of RE and CH. • Generative model. • Concluding remarks. Highway dimension 6
  • 8. Definitions • Undirected graph G = (V, E), |V | = n, |E| = m. • ℓ : E → N , minimum length 1, diameter D. • Maximum degree ∆. Small for road networks, assume con- stant for this talk. • Ball Bv,r induced by vertices within distance r from v. • For a path P , |P | denotes the length of P . • Query: find the shortest path from s to t. Algorithms with preprocessing: • Two phases, preprocessing and query. • Preprocessing output not much bigger than the input. • Preprocessing may use more resources than queries. • Practical preprocessing, fast queries. Highway dimension 7
  • 9. Three Intuitive Methods • Reach pruning (RE): Local intersections far from origin/destination can be ignored. • Transit nodes (TN): All long shortest paths to/from a region pass through a small number of nodes. • Highway/contraction hierarchies (CH): Shortest path goes from local roads to local highways to global highways to local highways to local roads. These ideas can be mathematically formalized and lead to prov- ably correct algorithms which work very well on road networks. HD intuition based on TN; all preprocessing is based on CH; query analysis in this talk is for RE. Highway dimension 8
  • 10. Scanning Method • For each vertex v maintain its distance label ds(v) and status S(v) ∈ {unreached, labeled, scanned}. • Unreached vertices have ds(v) = ∞. • If ds(v) decreases, v becomes labeled. • To scan a labeled vertex v, for each arc (v, w), if ds(w) > ds(v) + ℓ(v, w) set ds(w) = ds(v) + ℓ(v, w). • Initially all vertices are unreached. • Start by decreasing ds(s) to 0. • While there are labeled vertices, pick one and scan it. • Different selection rules lead to different algorithms. Highway dimension 9
  • 11. Dijkstra’s Algorithm [Dijkstra 1959], [Dantzig 1963]. • At each step scan a labeled vertex with the minimum label. • Stop when t is selected for scanning. Work almost linear in the visited subgraph size. Reverse Algorithm: Run algorithm from t in the graph with all arcs reversed, stop when s is selected for scanning. Bidirectional Algorithm • Run forward Dijkstra from s and backward from t. • Stopping criteria (careful!). Highway dimension 10
  • 12. Example Graph 1.6M vertices, 3.8M arcs, travel time metric. Highway dimension 11
  • 13. Dijkstra’s Algorithm Searched area Highway dimension 12
  • 14. Bidirectional Algorithm forward search/ reverse search Highway dimension 13
  • 15. Contraction Hierarchies [Geisberget et al. 08] Based on preprocessing that orders vertices and adds shortcuts. Fast and simple! Shortcuts: 100 101 110 1 10 11 A shortcut arc can be omitted if redundant (alternative path exists). Highway dimension 14
  • 16. CH Preprocessing (1) Heuristically order vertices. (2) Shortcut vertices in that order. (3) To the original graph, add all shortcuts introduced in step 2. For road networks, a good heuristic ordering is fast and increases the number of arcs by a small constant factor. Intuition: Higher-order vertices are more important (“global”). Query is bidirectional, each search goes from lower to higher order vertices. Highway dimension 15
  • 17. CH Query Let (V, E ∪ E +) be the graph augmented by shortcuts, recall that the vertices are ordered. Let Gf be the directed graph induced by (v, w) : (v, w) ∈ E ∪ E +, v < w and Gr – by (w, v) : (v, w) ∈ E ∪ E +, v > w. Given a query, run a modified bidirectional Dijkstra’s algorithm, with the forward search in Gf and the reverse search in Gr . (Both searches go “up”.) Upon termination dist(s, t) = minv (d(s, v) + d(v, t)). Experiments show that for road networks queries look at a very small subgraph, even in the worst case. Highway dimension 16
  • 18. Reach Intuition Identify local intersections and prune them when searching far from s and t. Highway dimension 17
  • 19. Reach Definition [Gutman 04] • Consider a vertex v that splits a path P into P1 and P2. rP (v) = min(ℓ(P1), ℓ(P2)). • r(v) = maxP (rP (v)) over all shortest paths P through v. Using reaches to prune Dijkstra: LB(w,t) d(s,v) v w s t If r(w) < min(d(v) + ℓ(v, w), LB(w, t)) then prune w. Highway dimension 18
  • 20. Lower Bounds for Nothing Bidirectional search gives implicit bounds (Rt below). LB(w,t) d(s,v) v w s Rt t Reach-based query algorithm is Dijkstra’s algorithm with prun- ing based on reaches. Given a lower-bound subroutine, a small change to Dijkstra’s algorithm. Highway dimension 19
  • 21. Shortcuts • Consider the graph below. • Many vertices have large reach. 1000 1000 10 10 10 10 10 10 10 10 s 1000 1010 1020 1030 1040 1030 1020 1010 1000 t Highway dimension 20
  • 22. Shortcuts • Consider the graph below. • Many vertices have large reach. • Add a shortcut arc, break ties by the number of hops. 80 1000 1000 10 10 10 10 10 10 10 10 s t Highway dimension 21
  • 23. Shortcuts • Consider the graph below. • Many vertices have large reach. • Add a shortcut arc, break ties by the number of hops. • Reaches decrease. s 1000 60 50 40 30 40 50 60 1000 t Highway dimension 22
  • 24. Shortcuts • Consider the graph below. • Many vertices have large reach. • Add a shortcut arc, break ties by the number of hops. • Reaches decrease. • Repeat. s 1000 20 10 20 30 20 10 20 1000 t Highway dimension 23
  • 25. Reach Algorithm • Consider the graph below. • Many vertices have large reach. • Add a shortcut arc, break ties by the number of hops. • Reaches decrease. • Repeat. • A small number of shortcuts can greatly decrease many reaches. RE algorithm: reaches with shortcuts, bidirectional Dijkstra, balance the searches by the search radius. s 1000 0 10 0 30 0 10 0 1000 t Highway dimension 24
  • 27. TN Algorithm: Intuition For a region, there is a small set of nodes such that all sufficiently long shortest paths out of the region pass a vertex in the set. Highway dimension 26
  • 28. Transit Node (TN) Algorithm [Bast et. al 06] • Divide a map into regions. • For each region, paths to far away places pass through a small number of access points. • The union of all access nodes is the set of transit nodes. • Preprocessing: find all access points, connect each vertex to its access nodes, compute all pairs of shortest paths be- tween transit nodes. • Query: Look for a “local” shortest path or a shortest path of the form origin – transit node – transit node – destination. • Various ways to speed up local queries. • 10 access nodes per region on the average. • Leads to the fastest algorithms. Highway dimension 27
  • 29. Highway Dimension: Intuition TN algorithm works because for a region, there is a small set of nodes such that all sufficiently long shortest paths out of the region pass a vertex in the set. Highway dimension 28
  • 30. Highway Dimension P u 4r Highway dimension (HD) h: ∀ r ∈ ℜ, ∀u ∈ V, ∃S ⊆ Bu,4r , |S| ≤ h, such that ∀ v, w ∈ Bu,4r , if P is a SP: |P (v, w)| > r and P (v, w) ⊆ Bu,4r , then P (v, w) ∩ S = ∅. Locally, a small set covers all long SPs. Highway dimension 29
  • 31. Shortest Path Cover P u 2r (r, k) Shortest path cover ((r, k)-SPC): a set C such that ∀ SP P : r < |P | ≤ 2r ⇒ P ∩ C = ∅ and ∀u ∈ V, |C ∩ Bu,2r | ≤ k All SPs in a range can be covered by a sparse set. Can use constants different from 4 and 2, but the constants are related. Highway dimension 30
  • 32. Highway vs. Doubling Dimension A metric space has a doubling dimension α if every ball or radius r can be covered by 2α balls of radius r/2. Line: Small HD v A line has HD 7 and doubling dimension 1. Highway dimension 31
  • 33. Grid: High HD √ A grid has HD Θ( n) and the doubling dimension 2. Highway dimension 32
  • 34. HD vs. SPC Theorem. If G has highway dimension h, then for any r there exists an (r, h)-SPC. Proof idea: Show that S ∗, the smallest set that covers all short- est paths P : r < |P | ≤ 2r, is an (r, h)-SPC. Finding S ∗ is NP-hard. Efficient construction? Theorem. If G has highway dimension h, then for any r we can construct, in polynomial time, an (r, O(h log n))-SPC. Proof idea: Use the greedy set-cover algorithm to get an O(log n) approximation of S ∗. Proofs depend on the choice of constants in the definitions. Highway dimension 33
  • 35. Generic Preprocessing Let k denote h or O(h log n) (for poly-time preprocessing). • Let S0 = V . For 1 ≤ i ≤ log D build (2i, k)-SPC covers Si. • Let Li = Si − log D Sj (vertex layers). i+1 • Order vertices so that Li comes before Li+1; ordering inside layers is arbitrary. • Do shortcutting in this order to get E +. Lemma. Let v ∈ Li and j ≥ i. Then the number of (v, w) ∈ E + with w ∈ Lj is at most k. Proof. (v, w) corresponds to P with internal vertices less than v, w. Thus w ∈ Bv,2·2i . The SPC definition implies the lemma. Theorem. In (V, E ∪ E +) vertex degrees are bounded by ∆ + k log D and |E ∪ E +| = O(m + nk log D). Highway dimension 34
  • 36. Additional RE Preprocessing Reach bounds are in the graph with shortcuts. Lemma: If v ∈ Li then reach(v) ≤ 2 · 2i. Proof: Suppose the reach is greater. Then there is a shortest path P that v divides into P1 and P2 with |P1|, |P2| > 2 · 2i. Both P1 and P2 contain vertices in Lj with j > i, so there is a shortcut from P1 to P2. But then P is not a shortest path. Additional work is linear. Highway dimension 35
  • 37. RE Query Bound Theorem: RE query takes O((k log D)2) time. Proof: Consider a forward search from s. In Bs,2·2i , the search scans only vertices of Li in Bs,2·2i . Thus O(k log D) scans. • Shortest path can be extracted in time linear in the number of its arcs. • Similar analysis for CH yields the same bound. • Also develop a faster version of TN: O(k log D) query. Highway dimension 36
  • 38. Network Formation Natural networks with constant highway dimension? Attempt to model road networks: • Build on the Earth surface (low doubling dimension). • Build in decentralized and incremental manner. • Highways are faster than local roads. Capture some, but not all, real-life properties. Setting: • Metric space (M, d), doubling dimension log α, diameter D. • Speedup parameter δ ∈ (0, 1). • Edge {v, w} has length d(v, w) and transit time τ (v, w) = d1−δ (v, w). (Long roads are fast.) • On-line network formation, adversarial (or random) vertex placement. Highway dimension 37
  • 39. Network Formation (cont.) In the spirit of dynamic spanners [Gottlieb & Roditty 08]. • Adversary adds vertices, we connect them. • Intuition: connect a new village to all nearby villages and to the closest town. • Formally: maintain covers Ci for 0 ≤ i ≤ log D. C0 = V , Ci+1 ⊆ Ci, vertices in Ci are at least 2i apart. • When adding a new vertex v, add v to C0, . . . , Ci for appro- priate i. (The first vertex added to all C’s.) • For 0 ≤ j ≤ i, connect v to Cj ∩ Bv,6·2j . • If i < log D, connect v to the closest element of Ci+1. Theorem: The network has highway dimension of αO(1). Highway dimension 38
  • 40. Concluding Remarks • Highway dimension explains why intuitive algorithms work well on a non-trivial graph class. • Unified view of several different-looking algorithms. • Extensions for directed graphs. • Additional assumptions, such as small separators, may lead to better bounds. • For real road networks, small HD condition may not hold for some r and some v. • Does low HD make other problems simpler? • Computing HD dimension of road networks (work in progress with Daniel Delling): USA/Europe highway dimension is ≈ 1, 000, access dimension ≈ 20. Highway dimension 39