Presentation is loading. Please wait.

Presentation is loading. Please wait.

03/01/2005Tucker, Sec. 3.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara.

Similar presentations


Presentation on theme: "03/01/2005Tucker, Sec. 3.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara."— Presentation transcript:

1 03/01/2005Tucker, Sec. 3.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara

2 03/01/2005Tucker, Sec. 3.12 Definitions  Tree: a tree is a special type of graph that contains designated vertex called a root so that there is a unique path from the root to any other vertex in the tree. Equivalently, a tree graph contains no circuits.  Rooted Tree: a directed tree graph with all edges directed away from the root a bc d ef g h i j Root = the unique vertex with in- degree of 0

3 03/01/2005Tucker, Sec. 3.13 a b c d e f g h i j k Parent of g and h Children of d Siblings of each other Level 1 Level 2 Level 3  Level Number: the length of the path from the root a to x  Parent: the vertex y is a parent of x if they are connected by an edge  Children: the vertex y is a child of x if they are connected by an edge  Siblings: two vertices with the same parent

4 03/01/2005Tucker, Sec. 3.14 Theorem 1 A tree with n vertices has n – 1 edges. Choose a root, and direct all edges away from the root. Since each vertex except the root has a single incoming edge, there are n –1 non-root vertices and hence n –1 edges. Root = a Proof b c d e f a a b c de f

5 03/01/2005Tucker, Sec. 3.15  Leaves: vertices with no children  Internal Vertices: vertices with children  m-ary Tree: when each internal vertex of a rooted tree has m children  Binary Tree: when m = 2 Definitions Leaves Internal vertices

6 03/01/2005Tucker, Sec. 3.16  Height of a Rooted Tree: the length of the longest path to the root.  Balanced Tree (“good”): if all the leaves are at levels h and h-1, where h is the height of the tree. Definitions h h-1 Height (h) is 3

7 03/01/2005Tucker, Sec. 3.17 Theorem 2 If T is an m-ary tree with n vertices, of which i vertices are internal, then, n = mi + 1. Proof Each vertex in a tree, other than the root, is the child of a unique vertex. Each of the i internal vertices has m children, so there are a total of mi children. Adding the root gives n = mi + 1 m = 3 i = 3 n = 10

8 03/01/2005Tucker, Sec. 3.18 Corollary T is a m-ary tree with n vertices, consisting of i internal vertices and l leaves. Note: The proof of the corollary’s formulas follow directly from n=mi+1 (Theorem 2) and the fact that l + i = n

9 03/01/2005Tucker, Sec. 3.19 Example 1 If 56 people sign up for a tennis tournament, how many matches will be played in the tournament? Setting up as a binary tree, there will be 56 leaves and i matches with two entrants entering a match. Shortened Graph Entrants Matches

10 03/01/2005Tucker, Sec. 3.110 Theorem 3 T is a m-ary tree of height h with l leaves.  l ≤ m h and if all leaves are at height h, l = m h  h ≥ `é log m l ù and if the tree is balanced, h = é log m l ù a b c d e f g h i l = 5 h = 3 m = 2

11 03/01/2005Tucker, Sec. 3.111 There exists a sequence (s 1, s 2,…,s n-2 ) of length n-2. This is called a Prufer Sequence. 1 2 3 5 6 7 8 Start with the leaf of the smallest label (2). Its neighbor is 5. 5 = s 1 Delete the edge. Take the next smallest leaf (4). Its neighbor is 3. 3 = s 2 Delete the edge. Continue like this obtaining, (5,3,1,7,3,6) Note: There is a 1:1 correspondence to the Prufer Sequence and the tree Prufer Sequence 4

12 03/01/2005Tucker, Sec. 3.112 Example 2 1 3 2 6 4 5 7 8 Find the graph that has the Prufer Sequence 1 4 2 5 6 7 3 8 (6,2, 3, 3)

13 03/01/2005Tucker, Sec. 3.113 Theorem 4 There are n n-2 different undirected trees on n items. 6 1 5 3 2 4 8 7 1 2 4 6 8 7 5 3 Two different trees on 8 items.

14 03/01/2005Tucker, Sec. 3.114 Proof of Theorem 4 There are n n-2 different undirected trees on n items. We showed there is a 1-to-1 correspondence between trees on n items and Prufer sequences of length n-2. Count Prufer sequences. This means there are n n-2 different Prufer sequences. Since each tree has a unique Prufer Sequence, there are n n-2 different trees. (__, __, __, __, __, __) n choices …

15 03/01/2005Tucker, Sec. 3.115 Create a Prufer Sequence from the graph: 1 2 3 4 5 6 7 8 Class Problem

16 03/01/2005Tucker, Sec. 3.116 Create a Prufer Sequence from the graph: 1 2 3 4 5 6 7 8 (5,6,1,1,5,6) Solution


Download ppt "03/01/2005Tucker, Sec. 3.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara."

Similar presentations


Ads by Google