Undirected ST-Connectivity In Log Space

44
Undirected ST- Connectivity In Log Space Omer Reingold Slides by Sharon Bruckner

description

Undirected ST-Connectivity In Log Space. Omer Reingold Slides by Sharon Bruckner. Today. Some history What are we adding to the mix? Connectivity in expanders Making expanders: powering it up and cutting it down Putting it together in Log-Space In conclusion. Some History. - PowerPoint PPT Presentation

Transcript of Undirected ST-Connectivity In Log Space

Page 1: Undirected ST-Connectivity In Log Space

Undirected ST-Connectivity In Log Space

Omer ReingoldSlides by Sharon Bruckner

Page 2: Undirected ST-Connectivity In Log Space

Today

• Some history

• What are we adding to the mix?– Connectivity in expanders– Making expanders: powering it up and

cutting it down– Putting it together in Log-Space

• In conclusion

Page 3: Undirected ST-Connectivity In Log Space

Some History

• What is ST-Connectivity?

• What do we know about it?

• What are we trying to accomplish?

Page 4: Undirected ST-Connectivity In Log Space

What is ST-Connectivity?

• Given a graph G and two vertices s and t:– YES if there is a s-t path in G– NO otherwise

• Two flavors to the problem:– STCON: G is directed– USTCON G is undirected.

• Today we’ll talk about USTCON

Page 5: Undirected ST-Connectivity In Log Space

What do we know about it?• Solved easily with BFS

– But – polynomial space!

• USTCON is in NL (=NSPACE(log))– Just guess the path

• USTCON is in DSPACE(log2n) (Savitch)– Guess a vertex on the path, recurse

• USTCON is in RL– Random walk– Randomness is a resource!

• USTCON is complete for SL

Page 6: Undirected ST-Connectivity In Log Space

What are we trying to accomplish?

We would like an algorithm for USTCON which is deterministic

and works in space logarithmic in the size of

the graph

Page 7: Undirected ST-Connectivity In Log Space

What are we adding to the mix?

Page 8: Undirected ST-Connectivity In Log Space

Useful Notations

• The adjacency matrix of a graph G

• We’ll use D regular graphs and the normalized adjancecy matrix: (1/D)M ,

1 i, j EM i, j

0 otherwise

Page 9: Undirected ST-Connectivity In Log Space

Useful Notations

• M is a stochastic matrix, and serves as the “random walk” matrix.

• Largest eigenvalue of M is 1, with eigenvector (1,1,…,1)єRn ,2nd largest eigenvalue is λ(G).

• A (N,D,λ) graph is a D regular graph over N vertices with λ(G) ≤ λ

Page 10: Undirected ST-Connectivity In Log Space

Expanders – a Reminder

Two equivalent definitions of expander• (N,D, λ) is an expander iff the

spectral gap 1- λ > 0• (N,D, λ) is an expander if there

exists ε>0 such that for any set S of at most half the vertices in G, at least (1+ ε)|S| vertices of G are connected to some vertex in S

Note that the adjacency matrix in this case in normalized!

Page 11: Undirected ST-Connectivity In Log Space

Expanders – a Reminder

2

2

21

2

G G

D D

,2

,min

V

S V S

E S SG

S D

Page 12: Undirected ST-Connectivity In Log Space

Connectivity in Expanders

What would happen if each connected component of our graph was an expander?

We could decide USTCON in logspace!

Page 13: Undirected ST-Connectivity In Log Space

Every expander has a O(log(N)) diameter

Theorem:For any s and t in an expander, there’s

a path from s to t of length O(log(N))

Page 14: Undirected ST-Connectivity In Log Space

Proof

i

i

n(1 )

2n

log 1 log2

log n 1ilog 1

Page 15: Undirected ST-Connectivity In Log Space

Logspace Algorithm for paths in an expander

For a (N,D, λ) expander there is a a space O(logD*logN) algorithm which decides USTCON for any s and t

Idea:•From any vertex s there are Dl=O(logN) different paths. •enumerate and check if any of them reach t.

Page 16: Undirected ST-Connectivity In Log Space

How much does it cost?

•At each vertex we have a choice of D vertices, log(D) to represent 1…D.

•Each path is log(N) long.

• we need log(D) at each stage of a log(N) path, altogether O(logD*logN)

Page 17: Undirected ST-Connectivity In Log Space

So far

We now know that if our graph G was an expander graph, USTCON can be solved in Log-Space.

How can we turn G into a graph of expanders?

Page 18: Undirected ST-Connectivity In Log Space

Making expanders: powering it up and cutting it down

Page 19: Undirected ST-Connectivity In Log Space

What do we want from the expander graph G’?

1. There is a path from s to t in G if and only if there is a path from s’ to t’ in G’.

2. Each connected component is an expander, with constant expansion

3. Construction in Log-Space.

Page 20: Undirected ST-Connectivity In Log Space

The Plan

• New tools for our toolbox– Rotation Maps– Powering– Zig Zag products

• The actual construction• Why we got what we wanted• Why we got it in Log-Space

Page 21: Undirected ST-Connectivity In Log Space

Overview• Series of powering by 8 and zig zag

products, one increases the spectral gap and the other one decreases it, but not by much.

8

O(Log(N))

Zig Zag Powering

Page 22: Undirected ST-Connectivity In Log Space

Rotation Maps

• This is the notation we’ll use in this algorithm

GRot : N D N D Let G be a D regular undirected graph. The rotation map

GRot v,i w, j

If the edge (v,w) exists and is the ith edge coming out of v and the jth edge coming out of w

Page 23: Undirected ST-Connectivity In Log Space

Rotation Map Example

1 23

4

17

…54

55

4

3 21

28

5554

…u

v

G

G

Rot u,17 v,28

