The goal of this work is to give precise bounds on the counting complexity of a family of generalized coloring problems (list homomorphisms) on bounded-treewidth graphs. Given graphs G, H, and lists L(v) ⊆ V(H) for every vV(G), a list homomorphism is a function f : V(G) → V(H) that preserves the edges (i.e., uvE(G) implies f(u)f(v) ∊ E(H)) and respects the lists (i.e., f(v) ∊ L(v)). Standard techniques show that if G is given with a tree decomposition of width t, then the number of list homomorphisms can be counted in time . Our main result is determining, for every fixed graph H, how much the base |V(H)| in the running time can be improved. For a connected graph H we define irr(H) in the following way: if H has a loop or is nonbipartite, then irr(H) is the maximum size of a set SV(H) where any two vertices have different neighborhoods; if H is bipartite, then irr(H) is the maximum size of such a set that is fully in one of the bipartition classes. For disconnected H, we define irr(H) as the maximum of irr(C) over every connected component C of H. It follows from earlier results that if irr(H) = 1, then the problem of counting list homomorphisms to H is polynomial-time solvable, and otherwise it is #P-hard. We show that, for every fixed graph H, the number of list homomorphisms from (G, L) to H
can be counted in time if a tree decomposition of G having width at most t is given in the input, and
given that irr(H) ≥ 2, cannot be counted in time for any > 0, even if a tree decomposition of G having width at most t is given in the input, unless the Counting Strong Exponential-Time Hypothesis (#SETH) fails.
Thereby we give a precise and complete complexity classification featuring matching upper and lower bounds for all target graphs with or without loops.

Formats available

You can view the full content in the following formats:

Information & Authors


Published In

cover image Proceedings
Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA)
Pages: 431 - 458
Editors: Joseph (Seffi) Naor, Technion Israel Institute of Technology, Israel and Niv Buchbinder, Tel Aviv University, Israel
ISBN (Online): 978-1-61197-707-3


Published online: 5 January 2022



Metrics & Citations



If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited By

There are no citations for this item

View Options

View options


View PDF

Get Access







Copy the content Link

Share with email

Email a colleague

Share on social media