Locality in distributed graph algorithms

35
LOCALITY IN DISTRIBUTED GRAPH ALGORITHMS Nathan Linial Presented by: Ron Ryvchin

description

Locality in distributed graph algorithms. Nathan Linial. Presented by: Ron Ryvchin. The Main Results. Tight bound on the complexity of 3-coloring of an n-cycle in a synchronous message passing model Lower bound proof Algorithm with the above complexity (by Cole and Vishkin ). - PowerPoint PPT Presentation

Transcript of Locality in distributed graph algorithms

Page 1: Locality in distributed graph algorithms

LOCALITY IN DISTRIBUTED GRAPH

ALGORITHMSNathan Linial

Presented by: Ron Ryvchin

Page 2: Locality in distributed graph algorithms

The Main Results• Tight bound on the complexity of 3-coloring of an n-cycle

in a synchronous message passing model• Lower bound proof• Algorithm with the above complexity (by Cole and Vishkin)

Page 3: Locality in distributed graph algorithms

Cycle coloring and the chromatic number

6 2C 5 3C

The chromatic number of a graph G (denoted by ) is the minimum number of colors k such that a proper k-coloring of G exists

Page 4: Locality in distributed graph algorithms

The Model• Synchronous message passing• No faults• Message size unlimited

6 3

1

2

4

5

Page 5: Locality in distributed graph algorithms

• After t rounds, each processor knows the labeling of all nodes at distance t or less away

• After diameter(G) rounds every process knows the ID of every node and therefore can compute any function of G

The Model

Page 6: Locality in distributed graph algorithms

A general algorithm• Let t be the number of rounds required to find the 3-

coloring of an n-cycle • The algorithm is:

• Each round, every processor will send all the information it knows to both of its neighbors

• After t rounds, each processor chooses the color of its node according to the information it has

Page 7: Locality in distributed graph algorithms

A lower bound on 3 coloring of an n-cycle

• After t rounds, the data known to a processor P is an ordered list of 2t+1 labels, starting t places before it, through its own and on to the next t labels

1 4

3

2

5

5,1,4 1,4,3

4,3,2

3,2,5

2,5,1

t=1

Page 8: Locality in distributed graph algorithms

A lower bound on 3 coloring of an n-cycle

• Let V be the set of all vectors where are distinct integers from .

• The algorithm is a mapping c from V to {B, R, G}.

Page 9: Locality in distributed graph algorithms

• The graph is the graph whose set of vertices is V• The edges of are given by:

• and are neighbors for all

The Graph

Page 10: Locality in distributed graph algorithms

𝐵1 , 4

1,2,3

4,1,2

3,4,1

2,3,4

Page 11: Locality in distributed graph algorithms

• Lemma 1: .• The mapping is a proper 3-coloring of :

• and are labels of consecutive nodes in graph G algorithm fails

The Graph

1,2,3

4,1,2

3,4,1

2,3,4

2

1

4

3

1,4B 4C

Page 12: Locality in distributed graph algorithms

• Given a graph G = (V, E), its line graph L(G) is the directed graph whose vertex set is E with (u, v) an edge if u,v is a directed path in G.

Line Graphs

1 2

54

3

(1,2) (2,5) (5,4)

(4,3)(1,3) (4,1)

G L G

Page 13: Locality in distributed graph algorithms

L(G) coloring• Lemma 2: For a graph G, .• Proof:

• Given a k-coloring of L(G), is a - coloring of G.

12

24

23 43

31

G L G

1

2 4

3

G

1

2 4

3

Page 14: Locality in distributed graph algorithms

L(G) coloring

x y

Page 15: Locality in distributed graph algorithms

• The graph is a directed graph.• The vertices of are all sequences with .• The outneighbors of are all vertices of the form with .

𝐷𝑠 ,𝑛

(1,2)(1,3) (1,4)

(2,3) (2,4)(3,4)

:

Page 16: Locality in distributed graph algorithms

𝐷𝑠+1 ,𝑛=𝐿 (𝐷𝑠 ,𝑛)

(1,2)(1,3) (1,4)

(2,3) (2,4)(3,4)

:

(1)

(3) (4)(2)

:

Page 17: Locality in distributed graph algorithms

