Mohamed G. Gouda CS 313K Fall 2012 Exercise 5 1. Let G=(V,E) be a graph where V={1,2,3,4,5}, E={(1,4),(1,5),(2,3),(2,4),(2,5),(4,5)} Which of the following vertex lists is a path, a simple path, a circuit, a simple circuit, or a cycle? (a) (1,5,2,3,2) (b) (1,5,1,4,2,3,1) (c) (5,2,1,4,2,5) (d) (3,2,4,1,5,2,3) (e) (1,4,2,5,1) Sol: (a) is a (not simple) path of length 4 (b) is not a path because (3,1) is not an edge (c) is not a path because (2,1) is not an edge (d) is a (not simple) circuit of length 6 (e) is a cycle of length 4 2. Compute the chromatic number k for the following three graphs and define a valid k-coloring for each of them. (a) G1 = (V1,E1) where V1 = {1,2,3,4}, E1 = {(1,2),(1,3),(2,3),(2,4)} (b) G2 = (V2,E2) where V2 = {1,2,3,4} E2 = {(1,2),(1,4),(2,3),(2,4),(3,4)} (c) G3 = (V3,E3) where V3 = {1,2,3,4,5} E3 = {(1,2),(1,4),(1,5),(2,3),(3,4),(3,5)} Sol: (a) Chromatic number of G1 is 3. Colors of 1, 2, and 3 are distinct. Color of 4 is the same as color of 1 or 3. (b) Chromatic number of G2 is 3. Colors of 1, 2, and 4 are distinct. Colors of 3 is the same as color of 1. (c) Chromatic number of G3 is 2. Colors of 1 and 3 are the same. Colors of 2, 4, and 5 are the same. 3. Let Kn be the complete graph with n vertices 1,2, ..., n, where n is at least 2. Let Mn be the graph that results from Kn after removing all the edges that are incident at vertex 1. (a) What is the chromatic number of Kn? Explain. (b) What is the chromatic number of Mn? Explain. Sol: (a) Chromatic number of Kn is n. The colors of all vertices are distinct because there is an edge between every two vertices. (b) Chromatic number of Mn is n-1. Mn consists of two components: one component consists of only one isolated vertex, namely vertex 1, and the other component is K(n-1). The second component needs n-1 colors and any one of these colors can be used to color vertex 1. 4. Let G=(V,E) be the graph where V={1,2,3,4}, E={(1,2),(2,3),(2,4),(3,4)} Which of the following graphs is NOT subgraphs of G, which is a subgraph but NOT induced for G, and which is an induced subgraph of G? (a) ({3,4}, {(3,4)}) (b) ({2,3,4}, {(2,3),(2,4)}) (c) ({1,2,3}, {(1,2),(1,3)}) Sol: (a) is an induced subgraph of G (b) is a subgraph not induced for G (c) is not a subgraph for G 5. Let G=(V,E) be a "star" graph where V={1,2, ..., n} E={(1,2),(1,3), ..., (1,n)} Vertex 1 is called the "center" and each of the vertices 2, ..., n is called an "end". What is the chromatic number for this graph? Explain. Sol: Chromatic number of a star graph is 2. The center vertex is colored with one color and every end vertex is colored with another color. 6. Let G.0, G.1, ..., G.(m-1) be a sequence of star graphs, and assume that m is an even integer whose value is at least 2. Construct a graph G by connecting these star graphs as follows: Add an edge between the center of every star graph G.i and the center of the star graph G.((i+1) mod m). What is the chromatic number of graph G? Explain. Sol: Chromatic number of G is 2. Color the vertices in each star graph G.i, where i is even, as follows: Color the center vertex red and color each end vertex blue. Color the vertices in each star graph G.i, where i is odd, as follows: Color the center vertex blue and color each end vertex red. 7. This problem is similar to problem 6 except that m is an odd integer whose value is at least 3. Sol: Chromatic number of G is 3. Color the vertices in each star graph G.i, where i is even less than (m-1), as discussed in the solution of problem 6. Color the vertices in each star graph G.i, where is is odd, as discussed in the solution of problem 6. Color the vertices in the star graph G.(m-1) as follows: Color the center vertex green and color each end vertex red or blue. 8. Let G be a graph of two or more vertices. Prove by contradiction that (All u,v vertices in G, N(u) = N(v)) => (All x vertex in G, N(x) = {}) (Hint: N(u) denotes the neighborhood of vertex u; i.e. N(u) is the set of every vertex v such that u and v are neighbors.) Sol: (All u,v vertices in G, N(u) = N(v)) and (Exist x, y vertices in G, N(x) != {} and so y is in N(x)) => {N(x) = N(y)} (Exist y vertex in G, y in N(y)) => {from definition of neighborhood: (All z vertex in G, not (z in N(z))} F 9. Let G1 be a graph that has a vertex v1, where deg(v1) < max-deg(G1) and let G2 be a graph that has a vertex v2, where deg(v2) < max-deg(G2). Also, let G be the graph that results from connecting vertices v1 and v2 by an edge. Compute an integer k such that graph G can be colored validly using k colors. Sol: Because deg(v1) < max-deg(G1), max-deg(G1) is not changed by adding the edge between v1 and v2. Similarly, max-deg(G2) is not changed by adding the edge between v1 and v2. Therefore, max-deg(G) = MAX (max-deg(G1), max-deg(G2)) k = max-deg(G) + 1 = MAX (max-deg(G1), max-deg(G2)) + 1 10. Let G be any graph with n vertices where n >= 2. Show that at least two vertices in G have the same degree. Sol: The degree of any vertex in G is one of the followings: 0,1, ..., n-1. If a vertex in G has a degree of 0, then no vertex in G has a degree of n-1, and vice versa. Therefore, the number of distinct degrees of the n vertices in G is n-1. Thus, by the Pigeon Hole principle, at least two vertices in G have the same degree. 11. Let G be any graph with n vertices. Show that if the degree of each vertex in G is at least 2, then G has a cycle of length at least 3. Sol: Start at any vertex u in G and construct any maximal path P that has no repeated vertices in G. At the beginning, the construction of P will proceed successfully because every encountered vertex has a degree of at least 2. However, the construction of P will stop at a vertex v whose neighbors have all been already included in P. Thus, vertex v has a neighbor w that occurs in the middle of path P. Now consider the path that starts at w, traverses P from w to v, then traverses edge (v,w) and ends at w. This path is a cycle of length at least 3 in G. 12. Let u and v be two vertices in a graph G. Show that if G has two simple paths between vertices u and v, then G has a simple circuit. Sol: Assume that G has the following two simple paths: (u,..P1..,v) and (v,..P2..,u). Therefore, G has the circuit (u,..P1..,v,..P2..,u). If this circuit has no repeated edges, then the proof is complete. Otherwise, let (x,y) be the first edge that occurs in P1 and is repeated in P2. In this case, the circuit can be represented as follows: (u,..P1..,x,y,..P1..,v,..P2..,y,x,..P2..,u) This circuit can be reduced to become as follows: (u,..P1..,x,..P2..,u) where no edge in P1 is repeated in P2(because edge (x,y) was the first edge in P1 that is repeated in P2). Thus, the reduced circuit is simple.