In this paper we study several problems concerning the number of
homomorphisms of trees. We give an algorithm for the number of homomorphisms
from a tree to any graph by the Transfer-matrix method. By using this algorithm
and some transformations on trees, we study various extremal problems about the
number of homomorphisms of trees. These applications include a far reaching
generalization of Bollob\'as and Tyomkyn's result concerning the number of
walks in trees.
Some other highlights of the paper are the following. Denote by hom(H,G)
the number of homomorphisms from a graph H to a graph G. For any tree Tm
on m vertices we give a general lower bound for hom(Tm,G) by certain
entropies of Markov chains defined on the graph G. As a particular case, we
show that for any graph G,
exp(Hλ(G))λm−1≤hom(Tm,G), where λ is the
largest eigenvalue of the adjacency matrix of G and Hλ(G) is a
certain constant depending only on G which we call the spectral entropy of
G. In the particular case when G is the path Pn on n vertices, we
prove that hom(Pm,Pn)≤hom(Tm,Pn)≤hom(Sm,Pn), where Tm
is any tree on m vertices, and Pm and Sm denote the path and star on
m vertices, respectively. We also show that if Tm is any fixed tree and
hom(Tm,Pn)>hom(Tm,Tn), for some tree Tn on n vertices, then
Tn must be the tree obtained from a path Pn−1 by attaching a pendant
vertex to the second vertex of Pn−1.
All the results together enable us to show that
|\End(P_m)|\leq|\End(T_m)|\leq|\End(S_m)|, where \End(T_m) is the set of
all endomorphisms of Tm (homomorphisms from Tm to itself).Comment: 47 pages, 15 figure