Mohamed G. Gouda CS 313K Fall 2012 Midterm 2 1. Let G be a graph that has: 21 edges 7 vertices of degree 1 each 3 vertices of degree 2 each 7 vertices of degree 3 each x vertices of degree 4 each Compute how many vertices are in G. Sol: From Handshake Theorem, 2*21 = 7*1 + 3*2 + 7*3 + x*4 = 7 + 6 + 21 + 4x = 34 + 4x Therefore, x = (42 - 34)/4 = 2 G has (7+3+7+x) = 19 vertices. 2. Let Kn be the complete graph with n vertices: 1, 2, ..., n, where n is at least 4. Let Ln be the graph that results from Kn after removing two edges (1,2) and (3,4). (a) What is the chromatic number of Kn? Explain. (b) What is the chromatic number of Ln? Explain. Sol: (a) Chromatic number of Kn is n. The colors of all vertices in Kn are distinct because there is an edge between every two vertices. (b) Chromatic number of Ln is n-2. A valid coloring of Ln is the same as Kn except that (1) the color of 2 is the same as that of 1 and (2) the color of 4 is the same as that of 3. 3. A graph T is a tree iff (i) T is connected and (ii) T has no simple circuits. Give an example of tree T that is connected and has a circuit. Specify a circuit in the example tree T. Sol: T=({1,2},{(1,2)}). A circuit in T is (1,2,1). 4. Let G=(V,E) be a graph where V={1,2,3,4} and E={(1,2),(1,3),(1,4),(2,4)}. Let G'=(V',E') be an induced subgraph for G. Given that V' is the set {3,4}, Compute the set E'. Sol: E'={} because G has no edge between the two vertices 3 and 4. 5. Let G1 be a graph whose chromatic number is 7 and G2 be a graph whose chromatic number is 2. Let G be a graph that is constructed by adding one edge between a vertex v1 in G1 and a vertex v2 in G2. What is the chromatic number of G? Explain. Sol: The chromatic number of G is 7. The vertices of G1 can be colored using seven colors in G. Also the vertices of G2 can be colored using two of those seven colors in G. Let the two colors of G2 be red and blue. It is possible that the colors assigned to vertices v1 and v2 are the same and the coloring of G is not valid. To get a valid coloring of G, switch the colors of the vertices in G2 from red to blue and from blue to red.