Presentation is loading. Please wait.

Presentation is loading. Please wait.

R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 2.3 CAYLEY’S THEOREM – משפט קיילי מבוסס על הספר : S. Even, "Graph Algorithms",

Similar presentations


Presentation on theme: "R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 2.3 CAYLEY’S THEOREM – משפט קיילי מבוסס על הספר : S. Even, "Graph Algorithms","— Presentation transcript:

1 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 2.3 CAYLEY’S THEOREM – משפט קיילי מבוסס על הספר : S. Even, "Graph Algorithms", Computer Science Press, 1979 שקפים, ספר וחומר רלוונטי נוסף באתר הקורס : Slides, book and other related material at: http://www.cs.technion.ac.il/~cs234141

2 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 2 2.3 CAYLEY’S THEOREM משפט קיילי Theorem 2.4: The number of spanning trees for n distinct vertices is n n-2. Proof: )Prüfer( Assume V = {1, 2,..., n}. Let us display a one-to-one correspondence between the set of the spanning trees and the n n-2 words of length n – 2 over the alphabet {1, 2,..., n}. The algorithm for finding the word which corresponds to a given tree is as follows:

3 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 3 Theorem 2.4: The number of spanning trees for n distinct vertices is n n-2. V = {1, 2,..., n} קלט: עץ עם צמתים: {1, 2,..., n} מעל א"ב n-2 פלט: מילה באורך For i=1 to n-2 do Among all leaves of the current tree let j be the least one. Eliminate j and its incident edge e from the tree. The i-th letter of the word is the other endpoint of e.

4 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 4 a[i] = j j עלה מינימלי

5 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 5 i = 1; j=3; min=1 a[1] = 3 3 עלה מינימלי 1 2 4 5

6 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 6 i = 2; j=2; min=3; a[2] = 2 3 עלה מינימלי 1 2 4 5

7 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 7 i = 3; j=2; min=4; a[3] = 2 3 עלה מינימלי 1 2 4 5

8 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 8 i = n-2 w="322" בסיום: 3 1 2 4 5

9 R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 9 Theorem 2.4: The number of spanning trees for n distinct vertices is n n-2. {1, 2,..., n} מעל א"ב n-2 קלט: מילה באורך V = {1, 2,..., n} פלט: עץ עם צמתים: For i=1 to n-2 do Let j be the least vertex for which d(j) = 1. Construct an edge j – a i, d(j)  0 and d(a i )  d(a i ) – l. Construct an edge between the two vertices whose degree is 1


Download ppt "R. Bar-Yehuda © www.cs.technion.ac.il/~cs234141 1 Graph theory – תורת הגרפים 2.3 CAYLEY’S THEOREM – משפט קיילי מבוסס על הספר : S. Even, "Graph Algorithms","

Similar presentations


Ads by Google