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.

  • Published on
    22-Dec-2015

  • View
    212

  • Download
    0

Embed Size (px)

Transcript

  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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 corollarys formulas follow directly from n=mi+1 (Theorem 2) and the fact that l + i = n
  • Slide 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
  • Slide 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
  • Slide 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
  • Slide 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)
  • Slide 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.
  • Slide 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
  • Slide 15
  • 03/01/2005Tucker, Sec. 3.115 Create a Prufer Sequence from the graph: 1 2 3 4 5 6 7 8 Class Problem
  • Slide 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