40
1 Exact Exact and and Approximate Approximate Distances in Graphs – Distances in Graphs – A Survey A Survey Uri Zwick Uri Zwick Tel Aviv University Tel Aviv University

Exact and Approximate Distances in Graphs – A Survey

  • Upload
    azia

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Exact and Approximate Distances in Graphs – A Survey. Uri Zwick Tel Aviv University. v. u. Distances and Shortest Paths. Variations. undirected directed. unweighted non-negative integer weights integer weights non-negative real weights real weights. given pair(s) single source - PowerPoint PPT Presentation

Citation preview

Page 1: Exact  and  Approximate  Distances in Graphs –  A Survey

1

ExactExact and and ApproximateApproximate Distances in Graphs – Distances in Graphs –

A SurveyA Survey

Uri ZwickUri Zwick

Tel Aviv UniversityTel Aviv University

Page 2: Exact  and  Approximate  Distances in Graphs –  A Survey

2

Distances and Shortest Distances and Shortest PathsPaths

u

v

Page 3: Exact  and  Approximate  Distances in Graphs –  A Survey

3

VariationsVariations

unweightednon-negative integer weights

integer weightsnon-negative real weights

real weights

undirecteddirected

exact resultsadditive error

multiplicative error

given pair(s)single source

all pairs

SpannersDistance oracles

deterministicrandomized

Page 4: Exact  and  Approximate  Distances in Graphs –  A Survey

4

Models of ComputationModels of Computation

Integer weights: word RAM modelEach weight is contained in a w-bit word. Allowed to perform additions, subtractions, comparisons, shifts, ANDs, ORs, XORs, and other bit operations.

Real weights: addition-comparison modelThe only operations allowed on edge weights are additions (subtractions) and comparisons. We again assume random access capabilities.

Page 5: Exact  and  Approximate  Distances in Graphs –  A Survey

5

Single-Source Shortest Paths“Classical” results

Unweighted graphsm+nBFS

Nonnegative real edge weights

m+n log nDijkstra ’59 Fredman-Tarjan ’87

General real edge weightsm nBellman ‘58

Ford ‘62

Integer edge weightsmn1/2log N

Goldberg ’95(Gabow-Tarjan ’89)

Page 6: Exact  and  Approximate  Distances in Graphs –  A Survey

6

SSSP, Priority queues and Sorting

Time of Dijkstra = m*(decrease key) + n*(extract min).

Monotone priority queues are enough.

Dijkstra’s algorithm sorts the distances.

If n elements can be sorted in nf(n) time, then SSSP can be solved in mf(n) time. [Thorup ’96]

For undirected graphs, the sorting bottleneck can be avoided! [Thorup ’97]

Page 7: Exact  and  Approximate  Distances in Graphs –  A Survey

7

Single-Source Shortest Pathsdirected graphs, nonnegative integer edge weights, randomized algorithms

m loglog nThorup ’96

m+(n log n)/w1/2-

Thorup ’96

m+nw1/4+

Raman ’97, Cherkassky-

Goldberg-Silverstein ’97

m+n(log n)1/3+Raman ’97

Page 8: Exact  and  Approximate  Distances in Graphs –  A Survey

8

Single-Source Shortest Paths

undirected graphs, nonnegative integer edge weights, deterministic algorithm

m+nThorup ’97

Page 9: Exact  and  Approximate  Distances in Graphs –  A Survey

9

Single-Source Shortest Paths deterministic algorithms

undirected

m(m,n)+n

loglog RPettie- Ramachandra

n ’01 directedm+n log RR – ratio between largest and smallest edge

weights

positive real weights

nonnegative integer weights

directedm log wHagerup ’00

Page 10: Exact  and  Approximate  Distances in Graphs –  A Survey

10

Open Problems: Open Problems: SSSPSSSP1. Directed SSSP with real edge

weights in o(mn) time?

2. Directed SSSP with integer edge weights in o(mn1/2log N) time?

3. Directed SSSP with non-negative integer edge weights in linear time?

4. What is the complexity of the SSSP problem with non-negative weights in the addition-comparison model?

Page 11: Exact  and  Approximate  Distances in Graphs –  A Survey

11

All-Pairs Shortest PathsAll-Pairs Shortest PathsDirected?WeightsComplexityReference

Yesrealmn+n2 log nJohnson ‘77

Yesreal+m*n+n2 log n

Kar-Kol-Phi ’93

McGeoch ‘95

Yesintegermn+n2 loglog nHagerup ’00

NointegermnThorup ’97

Norealmn(m,n)Pettie-Rama.

