Download Enumerating labeled trees

Document related concepts
no text concepts found
Transcript
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
2
3
1
3
1
2
1
3
3
2
1
2
3
2
3
1
1
2
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
2
3
1
3
1
2
1
3
3
2
1
2
3
2
3
1
1
2
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
3
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
3
4
4!/2=12
Enumerating labeled trees
Definition: A labeled tree is a tree the vertices of which are assigned unique
numbers from 1 to n.
We can count such trees for small values of n by hand so as to conjecture a
general formula.
3
5!/2=60
4
4!/2=12
5
5!/2
So what is the general formula?
Let Tn denote the number of labeled trees on n vertices. We now know the
following values for small n:
T2 = 1 as there is only one tree on 2 vertices
So what is the general formula?
Let Tn denote the number of labeled trees on n vertices. We now know the
following values for small n:
T2 = 1 as there is only one tree on 2 vertices
T3 = 3 as we have seen before:
3
So what is the general formula?
Let Tn denote the number of labeled trees on n vertices. We now know the
following values for small n:
T2 = 1 as there is only one tree on 2 vertices
T3 = 3 as we have seen before:
3
T4 = 4+12=16 as we have also seen before:
4
So what is the general formula?
Let Tn denote the number of labeled trees on n vertices. We now know the
following values for small n:
T2 = 1 as there is also one tree on 2 vertices
T3 = 3 as we have seen before:
3
T4 = 4+12=16 as we have also seen before:
4
24!/2=12
T5 = 60+5+60=125
5!/2=60
5
5!/2
So what is the general formula?
If we continue in this fashion, we will obtain the
following sequence:
1, 3, 16, 125,1296,16807,262144...
So what is the general formula?
If we continue in this fashion, we will obtain the
following sequence:
1, 3, 16, 125,1296,16807,262144...
T =n
n
n−2
Cayley’s theorem
Theorem (Cayley) There are n
vertices.
n−2
labeled trees on n
1. Induction
A ⊂ {1,2,...n}, | A |= k
F(A, n) - the set of forests on n vertices in which vertices from A
appear in different connected components(trees).
Tn,k - the number of forests of k trees, for which the vertices from A appear
in different components.
Cayley’s theorem - induction
A = {n − k + 1, n − k + 2,...n}, | A |= k
F(A, n) - the set of forests on n vertices in which vertices from A
appear in different connected components(trees).
Tn,k - the number of forests of k trees, for which the vertices from A appear
in different components.
n-k+1
i vertices
n-k+2 n-k+3
n
n-k+1 n-k+2
i vertices
n-1
n
n-k+1 n-k+2
n-1
n
i vertices
F ( A, n) ↔ {F ( A' , n − 1), A' = ( A \ {n}) ∪ {i chosen
Tn,k =
n − k ⎛ ( n − 1) − ( k
∑ ⎜
i
i =0 ⎝
Tn,k = kn n − k −1
− 1) ⎞
⎟Tn −1,k +i −1
⎠
vertices}}
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
7
9
1
5
2
8
4
3
| S n |= n 2 | Tn |
f : {1,..., n} → {1,..., n}
6
10
right end
left end
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
7
9
1
5
8
4
⎠
⎝
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 2 3 4 5 6 7 8 9 10 ⎞
f =⎜
⎟
7
5
5
9
1
2
5
8
4
7
⎠
⎝
1
7
5
2
10
4
3
8
6
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛ 1 2 3 4 5 6 7 8 9 10 ⎞
f =⎜
⎟
7
5
5
9
1
2
5
8
4
7
⎠
⎝
1
7
5
2
M = {1,4,5,7,8,9}
10
4
3
8
6
f | M is a bijection
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
⎝ 7 9 1 5 8 4⎠
7
10
9
1
5
8
4
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
⎝ 7 9 1 5 8 4⎠
1
7
5
7
9
1
5
8
4
3
8
4
2
10
10
6
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
⎝ 7 9 1 5 8 4⎠
1
7
5
7
9
1
5
8
3
10
10
4
3
8
4
2
6
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
⎝ 7 9 1 5 8 4⎠
1
7
5
7
9
1
2
10
5
8
3
10
4
3
8
4
2
6
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
⎛1 4 5 7 8 9 ⎞
f |M = ⎜
⎟
⎝ 7 9 1 5 8 4⎠
1
7
5
7
9
1
2
6
10
5
8
3
10
4
3
8
4
2
6
9
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
7
9
1
5
2
8
4
3
6
10
right end
left end
(7,9,1,5,8,4) -> (1,5,7,8,4,9)
⎛ 1 4 5 7 8 9 ⎞
f =⎜
⎟
⎝ 7 9 1 5 8 4 ⎠
2. Pruefer code
1
2
6
10
4
8
9
5
3
7
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
1
2
6
10
4
8
9
5
3
7
Pruefer code :1
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
1
6
10
4
8
9
5
3
7
Pruefer code :1 4
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
1
6
10
4
8
9
5
7
Pruefer code :1 4 4
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
1
6
10
4
8
9
7
Pruefer code :1 4 4 1
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
1
6
10
8
9
7
Pruefer code :1 4 4 1 6
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
6
10
8
9
7
Pruefer code :1 4 4 1 6 6
Labeled tree -> (a1 , a2 ,..., an −2 )
2. Pruefer code
6
10
Labeled tree -> (a1 , a2 ,..., an −2 )
8
9
Pruefer code :1 4 4 1 6 6 8
2. Pruefer code
6
10
Labeled tree -> (a1 , a2 ,..., an −2 )
8
Pruefer code :1 4 4 1 6 6 8 6
2. Pruefer code
6
10
4
8
9
5
3
7
(1 4 4 1 6 6 8 6)
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
1
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
6
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
6
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
6
1
4
2
3
5
7
9
10
Reversing the correspondence
- deleted vertex
- end vertex
- inner vertex
(1 4 4 1 6 6 8 6)
6
1
4
2
3
5
7
9
10
Reversing the correspondence
1
2
6
10
4
8
9
5
6
3
7
1
4
2
3
5
7
9
10
Other applications: the number of trees with a given
degree sequence
( x1 + ... + xm ) n =
n!
d
x1 1
∑
( d1 ,..., d m ) d1!⋅… ⋅ d m !
∑ di =n
i
Let ( d1 ,..., d n ) be the degree sequence
(n − 2)!
(d1 − 1)!⋅… ⋅ ( d m − 1)!
dm
⋅ … ⋅ xm
Other applications: the number of trees with a given
degree sequence
( x1 + ... + xm ) n =
n!
d
x1 1
∑
( d1 ,..., d m ) d1!⋅… ⋅ d m !
∑ di =n
dm
⋅ … ⋅ xm
i
Let ( d1 ,..., d n ) be the degree sequence
( n − 2)!
(d1 − 1)!⋅… ⋅ ( d n − 1)!
⎛ n − 2⎞
⎜
⎟(n − 1) n − k −1
⎝ k −1 ⎠
-the number of trees in which vertex n has
degree k
Polya’s approach
T ( x) =
∞
∑ nt n
n =1
xn
n!
T(x) is the generating function for the number of rooted trees with n vertices
Let cn be the number of connected graphs on n vertices enjoying a certain
property P.
1 n −1 ⎛ n ⎞
1 n −1 ck cn − k
⋅
∑ ⎜ ⎟ ⋅ ck ⋅ cn − k = ⋅ n! ∑
2 k =1 ⎝ k ⎠
2 k =1 k! (n − k )!
С ( x) =
∞
∑ сn
n =1
xn
n!
Polya’s approach
T ( x) =
∞
∑ nt n
n =1
xn
n!
T(x) is the generating function for the number of rooted trees with n vertices
T ( x) = xeT ( x )
Lagrange inversion formula
ϕ ( s ) = xψ (ϕ ( s ))
dn
1 dn n
ϕ ( s ) | s =0 =
ψ (t ) |t =0
n
n
n dt
ds
1 d n nt
n −1
nt n =
e
|
=
n
t =0
n dt n
The number of spanning trees of a directed graph
Def. A spanning tree of a graph G is its subgraph T that includes all the vertices
of G and is a tree
Def. A directed tree rooted at vertex n is a tree, all arcs of which are directed
towards the root
1
2
3
1
2
3
1
2
3
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example: s1 = 3, s 2 = 2, s3 = 2
1
2
3
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example: s1 = 3, s 2 = 2, s3 = 2
1
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example:
s1 = 3, s2 = 2, s3 = 2
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example:
s1 = 3, s2 = 2, s3 = 2
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example:
s1 = 3, s2 = 2, s3 = 2
Knuth’s theorem
n=
h
∑ sj
j =1
Consider an example:
s1 = 3, s2 = 2, s3 = 2
Knuth’s theorem
Def. A function f is called a tree function of a directed tree T iff f(i)=j when j is
the first vertex on the way from i to the root.
Let c(H) denote the number of spanning trees of the graph H
S2
S1
S3
Knuth’s theorem
Theorem (Knuth) c ( H ) =
h −1
|S |−1
∑ ∏ | Γ( S i ) | i |
f i =1
f (Si ) |
Theorem The number of spanning trees of a graph H arisen from a
directed cycle equals
s −1
s21
s
s
s −1
⋅ s32 ⋅ s43 ⋅ ... ⋅ s1 h
Knuth’s theorem
Theorem The number of spanning trees of a graph H arisen from a
directed cycle equals
s −1
s21
s −1
s21
s −1
⋅ s1 2
s
s
s −1
⋅ s32 ⋅ s43 ⋅ ... ⋅ s1 h
is the number of r by s bipartite graphs
Knuth’s theorem
n ⎛ n ⎞ n − k −1
(n − k
∑ ⎜ ⎟k
k =0 ⎝ k ⎠
− 1) k −1 = 2n n − 2
Matrix-Tree Theorem
Def. Let G be a directed graph without loops. Let {v1 ,..., vn } denote the
vertices of G, and {e1 ,..., em } denote the edges of G.
The incidence matrix of G is the n x m matrix A, such that
ai , j = 1,
if vi is the head of e j
ai , j = −1, if vi is the tail of e j
ai , j = 0 otherwise
1
2
+1
1
4
5
2
3
4
3
0
−1 −1
0
−1
0
0
0
−1
0
0
0
+1 −1
0
0
+1 +1 +1
Matrix-Tree Theorem
Lemma. The incidence matrix of a connected graph on n vertices has the rank of
n-1
The reduced incidence matrix A of a connected graph G is the matrix obtained
from the incidence matrix by deleting a certain row.
1
2
+1
1
4
5
2
3
4
3
0
−1 −1
0
−1
0
0
0
−1
0
0
0
+1 −1
0
0
+1 +1 +1
Matrix-Tree Theorem
Lemma. The incidence matrix of a connected graph on n vertices has the rank of
n-1
The reduced incidence matrix A of a connected graph G is the matrix obtained
from the incidence matrix by deleting a certain row.
1
2
+1
1
4
5
2
3
4
3
0
−1 −1
0
0
−1
0
0
0
−1
0
0
+1 −1
Matrix-Tree Theorem
Lemma. The incidence matrix of a connected graph on n vertices has the rank of
n-1
The reduced incidence matrix A of a connected graph G is the matrix obtained
from the incidence matrix by deleting a certain row.
1
2
+1
1
4
5
2
3
4
3
0
−1
−1 −1
0
+1
0
0
Matrix-Tree Theorem
Lemma. The incidence matrix of a connected graph on n vertices has the rank of
n-1
The reduced incidence matrix A of a connected graph G is the matrix obtained
from the incidence matrix by deleting a certain row.
1
2
1
4
5
2
3
4
3
+1 −1
0
−1
0
−1
0
0
0
Matrix-Tree Theorem
Let A0 be the reduced incidence matrix of the graph G.
Theorem (Binet-Cauchy)
If R and S are matrices of size p by q and q by p, where p ≤ q
, then
det( RS ) = ∑ det( B ) ⋅ det(C )
Theorem (Matrix-Tree Theorem)
If A is a reduced incidence matrix of the graph G, then the number of spanning trees
equals det( A ⋅ AT )
det A AT = ∑ (det B ) 2
Matrix-Tree Theorem
e1 ,...eb − var iables identified
with edges of
G
M (e) = [mij ]
mij = −ek , if
mij = sum if
Theorem
ek
joins i and
j and
i≠ j
edges incident to i otherwise
M n (e) = ∑ Π (T )
e1 + e4
− e1
0
M 4 (e) = − e1 e1 + e2 + e5 − e2 =
− e2
0
e2 + e3
1
2
1
4
5
2
3
4
3
= e1e2 e3 + e1e2 e4 + e1e2 e5 + e1e3e4 + e1e3e5 + e2 e3e4 + e2 e4 e5 + e3e4 e5
Matrix-Tree Theorem
e1 ,...eb − var iables identified
with edges of
G
M (e) = [mij ]
mij = −ek , if
ek
mij = sum if
Theorem
joins i and
j and
i≠ j
edges incident to i otherwise
M n (e) = ∑ Π (T )
M n (e) = det( A ⋅ Y ⋅ AT )
e1 + e4
− e1
0
M 4 (e) = − e1 e1 + e2 + e5 − e2 =
− e2
0
e2 + e3
1
2
1
4
5
2
3
4
3
= e1e2 e3 + e1e2 e4 + e1e2 e5 + e1e3e4 + e1e3e5 + e2 e3e4 + e2 e4 e5 + e3e4 e5
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
n −1 −1
−1 n −1
−1
−1
−1
−1
−1
−1
−1
−1
−1
−1
−1
−1
−1 n −1 −1
−1 −1 n −1
…
…
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
1
1
−1 n −1
−1 −1
−1 −1
−1 −1
…
…
1
1
−1
−1
−1
−1
−1 n −1 −1
−1 −1 n −1
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
1
0
0
0
0
1 … 1 1
n … 0 0
0
0 0 = n n−2
0 0 n 0
0 0 0 n
Matrix-Tree Theorem
Theorem (Matrix-Tree Theorem for directed graphs)
Let
be variables representing the arcs of the graph. Let C = [cij ]
denote the n by n matrix in which − cij equals the sum of arcs directed
from node i to node j if i ≠ j , and cii equals the sum of all arcs
directed from node i to all other nodes.
Then
С n = ∑ Π (T ) ,
where the summation is over all spanning subtrees of G rooted at node n .
1
2
1
4
5
2
3
4
3
⎛
⎜ e1
⎜
0
⎜
Сn =
⎜ 0
⎜
⎜ − e4
⎝
− e1
0
0
0
− e2
e2
− e3
− e5
⎞
⎟
⎟
0
⎟
⎟
0
⎟
e3 + e4 + e5 ⎟
⎠
0
Matrix-Tree Theorem
1
2
1
4
5
2
3
4
3
e1
С2 =
0
− e4
0
0
e2
− e3
0
e3 + e4 + e5
= e1e2 e3 + e1e2 e4 + e1e2 e5
Related documents