38
Color-coding Noga Alon Institute for Advanced Study and Tel Aviv University Raphael Yuster Dept. of Computer Science Tel Aviv University Uri Zwick Dept. of Computer Science Tel Aviv University Shirly Shirly Zilkha Zilkha

C o l o r -coding

Embed Size (px)

DESCRIPTION

C o l o r -coding. Shirly Zilkha. Noga Alon Institute for Advanced Study and Tel Aviv University. Raphael Yuster Dept. of Computer Science Tel Aviv University. Uri Zwick Dept. of Computer Science Tel Aviv University. Talk Plan. Backgroud, motivation Main results of the paper - PowerPoint PPT Presentation

Citation preview

Page 3: C o l o r -coding

3

Shirly zilkha Color-coding

Backgroud, motivationBackgroud, motivation Novel method for finding simple

paths and cycles of a specified length k, and other small subgraphs, within a given graph G = (V,E).

randomized method of color-coding can be derandomized using families

of perfect hash functions.

Page 4: C o l o r -coding

4

Shirly zilkha Color-coding

Main results of the paperMain results of the paper

a simple cycle of size exactly k (for a fixed k) can be found in either O(Vω) expected time or O(Vωlog V ) worst-case time, where ω < 2.376 is the exponent of matrix multiplication.

In a planar graph such a cycle can be found in either O(V ) expected time or O(V log V ) worst-case time.

If a graph G = (V,E) contains a subgraph isomorphic to a bounded tree-width graph H = (VH,EH) where |VH| = O(log V ), then such a copy of H can be found in polynomial time. This was not previously known even if H were just a path of length O(log V ).

Page 5: C o l o r -coding

5

Shirly zilkha Color-coding

Previous resultsPrevious resultsThese results improve upon previous

results of many authors. The third result resolves in the

affirmative a conjecture of Papadimitriou and Yannakakis that the LOG PATH problem is in P. The paper shows that it is even in NC.

Page 6: C o l o r -coding

6

Shirly zilkha Color-coding

Simple paths of length k-1 Choose a random coloring of the

vertices of G with k colors. Definition: path is colorful iff each

vertex on it is colored by a distinct color.

Colorful path is clearly simple Simple path has a chance of k!/kk >

e-k to become colorful.

Page 7: C o l o r -coding

7

Shirly zilkha Color-coding

Colorful Path Lemma Lemma 3.1:

For a given coloring, a colorful path of length k-1, if exists, can be found in 2O(k)·E worst-case time.

Page 8: C o l o r -coding

8

Shirly zilkha Color-coding

Colorful Path Lemma (Proof)

The idea of the proof:

first prove it for path starting from a specific vertex (using dynamic programming)

Add a new vertex with a new color that is connected to all the vertices of G

Page 9: C o l o r -coding

9

Shirly zilkha Color-coding

Colorful Path Lemma (Proof 2)

We keep in each vertex the colors of colorful paths connecting it to the start vertex

1

3

2

2

23

3

2 1

(3)

ø

ø

øø

øø

ø

ø

Page 10: C o l o r -coding

10

Shirly zilkha Color-coding

Colorful Path Lemma (Proof 2) Each vertex holds 2k entries

1

3

2

2

23

3

2 1

(3)

(1,3)

(2,3)

(2,3)ø

(2,3)

ø

ø

ø

Page 11: C o l o r -coding

11

Shirly zilkha Color-coding

Colorful Path Lemma (Proof 2) We update recursively the neighbors of

each vertex only if its color was not used by the path

1

3

2

2

23

3

2 1

(3)

(1,3)

(2,3)

(2,3)ø

(2,3) (1,2,3

ø

ø

Page 12: C o l o r -coding

12

Shirly zilkha Color-coding

Colorful Path Lemma (Proof 2)

The graph G contains a colorful path of length k-1 with respect to the coloring c if and only if the final collection, that corresponding to paths of length k-1, of at least one vertex is non-empty.

The number of operations performed by the algorithm outlined is at most O(Σii·(i

k)·|E|) which is clearly O(k2k·E).

Page 13: C o l o r -coding

13

Shirly zilkha Color-coding

Finding connected vertices Lemma 3.2:

For a given coloring, all pairs of vertices connected by colorful paths of length k-1, can be found in

A. 2O(k)·V·E worst-case time or

B. 2O(k)·Vω worst-case time

Page 14: C o l o r -coding

14

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·V·E worst-case time ):