’01

Page 12: Exact  and  Approximate  Distances in Graphs –  A Survey

12

Min-Plus (Distance) Product

125

703

48

528

5

731

571

252

1036

}{min kjikk

ij bac

BAC

Page 13: Exact  and  Approximate  Distances in Graphs –  A Survey

13

Algebraic Product

kkjikij bac

BAC

The algebraic product of two n by n matrices over a ring can be computed using n algebraic operations (additions, subtractions, multiplications), where <2.376.

Strassen ’69, … , Coppersmith-Winograd ’90

Page 14: Exact  and  Approximate  Distances in Graphs –  A Survey

14

APSP and DPIf D is an n by n matrix containing the edge weightsof a graph, then Dn is the distance matrix.

APSP(n) DP(n) log n

APSP(n) 6 ( DP(n/2) + 2 DP(n/4) + 4 DP(n/8) + …) + O(n2)

DP(n) APSP(3n)

Furman ’70, Munro ’71, Fischer-Meyer ’71

Page 15: Exact  and  Approximate  Distances in Graphs –  A Survey

15

All-Pairs Shortest Paths directed graphs, real weights

n3Floyd ’62 Warshall

’62

*** n5/2 ***Fredman ‘76

n3(loglog n/log n)1/2

Fredman ’76

Takaoka ’92

Page 16: Exact  and  Approximate  Distances in Graphs –  A Survey

16

All-Pairs Shortest Paths undirected graphs, weights from {1,2,

…,M}

Mn < Mn2.367

Galil-Margalit ’92Alon-Naor ’92

Seidel ’92Shoshan-Zwick

’99 – exponent of fast matrix multiplicationCoppersmith-Winograd ’90]

Page 17: Exact  and  Approximate  Distances in Graphs –  A Survey

17

Seidel’s Algorithm unweighted undirected graphs

running time: n log n

Algorithm Seidel(A)if A=J then

return J-Ielse

C Seidel(A2)X CA , deg Ae-1dij 2cij – [xij < cijdegj]return D

endif

Page 18: Exact  and  Approximate  Distances in Graphs –  A Survey

18

All-Pairs Shortest Paths directed graphs, weights from {-M,…,0,

…,M}

(Galil-Margalit ’91)Zwick ‘98

nMnM

nM2.5750.681

ω4

12

ω4

1

2αω4

