Highway Dimension and Provably Efficient Shortest Paths Algorithms

Similar documents
Reach for A : an Efficient Point-to-Point Shortest Path Algorithm

Point-to-Point Shortest Path Algorithms with Preprocessing

Route Planning. Reach ArcFlags Transit Nodes Contraction Hierarchies Hub-based labelling. Tabulation Dijkstra Bidirectional A* Landmarks

Algorithm Engineering for Route Planning: An Update International Symposium on Algorithms and Computation 2011 Dorothea Wagner December 6, 2011

Reach for A : Efficient Point-to-Point Shortest Path Algorithms

Reach for A : Efficient Point-to-Point Shortest Path Algorithms

Highway Hierarchies (Dominik Schultes) Presented by: Andre Rodriguez

Experimental Study on Speed-Up Techniques for Timetable Information Systems

Alternative Routes in Road Networks

Simon Peyton Jones (giving the talk) Andrew Goldberg (who did all the work) Microsoft Research

Hierarchical Hub Labelings for Shortest Paths

Transit Nodes Lower Bounds and Refined Construction

Bidirectional search and Goal-directed Dijkstra

Shortest Paths: Basics. Algorithms and Networks 2016/2017 Johan M. M. van Rooij Hans L. Bodlaender

Highway Hierarchies Star

Shortest Paths: Algorithms for standard variants. Algorithms and Networks 2017/2018 Johan M. M. van Rooij Hans L. Bodlaender

Approximation Algorithms

Computing the Shortest Path: A Search Meets Graph Theory

1 The Traveling Salesperson Problem (TSP)

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

val(y, I) α (9.0.2) α (9.0.3)

Highway Hierarchies Hasten Exact Shortest Path Queries

Point-to-Point Shortest Path Algorithms with Preprocessing

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

Accurate High-Performance Route Planning

Introduction to Parallel & Distributed Computing Parallel Graph Algorithms

Exact Combinatorial Algorithms for Graph Bisection

Route Planning in Transportation Networks

2) Multi-Criteria 1) Contraction Hierarchies 3) for Ride Sharing

Combining Hierarchical and Goal-Directed Speed-Up Techniques for Dijkstra s Algorithm

Route Planning for Bicycles Exact Constrained Shortest Paths made Practical via Contraction Hierarchy

Accurate High-Performance Route Planning

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

CAD Algorithms. Categorizing Algorithms

Faster parameterized algorithms for Minimum Fill-In

Engineering Highway Hierarchies

Algorithmic Problems Related to Internet Graphs

A Goal-Directed Shortest Path Algorithm Using Precomputed Cluster Distances

Hub Label Compression

Faster parameterized algorithms for Minimum Fill-In

Lecture 7: Asymmetric K-Center

Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem

Customizable Route Planning in Road Networks

Combinatorial Optimization

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility

Advanced Route Planning and Related Topics Freiburg Update

CSE 431/531: Analysis of Algorithms. Greedy Algorithms. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Lecture 20 : Trees DRAFT

Algorithms for Data Science

Local Algorithms for Sparse Spanning Graphs

Feasibility Study: Subgoal Graphs on State Lattices

and 6.855J March 6, Maximum Flows 2

Flat Routing on Curved Spaces

Approximation Algorithms for Geometric Intersection Graphs

arxiv: v5 [cs.dm] 9 May 2016

Algorithms on Graphs: Part III. Shortest Path Problems. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

Exact Algorithms Lecture 7: FPT Hardness and the ETH

Notes for Recitation 9

Dijkstra's Algorithm

Introduction to Graph Theory

Route Planning in Road Networks

Design and Analysis of Algorithms (VII)

Theorem 2.9: nearest addition algorithm

Solution for Homework set 3

Greedy algorithms Or Do the right thing

Bidirectional search and Goal-directed Dijkstra

CSE 331: Introduction to Algorithm Analysis and Design Graphs

Combining Hierarchical and Goal-Directed Speed-Up Techniques for Dijkstra s Algorithm

PBW 654 Applied Statistics - I Urban Operations Research. Unit 3. Network Modelling

Approximability Results for the p-center Problem

1 Shortest Paths. 1.1 Breadth First Search (BFS) CS 124 Section #3 Shortest Paths and MSTs 2/13/2018

Parallel Graph Algorithms. Richard Peng Georgia Tech

Strongly connected: A directed graph is strongly connected if every pair of vertices are reachable from each other.

Understanding Subgoal Graphs by Augmenting Contraction Hierarchies

(Refer Slide Time: 00:18)

Fall CS598CC: Approximation Algorithms. Chandra Chekuri

Fixed Parameter Algorithms

Minimizing the Diameter of a Network using Shortcut Edges

Connectivity in Interdependent Networks

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

Notes for Lecture 24

Topic: Local Search: Max-Cut, Facility Location Date: 2/13/2007

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

Computing Many-to-Many Shortest Paths Using Highway Hierarchies

Property Testing for Sparse Graphs: Structural graph theory meets Property testing

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Dijkstra s algorithm for shortest paths when no edges have negative weight.

Examples of P vs NP: More Problems

