Presentation is loading. Please wait.

Presentation is loading. Please wait.

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 11, Wednesday, September 24.

Similar presentations


Presentation on theme: "MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 11, Wednesday, September 24."— Presentation transcript:

1 MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 11, Wednesday, September 24

2 A Spanning Tree Each connected graph has a spanning tree. For finite graphs the proof is easy. [Keep removing edges that belong to some circuit]. For infinite graphs this is not a theorem but an axiom that is equivalent to the renowned axiom of choice from set theory. Note: A spanning subgraph H of G contains all vertices of G.

3 How many spanning trees are there in K n ? For example, on the right we see that K 3 has 3 spanning trees! Let (K n ) denote the number of spanning trees in the completre graph K n. We know that (K 3 ) = 3. Theorem 4 (Cayley, 1889): (K n ) = n n-2 Proof: Bijective proof (principle of equality): Prüfer sequences (codes)!

4 Two Remarks Remark 1: We are counting all spanning trees. [Some may be isomorphic]. Remark 2: Counting all spanning trees in a complete graph K n is the same as counting all labeled trees on n vertices.

5 Prüfer Sequence From a Labeled Tree We are given a tree whose vertices are labeled (from 1 to n). Following the rule on the left we form a sequence s 1, s 2,..., s n-2 of length n-2. Each element of the sequence is a number from 1 to n. The sequence [s 1, s 2,..., s n-2 ] is called the Prüfer code or sequence. 7 5 48 1 6 23 Delete the leaf with the largest label and print the label of its neighboor!

6 The Steps of Prüfer Recipe Delete 7, print 1. Delete 6, print 8. Delete 5, print 1. Delete 4, print 1. Delete 2, print 3. Delete 3, print 8. The sequence: [1,8,1,1,3,8] 7 5 48 1 6 23 Delete the leaf with the largest label and print the label of its neighboor!

7 From the Sequence to the Tree. Examle: [2,3,2,8,2,1]. Numbers (between 1 and 8), missing in the sequence represent the leaves of a tree. ki v kodi manjkajo, so listi drevesa. Maximal leaf: 7 First sequence element: 2 Edge: 7~2. Leaves: [4,5,6] Edge: 6~3. Leaves: [3,4,5] Edge: 5~2. Leaves: [3,4] Edge: 4~8. Leaves: [3,8] Edge: 8~2. Leaves: [2,3] Edge: 3~1. Leaves: [1,2] Final edge: 1~2. 7263 5 1 48 Add an edge between the vertex labeled by the current sequence element and the leaf with maximal label.

8 Rooted Trees, Binary Trees Some new terms: root level number parent child sibling leaf (leaves) internal vertex m-ary tree binary tree

9 Theorem 2 Let T be an m-ary tree with n vertices, of which i vertices are internal. Then, n = m i + 1. On the left we have n = 25, #leaves = l = 13, i = 12. n = 2i + 1. Proof: Each internal vertex gives rise to m edges. The tree has therefore m i edges. It hase m i + 1 vertices.

10 Corollary Let T be an m-ary tree with n vertices, i internal vertices, and l leaves. Then: (a) Given i, l = (m-1)i + 1, n = mi + 1 (b) Given l, i = (l – 1)/(m – 1), n = (ml – 1)/(m-1) (c) Given n, i = (n – 1)/m, l = [(m – 1)n + 1]/m.

11 Example 1 If 56 people sign up for a tennis tournament, how many matches will be played? [Hint: binary tree]. Answer: 55 matches. [Every player but winner played exactly one match in which he or she lost and these are all the matiches]

12 Rooted Trees – More New Terms More new terms: The height of a rooted tree balanced rooted tree Note: the binary tree on the left is not balanced but the right subtree is.

13 Theorem 3 Let T be an m-ary tree of height h with l leaves. Then (a) l · m h, and if all leaves are at height h, l = m h. (b) h ¸ d log m l e, and if the tree is balanced, h = d log m l e.

14 3.2 Search Trees and Spanning Trees Homework (MATH 310#4W): Read 4.1. Do Exercises 3.2: 2,4,8,10,12,16,22,28 Volunteers: ____________ Problem: 28. On Monday you will also turn in the list of all new terms (marked). On Monday you will also turn in the list of all new terms (marked).


Download ppt "MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 11, Wednesday, September 24."

Similar presentations


Ads by Google