Vertex Coloring Maximum Independent Sets

Vertex Coloring & Maximum Independent Sets

Martin Biely

Embedded Computing Systems Group Vienna University of Technology European Union

December 1, 2006

Biely Vertex Coloring & Maximum Independent Sets 1 Vertex Coloring Maximum Independent Sets Outline

1 Vertex Coloring

2 Maximum Independent Sets

Biely Vertex Coloring & Maximum Independent Sets 2 Vertex Coloring Maximum Independent Sets Outline

1 Vertex Coloring

2 Maximum Independent Sets

Biely Vertex Coloring & Maximum Independent Sets 3 Vertex Coloring Maximum Independent Sets The Coloring Problem

Definition 1 (Vertex Coloring)

A legal vertex coloring for a graph is an assignment of a color ϕv to each vertex v, such that no two adjacent vertices have the same color. I.e., ϕv 6= ϕw for every (v, w) ∈ E.

Biely Vertex Coloring & Maximum Independent Sets 4 Vertex Coloring Maximum Independent Sets Chromatic Number

Note that, the Ids of vertices form a legal coloring. However, we want as few colors as possible. But: how many are as few as possible?

Biely Vertex Coloring & Maximum Independent Sets 5 Vertex Coloring Maximum Independent Sets Chromatic Number

Note that, the Ids of vertices form a legal coloring. However, we want as few colors as possible. But: how many are as few as possible? Definition 2 (Chromatic Number) The chromatic number χ(G) of a graph G is the minimum number of colors needed for a legal vertex coloring of the graph.

Biely Vertex Coloring & Maximum Independent Sets 5 Vertex Coloring Maximum Independent Sets Typical Chromatic Numbers

χ(G) = 1, iff G is disconnected (E = ∅) χ(G) ≥ 3, iff G has an odd cycle (G is not bipartite) χ(G) ≥ |biggest |, e.g., trees have χ(G) = 2 χ(G) ≤ 4, if G is planar. (“four color theorem”) χ(G) ≤ ∆(G) + 1, (∆ is the maximum degree)

Biely Vertex Coloring & Maximum Independent Sets 6 Vertex Coloring Maximum Independent Sets Reducing the palette

function first-free(W , P) let c be the smallest color in P not in use by any vertex in W return c

function reduce(m) for round i = ∆ + 2 to m do if ϕv = i then ϕv ← first − free(Nv , P∆+1) inform neighbours (Nv ) of this choice

Biely Vertex Coloring & Maximum Independent Sets 7 Vertex Coloring Maximum Independent Sets Reducing the palette (Proof)

Lemma 3 The function reduce produces a legal coloring of the network G with ∆ + 1 colors, and Time(reduce) = m − ∆ + 1.

Proof. Consider iteration i of the procedure. Since there are at most ∆ neighbours at most ∆ different colors can be in use by the neighbours already, therefore one of the ∆ + 1 colors will be returned by first-free. In iteration i, only vertices with color i change their color. Since we have a legal coloring before the ith iteration, no two neighbours ever change their color in the same round.

Biely Vertex Coloring & Maximum Independent Sets 8 Vertex Coloring Maximum Independent Sets 6-Coloring Trees

Algorithm 6-Color:

ϕv ← idv repeat ` ← |ϕv | if v is root then Iv ← 0 else Iv ← min{i | ϕv [i] 6= ϕparent(v)[i]} ϕv ← hIv ; ϕv [Iv ]i inform children of new color until |ϕv | = `

Biely Vertex Coloring & Maximum Independent Sets 9 Vertex Coloring Maximum Independent Sets 6-Color (Proof)

Lemma 4 In each iteration, 6-Color produces a legal coloring.

Biely Vertex Coloring & Maximum Independent Sets 10 Vertex Coloring Maximum Independent Sets Algorithm 6-Color (Proof)

Lemma 4 In each iteration, 6-Color produces a legal coloring.

Proof. Consider two adjacent vertices of the tree, v and w, and let v = parentw . If Iv 6= Iw , then the new colors will differ in their first component, otherwise, the choice of Iv ensures that ϕv [Iv ] 6= ϕw [Iw ].

Biely Vertex Coloring & Maximum Independent Sets 10 Vertex Coloring Maximum Independent Sets Algorithm 6-Color (Proof)

Definition 5

Let Ki denote the number of bits after the ith iteration. K0 = |id| = O(log n).

Lemma 6 The following hold:

Ki+1 = dlog Ki e + 1

Ki+1 < Ki as long as Ki ≥ 4 (i) Ki ≤ llog Km + 2 for every i

Lemma 7 The final coloring consists of 6 colors.

Proof.