Run the algorithm described in the proof of Lemma 3.1 |V| times, once for each starting vertex.

Page 15: C o l o r -coding

15

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ):

Idea: If there is a colorful path, then there exist partition of colors such that the first part of the path is colored by colors of the first subgroup of colors and the second by second. So we will try all possible partitions of colors and look for a colorful path of half length by recursion.

2

2

1

1

23

3

3 4

Page 16: C o l o r -coding

16

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ): Enumerate all partitions of the color set {1,2…

k} into two subsets C1,C2 of size k/2 ((kk/2) < 2k

partitions) Ex:{({1,2}{3,4}), ({1,3}{2,4}), ({(1,4),(2,3)})}

2

2

1

1

23

3

3 4

Page 17: C o l o r -coding

17

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ): For each such partition C1,C2, let V1 be the set

of vertices of G colored by colors from C1 and V2 be the set of vertices of G colored by colors from C2. Let G1 and G2 be the subgraphs of G induced by V1 and V2 respectively.

Ex:C1={1,2} , c2={3,4}2

2

1

1

23

3

3 4

Page 18: C o l o r -coding

18

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ):

Recursively find all pairs of vertices in G1 and in G2 connected by colorful paths of length k/2-1.

Page 19: C o l o r -coding

19

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ):

Collect this information into two Boolean matrices A1 and A2. Let B be a Boolean matrix that describes the adjacency relations between the vertices of V1 and those of V2. The Boolean product A1BA2 gives all pairs of vertices in V that are connected by colorful paths of length exactly k-1, where the first k/2 vertices on the paths are colored by colors from C1 and the last k/2 vertices are colored by colors from C2.

Page 20: C o l o r -coding

20

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ):

By OR-ing the matrices obtained for all the partitions we obtain the desired result.

Page 21: C o l o r -coding

21

Shirly zilkha Color-coding

Finding connected vertices (Proof)

Proof (2O(k)·Vω worst-case time ):

It is easy to verify that the complexity of this approach is indeed 2O(k)·Vω ,as the number of matrix multiplication used, t(k), satisfies the recurrence t(k) < 2k t(k/2).

Page 22: C o l o r -coding

22

Shirly zilkha Color-coding

Theorem 3.3 A simple directed or undirected path

of length k-1 in a (directed or undirected) graph G = (V,E) that contains such a path can be found in 2O(k)·E expected time.

Page 23: C o l o r -coding

23

Shirly zilkha Color-coding

Theorem 3.4 A simple directed or undirected cycle

of size k in a (directed or undirected) graph G = (V,E) that contains such a cycle can be found in either 2O(k)·V·E or 2O(k)·Vω expected time.

Page 24: C o l o r -coding

24

Shirly zilkha Color-coding

Proof of the theorems We pick a random coloring of k

colors. The simple path (cycle) has a chance

of p=k!/kk to be colored in different colors

The expected time until choosing a good coloring is 1/p<ek<22k

22k·2O(k) =2O(k)

Page 25: C o l o r -coding

25

Shirly zilkha Color-coding

Derandomized colorings The randomized algorithms of the

previous two sections can be derandomized with only a small loss of

eficiency. The 2O(k) dependence on k is retained

for the small price of an extra logV factor to the complexity.

Page 26: C o l o r -coding

26

Shirly zilkha Color-coding

Derandomized colorings We want to give every simple path of

length k-1 a chance of being discovered. We need a list of colorings of V such

that for every subset of size k of V there exists a coloring in the list that gives each its vertex a distinct color.

This is a k-perfect family of hash functions from {1,2,…,|V|} to {1,2,…,k}.

Page 27: C o l o r -coding

27

Shirly zilkha Color-coding

k-perfect hash family Definition: a k-perfect hash family