𝐷𝑠+1 ,𝑛=𝐿 (𝐷𝑠 ,𝑛)

Page 18: Locality in distributed graph algorithms

• Lemma 3: • Proof: by induction.

• Base case:

• .

𝜒 (𝐷𝑠 ,𝑛)

(1)

(3) (4)(2)

:

Page 19: Locality in distributed graph algorithms

• Lemma 3: • Proof: by induction.

• Inductive step:

𝜒 (𝐷𝑠 ,𝑛)

Page 20: Locality in distributed graph algorithms

• We proved:

lower bound – conclusion

, 2 1,

2

3 log log...log

log*

t n t n

t times

B D n

t n

Page 21: Locality in distributed graph algorithms

• Define t and as in the case of 3 coloring.• , and thus is bipartite.

• contains an odd cycle:

Lower bound for 2 coloring an n-cycle, for n even

1, , 3 , 2, , 2 , 3, , 3 , 4, , 1,1 ,

5, , 1,1, 2 , , 1,1, , 4 , 1, , 3

n n n n

n n n n

Page 22: Locality in distributed graph algorithms

AN ALGORITHM FOR 3-COLORING OF AN N-

CYCLER. Cole and U. Vishkin, Deterministic coin

tossing and accelerating cascades: micro and macro techniques for designing parallel

algorithms

Page 23: Locality in distributed graph algorithms

• The algorithm has 3 phases• In the first phase it will find a 6-coloring of the cycle• In the second phase it will find a MIS of the cycle from the

6 coloring• In the last phase it will find the 3-coloring of the cycle from

the MIS

3 coloring algorithm

Page 24: Locality in distributed graph algorithms

Phase #1: 6-coloring of an n-cycle• Given a k-coloring of a cycle, we can find a - coloring of

the cycle in one time unit:• define , where is the index of the rightmost bit where a and b differ,

and is the value of this bit in a. For example.:

• Given a k-coloring c, c’(u) = f(u, next(u)) is a –coloring.

X Y Z

Page 25: Locality in distributed graph algorithms

Phase #1: 6-coloring of an n-cycle• The initial labeling of the cycle is an n-coloring of it• After iterations we will get a 6-coloring of the cycle

Page 26: Locality in distributed graph algorithms

Phase #1: initial coloring

20

683 5

4

1 7

9

11 12 14

15

1618191317

10𝑓 (11 ,3 )= 𝑓 (10112 ,00112 )=2∗3+1=7𝑓 (3 ,5 )= 𝑓 (0112 ,1012 )=2∗1+1=3𝑓 (5 ,8 )= 𝑓 (01012 ,10002 )=2∗0+1=1

𝑓 (8 ,12 )= 𝑓 (10002 ,11002 )=2∗2+0=4

Page 27: Locality in distributed graph algorithms

Phase #1: iteration 1

32

643 1

0

1 6

2

7 2 0

1

9051

0

3

Page 28: Locality in distributed graph algorithms

Phase #1: iteration 2

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Page 29: Locality in distributed graph algorithms

Phase #2: MIS• Finding the MIS from the 6-coloring will take 6 iterations.• Each node N will have an alive bit, which will initially be 1.• When we add a node to the independent set it sends a

signal to its neighbor, and at the beginning of the next iteration they will turn their alive bit off (to 0).

• At iteration #(i+1):• If the color of N is i and alive[N] = 1:

• N will be added to the independent set, and will send a signal to its neighbors so they will turn their alive bit off.

Page 30: Locality in distributed graph algorithms

Phase #2: MIS

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Page 31: Locality in distributed graph algorithms

Phase #3: Given an MIS I of an n-cycle, construct a 3-coloring

Color each red

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Page 32: Locality in distributed graph algorithms

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Phase #3: Given an MIS I of an n-cycle, construct a 3-coloring

If is a (clockwise) edgeand , color u green

Page 33: Locality in distributed graph algorithms

Phase #3: Given an MIS I of an n-cycle, construct a 3-coloring

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Color all remaining nodes blue

Page 34: Locality in distributed graph algorithms

33

323 1

0

1 0

4

5 4 2

2

1051

0

3

Phase #3: Given an MIS I of an n-cycle, construct a 3-coloring

Takes one round

Page 35: Locality in distributed graph algorithms

The End