By previous lemma, in the finalBiely iterationVertex Coloi ringwe&haveMaximumKIndepi =endentKi−Sets1 ≤ 3. 11 Therefore, there are 3 choices for the bit Iv and 2 possible values for the bit. I.e., a total of 6 colors. Vertex Coloring Maximum Independent Sets Algorithm 6-Color (Proof)

Lemma 6 The following hold:

Ki+1 = dlog Ki e + 1

Ki+1 < Ki as long as Ki ≥ 4 (i) Ki ≤ llog Km + 2 for every i

Lemma 7 The final coloring consists of 6 colors.

Proof.

By previous lemma, in the final iteration i we have Ki = Ki−1 ≤ 3. Therefore, there are 3 choices for the bit Iv and 2 possible values for the bit. I.e., a total of 6 colors.

Biely Vertex Coloring & Maximum Independent Sets 11 Vertex Coloring Maximum Independent Sets From 6 to 3 Colored Trees

Algorithm Six2Three: for x ∈ {4, 5, 6} do use parent’s color (root just chooses any new one) Each vertex with ϕv = x: ϕ ← first − free(Nv , P3)

Lemma 8 Each iteration removes one color.

Biely Vertex Coloring & Maximum Independent Sets 12 Vertex Coloring Maximum Independent Sets Complexity of 3-coloring a Tree

How many rounds does 6-Color need?

Ki+1 = dlog Ki e + 1 (i) Ki ≤ llog Km + 2 for every i

Definition 9 We define log(?) n = min{i | log (i)n ≤ 2}.

(E.g., log(?) 65535 = 3, since log log log 65535 ≈ 1.999)

Theorem 10 6-Color and Six2Three color any tree in time O(log (?)n).

Biely Vertex Coloring & Maximum Independent Sets 13 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings

Let Ws,n = {(x1, . . . , xs ) | 1 ≤ xi ≤ n, xi 6= xj }. In t rounds any vertex v can learn the topology of its t neighbourhood Γt (v), as W2t+1,n.

Define Bs,n = (Ws,n, Es,n), where (w1, w2) ∈ Es,n when w1 and w2 could be views of neighbouring processes.

Algorithm Πt : Collect topology for t rounds Let ζ(v) ∈ W2t+1,n be the information gathered ϕv ← ϕv ← ϕ˜Π(ζ(v)), where ϕv ← ϕ˜Π : Ws,n → {1, . . . , cmax} is the coloring function of Πt

Biely Vertex Coloring & Maximum Independent Sets 14 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Lemma 11

If Πt produces a legal coloring for any n-vertex ring, then ϕv ← ϕ˜Π defines a legal coloring for B2t+1,n.

Proof. Assume otherwise, then for two neighbouring vertices ζ and ζ 0 of 0 B2t+1,n we have ϕv ← ϕ˜Π(ζ) = ϕv ← ϕ˜Π(ζ ). But then Πt will yield a coloring for a ring where 2 neighbouring vertices have views ζ and ζ0 with the same color.

Corollary 12

If the n-vertex ring can be colored in t rounds using cmax colors, then χ(B2t+1,n) ≤ cmax.

Biely Vertex Coloring & Maximum Independent Sets 15 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Corollary 12

If the n-vertex ring can be colored in t rounds using cmax colors, then χ(B2t+1,n) ≤ cmax.

Theorem 13 Any deterministic distributed algorithm for coloring the (2n)-vertex ring with two colors requires at least n − 1 rounds.

Proof.

By corollary, χ(B2t+1,2n) ≤ 2. However, we can find a cycle of odd length in B2t+1,2n, for t ≤ n − 2 But we know χ(G) ≥ 3, iff G has an odd cycle. Contradiction.

Biely Vertex Coloring & Maximum Independent Sets 16 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Back to 3-coloring rings. . .

Biely Vertex Coloring & Maximum Independent Sets 17 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Lemma 14

(2t) χ(B2t+1,n) ≥ log n.

We define a new Graph B˜s,n = (E˜s,n, E˜s,n), s.t. 0 W˜ s,n = {(x1, . . . , xs ) | 1 ≤ x1 < · · · < xs ≤ n} and (ζ, ζ ) ∈ E˜s,n if 0 ζ = (x1, x2, . . . , xs ) and ζ = (x2, . . . , xs , b), with xs < b ≤ n. Since the undirected version of B˜s,n is a subgraph of Bs,n we have: Lemma 15

χ(Bs,n) ≥ χ(B˜s,n)

To show Lemma 14 we have to bound χ(B˜s,n) from below.

Biely Vertex Coloring & Maximum Independent Sets 18 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Definition 16 (Line Graph) Given a directed graph H = (U, F ), the line graph of H denoted DL(H), is a directed graph whose vertices are the arcs of F and in which there is an arc from e to e0 (e, e0 ∈ F ) iff in H, e0 starts at the vertex in which e ends.

Biely Vertex Coloring & Maximum Independent Sets 19 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Lemma 17

