Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department...
Transcript of Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department...
![Page 1: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/1.jpg)
Tutorial 7
Yuen-Man Pun
Department of Systems Engineering and Engineering ManagementThe Chinese University of Hong Kong
23 November 2017
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 1 / 14
![Page 2: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/2.jpg)
Definition
(i) A graph G is a pair (V ,E ) of sets, where V is the vertex set, and E isthe edge set, which contains unordered pair of vertices.
(ii) The degree of a vertex v , denoted by deg(v), is the number of edgesincident to it.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 2 / 14
![Page 3: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/3.jpg)
Definition
(i) A path in G is either a single vertex or an ordered list of distinctverticesv1 − v2 − ...− vk , where (v1, v2),(v2, v3),...,(vk − 1, vk) are edges.
(ii) A cycle in G is a path in which the starting and ending vertices arethe same.
(iii) G is connected if for every pair of vertices u, v in G , there is a pathbetween them.
(iv) G is an acyclic graph if it has no cycle. A connected acyclic graph iscalled a tree.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 3 / 14
![Page 4: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/4.jpg)
Examples
G1 and G2 are trees, but G3 and G4 are not.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 4 / 14
![Page 5: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/5.jpg)
Handshaking Lemma
Theorem (Handshaking lemma)
Let v1, v2, ..., vn be the vertices of a graph G, and E be the edge set. Then
n∑i=1
deg(vi ) = 2|E |
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 5 / 14
![Page 6: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/6.jpg)
Example 1
Problem 1 (Q7 in 15/16 Exam)Let T be a tree whose average degree is a. Show that T has 2/(2− a)vertices.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 6 / 14
![Page 7: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/7.jpg)
Example 1
Problem 1 (Q7 in 15/16 Exam)Let T be a tree whose average degree is a. Show that T has 2/(2− a)vertices.
Solution: Let n be the number of vertices in T .
T is a tree implies it has n − 1 edges. By handshaking lemma,
n · a = 2(n − 1) =⇒ n = 2/(2− a)
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 7 / 14
![Page 8: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/8.jpg)
Example 2
Problem 2Let G be a graph with n vertices and assume that each vertex of G hasdegree dn−12 e. Show that G must be connected.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 8 / 14
![Page 9: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/9.jpg)
Example 2
Problem 2Let G be a graph with n vertices and assume that each vertex of G hasdegree dn−12 e. Show that G must be connected.
Solution:
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 9 / 14
![Page 10: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/10.jpg)
Example 2
Problem 2Let G be a graph with n vertices and assume that each vertex of G hasdegree dn−12 e. Show that G must be connected.
Solution:
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 10 / 14
![Page 11: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/11.jpg)
Example 2
Problem 2Let G be a graph with n vertices and assume that each vertex of G hasdegree dn−12 e. Show that G must be connected.
Solution:Pick any u ∈ G .
Since deg(u) = dn−12 e, u is connected to dn−12 e distinct vertices,say {u1, u2, · · · , ud(n−1)/2e}.
Let G1 = {u, u1, u2, · · · , ud(n−1)/2e}, which is connected.
|G1| = dn − 1
2e+ 1
Let G2 = G \ G1. Pick any v ∈ G2.
Note that |G2| = n − (dn−12 e+ 1) = bn−12 c and deg(v) = dn−12 e.
By pigeonhole principle, there must exist some vertex w ∈ G1 connectedto v by an edge. Therefore, G must be connected.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 11 / 14
![Page 12: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/12.jpg)
Example 3
Problem 3 (Q7 in 14/15 Exam)Show that every simple graph G = (V ,E ) with |V | ≥ 2 has at least 2vertices of the same degree.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 12 / 14
![Page 13: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/13.jpg)
Example 3
Problem 3 (Q7 in 14/15 Exam)Show that every simple graph G = (V ,E ) with |V | ≥ 2 has at least 2vertices of the same degree.
Solution: Let
Set of possible degree of vertices = S = {0, 1, 2, · · · , |V | − 1}
Case 1: There exists a vertex with degree 0.Observe that a vertex u with deg(u) = 0 implies none of the vertices in Vforms an edge with u.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 13 / 14
![Page 14: Tutorial 7 - se.cuhk.edu.hkmanchoso/1718/engg2440b/tut7.pdf · Tutorial 7 Yuen-Man Pun Department of Systems Engineering and Engineering Management The Chinese University of Hong](https://reader034.fdocuments.in/reader034/viewer/2022050214/5f5fe36f59b5897f8d6e3e3f/html5/thumbnails/14.jpg)
Example 3
Problem 3 (Q7 in 14/15 Exam)Show that every simple graph G = (V ,E ) with |V | ≥ 2 has at least 2vertices of the same degree.
Solution(cont’d):Then maximum degree of the remaining vertices is at most |V | − 2.
Case 2: There does not exist a vertex with degree 0. Therefore, in anycase,
|S | = |V | − 1
By pigeonhole principle, G has at least 2 vertices of the same degree.
Yuen-Man Pun (Department of Systems Engineering and Engineering Management The Chinese University of Hong Kong)Tutorial 7 23 November 2017 14 / 14