Mohamed G. Gouda CS 313K Fall 2012 Homework 2 1. Let G be a graph with 5 vertices of degree 3 each, 4 vertices of degree 2 each, 3 vertices of degree 1 each, 2 vertices of degree 4 each, and x vertices of degree 6 each. Compute x if G has 35 edges. Sol: From Handshake Theorem, 70 = 5*3 + 4*2 + 3*1 + 2*4 + x*6 = 15 + 8 + 3 + 8 + 6x = 34 + 6x Thus, x = 36/6 = 6 2. Let G be a graph with n vertices, where n >= 2. Show that (a) if G has a vertex of degree n-1 then G has no vertex of degree 0 (b) if G has a vertex of degree 0 then G has no vertex of degree n-1 Sol: (a) Assume that G has a vertex v of degree n-1. Thus, vertex v is connected by an edge with every other vertex in G. The degree of every vertex in G is at least 1. Therefore, G has no vertex of degree 0. (b) Because (b) is contrapositive of (a), then (b) follows from (a). 3. Generate all subgraphs of graph G=(V,E) where V={1,2,3} and E={(1,2),(2,3)} Indicate which of the generated subgraphs is "induced" for G. Sol: There are 12 generated subgraphs; they are G: the original graph - induced for G {1,2,3}, {(1,2)} {1,2,3}, {(2,3)} {1,2,3}, {} {1,2}, {(1,2)} - induced for G {1,2}, {} {2,3}, {(2,3)} - induced for G {2,3}, {} {1,3}, {} - induced for G {1}, {} - induced for G {2}, {} - induced for G {3}, {} - induced for G 4. Let G=(V,E) be a graph where V={1,2,3,4}, E={(1,2),(1,3),(2,3),(2,4),(3,4)} (a) What is the chromatic number k for G? Explain. (b) Define a valid k-coloring for G. Sol: (a) The chromatic number k = 3. The vertices 1, 2, and 3 need to have distinct colors, but vertex 4 can have the same color of vertex 1. (b) color(1) = color(4) = blue color(2) = red color(3) = white 5. Let Kn denote the complete graph with n vertices. Let Ln denote Kn after removing one edge from it. (a) What is the chromatic number for Kn? Explain. (b) What is the chromatic number for Ln? Explain. Sol: (a) The chromatic number for Kn = n. Every two vertices are connected by an edge in Kn. Thus, every vertex in Kn needs to have distinct colors. (b) The chromatic number for Ln = n-1. Let (u,v) be the edge that is removed from Kn to get Ln. Thus, vertex u can have the same color as that of vertex v. 6. Let G=(V,E) be a graph where V={1,2,3,4,5}, E={(1,2),(1,3),(2,3),(3,4),(3,5),(4,5)} (a) Identify all simple paths from 1 to 5. (b) Identify all simple circuits from 1 to 1. (c) Identify all cycles from 1 to 1. Sol: (a) Simple paths from 1 to 5: (1,3,5), (1,2,3,5), (1,3,4,5), (1,2,3,4,5) (b) Simple circuits from 1 to 1: (1,2,3,1), (1,3,2,1), (1,2,3,4,5,3,1), (1,3,4,5,3,2,1), (1,2,3,5,4,3,1), (1,3,5,4,3,2,1) (c) Cycles from 1 to 1: (1,2,3,1), (1,3,2,1)