The undirected version of B˜1,n is a of size n.

B˜s+1,n = DL(B˜s,n).

Proof of second claim.

We establish an isomorphism between the B˜s+1,n and DL(B˜s,n). Consider vertex e of DL(B˜s,n), then e is an arc in B˜s,n connecting (x1, x2, . . . , xs ) and (x2, . . . , xs , y). Then we can map e to (x1, x2, . . . , xs , y) in B˜s+1,n. Consider a edge f of DL(B˜s,n), then its start and endpoints, can be mapped to two edges connecting (x1, x2, . . . , xs ), (x2, x3, . . . , xs , y) and (x3, . . . , xs , y, z). Therefore it can be mapped to the edge in B˜s+1,n connecting (x1, x2, . . . , xs , y) and (x2, . . . , xs , y, z).

Biely Vertex Coloring & Maximum Independent Sets 20 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

Lemma 18 For every directed graph H, χ(DL(H)) ≥ log(χ(H))

Proof. Let k = χ(DL(H)), then there is a k-coloring ϕˆ of DL(H) and ϕˆ can be seen as a edgecoloring of H where if e ends where e 0 starts, ϕˆ(e) 6= ϕˆ(e0). Clearly we can create a 2k -coloring for H: ϕ˜(v) = {ϕˆ(e) | e ends in v}. It is legal: Consider v, w ∈ H, with e = (v, w) ∈ H, clealy ϕ˜(v) contains ϕˆ(e), but ϕ˜(w) does not. Otherwise there must be an e 0 ending in w with that color, which is a contradiction to the assumption that it ϕˆ is a legal edge-coloring. It follows that χ(H) ≤ 2k .

Biely Vertex Coloring & Maximum Independent Sets 21 Vertex Coloring Maximum Independent Sets Time Lower Bound coloring rings (cont.)

By induction on s we can now show that Lemma 19 (s−1) χ(B˜s,n) ≥ log n.

(2t) And finally, Lemma 14, i.e., χ(B2t+1,n) ≥ log n. From this and our corollary we get: if an algorithm collects (2t)n information for t rounds, it can color with χ(B2t+1,n) ≥ log colors. Hence, 2t ≥ log(?) n − 1 for a 3-coloring algorithm. I.o.w.: Theorem 20 Any deterministic distributed algorithm for coloring the n-vertex 1 (?) ring with three colors requires at least 2 (log n − 1) rounds.

Biely Vertex Coloring & Maximum Independent Sets 22 Vertex Coloring Maximum Independent Sets Outline

1 Vertex Coloring

2 Maximum Independent Sets

Biely Vertex Coloring & Maximum Independent Sets 23 Vertex Coloring Maximum Independent Sets The MIS Problem

Definition 21 An independent set is a set of vertices U ⊆ V , no two of which are adjacent. An independent set is maximal of no vertex can be added to it without violating its independence. The MIS problem is the problem of computing a maximal independent set for a given graph.

Definition 22 The LexMIS problem is the problem of finding the lexicographically first maximal independent sets.

(Both of these problems are in PTIME)

Biely Vertex Coloring & Maximum Independent Sets 24 Vertex Coloring Maximum Independent Sets . . . and an NP-hard variant

Definition 23 The maximal-size MIS problem is the problem of finding the biggest maximal independent set.

Biely Vertex Coloring & Maximum Independent Sets 25 Vertex Coloring Maximum Independent Sets Sequential greedy MIS construction

Algorithm greedy-mis Variables: U ← V , M ← ∅ while U 6= ∅ do pick any v ∈ U. U ← U \ ({v} ∪ Nv ) M ← M ∪ {v}

Biely Vertex Coloring & Maximum Independent Sets 26 Vertex Coloring Maximum Independent Sets Distributed greedy MIS construction

MIS is solvable by straightforward DFS. LexMIS can be solved by the following algorithm. . .

Biely Vertex Coloring & Maximum Independent Sets 27 Vertex Coloring Maximum Independent Sets Distributed greedy MIS construction

Algorithm MIS-Rank Variables: b ∈ {0, 1, −1} ← −1 initially: invoke join() when receiving a message (Decided, 1) from w do b ← 0 send (Decided, 0) to all neighbours when receiving a message (Decided, 0) from w do invoke join() function join() if received (Decided, 0) from all w with id(w) > myid then b ← 1 send (Decided, 1) to all neighbours.

Biely Vertex Coloring & Maximum Independent Sets 28 Vertex Coloring Maximum Independent Sets Reducing coloring to MIS

Given a coloring with m colors. . .

Algorithm Color2MIS(m) for round i = 0 to m do if ϕv = i then if none of v’s neighbours has joined the MIS then b ← 1 (join MIS) inform neighbours else b ← 0

Biely Vertex Coloring & Maximum Independent Sets 29 Vertex Coloring Maximum Independent Sets Reducing coloring to MIS

