Vous êtes sur la page 1sur 73

Enumerating labeled trees

Definition: A labeledtree 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 labeledtree 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 labeledtree 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 labeledtree 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 labeledtree 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 labeledtree 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
3
T3 =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
3
T3 =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
3
T3 =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
n
n T
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 n
n
1. Induction
k A n A = | | }, ,... 2 , 1 {
k n
T
,
- the number of forests of k trees, for which the vertices from A appear
in different components.
Cayleys theorem
F(A, n) - the set of forests on n vertices in which vertices from A
appear in different connected components(trees).
k A n k n k n A = + + = | | }, ,... 2 , 1 {
k n
T
,
- the number of forests of k trees, for which the vertices from A appear
in different components.
Cayleys 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

=
+


=
k n
i
i k n k n
T
i
k n
T
0
1 , 1 ,
) 1 ( ) 1 (
1
,

=
k n
k n
kn T
n-k+1 n-k+2 n-1 n
i vertices
}} { }) { \ ( ' ), 1 , ' ( { ) , ( vertices chosen i n A A n A F n A F =
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
| | | |
2
n n
T n S =
1
7 9 5 8
10
2 3
6
4
left end
right end

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
} ,..., 1 { } ,..., 1 { : n n f

=
7
10
4 8 5 2 1 9 5 5
9 8 7 6 5 4 3 2
7
1
f
1 7 10 4 9
8 3
6
5
2
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)

=
7
10
4 8 5 2 1 9 5 5
9 8 7 6 5 4 3 2
7
1
f
1 7 10 4 9
8 3
6
5
2
} 9 , 8 , 7 , 5 , 4 , 1 { = M M
f |
is a bijection
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
4

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
4

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
1 7 10 4 9
8 3
6
5
2
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
3
4

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
1 7 10 4 9
8 3
6
5
2
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
2 3
4

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
1 7 10 4 9
8 3
6
5
2
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
2 3
6
4

=
4
9
8 5 1 9
8 7 5 4
7
1
|
M
f
1 7 10 4 9
8 3
6
5
2
2. Establishing a 1-1 correspondence between trees and
functions acting from 1..n into 1..n (Joyal)
1
7 9 5 8
10
2 3
6
4
left end
right end
(7,9,1,5,8,4) ->(1,5,7,8,4,9)

=
4 8 5 1 9 7
9 8 7 5 4 1
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
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
2. Pruefer code
1 2
3
4
5
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :1
2. Pruefer code
1
3
4
5
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14
2. Pruefer code
1
4
5
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4
2. Pruefer code
1
4
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4 1
2. Pruefer code
1
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4 1 6
2. Pruefer code
6
7
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4 1 6 6
2. Pruefer code
6
8
9
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4 1 6 6 8
2. Pruefer code
6
8
10
) ,..., , (
2 2 1 n
a a a
Labeled tree ->
Pruefer code :14 4 1 6 6 8 6
2. Pruefer code
(14 4 1 6 6 8 6)
3
4
5
6
7
8
9
10
2. Pruefer code
(14 4 1 6 6 8 6)
3
2
7 9
10
Reversing the correspondence
5
1
- deleted vertex
- end vertex
- inner vertex
(144 1 6 6 8 6)
3 2
7 9
10
Reversing the correspondence
5
1
4
- deleted vertex
- end vertex
- inner vertex
(1441 6 6 8 6)
3 2
7 9
10
Reversing the correspondence
5
1
4
- deleted vertex
- end vertex
- inner vertex
(14416 6 8 6)
3 2
7 9
10
Reversing the correspondence
5
1
4
- deleted vertex
- end vertex
- inner vertex
(144166 8 6)
3 2
7 9
10
Reversing the correspondence
5
1
4
6
- deleted vertex
- end vertex
- inner vertex
(1441668 6)
3 2
7 9
10
Reversing the correspondence
5
1
4
6
- deleted vertex
- end vertex
- inner vertex
(14416686)
3 2
7 9
10
Reversing the correspondence
5
1
4
6
- deleted vertex
- end vertex
- inner vertex
(14416686)
3 2
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
8
9
10
3 2
7 9
10 5
1
4
6
Other applications: the number of trees with a given
degree sequence
m
i
i
m
d
m
d
n d
d d
m
n
m
x x
d d
n
x x

= + +

1
1
1
) ,..., (
1
1
! !
!
) ... (
)! 1 ( )! 1 (
)! 2 (
1


m
d d
n

be the degree sequence


) ,..., (
1 n
d d
Let
Other applications: the number of trees with a given
degree sequence
m
i
i
m
d
m
d
n d
d d
m
n
m
x x
d d
n
x x

= + +

1
1
1
) ,..., (
1
1
! !
!
) ... (
be the degree sequence
) ,..., (
1 n
d d
)! 1 ( )! 1 (
)! 2 (
1


n
d d
n

1
) 1 (
1
2

k n
n
k
n
-the number of trees in which vertex n has
degree k
Let
Polyasapproach

=
=
1
!
) (
n
n
n
n
x
nt x T
T(x) is the generating function for the number of rooted trees withn vertices
Let be the number of connected graphs on n vertices enjoyinga certain
property P.
n
c

=

=

1
1
1
1
)! ( !
!
2
1
2
1
n
k
k n k
k n k
n
k
k n
c
k
c
n c c
k
n

=
=
1
!
) (
n
n
n
n
x
x
Polyasapproach

=
=
1
!
) (
n
n
n
n
x
nt x T
T(x) is the generating function for the number of rooted trees withn vertices
) (
) (
x T
xe x T =
Lagrange inversion formula
)) ( ( ) ( s x s =
0 0
| ) (
1
| ) (
= =
=
t
n
n
n
s
n
n
t
dt
d
n
s
ds
d

1
0
|
1

=
= =
n
t
nt
n
n
n
n e
dt
d
n
nt
1
2
3
The number of spanning trees of a directed graph
Def. A spanning tree of a graph G is its subgraphT 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 whichare directed
towards the root
1
2
3
1
2
3
1
2
3

=
=
h
j
j
s n
1
Knuths theorem
Consider an example: 2 , 2 , 3
3 2 1
= = = s s s
1

=
=
h
j
j
s n
1
Knuths theorem
Consider an example: 2 , 2 , 3
3 2 1
= = = s s s

=
=
h
j
j
s n
1
Knuths theorem
Consider an example:
2 , 2 , 3
3 2 1
= = = s s s

=
=
h
j
j
s n
1
Knuths theorem
Consider an example:
2 , 2 , 3
3 2 1
= = = s s s

=
=
h
j
j
s n
1
Knuths theorem
Consider an example:
2 , 2 , 3
3 2 1
= = = s s s

=
=
h
j
j
s n
1
Knuths theorem
Consider an example:
2 , 2 , 3
3 2 1
= = = s s s
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
1
S
2
S
3
S
Knuths theorem

=

=
f
h
i
i
S
i
S f S H c
i
1
1
1 | |
| ) ( | | ) ( | ) (
Theorem (Knuth)
Knuths theorem
Theorem The number of spanning trees of a graph H arisen from a
directed cycle equals
1
1 4 3
1
2
...
3 2 1


h
s s s s
s s s s
Knuths theorem
Theorem The number of spanning trees of a graph H arisen from a
directed cycle equals
1
1 4 3
1
2
...
3 2 1


h
s s s s
s s s s
1
1
1
2
2 1


s s
s s
is the number of r by s bipartite graphs
Knuths theorem
2 1 1
0
2 ) 1 (

=
=

n k k n
n
k
n k n k
k
n
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 n
v v
} ,..., {
1 m
e e
The incidence matrix of G is the n x m matrix A, such that
0
, 1
, 1
,
,
,
=
=
=
j i
j i
j i
a
a
a
if is the head of
if is the tail of
otherwise
1
2
3 4
1
2
3
4
5
1 1 1 0 0
0 0 1 1 0
1 0 0 1 1
0 1 0 0 1
+ + +
+

+
i
v
i
v
j
e
j
e
Matrix-Tree Theorem
1
2
3 4
1
2
3
4
5
1 1 1 0 0
0 0 1 1 0
1 0 0 1 1
0 1 0 0 1
+ + +
+

+
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
3 4
1
2
3
4
5
0 0 1 1 0
1 0 0 1 1
0 1 0 0 1
+

+
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
3 4
1
2
3
4
5
0 1 0
0 1 1
1 0 1
+

+
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
3 4
1
2
3
4
5
0 0 0
1 0 1
0 1 1

+
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
) (det det B A A
T
0
A
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(
T
A A
If R and S are matrices of size p by q and q by p, where , then
= ) det( ) det( ) det( C B RS
q p
Matrix-Tree Theorem
G of edges with identified iables e e
b
var ,...
1

] [ ) (
ij
m e M =
otherwise i to incident edges if sum m
j i and j and i joins e if e m
ij
k k ij
=
= ,
= ) ( ) ( T e M
n
Theorem
1
2
3 4
1
2
3
4
5
=
+

+ +

+
=
3 2
2
2
5 2 1
1
1
4 1
4
0
0
) (
e e
e
e
e e e
e
e
e e
e M
5 4 3 5 4 2 4 3 2 5 3 1 4 3 1 5 2 1 4 2 1 3 2 1
e e e e e e e e e e e e e e e e e e e e e e e e + + + + + + + =
Matrix-Tree Theorem
G of edges with identified iables e e
b
var ,...
1

] [ ) (
ij
m e M =
otherwise i to incident edges if sum m
j i and j and i joins e if e m
ij
k k ij
=
= ,
= ) ( ) ( T e M
n
Theorem
1
2
3 4
1
2
3
4
5
=
+

+ +

+
=
3 2
2
2
5 2 1
1
1
4 1
4
0
0
) (
e e
e
e
e e e
e
e
e e
e M
5 4 3 5 4 2 4 3 2 5 3 1 4 3 1 5 2 1 4 2 1 3 2 1
e e e e e e e e e e e e e e e e e e e e e e e e + + + + + + + =
) det( ) (
T
n
A Y A e M =
Matrix-Tree Theorem
Another derivation of Cayleysformula:
1 1 1 1 1
1 1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1





n
n
n
n

Matrix-Tree Theorem
Another derivation of Cayleysformula:
1 1 1 1 1
1 1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1




n
n
n

Matrix-Tree Theorem
Another derivation of Cayleysformula:
2
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0
1 1 1 1

=
n
n
n
n
n

Matrix-Tree Theorem
Theorem (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.
] [
ij
c C =
j i
ij
c
ii
c
Then
= ) (T
n
1
2
3 4
1
2
3
4
5
,
where the summation is over all spanning subtrees of G rooted at node n .

+ +

=
5 4 3 3 5 4
2 2
1 1
0 0
0 0 0 0
0 0
e e e e e e
e e
e e

n
Matrix-Tree Theorem
1
2
3 4
1
2
3
4
5
5 2 1 4 2 1 3 2 1
5 4 3 3 4
2
1
2
0 0
0 0
e e e e e e e e e
e e e e e
e
e
+ + =
+ +
=

Vous aimerez peut-être aussi