Graphs and Algorithms Exercise 1 (Greedy Coloring)
Total Page:16
File Type:pdf, Size:1020Kb
ETH Z¨urich FS 2010 Institute of Theoretical Computer Science Sample Solution 4 Dr. Dan Hefetz Anna Gundert Graphs and Algorithms Exercise 1 (Greedy Coloring) (a) Prove that there is an ordering v1, v2, . , vn of the vertices of G such that the greedy color- ing algorithm yields an optimal coloring when using this ordering. Let c : V (G) 7→ [k] with k = χ(G) be an optimal coloring of the vertices of G. Con- sider the color classes Ci = {v ∈ V (G) | c(v) = i} and let ki = |C1 ∪ C2 ∪ ... ∪ Ci| for 1 ≤ i ≤ k. Set k0 = 0. Now, order the vertices of G such that for 1 ≤ i ≤ k we have Ci = {vki−1+1, vki−1+2, . , vki }, i.e. the ordering is built of blocks of consecutive vertices belonging to one color class. Given this ordering the greedy algorithm will color the graph with χ(G) colors. (b) Show that there is a tree T = (V, E) on n vertices and a permutation π : {1, 2, . , n} → V such that the algorithm Greedy-Coloring(T, π) needs Ω(log n) colors. We construct an infinite family of rooted trees Tk (k ≥ 0) as follows: Let T0 be an isolated ver- tex and Tk the tree that is obtained by connecting a new root vertex v to the root vertices of k copies of all trees T0,T1,...,Tk−1. Clearly we have n(Tk) = 2 . We want to show that there is an ordering π of the vertices of Tk such that Greedy-Coloring(Tk, π) = k+1 = Ω(log n). Such an ordering π can be defined recursively. T0 has only one vertex and there is only one possible ordering. The ordering of the vertices of Tk is defined as follows: First visit the vertices of T0, then those of T1 etc. up to Tk−1, and finally visit the new root vertex v (the vertices in each subtree are visited in the order defined for this subtree). It is easy to see by induction that using this ordering the greedy coloring algorithm will always need an additional (k + 1)-th color to color the new root vertex v. Exercise 2 (Completing the proof of Brooks’ Theorem) (For the whole proof: The proof presented on http://www.win.tue.nl/ wscor/OW/CO1b/brooks.pdf is similar to the one given in class and the tutorial.) From the lecture, we know that we can assume that ∆(G) ≥ 3 and that G is ∆(G)-regular and κ(G) = 2, i.e. G is 2-connected but not 3-connected. Let {x, y} be a minimal cut-set and let C be one of the connected components of G \{x, y}. Then V (G) \ c is not-empty and we can consider the two graphs G1 = G[C ∪ {x, y}] and G2 = G[V (G) \ C]. We distinguish two cases: Case 1: {x, y} ∈ E(G) x and y both have neighbors in both G1 and G2. Hence, both G1 and G2 are not regular and by the part of the proof treated in the lecture, we know that they can be colored with ∆(G) colors. Let the resulting colorings be c1 abd c2. Because {x, y} ∈ E(G), x and y have to get different colors in both colorings. We can hence swop colors to get a coloring for G: c1(v) if v ∈ V (G1), c2(v) if v ∈ V (G2), c2(v) ∈/ {a, b, c, d} a if v ∈ V (G ), c (v) = c c(v) = 2 2 , b if v ∈ V (G ), c (v) = d 2 2 c if v ∈ V (G2), c2(v) = a d if v ∈ V (G2), c2(v) = b. where we assume c1(x) = a, c1(y) = b, c2(x) = c, c2(y) = d. Case 2: {x, y} ∈/ E(G) 0 0 0 In this case, we add {x, y} to our three graphs, obtaining the graphs G , G1 and G2. If one of x 0 and y has at least two neighbors in both G1 and G2, it has degree ≤ ∆(G) − 1 in both G1 and 0 0 0 G2. In this case we can proceed as above. If e.g. degG1 (x) = degG1 (y) = 1, let x and y be their 0 neighbors in G1. Then {x, y } is also a cut-set and it fulfills the condition of the first argument of this case..