1)α(ω1

2αω4

α1

Page 19: Exact  and  Approximate  Distances in Graphs –  A Survey

19

Rectangular Matrix Multiplication

n

n n

n

nn

n

- The largest constant such that these algebraic products can be computed using n2+o(1) operations.>0.294

Coppersmith ‘97

Page 20: Exact  and  Approximate  Distances in Graphs –  A Survey

20

Sampled Distance Products

F D for i 1 to log3/2n do{

s (3/2)i

B rand(V,(10n ln n)/s)F min{ F , F[V,B]*F[B,V] }

}

n

n

n

|B|

Page 21: Exact  and  Approximate  Distances in Graphs –  A Survey

21

All-Pairs Shortest Paths directed graphs, weights from

[1,W](1+)-approximate distances and

paths

(n/) log(W/)Zwick ’98

Page 22: Exact  and  Approximate  Distances in Graphs –  A Survey

22

Open Problems: Open Problems: APSPAPSP

5. Are n5/2 additions-comparisons needed?

6. An n3- time algorithm in the add-comp model, counting all operations?

7. An n3-logM time algorithm?

8. An n5/2 time algorithm for unweighted directed graphs?

Page 23: Exact  and  Approximate  Distances in Graphs –  A Survey

23

An estimated distance ’(u,v) is of stretch t iff

(u,v) ’(u,v) t (u,v)

An estimated distance ’(u,v) is of surplus t iff

(u,v) ’(u,v) (u,v) + t

Page 24: Exact  and  Approximate  Distances in Graphs –  A Survey

24

All-Pairs Almost Shortest Pathsunweighted, undirected graphs

SurplusTime*Reference

2n5/2Aingworth-Chekuri-Indyk-Motwani ’96

2n3/2m1/2 , n7/3Dor-Halperin-Zwick ’96

4n5/3m1/3 , n11/5“

2(k-1)kn2-1/km1/k

kn2+1/(3k-4)“

Ignoring polylogarithmic factors

Page 25: Exact  and  Approximate  Distances in Graphs –  A Survey

25

All-Pairs Almost Shortest Pathsweighted undirected graphs

Stretch

Time*Reference

2n3/2m1/2Cohen-Zwick ‘97

7/3n7/3“

3n2“

Page 26: Exact  and  Approximate  Distances in Graphs –  A Survey

26

Multiplicative/Additive Approximations

For every >0, there is b=b(), such that an estimated distance ’(u,v) satisfying

(u,v) ’(u,v) (1+)(u,v) + b() , for every uS and vV,

can be computed in

O(mn+|S|n1+) time.

(Elkin-Peleg ’01) , Elkin ‘01

Page 27: Exact  and  Approximate  Distances in Graphs –  A Survey

27

Open Problems: Open Problems: Approx.Approx.

APSPAPSP9. Improve the surplus/time tradeoff.

Finite surplus in n2+o(1) time?

10.Improve the stretch/time tradeoff. Stretch < 3 in n2+o(1) time?

11.Further explore multiplicate/additive approximations.

Page 28: Exact  and  Approximate  Distances in Graphs –  A Survey

28

Spanners

Let G be a weighted undirected graph.

A subgraph H of G is a t-spanner of G

iff u,vG,

H(u,v) t G(u,v) .

Awerbuch ’85Peleg-Schäffer ‘89

Page 29: Exact  and  Approximate  Distances in Graphs –  A Survey

29

Example

Page 30: Exact  and  Approximate  Distances in Graphs –  A Survey

30

Theorem

For every k>1, every weighted

undirected graph on n vertices

has a (2k-1)-spanner with at

most n1+1/k edges.

Tight for k=1,2,3,5. Conjectured to be

tight for any k – equivalent to a girth

conjecture of Erdös.

Page 31: Exact  and  Approximate  Distances in Graphs –  A Survey

31

Proof/Algorithm: Consider the edges in non-decreasing

order of weight. Add each edge to the

spanner if it does not close a cycle of size

at most 2k.

The resulting graph is a (2k-1)-spanner

and it does not contain a cycle of size at

most 2k. Hence the number of edges is at

most n1+1/k.

[Althöfer, Das, Dobkin, Joseph, Soares ‘93]

Page 32: Exact  and  Approximate  Distances in Graphs –  A Survey

32

If |cycle|2k, then red edge can be removed.

Page 33: Exact  and  Approximate  Distances in Graphs –  A Survey

33

(a,b)-Spanners

Let G be an unweighted undirected graph.

A subgraph H of G is an (a,b)-spanner of G

iff u,vG,

H(u,v) a G(u,v) + b .

(Dor-Halperin-Zwick ’96, a=1)

Peleg-Elkin ‘01

Page 34: Exact  and  Approximate  Distances in Graphs –  A Survey

34

(a,b)SizeReference

(1,2)n3/2Dor-Halperin-Zwick ’96

(1+,b())n1+Elkin-Peleg ‘01

(a,b)-Spanners

Page 35: Exact  and  Approximate  Distances in Graphs –  A Survey

35

Open Problems: Open Problems: SpannersSpanners

12.Are there b<, and >0, such that every unweighted undirected graph on n vertices has a (1,b)-spanner with n3/2- edges?

Page 36: Exact  and  Approximate  Distances in Graphs –  A Survey

36

All-Pairs Shortest Paths

APSPalgorithm

n by ndistancematrix

The output matrix may be much larger than the input graph !!!

Input graph

Page 37: Exact  and  Approximate  Distances in Graphs –  A Survey

37

(Approximate) Distance Oracles

Preprocessingalgorithm

Compactdata structure

(u,v) ’(u,v)Query answeringalgorithm

Input graph

Page 38: Exact  and  Approximate  Distances in Graphs –  A Survey

38

Approximate Distance Oracles

StretchQuery time

SpacePreproc

. time

Reference

64kkn1/k

kn1+1/

kkmn1/k

Awerbuch-Berger-

Cowen-Peleg ‘93

2k+kn1/kCohen ‘93

2k-1kThorup-

Zwick ‘01

Page 39: Exact  and  Approximate  Distances in Graphs –  A Survey

39

Open Problems: Open Problems: Distance OraclesDistance Oracles

13.Deterministic construction of(2k-1,n1+1/k,k)-distance oracles in o(mn) time?

14.Constructing a (3,n3/2,1)-distance oracle in n2+o(1) time?

15.Distance oracles withadditive errors?

Page 40: Exact  and  Approximate  Distances in Graphs –  A Survey

40

A Slightly updated version of the survey can be found at

http://www.cs.tau.ac.il/~zwick/papers/dist-survey-

esa.ps.gzPlease send

suggestions/corrections/comments to

[email protected]