of size s consists of a sequence φ1, φ2, …, φs of functions from {1,…,n} to {1,…,m} with the property, that for any k-subset X of {1,…,n}, there exists i such that φi is injective when restricted to X.

Page 28: C o l o r -coding

28

Shirly zilkha Color-coding

Derandomized colorings There is an explicit construction of a k-

perfect family from {1,2,…,n} to {1,2,…,k} in which each function is specified using O(k) +2loglogn bits.

The size of the family is therefore 2(O(k)+2loglogn) =2O(k)log2n.

This gives us derandomization with factor of log2V (and not of logV as promised).

Page 29: C o l o r -coding

29

Shirly zilkha Color-coding

logV Derandomizing The size of the family of hash

functions can be reduced to 2O(k)logn in the following way: construct a k-perfect family that maps

{1,2,…,n} to {1,2,…,k2}. construct a k-perfect family that maps

{1,2,…, k2} to {1,2,…,k}. compose these families of hash functions.

Page 30: C o l o r -coding

30

Shirly zilkha Color-coding

Derandomized colorings A k-perfect family of size 2O(k) from

{1,2,…, k2} to {1,2,…,k} can be obtained using the previously mentioned construction. (2O(k)

+log2k2=2O(k))

Page 31: C o l o r -coding

31

Shirly zilkha Color-coding

Derandomized colorings Now we want to construct a k-perfect

family of size kO(1)logn from {1,2,…,n} to {1,2,…,k2}

We use small probability spaces that support sequences of almost l-wise independent random variables.

Page 32: C o l o r -coding

32

Shirly zilkha Color-coding

Derandomized colorings Definition: A sequence X1,…,Xn of random

Boolean variables is (ε,l)-independent if for any l positions i1 < i2 < ...< il and any l bits α1,…, αl we have |Pr[Xi1= α1,…,Xil= αl]-2-l| < ε

If the X1,…,Xn are (2-l,l)-independent, then any subset of l variables attains each one of its 2l possible values with some positive probability.

Page 33: C o l o r -coding

33

Shirly zilkha Color-coding

Derandomized colorings There are constructions where the

size of sample spaces that support n random variables that are (ε,l)-independent can be as small as 2O(l+log(1/ ε)logn and they can be constructed in 2O(l+log(1/ ε)nlogn time.

Page 34: C o l o r -coding

34

Shirly zilkha Color-coding

Derandomized colorings To construct a k-perfect family of size

kO(1)logn from {1,2,…,n} to {1,2,…,k2} we use a probability space of size kO(1)

logn that supports l·n random variables that are (2-2l,2·l)-independent, where l= 2logk (i.e. 2l=k2).

We attach l random variables to each element of {1,2,…,n} thereby assigning it a color from {1,2,…,k2}.

Page 35: C o l o r -coding

35

Shirly zilkha Color-coding

Derandomized colorings The probability that two elements i

and j are assigned the same color is at most 21-l =2/k2: Pr[Xi1= C1, Xi2= C2]-2-2l| < 2-2l

Pr[Xi1= Xi2= C]< 2·2-2l

Pr[Xi1= Xi2] = ΣCPr[Xi1= Xi2= C] < 2l·2·2-2l

= 21-l

Page 36: C o l o r -coding

36

Shirly zilkha Color-coding

Derandomized colorings The probability that two distinct

elements in a set of size k are assigned the same color is less than (k

2)·(2/k2) < 1(because it is less than the sum of probabilities of all pairs)

So the probability of all k elements to be different is strictly positive.

So the family is indeed k-perfect.

Page 37: C o l o r -coding

37

Shirly zilkha Color-coding

Open problems, future Open problems, future researchresearch

Is there a polynomial time (deterministic or randomized) algorithm for deciding if a given graph contains a path of length log2V ?(The answer “NO” was proven later by Alon&Gutner)

Can the logV factor appearing in our derandomization be omitted?

Is the problem of deciding whether a given graph contains a triangle as dificult as the Boolean multiplication of two V by V matrices?

Page 38: C o l o r -coding

38

Shirly zilkha Color-coding

The endThe end