Definition: A labeled tree is a tree the vertices of which ... · Enumerating labeled trees...
Transcript of Definition: A labeled tree is a tree the vertices of which ... · Enumerating labeled trees...
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.
1
2 3
2
1 3
3
1 2
1
3 2
2
3 1
3
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.
1
2 3
2
1 3
3
1 2
1
3 2
2
3 1
3
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 4 4!/2=12
5!/2=60 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
3T3 = 3 as we have seen before:
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
3T3 = 3 as we have seen before:
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
3T3 = 3 as we have seen before:
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
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?
2−= n
nnT
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...
Theorem (Cayley) There are labeled trees on n vertices.
2−nn
1. InductionkAnA =⊂ ||},,...2,1{
knT , - the number of forests of k trees, for which the vertices from A appear in different components.
Cayley’s theorem
F(A, n) - the set of forests on n vertices in which vertices from A appear in different connected components(trees).
kAnknknA =+−+−= ||},,...2,1{
knT , - the number of forests of k trees, for which the vertices from A appear in different components.
Cayley’s theorem - induction
F(A, n) - the set of forests on n vertices in which vertices from A appear in different connected components(trees).
n-k+1 n-k+2 n-k+3 n
i vertices
n-k+1 n-k+2 n-1 n
i vertices
∑−
=−+−⎟
⎠
⎞⎜⎝
⎛ −−−=
kn
iiknkn T
ikn
T0
1,1,)1()1(
1,
−−= knkn knT
n-k+1 n-k+2 n-1 n
i vertices
}}{}){\('),1,'({),( verticeschoseninAAnAFnAF ∪=−↔
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
|||| 2nn TnS =17 9 5 8
10
2 3
6
4
left endright end
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf
},...,1{},...,1{: nnf →
⎟⎠
⎞⎜⎝
⎛=
710
4852195598765432
71
f
1 7 10 4 9
83
6
5
2
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
⎟⎠
⎞⎜⎝
⎛=
710
4852195598765432
71
f
1 7 10 4 9
83
6
5
2
}9,8,7,5,4,1{=M Mf | is a bijection
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
4
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
4
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf1 7 10 4 9
83
6
5
2
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
3
4
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf1 7 10 4 9
83
6
5
2
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
2 3
4
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf1 7 10 4 9
83
6
5
2
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
2 3
6
4
⎟⎠
⎞⎜⎝
⎛=
49
85198754
71
|Mf1 7 10 4 9
83
6
5
2
2. Establishing a 1-1 correspondence between trees and functions acting from 1..n into 1..n (Joyal)
17 9 5 8
10
2 3
6
4
left endright end
(7,9,1,5,8,4) -> (1,5,7,8,4,9)
⎟⎠
⎞⎜⎝
⎛=
485197987541
f
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
89
10),...,,( 221 −naaaLabeled tree ->
2. Pruefer code
1 2
3
4
5
6
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1
2. Pruefer code
1
3
4
5
6
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4
2. Pruefer code
1
4
5
6
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4
2. Pruefer code
1
46
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4 1
2. Pruefer code
1
6
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4 1 6
2. Pruefer code
6
7
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4 1 6 6
2. Pruefer code
6
89
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4 1 6 6 8
2. Pruefer code
6
8
10),...,,( 221 −naaaLabeled tree ->
Pruefer code :1 4 4 1 6 6 8 6
2. Pruefer code
(1 4 4 1 6 6 8 6)
3
4
5
6
7
89
10
2. Pruefer code
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
6
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
6
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
6
- deleted vertex- end vertex- inner vertex
(1 4 4 1 6 6 8 6)
32 7 9 10
Reversing the correspondence
5
1 4
6
- deleted vertex- end vertex- inner vertex
Reversing the correspondence
1 2
3
4
5
6
7
89
10
32 7 9 105
1 4
6
Other applications: the number of trees with a given degree sequence
m
ii
m
dm
d
nddd m
nm xx
ddnxx ⋅⋅⋅⋅
=++ ∑
∑ =
……
1
11
),...,( 11 !!
!)...(
)!1()!1()!2(
1 −⋅⋅−−
mddn…
be the degree sequence),...,( 1 nddLet
Other applications: the number of trees with a given degree sequence
m
ii
m
dm
d
nddd m
nm xx
ddnxx ⋅⋅⋅⋅
=++ ∑
∑ =
……
1
11
),...,( 11 !!
!)...(
be the degree sequence),...,( 1 ndd
)!1()!1()!2(
1 −⋅⋅−
−
nddn…
1)1(12 −−−⎟⎠
⎞⎜⎝
⎛−− knn
kn -the number of trees in which vertex n has
degree k
Let
Polya’s approach
∑∞
==
1 !)(
n
n
n nxntxT
T(x) is the generating function for the number of rooted trees with n vertices
Let be the number of connected graphs on n vertices enjoying a certain property P.
nc
∑−
=
−−∑
−
= −⋅⋅=⋅⋅⎟
⎠
⎞⎜⎝
⎛ 1
1
1
1 )!(!!
21
21 n
kknk
knkn
k knc
kcncc
kn
∑∞
==
1 !)(
n
n
n nxсxС
Polya’s approach
∑∞
==
1 !)(
n
n
n nxntxT
T(x) is the generating function for the number of rooted trees with n vertices
)()( xTxexT =
Lagrange inversion formula
))(()( sxs ϕψϕ =
00 |)(1|)( == = tn
n
n
sn
nt
dtd
ns
dsd ψϕ
10|1 −
= == nt
ntn
n
n nedtd
nnt
1 2
3
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
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example: 2,2,3 321 === sss
1
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example: 2,2,3 321 === sss
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example:2,2,3 321 === sss
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example:2,2,3 321 === sss
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example:2,2,3 321 === sss
∑=
=h
jjsn
1
Knuth’s theorem
Consider an example:2,2,3 321 === sss
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
1S
2S
3S
Knuth’s theorem
∑ ∏−
=
−Γ=f
h
ii
Si SfSHc i
1
1
1|| |)(||)(|)(Theorem (Knuth)
Knuth’s theorem
Theorem The number of spanning trees of a graph H arisen from a directed cycle equals
1143
12 ...321 −− ⋅⋅⋅⋅ hssss ssss
Knuth’s theorem
Theorem The number of spanning trees of a graph H arisen from a directed cycle equals
1143
12 ...321 −− ⋅⋅⋅⋅ hssss ssss
11
12
21 −− ⋅ ss ss is the number of r by s bipartite graphs
Knuth’s theorem
211
02)1( −−−−∑
==−−⎟
⎠
⎞⎜⎝
⎛ nkknn
knknk
kn
Matrix-Tree Theorem
Def. Let G be a directed graph without loops. Let denote the vertices of G, and denote the edges of G.
},...,{ 1 nvv},...,{ 1 mee
The incidence matrix of G is the n x m matrix A, such that
0,1
,1
,
,
,
=−==
ji
ji
ji
aaa if is the head of
if is the tail of
otherwise
1 2
34
1
2
3
4 5
111000011010011
01001
+++−+
−−−−+
iv
ivje
je
Matrix-Tree Theorem
1 2
34
1
2
3
4 5
111000011010011
01001
+++−+
−−−−+
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.
Matrix-Tree Theorem
1 2
34
1
2
3
4 50011010011
01001
−+−−−
−+
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.
Matrix-Tree Theorem
1 2
34
1
2
3
4 5010011101
+−−
−+
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.
Matrix-Tree Theorem
1 2
34
1
2
3
4 5000101
011−−
−+
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.
Matrix-Tree Theorem
Theorem (Binet-Cauchy)
∑= 2)(detdet BAA T
0A be the reduced incidence matrix of the graph G.Let
Theorem (Matrix-Tree Theorem)
If A is a reduced incidence matrix of the graph G, then the number of spanning trees equals )det( TAA ⋅
If R and S are matrices of size p by q and q by p, where , then
∑ ⋅= )det()det()det( CBRSqp ≤
Matrix-Tree Theorem
Gofedgeswithidentifiediablesee b var,...1 −
][)( ijmeM =
otherwiseitoincidentedgesifsumm
jiandjandijoinseifem
ij
kkij
=
≠−= ,
∑Π= )()( TeM nTheorem1 2
34
1
2
3
4 5=
+−
−++
−−+
=
32
2
2
521
1
1
41
4
0
0)(
eee
eeee
eeee
eM
543542432531431521421321 eeeeeeeeeeeeeeeeeeeeeeee +++++++=
Matrix-Tree Theorem
Gofedgeswithidentifiediablesee b var,...1 −
][)( ijmeM =
otherwiseitoincidentedgesifsumm
jiandjandijoinseifem
ij
kkij
=
≠−= ,
∑Π= )()( TeM nTheorem1 2
34
1
2
3
4 5
=+
−−
++−
−+
=
32
2
2
521
1
1
41
4
0
0)(
eee
eeee
eeee
eM
543542432531431521421321 eeeeeeeeeeeeeeeeeeeeeeee +++++++=
)det()( Tn AYAeM ⋅⋅=
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
1111111111111111111111
−−−−−−−−−−−−−−−−−−−−−−
nn
nn
……
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
111111111111111111
1111
−−−−−−−−−−−−−−−−−−
nn
n ……
Matrix-Tree Theorem
Another derivation of Cayley’s formula:
2
0000000000000001111
−= nn
nn
n ……
Matrix-Tree TheoremTheorem (Matrix-Tree Theorem for directed graphs)
Let be variables representing the arcs of the graph. Let denote the n by n matrix in which equals the sum of arcs directed from node i to node j if , and equals the sum of all arcs directed from node i to all other nodes.
][ ijcC =
ji ≠ijc−iic
Then∑Π= )(TСn
1 2
34
1
2
3
4 5
,
where the summation is over all spanning subtrees of G rooted at node n .
⎟⎟⎟⎟⎟⎟
⎠
⎞
++−−−−
−
⎜⎜⎜⎜⎜⎜
⎝
⎛
=
543354
22
11
00000000
eeeeeeee
ee
Сn
Matrix-Tree Theorem
1 2
34
1
2
3
4 5 521421321
54334
2
1
2 0000
eeeeeeeeeeeeee
ee
С ++=++−−
=