This preview shows page 1. Sign up to view the full content.
Unformatted text preview: DISCRETE DISCRETE MATHEMATICS
W W L CHEN
c c
W W L Chen, 1992, 2008. W W L Chen, 1992, 2003. This chapter is available free to all individuals, on the understanding that it is not to be used for ﬁnancial gain, This chapter is available free to all individuals, on the understanding that it is not to be used for ﬁnancial gains, and may be downloaded and/or photocopied, with or without permission from the author. However, this document may not be kept on any information storage and retrieval system without permission from the author, unless such system is not accessible to any individuals other than its owners. Chapter 17
GRAPHS 17.1. Introduction Introduction A graph is simply a collection of vertices, together with some edges joining some of these vertices. Example 17.1.1. The graph The graph 1 3 2 4 5 has vertices 1, 2, 3, 4, 5, while the edges may be described by {1, 2}, {1, 3}, {4, 5}. In particular, any edge has vertices 1, 2, 3, 4, 5, while the edges may be described by {1, 2}, {1, 3}, {4, 5}. In particular, any edge can be described as a 2subset of the set of all vertices; in other words, a subset of 2 elements of the set can be described as a 2subset of the set of all vertices; in other words, a subset of 2 elements of the set of all vertices. of all vertices. Definition. AA graph is an objectG = (V, E ), where VV is aaﬁnite set and E is a collection of 2subsets Definition. graph is an object G = (V, E ), where is ﬁnite set and E is a collection of 2subsets of V . The elements of V are known as vertices and the elements of E are known as edges. Two vertices of V . The elements of V are known as vertices and the elements of E are known as edges. Two vertices x, y ∈ V are said to be adjacent if {x, y } ∈ E ; in other words, if x and y are joined by an edge. x, y ∈ V are said to be adjacent if {x, y } ∈ E ; in other words, if x and y are joined by an edge. Example 17.1.2. InIn our earlier example,=V{1= ,{1,42,53, 4, 5}E = {{1,=},{{1,3},,{4,,5}}.{4, 5}}. The Example 17.1.2. our earlier example, V , 2 3, , } and and E 2 {1, 2} {1 3}, The vertices vertices 2 and 3 are both adjacent to the vertex 1, not adjacentadjacent other since {2,since {2., 3} ∈can 2 and 3 are both adjacent to the vertex 1, but are but are not to each to each other 3} ∈ E We E . We can also represent this graph by an adjacency list also represent this graph by an adjacency list 12345 21154 3 where each vertex heads a list of those vertices adjacent to it.
Chapter 17 : Graphs page 1 of 11 17–2 W 17–2 MathematicsW L Chen : Discrete Mathematics W W L Chen : Discrete Mathematics Discrete c W W L Chen, 1992, 2008 Remark. Note that our deﬁnition does not permit any edge to join the same vertex, so that there are Remark. Note that our deﬁnition does not permit any edge to join the same vertex, so that there are Remark. Note that our deﬁnition does not permit any edge to join the same vertex, so that there are no “loops”. Note also that the edges do not have directions. no “loops”. Note also that the edges do not have directions. no “loops”. Note also that the edges do not have directions. Example 17.1.3. For every n ∈ N, the wheel graph W = (V, E ), where V = { 0, 1, 2, . . . , n } and { ,n Example 17.1.3. For every n n ∈ Nthe wheel graph Wn n =V, EE ), where V== 0,0,,1,,2,....,.n} } and Example 17.1.3. For every ∈ N, , the wheel graph W n ( (V, ), where V = { 12. and E = {{0, 1}, {0, 2}, . . . , {0, n}, {1, 2}, {2, 3}, . . . , {n − 1, n}, {n, 1}}. E = {{0, 1}, {0, 2}, . . . , {0, n}, {1, 2}, {2, 3}, . . . , {n − 1, n}, {n, 1}}. We can represent this graph by the adjacency list below. We can represent this graph by the adjacency list below. 012 012 100 100 . .23 .23 . nn1 nn1 3 3 0 0 4 4 2 2 ... n − 1 n ... n − 1 n ... 0 0 ... 0 0 ... n 1 ... n 1 .. . n − 2 n − 1 .. n − 2 n − 1 . For example, W4 can be illustrated by the picture below. For For example, W4 can be illustrated by the picture below. 1 1 4 4 0 0 3 3 Example 17.1.4. For every n ∈ N , the complete graph K = (V, E ), where V = {1, 2, . . . , n} and For every ∈ N the complete graph K = V, E ), where V Example 17.1.4. For every nn∈ N, , the complete graph Knn = ((V,E ), where V = {1, 2, . . . , n} and n E = {{i, j } : 1 ≤ i < j ≤ n}. In this graph, every pair of distinct vertices are adjacent. For example, In E = {{i, j } : 1 ≤ i < j ≤ n}. In this graph, every pair of distinct vertices are adjacent. For example, K4 can be illustrated by the picture below. K4 can be illustrated by the picture below.
4 2 2 1 1 4 4 2 2 3 3 In Example 17.1.4, we called Kn the complete graph. This calls into question the situation when In In Example 17.1.4, we called K n the complete graph. This calls into question the situation when Example 17.1.4, we called K the complete graph. This calls into question the situation when we we may have another graph with n vertices and where every pair of dictinct vertices are adjacent. We may have another graph with n vertices and where every pair of dictinct vertices are adjacent. We n we have another graph with n vertices and where every pair of dictinct vertices are adjacent. We have may have then to accept that the two graphs are essentially the same. then to accept that the two graphs are essentially the same. have to accept that the two graphs are essentially the same. then Definition. Two graphs G 1 = ( V1E 1 ) and G 2 = (V2 , E 2 ) are said to be isomorphic if there exists a Two graphs G = ( 1 , E1 and G = V , E ) are said to be isomorphic Definition. Two graphs G1 1= (VV, , E) )and G22= ((V 2,E22) are said to be isomorphic if there exists a 1 1 2 function α : V 1 → V 2 which satisﬁes the following properties: α : V1 → V2 which satisﬁes the following properties: function 1 2 (GI1) (GI1) α : V1 → V2 onetoone. (GI1) α :αV:1V 1 →2V 2 is onetoone. → V is is onetoone. (GI2) :αV: V 1 → V 2 is onto. : V1 → V2 onto. (GI2) (GI2) α α 1 → V2 is is onto. (GI3) For every x, y ∈ , { {x, } ∈ if if and only if (x (x) y (y ∈ ∈ . (GI3) For every y y ∈ V1 , {y }y} ∈ E1 if and only if {α(x) , α(y )} ∈ E2 . (GI3) For every x, x,∈ V1V 1,x, x, y∈ E1E 1 and only if {α{α), α,(α)} )} E2E 2. Example 17.1.5. The two graphs below are isomorphic. The two graphs below are isomorphic. Example 17.1.5. The two graphs below are isomorphic. a a b b 1 1 3 3 c c d d 2 2 4 4 Simply let, for example, α(a) = 2, α(d) = 4, α(b) = 1 and α(c) = 3. Simply let, for example, α(a) = 2, α(d) = 4, α(b) = 1 and α(c) = 3. Simply let, for example, α(a) = 2, α(d) = 4, α(b) = 1 and α(c) = 3.
Chapter 17 : Graphs page 2 of 11 Discrete Mathematics WWL 2008 Chapter 17 : cGraphs Chen, 1992,17–3 Example 17.1.6. Let GG = V, EE ) bedeﬁned as follows. Let V be the collection of all strings of length Let = ( (V, ) be deﬁned as follows. Let V be the collection of all strings 3 in {0, 1}. In other words, V = {x1 x2 x3 : x1 , x2 , x3 ∈ {0, 1}}. Let E contain precisely those pairs of In 123 1 2 3 strings which diﬀer in exactly one position, so that, for example, {000, 010} ∈ E while {101, 110} ∈ E . diﬀer We can show that G is isomorphic to the graph formed by the corners and edges of an ordinary cube. This is best demonstrated by the following pictorial representation of G. 011 001 010 000 100 101 110 111 17.2. Valency 17.2. Valency Definition. Suppose that G = (V, E ), and let v ∈ V be a vertex of G. By the valency of v , we mean Definition. Suppose that G = (V, E ), and let v ∈ V be a vertex of G. By the valency of v , we mean the number the number δ (v ) = {e ∈ E : v ∈ e}, δ (v ) = {e ∈ E : v ∈ e}, the number of edges of G which contain the vertex v . the number of edges of G which contain the vertex v . Example 17.2.1. Fothe wheel graph W4 , , δ (0) 4 and δ v v ) 3 for every v ∈ { { 2 3 4 4 Example 17.2.1. For r the wheel graph W4δ (0) == 4 and (δ () == 3 for every v ∈ 1,1,,2,,3,}.}. Example 17.2.2. Foevery complete graph Kn , v v ) n − 1 for every v ∈ V . Example 17.2.2. For r every complete graph K,nδ (δ () == n − 1 for every v ∈ V . Note that each edge contains two vertices, we immediately have the following simple result. Note that each edge contains two vertices, so so we immediately have the following simple result. The sum of the values of the valency (v ), taken over all vertices v of PROPOSITION 17A. The sum of the values of the valency δδ (v ),taken over all vertices v of a graph is equal In G = (V, E ), is equal to twice the number of edges of G. In other words, δ (v ) = 2E .
v ∈V Consider an edge {x, y } I will contribute to each of the values δ x) and δ (y ) and Proof. Consider an edge {x, y }. .It twill contribute 11to each of the values δ ((x) and δ (y ) and E . The result follows on adding together the contributions from all the edges. In Ifact, wewe can say bitbit more. n fact, can say a a more. Definition. AA vertex ofa agraph G = (V, E ))isssaid to be odd (resp. even) if its valency δ (v ) is odd vertex of graph G = (V, E i said to be odd (resp. even) if its valency (resp. even). PROPOSITION 17B. The number ofof odd vertices of a graph G =V, EE ) is even. The number odd vertices of a graph G = ( (V, ) is even. Proof. Let Ve e and Vodenote respectively the collection of even and odd vertices of G.. Then it follows Let V and Vo denote respectively the collection of even and odd vertices of G Then from Proposition 17A that δ (v ) +
v ∈Ve v ∈Ve Chapter 17 : Graphs v ∈Vo v ∈Vo page 3 of 11 δ (v ) = 2E . 17–4 MathematicsW L Chen : Discrete Mathematics W Discrete c W W L Chen, 1992, 2008 For every v ∈ Ve , the valency δ (v ) is even. It follows that For every v ∈ Ve , the valency δ (v ) is even. It follows that
v ∈Vo v ∈Vo δ (v ) δ (v ) is even. Since δ (v ) is odd for every v ∈ Vo , it follows that Vo  must be even. is even. Since δ (v ) is odd for every v ∈ Vo , it follows that Vo  must be even. Example 17.2.3. For every nn∈∈N satisfying n ≥ 3, the cycle graph Cn = (V, E ), where V = {1, . . . , n} N satisfying n ≥ 3, the cycle graph Cn = (V, E ), where V = {1, . . . , n} Example 17.2.3. For every and E = {{1, 2}, {2, 3}, . . . , {n − 1, n}, {n, 1}}. Here every vertex has velancy 2. and E = {{1, 2}, {2, 3}, . . . , {n − 1, n}, {n, 1}}. Here every vertex has velancy 2. Example 17.2.4. AA graph G = V, E ) )is ssaid to be regular with valency r if δ (v ) = r for every v ∈ V . Example 17.2.4. graph G = ( (V, E i said to be regular with valency r if δ (v ) = r for every v ∈ V . In particular, the complete graph Kn is regular with valency n − 1 for every n ∈ N. In particular, the complete graph Kn is regular with valency n − 1 for every n ∈ N. Remark. The notion of of valency can used to test whether two graphs are isomorphic. It is notIt is not Remark. The notion valency can be be used to test whether two graphs are isomorphic. diﬃcult diﬃcult to seeα : V1if→ : V1gives 2 gives an isomorphism between graphs G11 , E(V1and ) and GV2=E2 ),, then to see that if that α V2 → V an isomorphism between graphs G1 = (V = 1 ) , E1 G2 = ( 2 , (V2 E2 ), then we must have =(δ (α(vδ (α(v )) for everyVv.∈ V1 . we must have δ (v ) δ v ) = )) for every v ∈ 1 17.3. Walks, Paths and Cycles 17.3. Walks, Paths and Cycles Graph theory is particularly useful for routing purposes. After all, a map can be thought of as a graph, Graph theory is particularly useful for routing purposes. After all, a map can be thought of as a graph, with places as vertices and roads as edges (here we assume that there are no oneway streets). It is with places as vertices and roads as edges (here we assume that there are no oneway streets). It is therefore not unusual for some terms in graph theory to have some very practicalsounding names. therefore not unusual for some terms in graph theory to have some very practicalsounding names. Definition. AA walk in a graph G =V, EE ) is a sequence of vertices Definition. walk in a graph G = ( (V, ) is a sequence of vertices v0 , v1 , . . . , vk ∈ V 01 k such that for every i = 1, . . . , k, {vi−1 , vi } ∈ E . In this case, we say that the walk is from v0 to vk . In Furthermore, if all the vertices are distinct, then the walk is called a path. On the other hand, if all the Furthermore, vertices are distinct except that v0 = vk , then the walk is called a cycle. vertices Remark. AA walk can also be thought of as a succession of edges walk can also be thought of as a succession of edges {v0 , v1 }, {v1 , v2 }, . . . , {vk−1 , vk }. Note that a walk may visit any given vertex more than once or use any given edge more than once. Example 17.3.1. Consider the wheel graph W4 4 described in the picture below. Consider the wheel graph W described in the picture below. 1 4 0 3 Then 0, 1, 2, 0, 3, 4, 3 is a walk but not a path or cycle. The walk 0, 1, 2, 3, 4 is a path, while the walk Then 0, 1, 2, 0, 3, 4, 3 is a walk but not a path or cycle. The walk 0, 1, 2, 3, 4 is a path, while the walk 0, 1, 2, 0 is a cycle. 0, 1, 2, 0 is a cycle. Suppose that = ( ( E ) is a graph. Deﬁne relation ∼ on V in the following way. Suppose that Suppose that G G =V,V, E ) is a graph.Deﬁne aarelation ∼ on V in the following way. Suppose that x, y ∈ V . Then we write x ∼ y whenever there exists a walk x, y ∈ V . Then we write x ∼ y whenever there exists a walk v0 , v1 , . . . , vk ∈ V v0 , v1 , . . . , vk ∈ V
Chapter 17 : Graphs page 4 of 11 2 Discrete Mathematics Chapter 17 : Graphs 17–5 Chapter 17 : cGraphs Chen, 1992,17–5 WWL 2008 with x = v0 and y = vk . Then it is not diﬃcult to check that ∼ is an equivalence relation on V . Let with x = v0 and y = vk . Then it is not diﬃcult to check that ∼ is an equivalence relation on V . Let with x = v0 and y = vk . Then it is not diﬃcult to check that ∼ is an equivalence relation on V . Let V = V ∪ ... ∪ V , V = V1 ∪ . . . ∪ Vr, V = V1 ∪ . . . ∪ Vr , 1 r a (disjoint) union of the distinct equivalence classes. For every i = 1, . . . , r, let a (disjoint) union of the distinct equivalence classes. For every i = 1, . . . , r, let a (disjoint) union of the distinct equivalence classes. For every i = 1, . . . , r, let E = {{x, y } ∈ E : x, y ∈ V }; E i = {{x, y } ∈ E : x, y ∈ V i}; i i in other words, Ei denotes the collection of all edges in E with both endpoints in Vi . It is not hard to in other words, Ei denotes the collection of all edges in E with both endpoints in Vi . It is not hard to i i It is see that E1 , . . . , Er are pairwise disjoint. see that E1 , . . . , Er are pairwise disjoint. 1 r Definition. For every i = 1. . . , rr, the graphs G i = (Vi , E i), where V i and E are deﬁned above, are Definition. For every = , , . . . , , the graphs G = Vi E ), where V and Ei are deﬁned above, are Definition. For every i i= 11, . . . , r,the graphs Gii = ((Vi,,Eii), where Vii and Eii are deﬁned above, are called the components of G. If G has just one component, then we say that G is connected. called the components of G. If G has just one component, then we say that G is connected. called the components of G. If G has just one component, then we say that G is connected. Remark. A graph G = (V, E ) is connected if for every pair of distinct vertices x, y ∈ , , there exists graph G = ( (V, ) is connected if for every pair of distinct vertices x, y ∈ V V , there exists Remark. AA graph G = V, EE ) is connected if for every pair of distinct vertices x, y ∈ V there exists a a walk from x to .y . walk from to y walk from x x to y . a Example 17.3.2. The graph described by the picture The graph described by the picture Example 17.3.2. The graph described by the picture 1 1 3 3 5 5 1 1 3 3 5 5 is connected. is connected. is connected. Example 17.3.3. For every n ∈ N, the complete graph Kn is connected. Example 17.3.3. For every n n ∈ Nthe complete graph KKn is connected. Example 17.3.3. For every ∈ N, , the complete graph n is connected. Sometimes, it is rather diﬃ to decide whether or given Sometimes, it is rather diﬃ cult to decide whether or not a given graph is connected. We shall Sometimes, it is rather diﬃcultcultdecide whether or not a not a graph graph is connected. We shall to given is connected. We shall develop develop some algorithms later to study this problem. some algorithms later to study this problem. develop some algorithms later to study this problem. 6 6 6 6 2 2 4 4 7 7 2 2 4 4 7 7 has two components, while the graph described by the picture has two components, while the graph described by the picture 17.4. Hamiltonian Cycles and Eulerian Walks Hamiltonian Cycles and Eulerian Walks 17.4. Hamiltonian Cycles and Eulerian Walks At some imaginary time, the mathematicians Hamilton and Euler went for a holiday. They visited a At some imaginary time, the mathematicians Hamilton and Euler went for a holiday. They visited a country with 7 cities (vertices) linked by a system of roads (edges) described by the following graph. country with 7 cities (vertices) linked by a system of roads (edges) described by the following graph. 1 1 4 4 2 2 5 5 3 3 6 6 7 7
Chapter 17 : Graphs page 5 of 11 17–6 MathematicsW L Chen : Discrete Mathematics W Discrete c W W L Chen, 1992, 2008 Hamilton is a great mathematician. He would only be satisﬁed if he could visit each city once and return Hamilton is a great mathematician. He would only be satisﬁed if he could visit each city once and return to his starting city. Euler is an immortal mathematician. He was interested in the scenery on the way to his starting city. Euler is an immortal mathematician. He was interested in the scenery on the way as well and would only be satisﬁed if he could follow each road exactly once, and would not mind ending as well and would only be satisﬁed if he could follow each road exactly once, and would not mind ending his trip in a city diﬀerent from where he started. his trip in a city diﬀerent from where he started. Hamilton was satisﬁed, but Euler was not. Hamilton was satisﬁed, but Euler was not. ToTo see that Hamilton was satisﬁed, note that he could follow, for example, the cycle see that Hamilton was satisﬁed, note that he could follow, for example, the cycle 1, 2, 3, 6, 7, 5, 4, 1. 1, 2, 3, 6, 7, 5, 4, 1. However, to see that Euler was not satisﬁed, we need to study the problem a little further. Suppose that Euler attempted to start at x and ﬁnish at y . Let z be a vertex diﬀerent from x and y . Whenever Euler vertex diﬀerent arrived at z , he needed to leave via a road he had not taken before. Hence z must be an even vertex. he must Furthermore, if x = y , then both vertices x and y must be odd; if x = y , then both vertices x and y Furthermore, must must be even. It follows that for Euler to succeed, there could be at most two odd vertices. Note now must that the vertices 1, 2, 3, 4, 5, 6, 7 have valencies 2, 4, 3, 3, 5, 3, 2 respectively! have valencies Definition. AA hamiltonian cycle in agraph G = (V, E ) )issaacycle which contains all the vertices of V .. hamiltonian cycle in a graph G = (V, E i cycle which contains all the vertices of V Definition. An eulerian walk in aagraph G = (V, E ) )issaawalk which uses each edge in E exactly once. An eulerian walk in graph G = (V, E i walk which uses each edge in We shall state without proof the following result. We shall state without proof the following result. PROPOSITION 17C. In aagraph G = ((V,E )), a necessary and suﬃcient condition for an eulerian In graph G = V, E , a necessary and suﬃcient condition walk to exist is that G has at most two odd vertices. The question of of determining whether hamiltonian cycle exists, onon the other hand, turns out to be The question determining whether a a hamiltonian cycle exists, the other hand, turns out to be a rather more diﬃcult problem, and we shall not study this here. a rather more diﬃcult problem, and we shall not study this here. 17.5. Trees Trees For obvious For obvious reasons, we make the following deﬁnition. graph T = ( (V, ) is called a tree if it satisﬁes the following conditions: Definition. AA graph T =V, EE ) is called a tree if it satisﬁes the following conditions: (T1) T T is connected. (T1) is connected. (T2) T T does not contain cycle. (T2) does not contain a a cycle. Example 17.5.1. The graph represented by the picture Example 17.5.1. The graph represented by the picture • • • • is a tree. is a tree. The following three simple properties are immediate from our deﬁnition. The following three simple properties are immediate from our deﬁnition. PROPOSITION 17D. Suppose that TT= ((V, E )is aa tree with at least two vertices. Then for every PROPOSITION 17D. Suppose that = V, E ) is tree with at least two vertices. Then for every pair of distinct vertices x, y ∈ V , there is a unique path in T from x to y . pair of distinct vertices x, y ∈ V , there is a unique path in T from x to y .
Chapter 17 : Graphs page 6 of 11 • • • • • • • • • • • • • • • • • • • • • Discrete Mathematics Chapter 17 : c W W L Chen, 1992, 2008 Graphs 17–7 Proof. Since TTisis connected, there is a path from x to . .Let this be Since connected, there is a path from x to y y Let this be (1) v0 (= x), v1 , . . . , vr (= y ). 0 1 r (1) Suppose on the contrary that there is a diﬀerent path diﬀerent (2) u0 (= x), u1 , . . . , us (= y ). 0 1 s (2) must diﬀerent, We shall show that T must then have a cycle. Since the two paths (1) and (2) are diﬀerent, there exists i ∈ N such that v0 = u0 , 0 0 v1 = u1 , 1 1 ..., vii = uii but vii+1 = uii+1 . +1 +1 Consider now the vertices vii+1 , vii+2 , . . . , vr . Since both paths (1) and (2) end at y , they must meet again, +1 +2 r so that there exists a smallest j ∈ {i + 1, i + 2, . . . , r} such that vj = ull for some l ∈ {i + 1, i + 2, . . . , s}. j Then the two paths vi+1 v0 same u0 v1 same u1 vi same ui ui+1 give rise to a cycle give rise to a cycle vi , vi+1 , . . . , vj −1 , ul , ul−1 , . . . , ui+1 , vi , vi , vi+1 , . . . , vj −1 , ul , ul−1 , . . . , ui+1 , vi , contradicting the hypothesis that T is a tree. contradicting the hypothesis that T is a tree. PROPOSITION 17E. Suppose that TT = ((V,E )) is a tree with at least two vertices. Then the graph PROPOSITION 17E. Suppose that = V, E is a tree with at least two vertices. Then the graph obtained from T be removing an edge has two components, each of which is a tree. obtained from T be removing an edge has two components, each of which is a tree. Sketch of Proof. Suppose that {{u,vv }∈ E , ,where T = ((V,E ). Let us remove this edge, and consider Sketch of Proof. Suppose that u, } ∈ E where T = V, E ). Let us remove this edge, and consider the graph G = (V, E ),, where E = E \ {{u, v }}.. Deﬁne a relation R on V as follows. Two vertices the graph G = (V, E ) where E = E \ {{u, v }} Deﬁne a relation R on V as follows. Two vertices x, y ∈ V satisfy xRy if and only if x = y or the (unique) path in T from x to y does not contain the x, y ∈ V satisfy xRy if and only if x = y or the (unique) path in T from x to y does not contain the edge {u, v }.. It can be shown that R is an equivalence relation on V ,, with two equivalence classes [[u]] edge {u, v } It can be shown that R is an equivalence relation on V with two equivalence classes u and [[v ]. We can then show that [[u]] and [[v ]] are the two components of G.. Also, since T has no cycles, and v ]. We can then show that u and v are the two components of G Also, since T has no cycles, so neither do these two components. so neither do these two components. PROPOSITION 17F. Suppose that TT== V, EE ) is a tree.Then EE ==VV −− . . PROPOSITION 17F. Suppose that ( (V, ) is a tree. Then        1 1 Proof. We shall prove this result by induction onon the number of vertices T = (= E ). EClearly the Proof. We shall prove this result by induction the number of vertices of of T V, (V, ). Clearly the result is if V  if 1. Suppose now that the that the true if V  true. if V T ≤ (V, E ) with=V(V, E ) with result is true true = V = 1. Suppose now result is result is ≤ k Let  = k . Let T  = k +1. If we remove1one edge from Tone edge from T , then17E, the resulting graph is made upgraph iscomponents, V = k + . If we remove , then by Proposition by Proposition 17E, the resulting of two made up of two components,aeach ofDenote is a tree. Denote these by components by each of which is tree. which these two components two T1 = (V1 , E1 ) 1 1 1
Chapter 17 : Graphs vj −1 vj same ul ul−1 us vr distinct and T2 = (V2 , E2 ). 2 2 2
page 7 of 11 17–8 W 17–8 MathematicsW L Chen : Discrete Mathematics W W L Chen : Discrete Mathematics Discrete c W W L Chen, 1992, 2008 Then clearly V1  ≤ k and V2  ≤ k . It follows from the induction hypothesis that 1 2 Then clearly V1  ≤ k and V2  ≤ k . It follows from the induction hypothesis that Then clearly V1  ≤ k and V2  ≤ k . It follows from the induction hypothesis that E1  = V1  − 1 1 1 E1  = V1  − 1 E1  = V1  − 1 and and and E2  = V2  − 1. 2 2 E2  = V2  − 1. E2  = V2  − 1. Note, however, that V  = V1  + V2  and E  = E1  + E2  + 1. The result follows. 1 2 1 2 Note, however, that V  = V1  + V2  and E  = E1  + E2  + 1. The result follows. 1. 17.6. Spanning Tree of a Connected Graph Spanning Tree of Connected Graph 17.6. Spanning Tree of a a Connected Graph Definition. Suppose that G = (V, E ) is a connected graph. Then a subset T of E is called a spanning Suppose that = ( (V, ) is a connected graph. Then subset T of E is Definition. Suppose that GG = V, EE ) is aconnected graph. Then aasubset T of E is called a spanning tree of G if T satisﬁes the following two conditions: of G if T satisﬁes the following two conditions: tree (ST1) Every vertex V belongs to an edge in T (ST1) Every vertex in in V belongs to an edge in .T . (ST1) Every vertex in V belongs to an edge in T . (ST2) The edges T form a a tree. (ST2) The edges in in T form tree. (ST2) The edges in T form a tree. Example 17.6.1. Consider the connected graph described by the following picture. Example 17.6.1. Consider the connected graph described by the following picture. Example 17.6.1. Consider the connected graph described by the following picture. 1 1 4 4 2 2 5 5 3 3 6 6 Then each of the following pictures describes a spanning tree. Then each of the following pictures describes a spanning tree. 1 1 4 4 2 2 5 5 3 3 6 6 1 1 4 4 2 2 5 5 3 3 6 6 1 1 4 4 2 2 5 5 3 3 6 6 Here we use the notation that an edge represented by a double line is an edge in T . It is clear from this Here we use the notation that an edge represented by a double line is an edge in T . It is clear from this Here we use the spanning tree may not represented by a double line is an edge in T . It is clear from this example that a spanning tree may not be unique. that a notation that an edge be unique. example that a spanning tree may not be unique. example The natural question we may “grow” spanning tree. To do this, The natural question is, given a connected graph, how we may “grow” a spanning tree. To do this, The natural question is,is, given a connected graph, howwe may “grow” aa spanning tree. To do this, given a connected graph, how we apply a “greedy algorithm” as follows. apply a “greedy algorithm” as follows. we apply a “greedy algorithm” as follows. we GREEDY ALGORITHM FOR A SPANNING TREE. Suppose that G = (V, E ) is a connected GREEDY ALGORITHM FOR A SPANNING TREE. Suppose that G = (V, E ) is a connected FOR A SPANNING TREE. Suppose that G = (V, E ) graph. graph. (1) Take any vertex in V as an initial partial tree. (1) Take any vertex in V as an initial partial tree. (2) Choose edges in E one at a time so that each new edge joins a new vertex in V to the partial tree. (2) Choose edges in E one at a time so that each new edge joins a new vertex in V to the partial tree. (3) Stop when all the vertices in V are in the partial tree. (3) Stop when all the vertices in V are in the partial tree. Consider the connected graph Example 17.6.1. Let us start with vertex 5. Choosing Example 17.6.2. Consider the connected graph in Example 17.6.1. Let us start with vertex 5. ChoosExample 17.6.2. Consider the connected graph inin Example 17.6.1. Let us start with vertex 5. Choosing the edges {4, 5}, {2, 5}, {2, 3}, {1, 4}, {3 , 6} successively, obtain thethe following partial trees, the last the the edges 5},, {2,, 5},, {2,, 3},, {1,, 4},, {3,, 6} ,successively, we we obtain the following partial trees, the last edges {4, {4 5} {2 5} {2 3} {1 4} {3 6} successively, we obtain following partial trees, the last of ing of which represents a spanning tree. which represents a a spanning tree. of which represents spanning tree. 1 1 4 4 2 2 5 5 3 3 6 6 1 1 4 4
Chapter 17 : Graphs 1 1 4 4 2 2 5 5 3 3 6 6 2 2 5 5 3 3 6 6 1 1 4 4 2 2 5 5 1 1 4 4 3 3 6 6 2 2 5 5 3 3 6 6 page 8 of 11 Discrete Mathematics WWL 2008 Chapter 17 : cGraphs Chen, 1992,17–9 However, if we start with vertex 6 and choose the edges {3, 6}, {5, 6}, {4, 5}, {1, 4}, {2, 5} successively, diﬀerent we obtain the following partial trees, the last of which represents a diﬀerent spanning tree. 1 4 2 5 3 6 1 4 2 5 1 4 3 6 2 5 3 6 1 4 2 5 1 4 3 6 2 5 3 6 PROPOSITION 17G. The Greedy algorithm for a spanning tree always works. PROPOSITION 17G. The Greedy algorithm for a spanning tree always works. Proof. We need to show that at any stage, we can always join a new vertex in V to the partial tree Proof. We need to show that at any stage, we can always join a new vertex in V to the partial tree by an edge in E . To see this, let S denote the set of vertices in the partial tree at any stage. We may by an edge in E . To see this, let S denote the set of vertices in the partial tree at any stage. We may assume that S = ∅, for we can always choose an initial vertex. Suppose that S = V . Suppose on the assume that S = ∅, for we can always choose an initial vertex. Suppose that S = V . Suppose on the contrary that we cannot join an extra vertex in V to the partial tree. Then there is no edge in E having contrary that we cannot join an extra vertex in V to the partial tree. Then there is no edge in E having one vertex in S and the other vertex in V \ S . It follows that there is no path from any vertex in S to one vertex in S and the other vertex in V \ S . It follows that there is no path from any vertex in S to any vertex in V \ S , so that G is not connected, a contradiction. any vertex in V \ S , so that G is not connected, a contradiction. Problems for Chapter 17 1. A 3cycle in a graph is a set of three mutually adjacent vertices. Construct a graph with 5 vertices and 6 edges and no 3cycles. 2. How many edges does the complete graph Kn have? 3. By looking for 3cycles, show that the two graphs below are not isomorphic. • • • • • • • • • • • • 4. For each of the following lists, decide whether it is possible that the list represents the valencies of all the vertices of a graph. Is so, draw such a graph. a) 2, 2, 2, 3 b) 2, 2, 4, 4, 4 c) 1, 2, 2, 3, 4 d) 1, 2, 3, 4 5. Suppose that the graph G has at least 2 vertices. Show that G must have two vertices with the same valency.
Chapter 17 : Graphs page 9 of 11 Proof. We need to show that at any stage, we can always join a new vertex in V to the partial tree by an edge in E . To see this, let S denote the set of vertices in the partial tree at any stage. We may assume that S = ∅, for we can always choose an initial vertex. Suppose that S = V . Suppose on the contrary that we cannot join an extra vertex in V to the partial tree. Then therecis W W L Chen,E having no edge in 1992, 2008 Discrete Mathematics one vertex in S and the other vertex in V \ S . It follows that there is no path from any vertex in S to any vertex in V \ S , so that G is not connected, a contradiction. Problems for Chapter 17 Problems for Chapter 17 1. A 3cycle in a graph is a set of three mutually adjacent vertices. Construct a graph with 5 vertices 1. and 6 edges and no 3cycles. of three mutually adjacent vertices. Construct a graph with 5 vertices A 3cycle in a graph is a set and 6 edges and no 3cycles. 2. How many edges does the complete graph Kn have? 2. How many edges does the complete graph Kn have? 3. By looking for 3cycles, show that the two graphs below are not isomorphic. 3. By looking for 3cycles, show that the two graphs below are not isomorphic. • • • • • • • • • • • • 4. For each of the following lists, decide whether it is possible that the list represents the valencies of all each of the following lists, decide such a it is possible that the list represents the valencies of 4. Forthe vertices of a graph. Is so, drawwhether graph. a) 2, vertices d) 1, 2, 3, 4 all the 2, 2, 3 of a graph. b) so, 2, 4, 4, such a graph. c) 1, 2, 2, 3, 4 Is 2, draw 4 a) 2, 2, 2, 3 b) 2, 2, 4, 4, 4 c) 1, 2, 2, 3, 4 d) 1, 2, 3, 4 5. Suppose that the graph G has at least 2 vertices. Show that G must have two vertices with the same valency. 5. Suppose that the graph G has at least 2 vertices. Show that G must have two vertices with the same valency. 6. Consider the graph represented by the following adjacency list. 0123456789 5217201300 864 682 55 9 6 94 How many components does this graph have? 7. Mr and Mrs Graf gave a party attended by four other couples. Some pairs of people shook hands when they met, but naturally no couple shook hands with each other. At the end of the party, Mr Graf asked the other nine people how many hand shakes they had made, and received nine diﬀerent answers. Since the maximum number of handshakes any person could make was eight, the nine answers were 0, 1, 2, 3, 4, 5, 6, 7, 8. Let the vertices of a graph be 0, 1, 2, 3, 4, 5, 6, 7, 8, g , where g represents Mr Graf and the nine numbers represent the other nine people, with person i having made i handshakes. a) Find the adjacency list of this graph. b) How many handshakes did Mrs Graf make? c) How many components does this graph have?
Chapter 17 : Graphs page 10 of 11 Mr Graf asked the other nine people how many hand shakes they had made, and received nine diﬀerent answers. Since the maximum number of handshakes any person could make was eight, the nine answers were 0, 1, 2, 3, 4, 5, 6, 7, 8. Let the vertices of a graph be 0, 1, 2, 3, 4, 5, 6, 7, 8, g , where g represents Mr Graf and the nine numbers represent the other nine people, with person i having made i handshakes. c W W L Chen, 1992, 2008 Discrete Mathematics a) Find the adjacency list of this graph. b) How many handshakes did Mrs Graf make? c) How many components does this graph have? 8. Hamilton and Euler decided to have another holiday. This time they visited a country with 9 cities 8. Hamilton and Euler decided to have another holiday. This time they visited a country with 9 cities and a road system represented by the following adjacency table. and a road system represented by the following adjacency table. 1 1 2 2 4 4 6 6 8 8 2 2 1 1 3 3 7 7 9 9 3 3 2 2 4 4 8 8 45 45 14 14 36 36 5 5 9 9 6 6 1 1 5 5 7 7 9 9 7 7 2 2 6 6 8 8 8 8 1 1 3 3 7 7 9 9 9 9 2 2 4 4 6 6 8 8 a) a) Was either disappointed? Was either disappointed? b) b) The government of this country wasconcerned that either of these mathematicians could be The government of this country was concerned that either of these mathematicians could be disappointed with their visit, and decided to to build an extra road linking two the cities just in disappointed with their visit, and decided build an extra road linking two of of the cities just case. case. this necessary? If so,If so, advise them to proceed. in Was Was this necessary? advise them how how to proceed. 9. Find a hamiltonian cycle in the graph formed by the vertices and edges of an ordinary cube. 9. Find a hamiltonian cycle in the graph formed by the vertices and edges of an ordinary cube. 10. For which values of n ∈ N is it true that the complete graph Kn has an eulerian walk? 10. For which values of n ∈ N is it true that the complete graph Kn has an eulerian walk? 11. Draw the six nonisomorphic trees with 6 vertices. 11. Draw the six nonisomorphic trees with 6 vertices. 12. Suppose that T = (V, E ) is a tree with V  ≥ 2. Use Propositions 17A and 17F to show that T has 12. Suppose that T = (V, E ) is a tree with V  ≥ 2. Use Propositions 17A and 17F to show that T has at least two vertices with valency 1. at least two vertices with valency 1. 13. Use the Greedy algorithm for a spanning tree on the following connected graph. 13. Use the Greedy algorithm for a spanning tree on the following connected graph. • • • • • • • • • • • • • • • • • • 14. Show that there are 125 diﬀerent spanning trees of the complete graph K5 . 14. Show that there are 125 diﬀerent spanning trees of the complete graph K5 . Chapter 17 : Graphs page 11 of 11 ...
View
Full
Document
This note was uploaded on 12/20/2009 for the course MATH 245 taught by Professor ramaswamy during the Spring '08 term at San Diego State.
 Spring '08
 RAMASWAMY
 Math

Click to edit the document details