  The goal of this paper is to investigate a family of optimization problems
arising from list homomorphisms, and to understand what the best possible
algorithms are if we restrict the problem to bounded-treewidth graphs. For a
fixed $H$, the input of the optimization problem LHomVD($H$) is a graph $G$
with lists $L(v)$, and the task is to find a set $X$ of vertices having minimum
size such that $(G-X,L)$ has a list homomorphism to $H$. We define analogously
the edge-deletion variant LHomED($H$). This expressive family of problems
includes members that are essentially equivalent to fundamental problems such
as Vertex Cover, Max Cut, Odd Cycle Transversal, and Edge/Vertex Multiway Cut.
  For both variants, we first characterize those graphs $H$ that make the
problem polynomial-time solvable and show that the problem is NP-hard for every
other fixed $H$. Second, as our main result, we determine for every graph $H$
for which the problem is NP-hard, the smallest possible constant $c_H$ such
that the problem can be solved in time $c^t_H\cdot n^{O(1)}$ if a tree
decomposition of $G$ having width $t$ is given in the input, assuming the SETH.
Let $i(H)$ be the maximum size of a set of vertices in $H$ that have pairwise
incomparable neighborhoods. For the vertex-deletion variant LHomVD($H$), we
show that the smallest possible constant is $i(H)+1$ for every $H$.
  The situation is more complex for the edge-deletion version. For every $H$,
one can solve LHomED($H$) in time $i(H)^t\cdot n^{O(1)}$ if a tree
decomposition of width $t$ is given. However, the existence of a specific type
of decomposition of $H$ shows that there are graphs $H$ where LHomED($H$) can
be solved significantly more efficiently and the best possible constant can be
arbitrarily smaller than $i(H)$. Nevertheless, we determine this best possible
constant and (assuming the SETH) prove tight bounds for every fixed $H$.