Lemma 24 Algorithm Color2MIS constructs an MIS from a m-colored graph in m rounds.

Proof. The m rounds claim is obvious. To see that the set is independent: No two adjacent vertices can be “activated” in the same round, since we have a legal coloring. To see that the set is maximal: Assume that there is a vertex with color i that could be added to the set, then none of its neighbours has joined the set before round i, which would have caused this vertex to join. Therefore no such process can exist.

Biely Vertex Coloring & Maximum Independent Sets 30 Vertex Coloring Maximum Independent Sets Reducing coloring to MIS

Lemma 24 Algorithm Color2MIS constructs an MIS from a m-colored graph in m rounds.

Proof. The m rounds claim is obvious. To see that the set is independent: No two adjacent vertices can be “activated” in the same round, since we have a legal coloring. To see that the set is maximal: Assume that there is a vertex with color i that could be added to the set, then none of its neighbours has joined the set before round i, which would have caused this vertex to join. Therefore no such process can exist.

Corollary 25 Given a coloring algorithm that colors every graph G with f (G)-colors in T (G) rounds, it is possible to construct an MIS for Biely Vertex Coloring & Maximum Independent Sets 30 G in time T (G) + f (G) rounds.

Corollary 26 There exists a deterministic distributed MIS algorithm for trees and for bounded-degree graphs with time complexity O(log(?) n). Vertex Coloring Maximum Independent Sets MIS lower bound on rounds

Theorem 27 Any deterministic distributed MIS algorithm for the n-vertex ring 1 (?) requires at least 2 (log )n − 1) − 1 rounds.

Proof. It suffices to show, that we can 3-color a ring given an MIS with one additional round. Assuming each vertex which neighbours are clockwise and counterclockwise. We can color a tree by requiring every vertex to send a message InMIS in clockwise direction. Every vertex in the MIS uses color 1, those receiving an InMIS message use color 2 and those not receiving such a message use color 3. Without this assumption we can still color in one round, if vertices have ids. If vertices are anonymous 3-coloring is impossibe.

Biely Vertex Coloring & Maximum Independent Sets 31 Vertex Coloring Maximum Independent Sets Small dominating sets

Definition 28 A set M of vertices in a graph G = (V , E) is said to be dominating if every vertex in V \ M has a neighbour in M, or iow, if dist(v, M) ≤ 1 for every v ∈ V .

Clearly V dominates G, therefore we are looking for small dominating sets, i.e., a set M s.t.: M dominates G and |M| ≤ n/2

Biely Vertex Coloring & Maximum Independent Sets 32 Vertex Coloring Maximum Independent Sets Small dominating sets of Trees

Algorithm Small-Dom-Set

L ← minl∈leaves dist(v, l) if l > 2 then participate in MIS algorithm all processes in MIS join else if l = 1 then join dominating set

Biely Vertex Coloring & Maximum Independent Sets 33 Vertex Coloring Maximum Independent Sets Correctness of Small-Dom-Set

Let L0, L1,and L2 denote the vertices at distance 0, 1 and 2 resp. from a leaf. Let M be the outcome of Small-Dom-Set on the tree T and Q the outcome of the MIS algorithm on the subtree. Lemma 29 Then for every vertex v 6∈ M there exists an adjacent vertex v 0 ∈ M.

Proof.

Now partition V into L0, L1, L2 and R. Clearly the Q dominates R. And the vertices in L0 and L2 are dominated by those in L1.

Biely Vertex Coloring & Maximum Independent Sets 34 Vertex Coloring Maximum Independent Sets “Smallness” of Small-Dom-Set

Lemma 30 n |M| ≤ 2

Proof.

By construction M = Q ∪ L1. Oviously |L1| ≤ |L0| and therefore |L ∪ L | |L | ≤ 0 1 . 1 2 Moreover, each v ∈ Q has at least one child in R ∪ L2 which is not in Q. Therefore, |R ∪ L2| ≥ 2 · |Q|. It now follows, |R ∪ L | |L ∪ L | n |M| = |Q| + |L | ≤ 2 + 0 1 = . 1 2 2 2

Biely Vertex Coloring & Maximum Independent Sets 35 Vertex Coloring Maximum Independent Sets

Since we only need to determine the displance from the leaves for up to 2, vertices can determine their (potential) membership in L{0,1,2} in a constant number of rounds. Therefore, Corollary 31 There exists a deterministic distributed algorithm for constructing a small dominating set on trees with time complexity O(log (?)n).

Biely Vertex Coloring & Maximum Independent Sets 36 Vertex Coloring Maximum Independent Sets

Proposition 32 (Final proposition) 37 slides suffice.

Proof. Left as an exercise to the audience.

Biely Vertex Coloring & Maximum Independent Sets 37