170 likes | 384 Views
Applied Combinatorics, 4th Ed. Alan Tucker. Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara. Definitions.
E N D
Applied Combinatorics, 4th Ed.Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara Tucker, Sec. 3.1
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 Root = the unique vertex with in-degree of 0 b c e f d i h g j Tucker, Sec. 3.1
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 a Parent of g and h b c Level 1 f Level 2 d e Level 3 j g k i h Siblings of each other Children of d Tucker, Sec. 3.1
b a c a b c d f d e f e Theorem 1 A tree with n vertices has n – 1 edges. Proof 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 Tucker, Sec. 3.1
Definitions • 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 Internal vertices Leaves Tucker, Sec. 3.1
Definitions • 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. Height (h) is 3 h-1 h Tucker, Sec. 3.1
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 Tucker, Sec. 3.1
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 Tucker, Sec. 3.1
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. Entrants Matches Shortened Graph Tucker, Sec. 3.1
Theorem3 • T is a m-ary tree of height h with l leaves. • l≤ mh and if all leaves are at height h, l = mh • h ≥ `élogmlù and if the tree is balanced, h = élogmlù l = 5 h = 3 m = 2 a b c d i f e h g Tucker, Sec. 3.1
Prufer Sequence There exists a sequence (s1, s2,…,sn-2) of length n-2. This is called a Prufer Sequence. Start with the leaf of the smallest label (2). Its neighbor is 5. 5 = s1Delete the edge. Take the next smallest leaf (4). Its neighbor is 3. 3 = s2 Delete the edge. Continue like this obtaining, 1 3 5 7 2 4 6 (5,3,1,7,3,6) 8 Note: There is a 1:1 correspondence to the Prufer Sequence and the tree Tucker, Sec. 3.1
1 6 3 8 5 7 2 4 Example 2 2, 3, Find the graph that has the Prufer Sequence (6, 2, 3, 3) 1 4 5 2 6 7 3 8 Tucker, Sec. 3.1
Theorem 4 There are nn-2 different undirected trees on n items. 4 8 1 6 3 5 3 6 2 1 7 4 7 5 2 8 Two different trees on 8 items. Tucker, Sec. 3.1
Proof of Theorem 4 There are nn-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. (__, __, __, __, __, __) … n choices n choices This means there are nn-2 different Prufer sequences. Since each tree has a unique Prufer Sequence, there are nn-2 different trees. Tucker, Sec. 3.1
2 1 5 8 4 6 7 3 Class Problem Create a Prufer Sequence from the graph: Tucker, Sec. 3.1
2 1 5 4 7 3 Solution Create a Prufer Sequence from the graph: 8 6 (5,6,1,1,5,6) Tucker, Sec. 3.1