david wilson – microsoft research uri zwick – tel aviv univ

33
David Wilson – Microsoft Research Uri Zwick – Tel Aviv Univ. A Forward-Backward Single-Source Shortest Paths Algorithm “Single-Source Shortest Paths in O(n) time” Deuxièmes journées du GT CoA Complexité et Algorithmes 19-20 novembre Université Paris Diderot (LIAFA)

Upload: alpha

Post on 25-Feb-2016

43 views

Category:

Documents


0 download

DESCRIPTION

David Wilson – Microsoft Research Uri Zwick – Tel Aviv Univ. A Forward-Backward Single-Source Shortest Paths Algorithm. “Single-Source Shortest Paths in O( n ) time”. Deuxièmes journées du GT CoA Complexité et Algorithmes 19-20 novembre Université Paris Diderot (LIAFA). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

David Wilson – Microsoft ResearchUri Zwick – Tel Aviv Univ.

A Forward-Backward Single-Source Shortest Paths

Algorithm“Single-Source Shortest Paths in O(n) time”

Deuxièmes journées du GT CoA Complexité et Algorithmes

19-20 novembreUniversité Paris Diderot (LIAFA)

Page 2: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Single-Source Shortest Paths inweighted directed graphs

with non-negative edge weightsWorst case result

Dijkstra (1959) m + n log n

Arbitrary graph, random U[0,1] edge weightsMeyer (2003)

Goldberg (2008)Hagerup (2006)

m + n

Page 3: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

All-Pairs Shortest Paths inweighted directed graphs

Worst case resultsn Dijkstra mn + n2 log nPettie (2004) mn + n2 log log nChan (2007) n3 / log2n

Page 4: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

All-Pairs Shortest Paths inrandomly weighted complete directed graphs

Expected running times (some with high probability)

Spira (1973) n2 log2nBloniarz (1983) n2 log n

log*nMoffat-Takaoka (1987)Mehlhorn-Priebe (1997) n2 log n

First three results hold in the endpoint independent model

Peres-Sotnikov-Sudakov-Z (2010) n2

Demetrescu-Italiano (2004)

Page 5: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Single-Source Shortest Paths inrandomly weighted complete directed graphs

with sorted adjacency lists

Spira (1973) O(n log2n)Bloniarz (1983) O(n log n log*n)

Moffat-Takaoka (1987)Mehlhorn-Priebe (1997) O(n log n)

Mehlhorn-Priebe (1997) (n log n)

Wilson-Z (2013) O(n)

Using only out-going adjacency lists

Using both out-going and in-coming adjacency lists

Page 6: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Endpoint independent model[Spira (1973)]

For each vertex v use an arbitrary processto generate n1 edge weights

Randomly permute the n1 edge weightsand assign them to the out-going edges of v

Page 7: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Dijkstra’s algorithm

Priority-queue holds vertices

When a vertex is “settled”, relax all its out-going edges

Page 8: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Spira’s algorithm[Spira (1973)]

Uses sorted out-going adjacency listsEdges are examined one at a time

Lazy version of Dijkstra’s algorithm

current edge

Page 9: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Spira’s algorithm[Spira (1973)]

Priority-queue holds current edges

After extracting an edge, examine the next out-

going edge

Fewer edges examinedMore extractions from priority queue

Page 10: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ
Page 11: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Analysis of Spira’s algorithmin the endpoint independent model

Suppose that k vertices were foundEach edge extracted from PQ has prob.

> (nk)/n of leading to a new vertex

Can it be further improved?Sub-linear algorithm

Page 12: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Verification of Shortest Paths Trees

Is this a SPT?

Page 13: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Verification of Shortest Paths Trees

Is this a SPT?

Page 14: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Could in-coming adjacency lists help?

Page 15: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Distances in a complete graphwith independent EXP(1) edge weights

[Davis-Prieditis (1993)] [Janson (1999)]

Page 16: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Distances in a complete graphwith independent EXP(1) edge weights

[Davis-Prieditis (1993)] [Janson (1999)]

Page 17: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Distances in a complete graphwith independent EXP(1) edge weights

[Janson (1999)]

Page 18: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ
Page 19: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Forward-only verification

Page 20: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Pertinent edgesout-pertinent edges

in-pertinent edges

Page 21: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Forward-backward verificationCheck only pertinent edges!

!

Page 22: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Number of pertinent edges

Expected number of pertinent edges is (n)

Probability that number of pertinent edgesis more than (n) is exponentially small

Page 23: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Number of pertinent edges

Condition on a SPT and distances

Page 24: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Number of out-pertinent edgesComparison with a Poisson process

Page 25: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Goal: Run Spira’s algorithm on the subgraph composed of pertinent edges

Run Spira’s algorithm until median distance M is found

Out-pertinent edges are easy to identifyHow do we identify the in-pertinent edges?

Backward scans used to identify in-pertinent edges

When an in-pertinent edge is found,a request is issued for its forward scan

Forward-backward SSSP algorithm

Page 26: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ
Page 27: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Adjacency lists

Out[u]

out-pertinent in-pertinent

Req[u]

in-pertinent

In[v]

in-pertinent

v

v

u

Page 28: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Identifying in-pertinent edges

Page 29: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

( (u,v) is an in-pertinent edge )

Append (u,v) to Req[u]If u has no current edge, the request is urgent,

and (u,v) is immediately inserted into P

Page 30: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Identifying in-pertinent edges

Page 31: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Bucket-based priority queues

Page 32: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Two-level Bucket-based priority queues

If a bucket contains k items when it becomesactive, split it into k sub-buckets

Store the items in each sub-bucketin a binary heap

Probability of more than (n) time is

Page 33: David Wilson  – Microsoft Research Uri  Zwick  – Tel Aviv Univ

Open problemsMore edge weight distributions?

(We already have some extensions)

End-point independent model?

n+o(m) for arbitrary graphs withrandom edge weights?

Could the new forward-backward algorithm be useful in practical applications?