Car or Public Transport Two Worlds

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

Searching for Shortest Path in A Large, Sparse Graph under Memory Limitation: A Successive Mixed Bidirectional Search Method

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Compact Routing with Slack

Undirected Graphs. DSA - lecture 6 - T.U.Cluj-Napoca - M. Joldos 1

6. Lecture notes on matroid intersection

Randomized algorithms have several advantages over deterministic ones. We discuss them here:

Lecture 17: Weighted Graphs, Dijkstra s Algorithm. Courtesy of Goodrich, Tamassia and Olga Veksler

arxiv: v1 [cs.ds] 5 Oct 2010

Transcription:

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 algorithms work. Highway dimension 3

Motivation Computing driving directions. Recent shortest path algorithms (exact): Arc flags [Lauther 04, Köhler et al. 06]. 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 algorithms 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. How efficient algorithms (CH, RE, TN) work (intuition). Why efficient algorithms work. Highway dimension (HD) and sparse covers. Provably good preprocessing. Sublinear bounds on RE query. Generative model of constant HD networks. Concluding remarks. Highway dimension 6

Definitions Undirected graph G = (V, E), V = n, E = m. l : E N, minimum length 1, diameter D. Maximum degree. Small for road networks, assume constant for this talk. Ball B v,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 provably 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 d s (v) and status S(v) {unreached, labeled, scanned}. Unreached vertices have d s (v) =. If d s (v) decreases, v becomes labeled. To scan a labeled vertex v, for each arc (v, w), if d s (w) > d s (v) + l(v, w) set d s (w) = d s (v) + l(v, w). Initially all vertices are unreached. Start by decreasing d s (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 1 10 101 110 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 G f be the directed graph induced by (v, w) : (v, w) E E +, v < w and G r by (w, v) : (v, w) E E +, v > w. Given a query, run a modified bidirectional Dijkstra s algorithm, with the forward search in G f and the reverse search in G r. (Both searches go up.) Upon termination dist(s, t) = min v (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 P 1 and P 2. r P (v) = min(l(p 1 ), l(p 2 )). r(v) = max P (r P (v)) over all shortest paths P through v. Using reaches to prune Dijkstra: d(s,v) v w LB(w,t) s t If r(w) < min(d(v) + l(v, w), LB(w, t)) then prune w. Highway dimension 18

Lower Bounds for Nothing Bidirectional search gives implicit bounds (R t below). d(s,v) v w LB(w,t) s Rt t Reach-based query algorithm is Dijkstra s algorithm with pruning 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 s 10 10 10 10 10 10 10 10 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. 1000 80 1000 s 10 10 10 10 10 10 10 10 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: preprocessing: add shortcuts and compute reaches; query: bidirectional Dijkstra with reach pruning. 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 between transit nodes. Query: Look for a local shortest path or a shortest path of the form origin transit node transit node destination. 10 access nodes per region on the average. 10 10 table lookup per long-range queriey. Various ways to speed up local queries. 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 R, u V, S B u,4r, S h, such that v, w B u,4r, if P is a SP: P(v, w) > r and P(v, w) B u,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 B u,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 shortest 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(hlog 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(hlog n) (for poly-time preprocessing). Let S 0 = V. For 1 i log D build (2 i, k)-spc covers S i. Let L i = S i log D i+1 S j (vertex layers), e.g. vertex partitioning, v S 2, S 4, S 6 v L 6. Order vertices so that L i comes before L i+1 ; ordering inside layers is arbitrary. Do shortcutting in this order to get E +. Lemma. Let v L i and j i. Then the number of (v, w) E + with w L j is at most k. Proof. (v, w) corresponds to P with internal vertices less than v, w. Thus w B v,2 2 i. The SPC definition implies the lemma. Theorem. In (V, E E + ) vertex degrees are bounded by + klog D and E E + = O(m + nklog D). Highway dimension 34

Additional RE Preprocessing Reach bounds are in the graph with shortcuts. Lemma: If v L i then reach(v) 2 2 i. Proof: Suppose the reach is greater. Then there is a shortest path P that v divides into P 1 and P 2 with P 1, P 2 > 2 2 i. Both P 1 and P 2 contain vertices in L j with j > i, so there is a shortcut from P 1 to P 2. But then P is not a shortest path. Additional work is linear. Highway dimension 35

RE Query Bound Theorem: RE query takes O((klog D) 2 ) time. Proof: Consider a forward search from s. In B s,2 2 i, the search scans only vertices of L i in B s,2 2 i. Thus O(klog 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(klog 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,dist), doubling dim. log α, diameter D. Speedup parameter δ (0,1). Edge {v, w} has length dist(v, w) and transit time τ(v, w) = dist 1 δ (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 C i for 0 i log D. C 0 = V, C i+1 C i, vertices in C i are at least 2 i apart. When adding a new vertex v, add v to C 0,..., C i for appropriate i. (The first vertex added to all C s.) For 0 j i, connect v to C j B v,6 2 j. If i < log D, connect v to the closest element of C i+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. 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? Highway dimension 39

Thank You! Highway dimension 40