  In this paper we study the following problem. Let $A$ be a fixed graph, and
let $\hom(G,A)$ denote the number of homomorphisms from a graph $G$ to $A$.
Furthermore, let $v(G)$ denote the number of vertices of $G$, and let
$\mathcal{G}_d$ denote the family of $d$--regular graphs. The general problem
studied in this paper is to determine $$\inf_{G\in
\mathcal{G}_d}\hom(G,A)^{1/v(G)}.$$ It turns out that in many instances the
infimum is not achieved by a finite graph, but a sequence of graphs with girth
(i. e., length of the shortest cycle) tending to infinity. In other words, the
optimization problem is solved by the infinite $d$--regular tree.
  We prove this type of results for the number of independent sets of bipartite
graphs, evaluations of the Tutte-polynomial, Widom-Rowlinson configurations,
and many more graph parameters. Our main tool will be a transformation called
$2$-lift.