Rot v,28 u,17

Page 24: Undirected ST-Connectivity In Log Space

PoweringNo limitations on the degree → can expenderize with powering:

The k-th power of the D-regular graph G is Gk where there is an edge (u,v) iff there is a path of length ≤ k between u and v in G. There can be multiple edges!

≤k

Page 25: Undirected ST-Connectivity In Log Space

Powering

What is it good for?• GN is an N-clique an expander• If G = (N,D, λ) then Gk is a (N,Dk, λk) λ(G)

The spectral gap• Why is this not enough?

Page 26: Undirected ST-Connectivity In Log Space

Zig Zag Product

If G is a D-regular graph with N vertices and H is a d-regular graph with D vertices, we replace each v in G with a copy of H, Hv. Therefore, our new graph has [N]x[D] vertices.

H

Part of G

v is now Hv

v

Page 27: Undirected ST-Connectivity In Log Space

Zig-Zag ProductThe resulting graph is a d2 regular

graph, with edges as follows:

zG H

z

G

v

w

a’

b’

Hv

Hw

a

b’

G Z H

a

b

i

j

a’ii’

bj

j’

Page 28: Undirected ST-Connectivity In Log Space

Zig-Zag Product

From last week:

If G is an (N,D,λ) graph and H is a (D,d,) graph, then

The zig-zag product doesn’t hurt the spectral gap too badly!

211 (G z H ) 1 1

2

Page 29: Undirected ST-Connectivity In Log Space

Satan’s Example

Page 30: Undirected ST-Connectivity In Log Space

Technicalities

Page 31: Undirected ST-Connectivity In Log Space

Rotation Map for Powering

u w

v

G

3

12 5

8

G

G

Rot u,3 v,12

Rot v,5 w,8

u v

G2

2GRot u, 3,12 w, 8,5

3,128,5

u w…a1 a2 ak

b1b(k-1)bk

G

G 1 1

G k k

Rot u,a v,b

...

Rot v ',a w,b

u va1,..,ak

bk,..,b1

Gk

2 1 2 k k k 1 1GRot u, a ,a ..., a w, b ,b ..., b

Page 32: Undirected ST-Connectivity In Log Space

Rotation Map for Zig Zag

Hw

(w,b’) (w,b)

G

v

w

a’

b’

Hv

(v,a) (v,a’)i i’

j j’

Rot ((v,a), (i,j)) = zG H

H

G

H

w,b , j', i ' where

a ', i ' Rot a, i

w,b ' Rot v,a '

b, j' Rot b ', j

Page 33: Undirected ST-Connectivity In Log Space

The Actual Construction

Show a transformation that turns every connected component of a graph into an expander.

But!Not any graph, but a D16 regular graph.

How to construct such a graph - later

Page 34: Undirected ST-Connectivity In Log Space

Main Transformation

0

8

i i 1

G G

G G z H

Gi is a D16 regular graph, with N*(D16)i vertices

On input G and H, where G is a D16 regular graph on N vertices, and H is a D-regular graph on D16 vertices

ldefine G,H G , where l O log N

Page 35: Undirected ST-Connectivity In Log Space

Details

•Set l to be the smallest integer s.t. If D is constant, then this number is O(logN).

•Gl has poly(N) vertices.•Every iteration can be done in logspace!

•Transforming the entire graph is equivalent to transforming each connected component separately

l2

2

1 11DN 2

Page 36: Undirected ST-Connectivity In Log Space

More Details

S1

S2

S3

S1

S2

S3

Page 37: Undirected ST-Connectivity In Log Space

Why ?

Show that this is true for a single iteration.

1

m

S

S

0

0

Adjacency matrix sorted by connected components

Both powering and zig zag maintain the block structure

Page 38: Undirected ST-Connectivity In Log Space

Why is this an expander?

G and H be inputs of above. If and G is connected and non-bipartite then

Which means that the output of is indeed an expander.

H 1/ 2

G,H 1/ 2

Non bipartite means that G cannot be split into two sets of

vertices where all the edges of G are between those two sets

Page 39: Undirected ST-Connectivity In Log Space

Proof

G0=G, connected and non-bipartite. Therefore, (inequality) Since

We’ll show and from the lemma we get

20G 1 1/ DN

l2 N2 21 1/ DN 1 1/ DN 1/ 2

2

i i 1i 0 G max G ,1/ 2

H 1/ 2

i 1 i 1 i 1G H 1 3/8 1 G 1 1/ 3 1 G

Page 40: Undirected ST-Connectivity In Log Space

Proof Continued

We saw that if G = (N,D,λ) then Gt = (N,Dt,λt) =We can bound λ(Gi) by

For each i, one of two cases occurs:

Otherwise, it’s always true that

8

i 11 1/ 3 1 G

8

i 1 i

1 5 1G G

2 6 2

41 1/ 3 1 x x

42

i i 1 i 1 i 1G G because it 's the square of 1 1/ 3 1 G G

Page 41: Undirected ST-Connectivity In Log Space

What do we want from the expander graph G’?

1. There is a path from s to t in G if and only if there is a path from s’ to t’ in G’.

2. Each connected component is an expander.

3. Construction in Log-Space.

Page 42: Undirected ST-Connectivity In Log Space

Log Space Construction

Prove that for any D, can be calculated in space O(log(N)).

l16 16v N D , a D

RotG RotHInput Tape

Page 43: Undirected ST-Connectivity In Log Space

Proof

Idea:Evaluating RotGi+1 for each pair takes just a constant additional amount of memory over evaluating RotGi. And all recursions use the same space!

Page 44: Undirected ST-Connectivity In Log Space

Proof - Continued

A will allocate the variables:v in [N] (from the original G)a0, …, al in [D16] (vertex names in H)