Counting and Finding Homomorphisms is Universal for Parameterized Complexity Theory
CCounting and Finding Homomorphisms isUniversal for Parameterized Complexity Theory
Marc Roth
Cluster of Excellence (MMCI), Saarland Informatics Campus (SIC), Saarbrücken, [email protected]
Philip Wellnitz
Max Planck Institute for Informatics, Saarland Informatics Campus (SIC), Saarbrücken, [email protected]
Abstract
Counting homomorphisms from a graph H into another graph G is a fundamental problem of(parameterized) counting complexity theory. In this work, we study the case where both graphs H and G stem from given classes of graphs: H ∈ H and G ∈ G . By this, we combine the structurallyrestricted version of this problem (where the class G = > is the set of all graphs), with the language-restricted version (where the class H = > is the set of all graphs). The structurally restricted versionallows an exhaustive complexity classification for classes H : Either we can count all homomorphismsin polynomial time (if the treewidth of H is bounded), or the problem becomes W [ ]-hard [Dalmau,Jonsson, Th.Comp.Sci’04]. In contrast, in this work, we show that the combined view most likelydoes not admit such a complexity dichotomy.Our main result is a construction based on Kneser graphs that associates every problem P in W [ ] with two classes of graphs H and G such that the problem P is equivalent to the problem Hom ( H → G ) of counting homomorphisms from a graph in H to a graph in G . In view of Ladner’sseminal work on the existence of NP -intermediate problems [J.ACM’75] and its adaptations to theparameterized setting, a classification of the class W [ ] in fixed-parameter tractable and W [ ]-complete cases is unlikely. Hence, obtaining a complete classification for the problem Hom ( H → G )seems unlikely. Further, our proofs easily adapt to W [ ] and the problem of deciding whether ahomomorphism between graphs exists.In search of complexity dichotomies, we hence turn to special graph classes. Those classes includeline graphs, claw-free graphs, perfect graphs, and combinations thereof, and F -colorable graphsfor fixed graphs F : If the class G is one of those classes and the class H is closed under takingminors, then we establish explicit criteria for the class H that partition the family of problems Hom ( H → G ) into polynomial-time solvable and W [ ]-hard cases. In particular, we can drop thecondition of H being minor-closed for F -colorable graphs. As a consequence, we are able to lift theframework of graph motif parameters due to Curticapean, Dell and Marx [STOC’17] to F -colorablegraphs and provide an exhaustive classification for the parameterized subgraph counting problem on F -colorable graphs. As a special case, we obtain an easy proof of the parameterized intractabilityresult of the problem of counting k -matchings in bipartite graphs. Theory of computation → Parameterized complexity and exactalgorithms; Theory of computation → Problems, reductions and completeness; Mathematics ofcomputing → Combinatorics; Mathematics of computing → Graph theory
Keywords and phrases
Parameterized complexity theory, counting problems, graph homomorphisms,Kneser graphs
Acknowledgements
We thank Karl Bringmann and Holger Dell for fruitful discussions and valuablefeedback on early drafts of this work. a r X i v : . [ c s . CC ] J u l Counting Homomorphisms is Universal for Parameterized Complexity Theory
Homomorphisms between Graphs
Given graphs H and G , a fundamental question is whether (or how often) we can “find” thegraph H in the graph G . Depending on the application, different notions of “finding” thegraph H are studied: In the classical subgraph isomorphism problem [14, 55] (also consulte.g. [2, 48]), the goal is to search for subgraphs of G that are isomorphic to the graph H .In contrast, allowing multiple vertices of the graph H to be mapped to the same vertex of G , only requiring edge relations to be preserved, we obtain a relaxation of the subgraphisomorphism problem called the (graph) homomorphism problem. The problem of finding(and by extension counting) homomorphisms in graphs has a tight connection to problemsrelated to conjunctive queries in data bases [11, 20], as well as applications in e.g. artificialintelligence [27]. As it turns out, once we want to count all “occurrences” of the graph H in G , understanding the graph homomorphism problem is already enough to understand variousother notions of “finding” graphs in other graphs: As Curticapean, Dell, and Marx [16]proved, counting e.g. isomorphic subgraphs is the same as counting linear combinations ofgraph homomorphisms. Hence, in this work, we focus on counting graph homomorphisms.Formally, given two classes of graphs H and G , the (decision) problem Hom ( H → G ) isdefined as follows: Given graphs H ∈ H and G ∈ G , decide whether there is a mapping h : V ( H ) → V ( G ) such that for any edge uv in V ( H ), the edge h ( u ) h ( v ) exists in V ( G ).The problem of finding graph homomorphisms, also called H -colorings, has been studiedsince the late 1970s and 1980s [32, 45, 1]. In its most general form, where both classes H and G contain all graphs (denoted by H = G = > ) the problem Hom ( H → G ) is NP -complete:Checking whether a graph H admits a homomorphism to the complete graph on 3 vertices isequivalent to checking whether H is 3-colorable, a classical NP -hard problem (see e.g. [31]).Motivated by the hardness in the general case, special cases of the problem Hom ( H → G )have been studied: The language-restricted version of the problem
Hom ( H → G ) only assumesthe class H = > to be the set of all graphs and restricts the class G . Note that the aboveexample of checking whether a graph is 3-colorable falls into this framework (by setting G = { K } ), so the problem Hom ( > → G ) is NP -hard in general as well. However, if theclass G contains only bipartite graphs, the problem Hom ( > → G ) is solvable in polynomialtime [38]. In fact, Hell and Nešetřil [38] also prove the following hardness result: If theclass G contains a non-bipartite graph, the problem Hom ( > → G ) is NP -hard. Together, thisyields a complexity dichotomy : for any problem Hom ( > → G ), we obtain its complexity justby looking at the class G . Based on this dichotomy, Feder and Vardi conjectured [27] that asimilar dichotomy is possible for constraint satisfaction problems; this Feder-Vardi-Conjecturewas proved recently by Bulatov [9] and, independently, by Zhuk [59].Having understood the problem Hom ( > → G ), the focus shifted to understanding “theother side”, that is the case where the class G contains all graphs instead. For this structurallyrestricted version of the problem Hom ( H → G ), the success story continues: As Grohe [34]proved, if every graph in the graph class H contains only graphs for which the so-called treewidth is small, then the problem Hom ( H → > ) is solvable in polynomial-time again.Otherwise, using the now classical “Excluded-Grid-Theorem” [50], the graph class H (veryroughly speaking) contains something looking like a grid, and finding homomorphisms Strictly speaking, the graphs in the class H only need to be homomorphically equivalent to graphs withsmall treewidth. . Roth and P. Wellnitz 3 from a grid in another graph is NP -hard, as it can be used to solve the classical cliquedetection problem (and finding a clique in turn is a classical NP -hard problem). In fact,Grohe’s dichotomy is even stronger: It shows that from a parametrized complexity view, theproblem Hom ( H → > ) is either what is called “fixed-parameter tractable” (solvable in time f ( | V ( H ) | ) · | V ( G ) | O (1) for graphs H ∈ H , G ∈ > ) or “ W [ ]-hard” (essentially a parametrizedequivalent of NP -hardness). We formalize these notions later; also consult [49, 29, 18] for anin-depth introduction to parametrized complexity theory. The Doubly Restricted Version of Counting Homomorphisms
A natural generalization of finding a solution to a problem is to count all solutions. From analgorithmic point of view, counting all solutions may be way harder than finding a solution:While finding a perfect matching in a graph has a classical polynomial-time algorithm, counting all perfect matchings is known to be P -complete [57].Formally, for two classes of graphs H and G , the counting version of the homomorphismproblem (denoted by Hom ( H → G )) is defined as follows: Given graphs H ∈ H and G ∈ G ,compute the number of (graph) homomorphism from the graph H to the graph G . Similarlyto the decision realm, the language-restricted version Hom ( > → G ) has been studied in thecontext of the counting constraint satisfaction problem: The dichotomy theorem of Dyer andGreenhill implies that the problem Hom ( > → G ) is P -complete if the class G containsa graph with a connected component that is neither an isolated vertex with or withoutself-loop, nor a complete graph with all self-loops, nor a complete bipartite graph withoutself-loops [23]. Otherwise, the problem Hom ( > → G ) is solvable in polynomial time (cf.[23, Lemma 4.1]). In a subsequent line of research, this classification was lifted to generalcounting constraint satisfaction problems [8, 24, 10].The structurally restricted version of the graph homomorphism problem has been studiedin the counting regime as well: A counting analogue of Grohe’s dichotomy was establishedby Dalmau and Jonsson [19]. In [19] they prove that the counting problem Hom ( H → > )is solvable in polynomial time if and only if there is a constant bound on the treewidth ofthe graphs in the class H ; otherwise the problem Hom ( H → > ) is complete for the class W [ ] (where the class W [ ] is the counting equivalent of W [ ]).Initiated by the breakthrough result by Curticapean, Dell, and Marx [16], a line ofresearch [52, 53, 20] lifted the dichotomy of Dalmau and Jonnson [19] to all parameterizedcounting problems that can be expressed as linear combinations of homomorphisms, sub-suming counting of subgraphs, counting of induced subgraphs and even counting of answersto existential first-order queries. This lifting technique is sometimes also called complexitymonotonicity . Counting Homomorphisms is Universal for W [ ] and W [ ] The previous results provide a surprisingly clean picture of the complexity landscape of theproblems of finding and counting graph homomorphisms for both, the language-restrictedand the structurally restricted version. However, none of the previous results are applicablefor the doubly restricted version: Instead of restricting only H or G , we consider the problem Hom ( H → G ) where both classes are fixed. This can be seen as a special case of boththe structurally restricted version and the language-restricted version. In particular, theknown dichotomies only translate for certain pairs of classes H , G , leaving a wide gap inthe complexity landscape to be explored. In particular, it is imaginable that for real-worldinstances, both graphs H and G have a certain structure that can be exploited. In fact, Counting Homomorphisms is Universal for Parameterized Complexity Theory we show that the doubly restricted version can express any problem in W [ ] and W [ ],respectively. Intuitively, this means that if we want to understand any problem P in W [ ], we may instead consider an equivalent problem Hom ( H P → G P ). In particular,any algorithm or hardness obtained for Hom ( H P → G P ) directly translates to the originalproblem P . (cid:73) Theorem 1.1 (Universality for W [ ] and W [ ] ) . For any problem P in W [ ] , there areclasses H = H P and G = G P such that P ≡ fptT Hom ( H → G ) , and for any problem P in W [ ] , there are classes H = H P and G = G P such that P ≡ fptT Hom ( H → G ) , where ≡ fptT denotes interreducibility (sometimes also called equivalence) with respect toparameterized Turing-reductions.The classes H and H are recursively enumerable and the classes G and G are recursive. Theorem 1.1 in turn also makes a clear categorization of the problems
Hom ( H → G ) into“easy” (that is fixed-parameter tractable) and “hard” (that is W [ ]-hard or W [ ]-hard) casesunlikely: A general partition of the class W [ ] in fixed-parameter tractable and W [ ]-completeproblems is very unlikely as indicated by Ladner’s seminal result [40] and its adaptation tothe parameterized setting by Downey and Fellows [22]. A similar reasoning applies to W [ ].Note that Theorem 1.1, in particular its consequences for the absence of parameterizeddichotomies, are independent from the “non-dichotomy” results of [6] and [12], which rule outa P vs. NP / P dichotomy for the structurally restricted versions: In [6], Bodirsky and Groheprove a P vs. NP non-dichotomy by a modification of Ladners Theorem [40]; however, thishas no direct implications from neither a parametrized complexity nor a counting complexitypoint of view. Independently, in [12], Chen, Thurley, and Weyer proved a similar result alsofor the counting version and hence obtained a P vs. P non-dichotomy result; again, thishas no direct implications for our setting. Dichotomies for F -Colorable Graphs and König Graphs Having established the doubly restricted version of the problem
Hom ( H → G ) as interestingin general, we proceed to demonstrate examples of both, (1) how existing complexitydichotomies translate to the doubly restricted setting, as well as (2) how we can exploit theexistence of structure in both classes to obtain new complexity dichotomies for certain pairsof graph classes.Note that if we fix a graph class G for which the corresponding language restrictedproblem Hom ( > → G ) is already “easy”, then the same is true for any graph class H andthe problem Hom ( H → G ). While it may be possible to improve the running time ofknown algorithms for special classes H in such a case, in this work we focus on investigatingclasses G where the problem Hom ( H → > ) is hard. (Note further that a similar statementis true for classes H where the structurally-restricted problem Hom ( H → > ) is “easy”.)As a first example how known dichotomies can be adapted to yield new results for thedoubly-restricted setting, we consider the case where the class G = G F is the set of all For instance if G is the class of all planar graphs, Eppstein [26] gave an fixed-parameter tractablealgorithm for Hom ( > → G ); a similar result is known even for classes of bounded local treewidth [30].Hence, there are also fixed-parameter tractable algorithms solving Hom ( H → G ) for any graph class H . . Roth and P. Wellnitz 5 F -colorable graphs for some fixed graph F . For example, if F is chosen to be the graphconsisting of a single edge, then the problem Hom ( H → G F ) is the problem of countinghomomorphisms from a graph H ∈ H to a bipartite graph G . As it turns out, it is possible torefine the dichotomy by Dalmau and Jonsson [19] for the case G = > to work for F -colorablegraphs as well: (cid:73) Theorem 1.2.
Let F be a graph, and let H be a recursively enumerable class of graphs. (1) If the treewidth of the class
H ∩ G F is bounded, then the problem Hom ( H → G F ) ispolynomial-time solvable. (2) Otherwise, the problem
Hom ( H → G F ) is W [ ] -complete. While the proof Theorem 1.2 is conceptually close to the proof by Dalmau and Jonsson [19],we can combine Theorem 1.2 with the aforementioned complexity monotonicty [16] to liftthe result to the realm of counting subgraphs: (cid:73)
Theorem 1.3 (Intuitive version) . Let F be a fixed graph and let H be a recursively enumerableclass of graphs. Given a graph H ∈ H and a graph G ∈ G F , we wish to compute the numberof subgraphs Sub ( H → G ) of G that are isomorphic to H . (1) If the matching number of
H ∩ G F is bounded then the problem Sub ( H → G ) ispolynomial-time solvable. (2) Otherwise, the problem
Sub ( H → G ) is W [ ] -complete. Note that Theorem 1.3 subsumes a dichotomy for counting subgraphs in bipartite graphsand, in particular, Theorem 1.3 yields an alternative and easy proof of W [ ]-hardness ofcounting k -matchings in bipartite graphs [17]. Further, as an example of a new result whichfollows from Theorem 1.3, we obtain W [ ]-hardness for the problem of counting trianglepackings in 3-colorable graphs: This problem asks, given parameter k and a 3-colorablegraph G , to compute the number of possibilities to embed k vertex-disjoint triangles into G .As an example for completely new insights gained in the doubly restricted setting, weconsider the cases where the class G = L is the set of line graphs and where the set G = K is the set of König graphs , respectively; where a König graph is a line graph of a bipartitegraph. König graphs are of particular interest, as they are a subset of the well-studiedclasses of perfect graphs [13], line graphs (of arbitrary graphs) and thus of the claw-freegraphs [3]. Consequently, the hardness results we obtain for König graphs hold for the threeprevious classes of graphs as well.Being a well-studied object for almost a whole century [58], line graphs have applicationsin both graph theory (see e.g. [13]), but also in algorithm design (see e.g. [44]). Thefirst thorough study of homomorphisms between line graphs is due to Nešetřil [47]; inparticular, Nešetřil gave criteria when a homomorphism from L ( H ) to L ( G ) correspondsto a homomorphism from H to G . We further motivate the study of line graphs (and byextension König graphs) by demonstrating that the problem of finding a homomorphism to aline graph is always fixed-parameter tractable: Observe that containment in the class G F is in general not solvable in polynomial time: If F is thetriangle then G F , if considered as language, is the 3-coloring problem. For this reason, we model theproblem Hom ( H → G ) as a parameterized promise problem; the formal definition is given in Section 2. We chose this terminology due to the fact that König’s theorem states that line graphs of bipartitegraphs are perfect (see e.g. [13]). The symbol K is used since “König” is the German word for “King”. Counting Homomorphisms is Universal for Parameterized Complexity Theory (cid:73)
Theorem 1.4.
The decision problems
Hom ( > → L ) and thus Hom ( > → K ) are fixed-parameter tractable. In particular, given a graph H and a line graph L , it is possible todecide the existence of a homomorphism from H to L in time f ( | V ( H ) | ) · O ( | V ( L ) | ) , for some computable function f independent of H and L . As it turns out, in contrast, counting all homomorphisms to König graph is in general W [ ]-hard; specifically, we prove the following: (cid:73) Theorem 1.5.
Let H be a recursively enumerable class of graphs. If H has unboundedtreewidth and is closed under taking minors, then the problem Hom ( H → K ) is W [ ] -complete. As argued before, the choice of König graphs induces the following consequences for perfectand claw-free graphs. (cid:73)
Corollary 1.6.
Let C be one of the classes of line-graphs, claw-free graphs or perfect graphs,or a non-empty union thereof. Further, let H be a recursively enumerable class of graphs. (1) If the treewidth of the class H is bounded, then the problem Hom ( H → C ) is solvablein polynomial time. (2) Otherwise, if the class H is additionally minor-closed, the problem Hom ( H → C ) is W [ ] -complete. Note that by restricting the graph class H in Theorem 1.5, we are able to give a moredetailed view of what makes counting homomorphisms to König graphs hard . In particular,the explicit criterion established by Theorem 1.5 suggests that we may only hope for fastalgorithms for classes H that are not minor-closed.However, in general, Theorem 1.5 does not answer the question whether we can classifythe problem Hom ( H → K ) into easy and hard problems, hence we answer that questionwith the following implicit dichotomy: (cid:73) Theorem 1.7.
Let H be a recursively enumerable class of graphs. Then the problem Hom ( H → K ) is either fixed-parameter tractable or W [ ] -complete under parameterizedTuring-reductions. Technical Overview
For our universality result (Theorem 1.1), we rely on known results regarding homomorphismsbetween
Kneser graphs . More precisely, we use a computable function that associates eachinteger n ≥ n ) such that there are no homomorphisms between K( n )and K( m ) whenever n = m . Now, given some problem P ∈ W [ ], we use the existence of acertain parameterized weakly parsimonious reduction A from P to the problem of countinghomomorphisms from Kneser graphs K( n ). In particular, for any instance x of the problem P , we have an efficiently computable mapping to a pair of graphs x ( H x , G x ) such that P ( x ) is equal (up to a normalizing factor) to the number of homomorphisms from the Knesergraph H x to the graph G x , the latter of which can be assumed to allow a homomorphismto H x . The main idea is then to choose H as the set of all graphs H x and G as the set ofall graphs G x . Then we prove that P and Hom ( K → G ) are interreducible. While thereduction P ≤ fptT Hom ( K → G ) is immediate, we consider the construction of the backwardreduction as our main technical contribution. . Roth and P. Wellnitz 7
In particular, consider a pair of graphs ( H x , G y ) ∈ H × G . In order to obtain a reduction Hom ( K → G ) ≤ fptT P , that is to compute the number Hom ( H x → G y ), we need toconstruct an instance to the problem P . This is easy if both H x and G y indeed correspondto the same instance z = x = y . If H x and G y do not correspond to a common instance,however, we need information about Hom ( H x → G y ) from somewhere else , as any oracleto the problem P is useless in this situation. In our case, the construction ensures that Hom ( H x → G y ) = 0 in this situation; but in order to obtain this equality (while alsomaintaining decodability of the original instance x ), an involved construction using Knesergraphs seems to be required.An even more fundamental (but easier to solve) challenge is to reversibly encode anystring x into a part of the graph G x in such a way, that the number of homomorphismsto the graph G x changes in a controlled way (in our case the number of homomorphismsstays in fact the same). As our constructed Kneser graphs have a chromatic number of atleast 3, encoding a string x is possible using a comparably simple construction using paths.Implicitly, this step as well relies on deep theory about Kneser graphs, in particular we relyon Lovász’ seminal result [42] which asserts that H x cannot be mapped homomorphicallyinto a graph with low chromatic number.For our dichotomy results, as advertised, from a technical point of view, obtainingTheorem 1.2 is a rather simple lifting exercise from the result in [19]; we obtain Theorem 1.3by a rather straightforward application of complexity monotonicity [16].In contrast, the analysis of the complexity of counting homomorphisms to König graphs istechnically more involved. The proof of the explicit classification for minor-closed classes H (Theorem 1.5) uses a gadget construction that, intuitively, associates each graph with a Königgraph, while keeping the number of grid-like substructures stable. In view of the diverseapplications of the Grid-Tiling Problem (see e.g. [18, Chapter 14.4.1]), the constructionmight yield further intractability results for counting problems on König graphs (and thuson claw-free and perfect graphs) and might hence be of independent interest.Finally, the implicit and exhaustive classification for counting homomorphisms to Königgraphs (Theorem 1.7) relies on Whitney’s Isomorphism Theorem for line graphs [58] whichallows to express the number of homomorphisms from a graph H to a König graph G as afinite linear combination of homomorphisms of the form X F λ F · Hom ( F → L − ( G )) , where the graphs F only depend on H and Hom ( F → L − ( G )) is the number of homo-morphisms from F to the primal graph of G . Theorem 1.7 then follows by complexitymonotonicity [16] and the classification of counting homomorphisms to bipartite graph asgiven by Theorem 1.2. Organization of the Paper
We start with an introduction to the concepts and notation used in this work (includingformal definitions of (parametrized) promise problems and reductions between them) inSection 2.The proof of Theorem 1.1 is presented in Section 3. For completeness, we provide asketch of the hardness proof of
Hom ( H → > ) in Appendix A. Continuing, in Section 4we prove the dichotomy for counting homomorphisms and subgraphs in F -colorable graphs,some proofs are deferred to the appendix Appendix B. Finally, in Section 5, we present thenew dichotomy for König graphs. Counting Homomorphisms is Universal for Parameterized Complexity Theory
We write [ n ] to denote the set { , . . . , n } . Further, we assume the binary alphabet { , } . Inparticular, we assume that numbers are encoded binary as well, which allows us to abusenotation and write N ⊆ { , }∗ . Given a function g : A × B → C and an element a ∈ A , wewrite g ( a, ? ) for the function which maps b ∈ B to g ( a, b ). Given a finite set A we write | A | and A for the cardinality of A . Given two functions f : A → B and g : B → C , we write f ◦ g for their composition that maps x ∈ A to g ( f ( x )) ∈ C . A partition of a set A is a set ofnon-empty and pairwise disjoint subsets of A , called blocks , whose union is A . We consider undirected simple graphs without self-loops (unless stated otherwise) and weassume that graphs are encoded by their adjacency matrices. Given a graph G , we write V ( G ) and E ( G ) for the vertices and edges of G . A graph is called complete or a clique ifall vertices are pairwise adjacent. A subgraph of G is a graph obtained from G by deletingvertices (including adjacent edges) and edges; more precisely, the graph F is a subgraph of G if F = ( V, E ) such that V ⊆ V ( G ) and E ⊆ E ( G ) ∩ V . The graph F is called a propersubgraph if F = G . A graph M is a minor of a graph G if M can be obtained by a sequenceof edge-contraction from a subgraph of G . Here the contraction of an edge e = { u, v } is theoperation of adding a new vertex uv which is made adjacent to all vertices that have beenadjacent to u or v . After that, the vertices u , v and possible self-loops and multi-edges aredeleted. Given a subset S of vertices of G , the induced subgraph G [ S ] has vertices S andedges E ( G ) ∩ S . Given a partition ρ of V ( G ), the quotient graph G/ρ of G is obtained from G by identifying every pair of vertices that are contained in the same block of ρ . After that,multiple edges are deleted. Note that this construction induces self-loops if there is an edgebetween two vertices in the same block. Adopting the notation of [16], we denote quotientgraphs without self-loops as spasms .Given graphs H and G , a homomorphism from H to G is a mapping h : V ( H ) → V ( G )that preserves the adjacency of vertices, that is, for every edge { u, v } in E ( H ), the graph G has the edge { h ( u ) , h ( v ) } ∈ E ( G ). If a homomorphism h is injective, then it is called an embedding . If an embedding h additionally satisfies that for every edge { h ( u ) , h ( v ) } in E ( G )there is an edge { u, v } in E ( H ), then h is called a strong embedding and a strong embeddingis called an isomorphism if it is bijective. Two graphs H and G are called isomorphic if thereexists an isomorphism from H to G . In this paper, we (implicitly) only work on isomorphismclasses of graphs; we abuse notation and write H = G if H and G are isomorphic. Inparticular, we denote > for the set of all (isomorphism types of) graphs. A homomorphismfrom H to itself is called an endomorphism . Further, a bijective endomorphism is called an automorphism . We write Hom ( H → G ), Emb ( H → G ) and StrEmb ( H → G ) for the set of allhomomorphisms, embeddings and strong embeddings from H to G , respectively. Furthermore,we write Aut ( H ) for the set of automorphisms of H , Sub ( H → G ) for the set of subgraphsof G that are isomorphic to H and IndSub ( H → G ) for the set of induced subgraphs of G that are isomorphic to H . Homomorphic Equivalence and Cores
Two graphs H and G are called homomorphically equivalent if there is both a homomorphismfrom H to G and a homomorphism from G to H . Clearly, homomorphic equivalence is anequivalence relation; further the following is known. . Roth and P. Wellnitz 9 (cid:73) Lemma 2.1 (See e.g. Chapter 1.6 in [39]) . The minimal representative of an equivalenceclass (with respect to homomorphic equivalence) is unique up to isomorphisms.
It is thus well-defined to speak of “the” minimal representative of an equivalence class; wesay that such a graph is a core . An equivalent definition of a core is given by the followingknown result. (cid:73)
Lemma 2.2 (See e.g. Chapter 1.6 in [39]) . A graph H is a core if and only if it there is nohomomorphism from H to a proper subgraph of H . In particular, every endomorphism of acore is an automorphism. Colorings and Graph Parameters An H -coloring of a graph G is a homomorphism c ∈ Hom ( G → H ). We say that a graph G is H -colorable or allows a coloring into H if the graph G has an H -coloring. In particular,given a positive integer k ∈ N , we say that G is k -colorable if it allows a coloring into thecomplete graph with k vertices. Given a graph G together with an H -coloring c , we say thata homomorphism h ∈ Hom ( H → G ) is color-prescribed if c ( h ( v )) = v for all v ∈ V ( H ). Wewrite cp - Hom ( H → G ) for the set of all color-prescribed homomorphisms from H to G .The following three graph parameters are of particular importance in this paper. First,the chromatic number of a graph G is defined to be the smallest k such that G is k -colorable.Second, the odd girth is defined to be the length of the smallest odd cycle in a graph,and undefined if no odd cycle exists. Third, we rely on the graph parameter of treewidth .Intuitively, a graph G has small treewidth if it has a “tree-like structure”. In particular,if a graph G has a small treewidth, then the graph G also has small “separators”. Theseseparators allow for efficient dynamic programming algorithms for a wide range of problemsthat are known to be hard in the unrestricted setting. However, as we need the treewidth ofa graph only in a black-box manner, we defer the reader to the literature (e.g. Chapter 7in [18]) for the formal definition and a detailed exposition. Tensor Products of Graphs
Given two graphs G and A , the tensor product G × A is the graph with vertices V ( G ) × V ( A ),where × is the Cartesian product of sets. Two vertices ( g, a ) and ( g , a ) are adjacent in G × A if the edge { g, g } is in E ( G ) and the edge { a, a } is in E ( A ). Now let H be a fixedgraph. It is well-known that the function Hom ( H → ? ) is linear with respect to × andmultiplication [43, Equation 5.30], that is, Hom ( H → G × A ) = Hom ( H → G ) · Hom ( H → A ) . A further well-known fact about the tensor product reads as follows. (cid:73)
Fact 2.3 (Folklore) . Let G , A and F be graphs. If either one of G or A is F -colorable,then so is their tensor product G × A . Recall that the problem
Hom ( H → G ) asks, given graphs H ∈ H and G ∈ G , to computethe number of homomorphisms from H to G . However, this definition is informal in thesense that it leaves out the specification of the output if the input is invalid , that is, if thegraph H does not belong to the class H or the graph G does not belong to the class G . A naive option to solve this issue, is to require the output to be 0 if the input is invalid.However, in this case we exclude a plethora of interesting cases from our studies, as evenseemingly trivial instances might encode NP -hard problems. Consider for example the class G of 3-colorable graphs. Following the naive option, the problem Hom ( H → G ) becomes NP -hard even if the class H only containts the graph K consisting of a single vertex, asit encodes the 3-colorability problem: An instance ( K , G ) of the problem Hom ( H → G )is mapped to zero if and only if the graph G is 3-colorable. In particular, fixed-parametertractability of this problem would yield an algorithm running in time f ( | K | ) · | V ( G ) | O (1) which is a polynomial in | V ( G ) | , and thus imply P = NP . In sharp contrast, the number ofhomomorphisms from the graph K to any graph G is just the number of vertices | V ( G ) | andthus the hardness of the problem Hom ( H → G ) stems only from enforcing invalid inputsto be mapped to zero.Another option of solving the issue of invalid instances of the problem
Hom ( H → G )is as follows: If a given instance (
H, G ) consists of graphs H ∈ H and G ∈ G , then we aresupposed to compute the number of homomorphisms Hom ( H → G ) correctly; otherwise, wemay output any number. Formally, this requires us to model the problem Hom ( H → G ) asa promise problem . In what follows, we thus present a concise but self-contained introductionto parameterized promise (counting) problems.A parameterization κ is a polynomial-time computable function from the set { , }∗ tothe natural numbers N . Note that the assumption of polynomial-time computable paramet-erizations for both, decision and counting problems, is common (see e.g. [29, Definitions 1.1and 14.1]), but not standard. We refer the reader to the discussion of this issue in Chapter 1.2in the textbook of Flum and Grohe [29]. (cid:73) Definition 2.4. A parameterized promise counting problem (or short “PPC problem”) isa triple ( P, κ, Π) consisting of a function P : { , }∗ → N , a parameterization κ : { , }∗ → N ,and a promise Π ⊆ { , }∗ . A parameterized counting problem (without promises) is a PPCproblem with Π = { , }∗ .A PPC problem ( P, κ, Π) is computable in time t if there exists a deterministic algorithm A that fulfills the following. On input x ∈ { , }∗ , the algorithm A runs in time t ( | x | ) . On input x ∈ Π , the algorithm A outputs P ( x ) .In particular, we call the problem ( P, κ,
Π) fixed-parameter tractable if there exists a com-putable function f such that the triple ( P, κ, Π) can be computed in time f ( κ ( x )) · | x | O (1) .Further, we call x ∈ { , }∗ an instance of the problem ( P, κ, Π) and say that an instance x is valid if it is contained in the promise, that is x ∈ Π . Note that we obtain the standard definition of fixed-parameter tractability of (non-promise)counting problems if we set the promise Π to be { , }∗ . Note further that parameterizeddecision problems with promises are obtained from Definition 2.4 by restricting the image ofthe function P to be { , } . In this case, Definition 2.4 coincides with the standard definitionof (parameterized) promise problems (see e.g. Definition 3.1 in the full version [4] of [5]).We consider the following family PPC problems. Goldreich [33, Chapter 2.4.1] states that promise problems offer the most direct way of formulatingnatural computational problems . Indeed, some of the most striking results in complexity theory implicitlyrely on promise problems. Examples are “gap problems” and “uniqueness promises”; we refer the readerto [33, Chapter 2.4.1.2] for a discussion. . Roth and P. Wellnitz 11 (cid:73)
Definition 2.5.
Let H and G be classes of graphs. The PPC problem Hom ( H → G ) asks,given H ∈ H and G ∈ G , to compute the number of homomorphisms Hom ( H → G ) ; theparameter is | V ( H ) | . Formally, the promise of Hom ( H → G ) is the set of all (encodingsof) pairs ( H, G ) ∈ H × G .Further, we define cp-Hom ( H → G ) as the PPC problem of, given H ∈ H , G ∈ G and an H -coloring of G , computing the number of color-prescribed homomorphisms cp - Hom ( H → G ) ;the parameter is | V ( H ) | . Again, the formal promise is defined as the set of all (encodings of)pairs ( H, G ) ∈ H × G . The decision problems
Hom ( H → G ) and cp-Hom ( H → G ) are defined similarly, with theexception that the output is required to be 1 if the number of homomorphisms
Hom ( H → G )is positive or the number of color-prescribed homomorphisms cp - Hom ( H → G ) is positive,respectively. (cid:73) Remark 2.6.
If membership of a graph in the class G can be tested in polynomial timeand the class H is recursive, then there is no need to define the problem Hom ( H → G ) aspromise problem. Instead, we can define the output to be zero if a given pair (
H, G ) is notcontained in
H × G ; note that H ∈ H can be verified in time f ( H ) for some computablefunction f as, by assumption, H is recursive. Reductions and Hardness
In this paper, we consider the following two notions of reducibility for PPC problems. (cid:73)
Definition 2.7 (Parameterized (Weakly) Parsimonious Reductions) . Let PPC problems ( P, κ, Π) and ( P , κ , Π ) be given. A parameterized weakly parsimonious reduction from ( P, κ, Π) to ( P , κ , Π ) is a pair of a deterministic algorithm A and a triple of computablefunctions ( f, g, s ) such that: For all valid instances x ∈ Π , the algorithm A outputs a valid instance of ( P , κ , Π ) ,that is A ( x ) ∈ Π . We can compute P ( x ) by computing P on the computed instance A ( x ) and the func-tion g ( x ) ; in particular, we have that P ( x ) = g ( x ) · P ( A ( x )) . The PPC problem ( g, κ, Π) is fixed-parameter tractable. On input x ∈ { , }∗ , the algorithm A runs in time f ( κ ( x )) · | x | O (1) . For all x ∈ { , } , the parameter of the instance A ( x ) is bounded by s ( κ ( x )) , that is κ ( A ( x )) ≤ s ( κ ( x )) .We write ( P, κ, Π) ≤ w - fpt ( P , κ , Π ) if such a reduction exists. If g is the identity functionon Π , then the reduction is called parsimonious and we write ( P, κ, Π) ≤ fpt ( P , κ , Π ) . (cid:73) Definition 2.8 (Parameterized Turing-reductions) . Let ( P, κ, Π) and ( P , κ , Π ) be PPCproblems. A parameterized Turing-reduction from ( P, κ, Π) to ( P , κ , Π ) is a pair of analgorithm A equipped with oracle access to the function P and a pair ( f, s ) of computablefunctions such that: On input x ∈ { , }∗ , the algorithm A runs in time f ( κ ( x )) · | x | O (1) . On input x ∈ Π , the algorithm A computes the function P ( x ) . On input x ∈ Π , the algorithm A only queries the oracle on strings y with y ∈ Π and κ ( y ) ≤ s ( κ ( x )) .We write ( P, κ, Π) ≤ fptT ( P , κ , Π ) if such a reduction exists. Unsurprisingly, the previous notions of reducibility coincide with the common notions for redu-cibility between parameterized counting problems if the promises Π and Π are trivial, that is, if Π = Π = { , }∗ (see e.g. [15, Definition 1.8]). Further, the following facts are straightfor-ward to verify. (cid:73) Fact 2.9.
Let (
P, κ,
Π) and ( P , κ , Π ) be PPC problems. We have that( P, κ, Π) ≤ fpt ( P , κ , Π ) = ⇒ ( P, κ, Π) ≤ w-fpt ( P , κ , Π ) = ⇒ ( P, κ, Π) ≤ fptT ( P , κ , Π ) . (cid:73) Fact 2.10.
All of the notions of reducibility ≤ fpt , ≤ w-fpt , and ≤ fptT are transitive. (cid:73) Fact 2.11.
Let (
P, κ,
Π) and ( P , κ , Π ) be PPC problems and assume that ( P, κ,
Π) reducesto ( P , κ , Π ) with respect to any of ≤ fpt , ≤ w-fpt , or ≤ fptT . If ( P , κ , Π ) is fixed-parametertractable, then ( P, κ,
Π) is also fixed-parameter tractable.Evidence of fixed-parameter in tractability of parameterized counting problems (withpromises) is given by hardness for the complexity class W [ ]. It is common to define W [ ]via the complete problem Clique . The problem
Clique asks, given k ∈ N and a graph G , to compute the number of cliques of size k in G . Note that by Remark 2.6 the problem Clique can be assumed to have no promise. (cid:73)
Definition 2.12 ([28, 46]) . The class W [ ] contains all parameterized counting problemswithout promises that can be reduced to Clique by parameterized parsimonious reductions.
Next, we extend the notion of W [ ]-hardness to PPC problems. (cid:73) Definition 2.13.
A PPC problem ( P, κ, Π) is W [ ]-hard under parameterized parsimoni-ous reductions if Clique ≤ fpt ( P, κ, Π) . Hardness under ≤ w - fpt and ≤ fptT is defined likewise. A parameterized counting problem withoutpromises is W [ ]-complete if it is contained in W [ ] and W [ ] -hard. As
Hom ( H → G ) is a promise problem, it is formally not contained in W [ ]. However,it can be shown that Hom ( H → G ) cannot be harder than W [ ]-complete problems: (cid:73) Lemma 2.14.
Let H and G be computable graph classes. We have that Hom ( H → G ) ≤ fpt Clique . Proof.
It is known that
Hom ( H → > ) ≤ fpt Clique by the more general result that A [ ] = W [ ] [29, Theorem 14.17]. The reduction Hom ( H → G ) ≤ fpt Hom ( H → > ) isgiven by the identity function. (cid:74)
As a concluding remark for this subsection, note that parameterized reductions,
Clique ,and (hardness and completeness for) W [ ] have corresponding notions in the decision realm.In particular, Clique , that is, the problem of deciding the existence of a clique of size k ,constitutes the canonical complete problem for W [ ]. We refer the reader to the textbook ofFlum and Grohe [29] for further details of parameterized decision complexity, as this workmainly deals with counting problems. . Roth and P. Wellnitz 13 The framework of
Complexity Monotonicity was recently introduced by Curticapean, Dell,and Marx in their breakthrough result regarding the complexity of the (induced) subgraphcounting problem [16]. Very roughly speaking, the principle of complexity monotonicitystates that
Computing a linear combination of homomorphism numbers is precisely as hard ascomputing its hardest term.
While linear combinations of homomorphisms have been modeled by so-called graph motifparameters in [16], we instead rely on the notion of quantum graphs as introduced byLovász [43, Chapter 6]. (cid:73)
Definition 2.15 (Quantum graphs) . A quantum graph Q is a formal linear combinationof graphs with finite support. We write Q = X H λ H · H, where λ H is non-zero only for finitely many graphs. We write supp ( Q ) for the set of all graphs H for which λ H is non-zero. The elements of the support supp ( Q ) are called constituents of Q . Graph parameters extend to quantum graphs linearly. In particular, we define
Hom ( Q → G ) := X H λ H · Hom ( H → G ) . (1)Now, given a set Q of quantum graphs, we write supp ( Q ) for the set of all constituentsof all quantum graphs in Q . Furthermore, given a class G of graphs, the PPC problem Hom ( Q → G ) is defined similarly as in case of (non-quantum) graphs: Given (
Q, G ) ∈ Q×G ,the goal is to compute the number Hom ( Q → G ); the parameter is given by the descriptionlength | Q | of Q .The main result of Curticapean, Dell and Marx can be stated as follows: (cid:73) Theorem 2.16 (Complexity Monotonicity [16]) . Let Q be a recursively enumerable class ofquantum graphs. Then we have that Hom ( Q → > ) ≡ fptT Hom ( supp ( Q ) → > ) . The reduction
Hom ( Q → > ) ≤ fptT Hom ( supp ( Q ) → > ) is trivial: Given a quantum graph Q and a graph G , we can compute the number Hom ( Q → G ) as given by Equation (1).However, the other direction relies on a deep theory of Lovász [43, Chapters 5 and 6] and isgiven by the following lemma. (cid:73) Lemma 2.17 (Lemma 3.6 in [16]) . Let Q be a quantum graph. There exists a deterministicalgorithm A that is given oracle access to Hom ( Q → ? ) and that, on input a graph G ,computes the number Hom ( H → G ) for every constituent H of Q . Furthermore, there existcomputable functions f and s such that the running time of A is bounded by f ( | Q | ) ·| V ( G ) | O (1) and the number of vertices of every graph G for which the oracle is queried, is bounded by s ( | Q | ) · | V ( G ) | . In Section 4 we show that the previous lemma readily extends to the problem
Hom ( Q → G F ),where G F is the set of all F -colorable graphs for some fixed graph F . Figure 1
Examples for Kneser graphs: The Kneser graphs K(5 , , , ,
2) is also known as the
Petersen graph
In this part of the paper, we show that every parameterized counting problem in W [ ]is interreducible with a problem Hom ( H → G ) with respect to parameterized Turing-reductions. Further, the proof shows that the analogous statement holds for (parameterized)decision problems in W [ ] and a problem Hom ( H → G ). The starting point is the followinglemma; it follows from the standard hardness proof of
Hom ( H → > ) for classes H ofunbounded treewidth. We provide an exposition of the proof in Appendix A—see Lemma A.2. (cid:73) Lemma 3.1.
Let H be a computable class of connected cores of unbounded treewidth.Then the problem Hom ( H → > ) is W [ ] -hard under parameterized weakly parsimoniousreductions. In particular, the images of the reductions can be assumed to contain onlypairs ( H, G ) such that H ∈ H and G is connected and H -colorable. The remainder of this section is devoted to the proof of the following theorem. (cid:73)
Theorem 3.2.
Let ( F, κ ) denote a problem in W [ ] . There are classes H and G suchthat ( F, κ ) ≡ fptT Hom ( H → G ) . Furthermore H is recursively enumerable and G is recursive. In particular, we show that for any problem (
F, κ ) in W [ ], we can construct graph classes H and G such that we have for any graphs H ∈ H and G ∈ G :If Hom ( H → G ) = 0, the pair ( H, G ) corresponds to exactly one instance x of theproblem ( F, κ ), and we can obtain both x and κ ( x ) from H and G .If Hom ( H → G ) = 0, the pair ( H, G ) does not correspond to an instance of (
F, κ ). Counting Homomorphisms Between Kneser Graphs
By Lemma 3.1, the problem
Hom ( H → > ) is W [ ]-hard for any (computable) class ofconnected cores. In particular, it is known that this is the case for (subclasses) of the classof Kneser graphs . Further, Kneser graphs have other nice properties which we exploit in theproof of Theorem 3.2. Formally, we start with the following definition; consider also Figure 1for examples of Kneser graphs. . Roth and P. Wellnitz 15 (cid:73)
Definition 3.3 (see e.g. [36, Chapter 3]) . Given integers r and s , the Kneser graph K( r, s ) is the graph that has as vertices the subsets of size s of [ r ] and edges between two vertices ifthe corresponding sets are disjoint. Given a number n ≥
3, we set K( n ) := K((2 n + 1)( n − , n ( n − r and s , we can use the following results; recall that the chromatic numberof a graph G is the minimum k such that G allows a homomorphism to the complete graphof size k , and the odd girth of a graph is the length of the smallest cycle of odd length. (cid:73) Fact 3.4 ([42] and Propositions 3.13, 3.14 in [36]) . The graph K( n ) has chromatic number n and odd girth 2 n + 1. Furthermore, the graph K( n ) is a core, that is, the graph K( n ) isminimal with respect to homomorphic equivalence.Note that by Lemma 2.2, the graph K( n ) being a core implies that every endomorphismof K( n ) is already an automorphism. Hence, the number of homomorphisms from thegraph K( n ) to itself is precisely the number of automorphisms Aut (K( n )). (cid:73) Fact 3.5 (Folklore, see e.g. [56]) . The graph K( r, s ) is connected if r > s .Hence, K( n ) is connected.An important property of Kneser graphs is the well-known fact that they constitute anantichain with respect to the homomorphism order. We provide a proof for convenience. (cid:73) Lemma 3.6.
Let n and m be distinct positive integers. Then we have Hom (K( m ) → K( n )) = 0 . Proof.
For every pair of graphs H and G with Hom ( H → G ) = 0, we have that the oddgirth of H is bounded from below by the odd girth of G [39, Exercise 1.10.2]. Further,the chromatic number of H is bounded from above by the chromatic number of G [39,Proposition 1.8]. The lemma hence holds by Fact 3.4. (cid:74) Now, let K even denote the set of all graphs K( n ) with even n and let K odd denote the set ofall graphs K( n ) with odd n . Encoding Problems into Graphs Classes
A central tool for the proof of Theorem 3.2 is an encoding of arbitrary strings into graphs,which we discuss next. In particular, we use a disjoint union of paths for the encoding. Tothis end, let P i be the path with i edges. Given a string x = x [1] x [2] · · · x [ n ] ∈ { , }∗ , wedefine enc ( x ) to be the graph that is the disjoint union of paths P i for all i ≤ | x | with x i = 1,as well as of | x | isolated vertices. Consider Figure 2 for a visualization.Next, we show how to use the encoding enc to (reversibly) encode an instance of anarbitrary problem in W [ ] into a pair of graphs. To that end, let ( F, κ ) denote any problemin W [ ]. By Lemma 3.1, we have that ( F, κ ) ≤ fpt Hom ( K even → > ), that is, there is analgorithm A = A F and a triple ( f, g, s ) of computable functions such that for all strings x ∈ { , }∗ all of the following holds: (a) The algorithm A computes a pair of graphs A ( x ) = ( H x , G x ), where H x ∈ K even andthe graph G x is connected and H x -colorable. (b) The answer to the instance x of the problem ( F, κ ) can be computed as F ( x ) = g ( x ) · Hom ( H x → G x ) . x enc ( x ) 0 0 0 0 1 x enc ( x ) 1 0 0 0 0 x enc ( x ) Figure 2
Examples of strings and their encoding into a graph. (c)
The problem ( g, κ ) is fixed-parameter tractable in time f ( κ ( x )) · | x | O (1) . (d) The algorithm A runs in time f ( κ ( x )) · | x | O (1) . (e) The size of the computed graph | V ( H x ) | is at most s ( κ ( x )).Now, let an instance x to ( F, κ ) be given. Using the graphs A ( x ) = ( H x , G x ) computed bythe algorithm A , we construct a pair of new graphs, which additionally encodes the originalinstance x as well as its parameter κ ( x ) by settingˆ H x := H x ∪ K(2 κ ( x ) + 3) , and (2)ˆ G x := G x ∪ enc ( h x, H x i ) ∪ K(2 κ ( x ) + 3) , (3)where h x, H x i is any efficient encoding of the pair ( x, H x ). We proceed to show that theconstructed graphs ˆ H x and ˆ G x behave as intended; also consider Figure 3 for a visualization. (cid:73) Lemma 3.7.
Given a problem ( F, κ ) and an instance x to ( F, κ ) , let the graphs ˆ H x and ˆ G x be defined as in Equations (2) and (3) . Then we have that The graph ˆ G x is ˆ H x -colored and The number of homomorphisms from ˆ H x to ˆ G x is given by Hom ( ˆ H x → ˆ G x ) = Hom ( H x → G x ) · Aut (K(2 κ ( x ) + 3)) . Proof.
Recall that by definition, we have that ˆ H x := H x ∪ K(2 κ ( x ) + 3) and ˆ G x := G x ∪ enc ( h x, H x i ) ∪ K(2 κ ( x ) + 3), where enc ( ? ) encodes a string into a disjoint set of pathsand isolated vertices.Now, for the homomorphism from ˆ G x to ˆ H x , note that the graph G x is H x -colored (byLemma 3.1 and in particular Item a). Further, the graph K(2 κ ( x ) + 3) has an automorphismand contains at least one edge, so there is a homomorphism from the graph enc ( h x, H x i ) ∪ K(2 κ ( x ) + 3) into the graph K(2 κ ( x ) + 3). In total, this completes the proof that ˆ G x isˆ H x -colored.For the number of homomorphisms from ˆ H x to ˆ G x , note that there are Hom ( H x → G x )many homomorphisms from H x to G x and Aut (K(2 κ ( x ) + 3)) many homomorphisms fromK(2 κ ( x ) + 3) to itself. As the graphs ˆ H x and ˆ G x consist of the disjoint union of H x andK(2 κ ( x ) + 3), and G x and K(2 κ ( x ) + 3), respectively, we directly obtain a lower bound forthe number of homomorphisms: Hom ( ˆ H x → ˆ G x ) ≥ Hom ( H x → G x ) · Aut (K(2 κ ( x ) + 3)) . (4)To prove the upper bound, observe the following. . Roth and P. Wellnitz 17 H o m ( H x → G x ) A u t ( K ( κ ( x ) + )) H x K(2 κ ( x ) + 3)ˆ H x G x ( H x -colored) enc ( h x, H x i )K(2 κ ( x ) + 3)ˆ G x Figure 3
Lemma 3.7 illustrated. A cross denotes that no homomorphisms between the parts ofthe graphs exist. Note that the Kneser graphs used in the lemma differ from the ones depicted. (i)
The graph H x cannot be mapped homomorphically to the graph K(2 κ ( x ) + 3), as H x is contained in K even and K(2 κ ( x ) + 3) is contained in K odd ; hence both are distinctKneser graphs and by Lemma 3.6 no homomorphisms between them are possible. (ii) The graph K(2 κ ( x ) + 3) cannot be mapped homomorphically to the graph G x . Supposeotherwise, that an homomorphism h : K(2 κ ( x ) + 3) → G x existed. As G x is H x -colorable, there is a homomorphism c : G x → H x . Composing the homomorphisms h and c yields a homomorphism h ◦ c : K(2 κ ( x ) + 3) → H x , that is, a homomorphism from a graph in K odd to a graph in K even , which, again, isnot possible by Lemma 3.6. (iii) None of the graphs H x and K(2 κ ( x ) + 3) can be mapped homomorphically to the graph enc ( h x, H x i ), as paths have a chromatic number of at most 2, and both graphs H x andK(2 κ ( x ) + 3) have a chromatic number of at least 3.Hence, the homomorphisms counted in the lower bound (4) are already all homomorphismsfrom ˆ H x to ˆ G x : Hom ( ˆ H x → ˆ G x ) = Hom ( H x → G x ) · Aut (K(2 κ ( x ) + 3)) . This completes the proof. (cid:74)
Now let ˆ H and ˆ G be the sets of all graphs ˆ H x and ˆ G x , respectively, corresponding toinstances x to ( F, κ ) for which the function g is non-zero, that is g ( x ) = 0. For the classesˆ H and ˆ G to be useful to us, we need to show that the only pairs of graphs H ∈ ˆ H and G ∈ ˆ G that admit a homomorphism from H to G are those, that correspond to the samepair ( x, κ ( x )). Formally, consider the following lemma. (cid:73) Lemma 3.8.
Let a problem ( F, κ ) ∈ W [ ] and the corresponding graph classes ˆ H and ˆ G be given. For any graphs K ∈ ˆ H and G ∈ ˆ G , if there is a homomorphism from H to G ,then there is an instance x to ( F, κ ) that corresponds to both H and G , that is, H = ˆ H x and G = ˆ G x . Proof.
It suffices to show that there are no homomorphisms from H to G if the graphs H and G do not correspond to the same instance of ( F, κ ). Hence, assume that the graphs K ∈ ˆ H and G ∈ ˆ G correspond to distinct instances x = x K and y = x G of ( F, κ ). For thesake of contradiction, further assume that there is a homomorphism h from the graph H to the graph G . By (2) and (3), for some distinct integers a, b , an integer c , and a graph H x = K ( a ), we have that H = K( a ) ∪ K( b ) and G = G ∪ enc ( h y, H y i ) ∪ K( c ) , where G is a connected graph that is H y -colored.Similar to (iii) from the proof of Lemma 3.7 we can show that, there are no homomorphismsfrom the graphs K( a ) or K( b ) to the graph enc ( h x, H x i ). Further, as the numbers a and b aredistinct, only at most one of a and b may be equal to c . We distinguish two cases, dependingon whether c is equal to either a or b , or not.First, assume that the number b is the same as c . (The case a = c is similar.) In thiscase, we have that K( b ) = K( c ), and hence κ ( x ) = κ ( y ). Further, by Lemma 3.6, thehomomorphism h maps the graph K( a ) to the graph G , as K( a ) and K( c ) are differentKneser graphs. Combining this homomorphism from K( a ) to G with the homomorphismfrom G to H y (which exists as G is H y -colorable) yields a homomorphism from K( a ) to H y .However, as K( a ) = H x and H y are both Kneser graphs, a homomorphism between them isonly possible if they are the same Kneser graph. This in turn, means that the instances x and y are the same, which is a contradiction.Second, consider the case where the numbers a , b , and c are pairwise distinct. ByLemma 3.6, we obtain that there are no homomorphisms from the graph K( a ) to the graphK( c ), as well as that there are no homomorphisms from the graph K( b ) to the graph K( c ).Hence, the homomorphism h maps both graphs K( a ) and K( b ) to the graph G . Assumewlog. that K( a ) = H x . Now, as before, we obtain a homomorphism from the graph H x tothe graph H y and hence (by Lemma 3.6) x = y , which is a contradiction.In total, if H and G do not correspond to the same instance x , there is no homomorphismfrom H to G . This concludes the proof. (cid:74) The Main Reductions
Using Lemmas 3.7 and 3.8, we proceed to show that the problems (
F, κ ) and
Hom ( ˆ
H → ˆ G )are interreducible with respect to parameterized Turing reductions. Proof of Theorem 3.2.
We start with the more involved direction. . Roth and P. Wellnitz 19 (cid:66)
Claim 3.9.
We have that
Hom ( ˆ
H → ˆ G ) ≤ fptT ( F, κ ). Proof.
Given graphs H and G and an oracle O for the problem ( F, κ ), we wish to computethe number of homomorphisms
Hom ( H → G ) if the promise H ∈ ˆ H and G ∈ ˆ G is fulfilled.Consider the following algorithm B . Verify that the graph H is the union of two Kneser graphs K( a ) ∈ K even and K( b ) ∈ K odd .If this is not the case, output 0. Verify that the graph G is the union of a set of paths P (and isolated vertices) and twoconnected components G and G that are not paths. If this is not the case, output 0. Verify that either G = K( b ) or G = K( b ) holds. If this holds, assume w.l.o.g. that G = K( b ). Otherwise output 0. Find a pair ( c, H ) such that enc ( h c, H i ) = P or report that no decoding is possible (e.g.if the set of paths P is empty, contains the same path multiple times or the number ofisolated vertices does not match). If the decoding failed, output 0. Compute the parameter κ ( c ) of the instance c . If we have that 2 κ ( c ) + 3 = b , output 0. Verify that the graphs H and K( a ) are isomorphic. If they are not isomorphic, output 0. Compute the value g ( c ). If we have that g ( c ) = 0, output 0. Query the oracle O on input c and obtain O ( c ). Output the number O ( c ) · Aut (K(2 κ ( c ) + 3)) · g ( c ) − . We first prove the required bound on the running time of the algorithm B . On input H and G ,Step 1 takes time only depending on | V ( H ) | ; Step 2 can be done in time polynomial in | V ( G ) | . Step 3 takes again time only depending on | V ( H ) | . Considering Step 4, we observethat by the definition of the encoding enc and by the assumption that h ?, ? i is an efficientencoding of pairs, the decoding can be done in time polynomial in | V ( P ) | ≤ | V ( G ) | . Step 5can also be done in time polynomial in | V ( G ) | , as the function κ is computable in polynomialtime in | c | . As the encoding enc ( h c, H i ) contains an isolated vertex for every bit of thestring c , we have that | c | ≤ | V ( G ) | (5)and hence the claimed running time for Step 5. Similarly to the Step 3, we can performStep 6 in time only depending on | V ( H ) | . Now assume Step 7 is reached. In this case, wehave that 2 κ ( c ) + 3 = b and consequently κ ( c ) ≤ | V ( H ) | , (6)as the graph K( b ) is a component of H and we have that | V (K( b )) | ≥ b . Note thatSteps 7 and 8 take time f ( κ ( c )) · | c | O (1) , as the problem ( g, κ ) is fixed-parameter tractable(see (c)). W.l.o.g., we can assume that f is monotonically increasing and thus (6) yields arunning time bound of f ( | V ( H ) | ) · | V ( G ) | O (1) ; recall (5), that is | c | ≤ | V ( G ) | .Note that the last argument also shows that the parameter κ ( c ) of the oracle query O ( c ) isbounded by | V ( H ) | .It remains to prove the correctness of algorithm B . To this end, assume that the promiseis fulfilled, that is, H ∈ ˆ H and G ∈ ˆ G . (If the promise is not fulfilled, we are not required tocompute a correct output.)Hence, for instances x and y , we have that H = ˆ H y = K( a ) ∪ K( b )= H y ∪ K(2 κ ( y ) + 3) and G = ˆ G x = G ∪ P ∪ G = G x ∪ enc ( h x, H x i ) ∪ K(2 κ ( x ) + 3) . Further, by construction we have that g ( x ) = 0. We consider three cases. (i) H x = H y : The instances x and y are different. Hence by Lemma 3.8, there are nohomomorphisms from H to G .In the algorithm B , in this case, the test in Step 6 fails, and B outputs 0, which iscorrect. (ii) H x = H y and κ ( x ) = κ ( y ). Note that H x = H y does not imply that the correspondinginstances are the same; the algorithm A is not necessarily injective. Indeed, in this casethe instances x and y differ and so, again by Lemma 3.8, there are no homomorphismsfrom the graph H to the graph G .In the algorithm B , in this case, the test in Step 3 fails, and B outputs 0, which iscorrect. (iii) H x = K y and κ ( x ) = κ ( y ): In this case, we have that ˆ H y = ˆ H x . Hence, by Lemma 3.7,the number of homomorphisms from H to G is Hom ( H → G ) = Hom ( H x → G x ) · Aut (K(2 κ ( x ) + 3)) . (7)Note that the oracle O on input x computes the number O ( x ) = g ( x ) · Hom ( H x → G x ) , (8)and we may assume that g ( x ) = 0 by construction. Hence, combining (7) and (8) yieldsthat we can compute the number of homomorphisms from the graph H to the graph G as follows: Hom ( H → G ) = O ( x ) · g ( x ) − · Aut (K(2 κ ( x ) + 3)) . In the algorithm B , it is easy to verify that the Steps 3 to 7 succeed and that in Step 8,we indeed return O ( x ) · g ( x ) − · Aut (K(2 κ ( x ) + 3)). Hence, the algorithm is correctin this case as well.In total, the algorithm B correctly solves the problem Hom ( ˆ H → ˆ G ). This finishes theproof of the reduction. (cid:67) Finally, we construct and verify the easy reduction. (cid:66)
Claim 3.10.
We have that (
F, κ ) ≤ fptT Hom ( ˆ
H → ˆ G ). Proof.
Given an instance x to ( F, κ ) and an oracle O solving the problem Hom ( ˆ
H → ˆ G ),we wish to compute the number F ( x ). Recall that by Lemma 3.1, there is a reduction( F, κ ) ≤ fptT Hom ( K even → > ); let A again denote the corresponding algorithm. Recallfurther, that for the graphs ( H x , G x ) = A ( x ), we have that F ( x ) = g ( x ) · Hom ( H x → G x ) . Now, to compute the result F ( x ), we first compute the value g ( x ) in FPT time with respectto κ . If we observe g ( x ) = 0, we output 0. Otherwise, we simulate the algorithm A andobtain graphs H x and G x in time f ( κ ( x )) · | x | O (1) . After that, we can compute the graphsˆ H x and ˆ G x in time ˆ f ( κ ( x )) · | x | O (1) : The construction of the encoding enc ( h x, H x i ) can . Roth and P. Wellnitz 21 be done in polynomial time in | x | and | V ( H x ) | . Note that | V ( H x ) | is bounded by s ( κ ( x ))and that the construction of K(2 κ ( x ) + 3) clearly takes time only depending on κ ( x ). Inparticular, we have that the size of the graph ˆ H x only depends on κ ( x ). Hence, we canquery the oracle O for the problem Hom ( ˆ
H → ˆ G ) on the graphs ˆ H x and ˆ G x and obtainthe number of homomorphisms from ˆ H x and ˆ G x .Recall that by Lemma 3.7, we have that Hom ( H x → G x ) = Aut (K(2 κ ( x ) + 3)) − · Hom ( ˆ H x → ˆ G x )= Aut (K(2 κ ( x ) + 3)) − · O ( ˆ H x , ˆ G x ) . Hence, to compute the result F ( x ) = g ( x ) · Hom ( H x → G x ), we can compute the number Aut (K(2 κ ( x ) + 3)) − in time only depending on κ ( x ) and multiply with the result of theoracle query and the result previous computation of the value g ( x ). This completes the proof,as we may assume that the algorithm A is correct. (cid:67) In total, by the reductions from Claims 3.9 and 3.10, we obtain(
F, κ ) ≡ fptT Hom ( H → G ) , thus completing the proof. (cid:74) Note that the previous proof shows the corresponding theorem for the decision realm, ifwe choose the decision version of Lemma 3.1 as a starting point; the decision version ofLemma 3.1 can be found as Corollary A.4 in Appendix A. (cid:73)
Theorem 3.11.
Let ( F, κ ) denote a problem in W [ ] . There are classes H and G such that ( F, κ ) ≡ fptT Hom ( H → G ) . Furthermore, H is recursively enumerable and G is recursive. F -Colorable Graphs Let H denote a recursively enumerable class of graphs. Further, given a fixed graph F ,let G F denote the class of all graphs G that admit a homomorphism to F , that is, theclass of F -colorable graphs. In this section we establish that the existing dichotomy forcounting homomorphisms due to Dalmau and Jonsson [19] extends to the PPC problem Hom ( H → G F ); that is, counting the number of homomorphisms from a graph H ∈ H toa graph G ∈ G F . Note that the notion of G F captures and generalizes the important specialcases of the class of all bipartite graphs (when F is a single edge) or, more general, theclass of all k -colorable graphs for any fixed number k (when F is the complete graph on k vertices). (cid:73) Theorem 4.1.
Let F be a graph, and let H be a recursively enumerable class of graphs. (1) If the treewidth of
H ∩ G F is bounded then the PPC problem Hom ( H → G F ) ispolynomial-time solvable. (2) Otherwise, the problem
Hom ( H → G F ) is W [ ] -hard. It turns out that the previous theorem can be proved by a refined analysis of the existing proofdue to Dalmau and Jonsson [19]. For this reason, we defer the proof to Appendix B.1. In whatfollows, instead, we demonstrate that the previous classification for counting homomorphismsto F -colored graphs yields a complete classification for the associated subgraph counting problem. More precisely, we define Sub ( H → G ) as the PPC problem of, given graphs H ∈ H and G ∈ G , computing the number Sub ( H → G ), that is, the number of subgraphsin G that are isomorphic to H ; the parameter is | V ( H ) | . Formally, the promise is the set H × G .An example of a problem
Sub ( H → G ) is the problem of computing the number of k -matchings in bipartite graphs; recall that a k -matching is a set of k edges that are pairwisedisjoint. This problem was first shown to be W [ ]-hard by Curticapean and Marx [17] andconstitutes the bottleneck for the intractable cases of the subgraph counting problem: (cid:73) Theorem 4.2 ([17]) . Let H be a recursively enumerable class of graphs. (1) If the matching number of the class H is bounded then the problem Sub ( H → > ) ispolynomial-time solvable. (2) Otherwise, the problem
Sub ( H → > ) is W [ ] -hard. Here, the matching number of a graph is the size of its largest matching and a class of graphs H has bounded matching number if there exists an overall constant c such that the matchingnumber of each graph H ∈ H is bounded by c .Recently, Curticapean, Dell, and Marx [16] strongly generalized Theorem 4.2 with a muchsimpler proof. They key ingredient of their work is the algorithm given by Lemma 2.17. Wefurther generalize their proof to F -colorable graphs and obtain the following strengtheningof the classification for counting subgraphs. (cid:73) Theorem 4.3.
Let F be a fixed graph and let H be a recursively enumerable class of graphs. (1) If the matching number of
H ∩ G F is bounded then the problem Sub ( H → G F ) ispolynomial-time solvable. (2) Otherwise, the problem
Sub ( H → G F ) is W [ ] -hard. Due to space constraints and the fact that we only need to perform minor modificationsof the arguments of Curticapean, Dell and Marx [16], we defer the proof to Appendix B.2.
Given a graph G , its associated line graph L ( G ) is the following graph: As vertices L ( G ) hasthe edges of G and two vertices e and ˆ e of L ( G ) are adjacent if the corresponding edges areneither equal nor disjoint, that is, | e ∩ ˆ e | = 1. We write L for the set of all line graphs. ByKönig’s Theorem, a line graph of a bipartite graph is also a perfect graph (see e.g. [13]). Tosimplify notation, we hence call a line graph of a bipartite graph a König graph . We write K to denote the class of all König graphs . This section is devoted to the complexity analysis ofthe problem Hom ( H → K ) of counting homomorphisms from a graph from some arbitrarygraph class H to a König graph. We start by investigating the decision version, that is, the problem
Hom ( > → K ). It turnsout that if we are only interested in the existence, and not the number, of homomorphisms,then the problem becomes fixed-parameter tractable. The symbol K is used since “König” is the German word for “King”. . Roth and P. Wellnitz 23 (cid:73) Theorem 5.1.
The decision problems
Hom ( > → L ) and thus Hom ( > → K ) are fixed-parameter tractable. In particular, given a graph H and a line graph L , it is possible todecide the existence of a homomorphism from H to L in time f ( | V ( H ) | ) · O ( | V ( L ) | ) , for some computable function f independent of H and L . Proof.
We construct an algorithm A for the problem Hom ( > → L ) that, given a graphs H ∈ > and L ∈ L , correctly decides whether there exists a homomorphism from H to L .Further, the algorithm A runs in time f ( | V ( H ) | ) · O ( | V ( L ) | ) for some computable function f independent of H and L . The algorithm A relies on the clique partition of line graphs [37,Chapter 8], stating that E ( L ) can be partitioned into cliques such that every vertex of L is contained in at most 2 cliques. Here, every clique corresponds to a vertex of a primalgraph of G such that L ( G ) = L . In particular, it is easy to see that the size of the largestclique in the partition is precisely the maximum degree of G . Consequently, our algorithmfirst computes a primal graph G of L , which can be done in time O ( | V ( L ) | ) [41]. Next, wecompute the maximum degree d of G , which can be done in time O ( | V ( G ) | ) = O ( | V ( L ) | ).Now let k = | V ( H ) | and let H , . . . , H ‘ be the connected components of H . For everyconnected component H i , we proceed as follows. If d ≥ k then there exists a homomorphismfrom H i to L , as we can embed H i into a clique of size d . Otherwise, the properties of theclique partition yield that the degree of L is bounded by 2 k : Every vertex of L is contained inat most two cliques and every clique is of size at most d < k . Consequently, we can perform astandard bounded search-tree algorithm: We guess the image v ∈ V ( L ) of a vertex h ∈ V ( H i ).As the graph H i is connected and | V ( H i ) | ≤ k , every homomorphism from H i to L that maps h to v must also map every further vertex of H i to a vertex in the k -neighborhood of v . Asthe maximum degree of L is at most 2 k , the size of the graph induced by the k -neighborhoodof v is bounded by (2 k ) k . We can then search for a homomorphism by brute-force; this takestime only depending on k . The final output is 1 if a homomorphism is found from everyconnected component H i and 0 otherwise.The total running time is bounded by O ( | V ( L ) | ) + f ( | V ( H ) | ) · O ( | V ( L ) | ) ≤ f ( | V ( H ) | ) · O ( | V ( L ) | );this completes the proof. (cid:74) Theorem 5.1 in turn further motivates the study of the counting version: The most interestinghardness results in counting complexity theory are concerned with problems that admita tractable decision version [57]. In particular, we construct an explicit reduction from
Clique to prove the following hardness result. (cid:73)
Lemma 5.2.
Let H be a recursively enumerable class of graphs. If H has unboundedtreewidth and is closed under taking minors, then the problem Hom ( H → K ) is W [ ] -hard. Note that König graphs are a subset of the perfect graphs [13], as well as a subset ofthe line graphs (of arbitrary graphs). As line graphs are also claw-free graphs [3], Königgraphs are also a subset of the claw-free graphs. Hence, the hardness result for the problem
Hom ( H → K ) extends to perfect graphs, line graphs, and claw-free graphs as well. , k , j , i, ki, ji, k, kk, jk, c (1 , k ) c (1 , j ) c (1 , c ( i, k ) c ( i, j ) c ( i, c ( k, k ) c ( k, j ) c ( k, Hom ( (cid:1) k → G ) (cid:1) k G ( (cid:1) k -colored) R e du c t i o n S (1 , k ) S (1 , j ) S (1 , S ( i, k ) S ( i, j ) S ( i, S ( k, k ) S ( k, j ) S ( k, S (1 , k ) S (1 , j ) S (1 , S ( i, k ) S ( i, j ) S ( i, S ( k, k ) S ( k, j ) S ( k, S ( c (1 , k )) S ( c (1 , j )) S ( c (1 , S ( c ( i, k )) S ( c ( i, j )) S ( c ( i, S ( c ( k, k )) S ( c ( k, j )) S ( c ( k, S ( c (1 , k )) S ( c (1 , j )) S ( c (1 , S ( c ( i, k )) S ( c ( i, j )) S ( c ( i, S ( c ( k, k )) S ( c ( k, j )) S ( c ( k, Hom ( K (cid:1) k → K G ) K (cid:1) k K G ( K (cid:1) k -colored) Figure 4
General overview of the reduction from Lemma 5.2: Corner vertices (red), bordervertices (blue), and interior vertices (purple) get replaced by corresponding gadgets; the resultinggraph K G is a König graph. We use c ( ? ) to denote the set of all vertices colored with ? and S ( ? ) todenote the gadget corresponding to ? ; the numbers i and j denote intermediate columns and rows. To prove Lemma 5.2, we use a gadget construction that transforms an arbitrary graph G into a König graph such that the number of grid-like subgraphs remains stable. In viewof the diverse applications of the Grid-Tiling Problem (see e.g. [18, Chapter 14.4.1]), theconstruction might yield further intractability results for counting problems on König graphs(and hence on claw-free and perfect graphs). Proof.
We write (cid:1) k for the k × k square grid, that is, the graph with the vertices V ( (cid:1) k ) := { ( i, j ) | i, j ∈ [ k ] } , and two vertices ( i, j ) and ( i , j ) are adjacent if | i − i | + | j − j | = 1. Now let (cid:1) be the set ofall square grids (cid:1) k for k ∈ N . We prove a reduction from the problem cp-Hom ( (cid:1) → > ),which is known to be W [ ]-hard and constitutes an important intermediate step in the proofof the classification of the homomorphism counting problem due to Dalmau and Jonsson [19].A sketch of the W [ ]-hardness proof can be found in Appendix A and the full proof can befound e.g. in [15, Lemma 5.7]. . Roth and P. Wellnitz 25 c ( k, c ( i, c ( i, j ) R R R c ( k, , ← ) c ( k, , ↓ ) c ( i, , ← ) c ( i, , → ) c ( i, , ↓ ) c ( i, j, ← ) c ( i, j, → ) c ( i, j, ↓ ) c ( i, j, ↑ ) c ( i, j, - ) c ( i, j, & ) Figure 5
The gadgets in detail.
Let us recall the definition of the problem cp-Hom ( (cid:1) → > ). This problem expects asinput a pair of a square grid (cid:1) k and a graph G that is (cid:1) k -colored by some given coloring c .The task is to compute the number of color-prescribed homomorphisms from (cid:1) k to G , that is,homomorphisms h ∈ Hom ( (cid:1) k → G ) that additionally satisfy c ( h ( v )) = v for every vertex v of the grid.For the first part of the reduction, we present a construction that maps a (cid:1) k -coloredgraph G to a vertex-colored König graph K G ; consider Figure 4 for an overview of theconstruction. Let c be the coloring of G . We partition the vertices of G into three disjointsets (again, consider Figure 4): (1) A vertex v is called a corner vertex if its coloring c ( v ) is one of the values (1 , , k ),( k, k, k ). (2) A vertex v is called a border vertex if its coloring c ( v ) satisfies c ( v ) ∈ { ( i, j ) ∈ [ k ] | i ∈ { , k } ∨ j ∈ { , k }} \ { (1 , , (1 , k ) , ( k, , ( k, k ) } . (3) All remaining vertices are called interior vertices .We construct a gadget (graph) S ( v ) for each vertex v ∈ V ( G ). Here, the graph S ( v ) dependson whether v is a corner, a border or an interior vertex. (1) The vertex v is a corner vertex. Assume that c ( v ) = (1 , N → be the set of neighbors of v that are colored by c with (1 ,
2) and let N ↓ bethe set of all neighbors of v that are colored by c with (2 , v as G is (cid:1) k -colored. For each vertex u ∈ N → , we add a vertex v u → andcolor it with (1 , , → ). For each vertex u ∈ N ↓ , we add a vertex v u ↓ and color it with(1 , , ↓ ). The graph S ( v ) is then obtained by making all of the previous vertices adjacentto each other. (2) The vertex v is a border vertex. Assume that c ( v ) = (1 , j ); the other cases are symmetric.Now let N → be the set of neighbors of v that are colored by c with (1 , j + 1), let N ← bethe set of neighbors of v that are colored by c with (1 , j − N ↓ be the set ofall neighbors of v that are colored by c with (2 , j ). For each vertex u ∈ N → , we add avertex v u → and color it with (1 , i, → ). We proceed similarly with N ← and N ↓ . The graph S ( v ) is then obtained by making all of the previous vertices adjacent. K d = L ( K ,d ) Line graph K ,d Figure 6
A clique K d of size d is the line graph of a star K ,d with d rays. (3) The vertex v is an interior vertex. Let v have color c ( v ) = ( i, j ) and let N → , N ← , N ↑ and N ↓ be the sets of neighbors of v that are colored by c with ( i, j + 1), ( i, j − i − , j )and ( i + 1 , j ), respectively. We add a new vertex v u → for each vertex u ∈ N → and color itwith ( i, j, → ); we proceed similarly with the sets N ↑ , N ← , and N ↓ . Next, we add twonew vertices v - and v & , color them ( i, j, - ) and ( i, j, & ), and connect them by an edge.Then we create two cliques: The first clique contains the vertex v ? and all vertices thatwe colored with ( i, j, ← ) or with ( i, j, ↑ ). The second clique contains the vertex v & andall vertices that we colored with ( i, j, → ) or with ( i, j, ↓ ). The resulting graph is S ( v ).The graph K G is obtained by connecting the gadgets as follows: Let { v, w } ∈ E ( G ) denote anedge of G and assume that the vertex v has color c ( v ) = ( i, j ) and the vertex w has color c ( w ) = ( i, j + 1); the remaining cases are processed similarly. By construction, the graph S ( v ) contains a vertex v w → and the graph S ( w ) contains a vertex w v ← . We connect those twovertices with an edge.We first observe that this construction yields a planar graph if it is applied to the griditself (Again, consider Figure 4). Further, when applied to the graph G , we indeed obtain aKönig graph: (cid:66) Claim 5.3.
If the graph G is (cid:1) k -colored, then the graph K G is a König graph. Proof.
We construct a bipartite graph B such that the line graph L ( B ) of B is the graph K G .To this end, we observe that the gadgets of corner and border vertices are cliques, and thegadgets of interior vertices are two cliques that are connected by a single edge. Hence, theentire graph K G is obtained by connecting vertex disjoint cliques with edges that are pairwisedisjoint.Now observe that cliques are the line graphs of stars. More precisely, let K ,d be thecomplete bipartite graph with 1 vertex on the left side and d vertices on the right side, thenits line graph L ( K ,d ) is the clique of size d ; consider Figure 6 for a visualization. In whatfollows, we say that the single vertex on the left side of K ,d is the center and the d verticeson the right side are the rays .Now, adding an edge between two vertex disjoint cliques corresponds to merging the rightvertices of the corresponding rays of the primal graphs (Consider Figure 7 for a visualization).Consequently, we can construct a graph B whose line graph is K G by merging right vertices ofthe rays corresponding to the edges that connect the cliques of the gadgets.Finally, it is easy to see that B is bipartite: A 2-coloring is given by the function thatmaps the centers to 1 and the (identifications of) rays to 2. (cid:67) . Roth and P. Wellnitz 27 Line graph
Figure 7
Connecting two vertex disjoint cliques corresponds to merging vertices in the corres-ponding primal graphs. Note that the resulting primal graph stays bipartite.
Now, recall that we colored the vertices of K G with triples ( i, j, ? ), where ? is one of thesymbols → , ← , ↑ , ↓ , - , and & . Let ˆ c be this coloring of the graph K G . Observe that thecoloring ˆ c is a bijection if G = (cid:1) k as illustrated in Figure 4. Hence, we can identify thevertices of K (cid:1) k with their colors.Note that the original coloring c is not a K (cid:1) k -coloring of G , as two vertices of G of thesame color are adjacent in the gadget construction. However, adding self-loops to K (cid:1) k inducesa proper coloring: (cid:66) Claim 5.4.
Let K (cid:1) ◦ k be the graph obtained from K (cid:1) k by adding a self-loop to every vertex.Then the mapping ˆ c is a K (cid:1) ◦ k -coloring of K G . Proof.
We have to show that ˆ c is a homomorphism. To this end, consider an edge { x, y } ofthe graph K G . By construction of K G , there are four cases for x and y :The vertices x and y are contained in the same clique. By definition of the mapping ˆ c ,we have thatˆ c ( x ) = ( i, j, ? ) and ˆ c ( y ) = ( i, j, ? )for some numbers i, j ∈ [ k ] and ? , ? ∈ {→ , ← , ↑ , ↓ , - , &} . If we have that ? = ? ,then the colors of x and y are the same, that is ˆ c ( x ) = ˆ c ( y ). Hence, we have that { ˆ c ( x ) , ˆ c ( y ) } ∈ E ( K (cid:1) ◦ k ), as we added all self-loops. Otherwise, if ? = ? , then the graph K (cid:1) k has the edge { ( i, j, ? ) , ( i, j, ? ) } , and hence we have that the edge { ˆ c ( x ) , ˆ c ( y ) } is in E ( K (cid:1) ◦ k )by construction.The vertices x and y satisfy x = v & and y = v - for some v ∈ V ( G ). By definition of themapping ˆ c , we have thatˆ c ( x ) = ( i, j, & ) and ˆ c ( y ) = ( i, j, - ) . By construction, we immediately get that { ˆ c ( x ) , ˆ c ( y ) } ∈ E ( K (cid:1) ◦ k ).The vertices x and y satisfy x = v w → and y = w v ← for some vertices v, w ∈ V ( G ). Bydefinition of the mapping ˆ c , we have thatˆ c ( x ) = ( i, j, → ) and ˆ c ( y ) = ( i, j + 1 , ← ) , which are again adjacent in K (cid:1) ◦ k by construction. The vertices x and y satisfy x = v w ↓ and y = w v ↑ for some vertices v, w ∈ V ( G ). This caseis similar to the previous case.In total, we obtain that ˆ c is indeed a K (cid:1) ◦ k -coloring of the graph K G . (cid:67) Now let h be a homomorphism from K (cid:1) k to K G for some (cid:1) k -colored graph G . We call h colorful if for every color (or vertex) ( i, j, ? ) in V ( K (cid:1) k ), there is a vertex in the image of h that is colored with ( i, j, ? ). Denote the set of all colorful homomorphisms from K (cid:1) k to K G with cf - Hom ( K (cid:1) k → K G ). (cid:66) Claim 5.5.
The number of colorful homomorphisms from K (cid:1) k to K G can be computed intime2 | V ( K (cid:1) k ) | · | V ( K G ) | O (1) by querying the oracle for Hom ( H → K ). Further, every oracle query ( ˆ H, ˆ G ) satisfies thatthe size | V ( ˆ H ) | only depends on the size | V ( K (cid:1) k ) | . Proof.
By the principle of “inclusion and exclusion”, we have that the number of colorfulhomomorphisms can be computed as cf - Hom ( K (cid:1) k → K G ) = X J ⊆ V ( K (cid:1) k ) ( − | J | · Hom ( K (cid:1) k → K G \ J ) , (9)where K G \ J is the graph obtained from K G by deleting all vertices that are colored by ˆ c witha color in J . Hence we can compute, using the previous equation, the number of colorfulhomomorphisms in time 2 | V ( K (cid:1) k ) | ·| V ( K G ) | O (1) if an oracle to the function A Hom ( K (cid:1) k → A )is provided. In particular, König graphs are closed under the removal of vertices: Deletinga vertex in a König graph is equivalent to deleting an edge in primal bipartite graph andbipartiteness is closed under the removal of edges. It hence suffices to restrict the graphs A to the class K .Now recall that the graph K (cid:1) k is planar. By the Excluded Grid Theorem [50], every class H of unbounded treewidth contains arbitrary large grids as minors. Furthermore, everyplanar graph is the minor of some grid [51]. As the class H is minor-closed, we hence obtainthat K (cid:1) k is contained in H for every k ∈ N . Consequently, we can compute (9) using thegiven oracle for Hom ( H → K ). (cid:67) Note that the composition of a colorful homomorphism and the K (cid:1) ◦ k -coloring ˆ c of K G is abijective homomorphism from K (cid:1) k to K (cid:1) ◦ k . In particular, bijectivity yields that we do not needthe self-loops of the graph K (cid:1) ◦ k . Consequently, we obtain a bijective endomorphism, that is,an automorphism of the graph K (cid:1) k . Formally, we can show the following: (cid:66) Claim 5.6.
The number of colorful homomorphisms from K (cid:1) k to K G is the same as cf - Hom ( K (cid:1) k → K G ) = Aut ( K (cid:1) k ) · cp - Hom ( K (cid:1) ◦ k → K G ). Proof.
Observe that for an automorphism, self-loops are irrelevant:
Aut ( K (cid:1) k ) = Aut ( K (cid:1) ◦ k ).Now, define two colorful homomorphisms to be equivalent if their image is equal. Then,every equivalence class has size Aut ( K (cid:1) k ) and is represented by a homomorphism for whichthe induced automorphism is the identity. This homomorphism is then not only colorful butalso color-prescribed. (cid:67) . Roth and P. Wellnitz 29 Finally, we show that the number of homomorphisms from K (cid:1) ◦ k to K G is the same as the numberof homomorphisms from (cid:1) k to G : cp - Hom ( K (cid:1) ◦ k → K G ) = cp - Hom ( (cid:1) k → G ).The argument is depicted in Figure 4: Let h ∈ cp - Hom ( (cid:1) k → G ) denote a color-prescribedhomomorphism. We define the homomorphism ˆ h ∈ cp - Hom ( K (cid:1) ◦ k → K G ) as follows: For every i, j ∈ [ k ] we setˆ h ( i, j, → ) := h ( i, j ) h ( i,j +1) → ˆ h ( i, j, ← ) := h ( i, j ) h ( i,j − ← ˆ h ( i, j, ↓ ) := h ( i, j ) h ( i +1 ,j ) ↓ ˆ h ( i, j, ↑ ) := h ( i, j ) h ( i − ,j ) ↑ ˆ h ( i, j, & ) := h ( i, j ) & ˆ h ( i, j, - ) := h ( i, j ) - The construction of K G immediately yields that ˆ h is a (color-prescribed) homomorphism if h iscolor-prescribed homomorphism. Furthermore, the mapping h ˆ h is a bijection. Thisconcludes the proof. (cid:74) Now, consider the following application of Lemma 5.2. (cid:73)
Theorem 5.7.
Let C be one of the classes of line-graphs, claw-free graphs or perfect graphs,or a non-empty union thereof. Further, let H be a recursively enumerable class of graphs. (1) If the treewidth of the class H is bounded, then the problem Hom ( H → C ) is solvablein polynomial time. (2) Otherwise, if the class H is additionally minor-closed, the problem Hom ( H → C ) is W [ ] -hard. Proof.
We immediately obtain the reduction
Hom ( H → C ) ≤ fptT Hom ( H → > ). Inparticular, the reduction is the identity and preserves not only fixed-parameter tractability,but also polynomial-time tractability.By the classification of Dalmau and Jonsson [19], the problem
Hom ( H → > ) is solvablein polynomial time if the class H has bounded treewidth. If the class H has unboundedtreewidth, W [ ]-hardness follows from Lemma 5.2, as the set of König graphs is a subset ofclaw-free graphs [3], a subset of perfect graphs [13] and, of course, a subset of line graphs. (cid:74) We complement the explicit criterion for hardness for the problem
Hom ( H → K ) fromTheorem 5.7 (which only works if the class H is closed under taking minors) with the followingimplicit exhaustive complexity classification. (cid:73) Theorem 5.8.
Let H be a recursively enumerable class of graphs. Then the problem Hom ( H → K ) is either fixed-parameter tractable or W [ ] -hard under parameterizedTuring-reductions. In particular, Theorem 5.8 shows that the negative result from Section 3 does not applyto König graphs.A central ingredient for the proof of Theorem 5.8 is the following lemma. L ( K ) = L ( K , ) Line graphLine graph K , K Figure 8
The claw K , and the triangle K have the same line graph K . (cid:73) Lemma 5.9.
Let H be a graph. There exists a quantum graph Q [ H ] such that we have forany bipartite graph G : Hom ( H → L ( G )) = Hom ( Q [ H ] → G ) . (10) In particular, the mapping H Q [ H ] is computable. The proof of Lemma 5.9 uses known transformations between linear combinations of ho-momorphisms, subgraphs and induced subgraphs (see e.g. Chapter 5.2.3 in [43] and [16,Section 3]), as well as Whitney’s Isomorphism Theorem: (cid:73)
Theorem 5.10 ([58]) . Let H be a connected line graph that is not isomorphic to thetriangle. Then the graph F such that L ( F ) = H is uniquely defined up to isolated vertices.More precisely, every graph F that satisfies L ( F ) = H and that does not contain isolatedvertices is isomorphic to F . Note that both the triangle and the claw have the triangle as line graph, consider Figure 8.The previous theorem states that the triangle is the only line graph whose primal graph isnot uniquely defined. Furthermore, the Isomorphism Theorem (Theorem 5.10) allows us todefine the following function; recall that G P is the set of bipartite graphs. L − : K → G P , such that L − ( L ( G )) := G for every bipartite graph G .Note that the function L − is well-defined by Theorem 5.10 and the fact that the triangle isnot bipartite. In particular, we have that L − ( K ) = K , , where K is the triangle and K , is the claw, that is, the complete bipartite graph with one vertex on the left side and threevertices on the right side (Again, consult Figure 8 for a visualization.) Similarly, it is welldefined to write L ( F ) for a König graph which is the line graph of the (uniquely determined)bipartite graph F without isolated vertices.Further, again by Whitney’s Isomorphism Theorem, we obtain the following lemma. (cid:73) Lemma 5.11.
Let H be a line graph and let L ( G ) be a König graph. Then we have that IndSub ( H → L ( G )) = ( Sub ( F → G ) if H = L ( F ) ∈ K otherwise . (11) Proof.
Assume first that the graph H = L ( F ) is a König graph. By Theorem 5.10 and thefact that triangles are not bipartite, we have that G is the unique bipartite graph whose linegraph is isomorphic to L ( G ). Let S ⊆ V ( L ( G )) = E ( G ) such that the induced subgraph L ( G )[ S ] is isomorphic to L ( F ) and let G be the subgraph of G with vertices V ( G ) := { v ∈ V ( G ) | ∃ e ∈ S : v ∈ e } , and edges E ( G ) := S . . Roth and P. Wellnitz 31 By construction, the line graph of L ( G ) is isomorphic to L ( F ). Hence, we obtain thatthe graphs F and G are isomorphic by Theorem 5.10 and the fact that none of the graphs F and G is the triangle; note that a bipartite graph cannot contain a subgraph isomorphicto a triangle.Now let G be a subgraph of G that is isomorphic to F . As the graph F does not containisolated vertices, we have that G is determined by its set of edges. We set S = E ( G ) andconsider the induced subgraph L ( G )[ S ]. By construction, we have that the graph L ( G )[ S ]is isomorphic to L ( G ) which in turn is isomorphic to L ( F ) (as the graphs G and F areisomorphic). This shows correctness for H = L ( F ) ∈ K .If the graph H is not a König graph, then H is not a triangle. Thus, we have that H = L ( F ) for some non-bipartite graph F which is uniquely determined (up to isolatedvertices) by Theorem 5.10. In this case, the same argument as before shows that any inducedsubgraph of L ( G ) that is isomorphic to L ( F ) yields a subgraph of G that is isomorphic to F . As the graph G is bipartite and the graph F is not, such an induced subgraph cannotexist; note that bipartite graphs are closed under taking subgraphs. (cid:74) The last ingredient for the proof of Lemma 5.9 is the following well-known identity whichrelates (strong) embeddings and (induced) subgraphs. (cid:73)
Fact 5.12.
For all graphs H and G we have that Emb ( H → G ) = Aut ( H ) · Sub ( H → G ) and (12) StrEmb ( H → G ) = Aut ( H ) · IndSub ( H → G ) . (13)Finally, we are ready to prove Lemma 5.9. Proof of Lemma 5.9.
We rely on a stepwise transformation of linear combinations of homo-morphisms, embeddings, and strong embeddings as given by Lovász [43, Chapter 5.2.3] andas used by Curticapean, Dell and Marx [16, Section 3].For the formal statement, we need to introduce some further notation. Given a graph H , we write Part ( H ) for the set of all partitions ρ of the vertex set V ( H ) such that thequotient H/ρ is a spasm, that is,
H/ρ does not contain self-loops. Furthermore, we write H ⊇ H if the graph H can be obtained from H by adding edges. Now, let us state thetransformations: For all graphs H and G , we have that Hom ( H → G ) = X ρ ∈ Part ( H ) Emb ( H/ρ → G ) , and (14) Emb ( H → G ) = X ρ ∈ Part ( H ) µ ( ∅ , ρ ) · Hom ( H/ρ → G ) , (15)where µ is the so-called Möbius function over the partition lattice. Furthermore, we havethat
Emb ( H → G ) = X H ⊇ H StrEmb ( H → G ) , and (16) StrEmb ( H → G ) = X H ⊇ H ( − | E ( H ) |−| E ( H ) | · Emb ( H → G ) . (17) As we do not need the formal definition of the Möbius function here, we refer the interested reader toe.g. [54] instead.
Now let us start with the construction of the quantum graph Q [ H ] and the proof ofEquation (10). We have that Hom ( H → L ( G )) (14) = X ρ ∈ Part ( H ) Emb ( H/ρ → L ( G )) , Emb ( H/ρ → L ( G )) (16) = X H ⊇ H/ρ
StrEmb ( H → L ( G )) , and StrEmb ( H → L ( G )) (13) = Aut ( H ) · IndSub ( H → L ( G )) . Combining (11) with the fact that line graphs are closed under taking induced subgraphs [3],we obtain that
IndSub ( H → L ( G )) = 0 , whenever H is not a König graph. Consequently, Emb ( H/ρ → L ( G )) = X H ⊇ H/ρH = L ( F ) ∈ K Aut ( H ) · IndSub ( H → L ( G )) . For a graph H = L ( F ) ∈ K we have that IndSub ( H → L ( G )) (11) = Sub ( F → G ) (12) = Aut ( F ) − · Emb ( F → G ) (15) = Aut ( F ) − · X ρ ∈ Part ( F ) µ ( ∅ , ρ ) · Hom ( F/ρ → G ) . We can thus successively apply the previous transformations and obtain:
Hom ( H → L ( G )) = X ρ ∈ Part ( H ) X H ⊇ H/ρH = L ( F ) ∈ K X δ ∈ Part ( F ) Aut ( H ) · µ ( ∅ , δ ) Aut ( F ) · Hom ( F/δ → G ) . The desired quantum graph Q [ H ] is obtained by collecting for isomorphic terms, that is, Q [ H ] := X F λ F · F , where λ F := X ρ ∈ Part ( H ) X H ⊇ H/ρH = L ( F ) ∈ K X δ ∈ Part ( F ) F/δ = F Aut ( H ) · µ ( ∅ , δ ) Aut ( F ) . (cid:74) Using Lemma 5.9, we obtain a proof for Theorem 5.8 as follows. (cid:73)
Theorem 5.8 (repeated) . Let H be a recursively enumerable class of graphs. Then the prob-lem Hom ( H → K ) is either fixed-parameter tractable or W [ ] -hard under parameterizedTuring-reductions. . Roth and P. Wellnitz 33 Proof.
Let P = P denote any path of length 1, and let G P denote the class of all P -colorablegraph; that is, G P is the class of all bipartite graphs. Now, consider the following class ofgraphsˆ H := [ H ∈H supp ( Q [ H ]) ∩ G P , We show the following reductions
Hom ( H → K ) ≡ fptT Hom ( ˆ
H → G P ) . Note that this imples Theorem 5.8 by the classification of F -colorable graphs (Theorem 4.1).For the direction Hom ( H → K ) ≤ fptT Hom ( ˆ
H → G P ), we assume that a graph H ∈ H and a König graph L ( G ) are given. By Lemma 5.2, we can compute (in time only dependingon H ) the quantum graph Q [ H ] that satisfies Hom ( H → L ( G )) = Hom ( Q [ H ] → G ) = X F ∈ supp ( Q [ H ]) λ F · Hom ( F → G ) , (18)where the λ F are the coefficients of Q [ H ]. Now, as L ( G ) is a König graph, we have that G is bipartite. Hence, by Observation B.1, there is no homomorphism from F to G whenever F is not bipartite, that is we have that Hom ( F → G ) = 0. Note that we can verifywhether a graph F ∈ supp ( Q [ H ]) is bipartite in time only depending on | V ( H ) | . All furtherterms Hom ( F → G ) with F ∈ G P can be obtained by querying the oracle for the problem Hom ( ˆ
H → G P ). Finally, we compute and the linear combination given by (18). Thiscompletes the first reduction.For the other direction, Hom ( ˆ
H → G P ) ≤ fptT Hom ( H → K ), we assume that graphs F ∈ ˆ H and G ∈ G P are given. By definition of the class ˆ H , we have that the graph F isa bipartite constituent of the quantum graph Q [ H ] for some H ∈ H . As H is recursivelyenumerable and the mapping H Q [ H ] is computable, we can compute in time onlydepending on | V ( F ) | the quantum graph Q [ H ].By Fact 2.3, we have that the tensor product G × A is bipartite for every graph A as thegraph G is bipartite. Therefore, the graph L ( G × A ) is a König graph for every (not necessarilybipartite) graph A . Hence, we can query the oracle for the problem Hom ( H → K ) tocompute for every graph A whose size only depends on | V ( F ) | the following values: Hom ( H → L ( G × A )) = Hom ( Q [ H ] → G × A )= X F ∈ supp ( Q [ H ]) λ F · Hom ( F → G × A )= X F ∈ supp ( Q [ H ]) λ F · Hom ( F → G ) · Hom ( F → A ) . Now, (the proof of) Lemma B.4 shows that the induced system of linear equations is solvablefor the proper choices of A . In particular, the size of those choices only depends on | V ( H ) | ,which itself only depends on | V ( F ) | . As the graph F is a constituent of the quantum graph Q [ H ], and thus the corresponding coefficient λ F is non-zero, we can compute and outputthe number Hom ( F → G ) in time only depending on | V ( H ) | , which itself only dependson | V ( F ) | . This completes the second reduction, and hence the proof. (cid:74) References Michael O. Albertson and Karen L. Collins. Homomorphisms of 3-chromatic Graphs.
DiscreteMathematics , 54(2):127–132, 1985. doi:10.1016/0012-365X(85)90073-1 . Noga Alon, Raphael Yuster, and Uri Zwick. Color-Coding.
J. ACM , 42(4):844–856, 1995. doi:10.1145/210332.210337 . Lowell W. Beineke. Characterizations of Derived Graphs.
Journal of Combinatorial Theory ,9(2):129 – 135, 1970. doi:https://doi.org/10.1016/S0021-9800(70)80019-9 . Arnab Bhattacharyya, Suprovat Ghoshal, Karthik C. S., and Pasin Manurangsi. ParameterizedIntractability of Even Set and Shortest Vector Problem from Gap-ETH.
CoRR , abs/1803.09717,2018. URL: http://arxiv.org/abs/1803.09717 , arXiv:1803.09717 . Arnab Bhattacharyya, Suprovat Ghoshal, Karthik C. S., and Pasin Manurangsi. ParameterizedIntractability of Even Set and Shortest Vector Problem from Gap-ETH. In , pages 17:1–17:15, 2018. doi:10.4230/LIPIcs.ICALP.2018.17 . Manuel Bodirsky and Martin Grohe. Non-dichotomies in constraint satisfaction complexity.In
Automata, Languages and Programming, 35th International Colloquium, ICALP 2008,Reykjavik, Iceland, July 7-11, 2008, Proceedings, Part II - Track B: Logic, Semantics, andTheory of Programming & Track C: Security and Cryptography Foundations , pages 184–196,2008. doi:10.1007/978-3-540-70583-3\_16 . Hans L. Bodlaender. A Linear-Time Algorithm for Finding Tree-Decompositions of SmallTreewidth.
SIAM J. Comput. , 25(6):1305–1317, 1996. doi:10.1137/S0097539793251219 . Andrei A. Bulatov. The complexity of the counting constraint satisfaction problem.
J. ACM ,60(5):34:1–34:41, 2013. doi:10.1145/2528400 . Andrei A. Bulatov. A Dichotomy Theorem for Nonuniform CSPs. In , pages 319–330, 2017. doi:10.1109/FOCS.2017.37 . Jin-Yi Cai and Xi Chen. Complexity of counting CSP with complex weights. In
Proceedingsof the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY,USA, May 19 - 22, 2012 , pages 909–920, 2012. doi:10.1145/2213977.2214059 . Ashok K. Chandra and Philip M. Merlin. Optimal Implementation of Conjunctive Queriesin Relational Data Bases. In
Proceedings of the 9th Annual ACM Symposium on Theory ofComputing, May 4-6, 1977, Boulder, Colorado, USA , pages 77–90, 1977. doi:10.1145/800105.803397 . Yijia Chen, Marc Thurley, and Mark Weyer. Understanding the Complexity of InducedSubgraph Isomorphisms. In
Automata, Languages and Programming, 35th InternationalColloquium, ICALP 2008, Reykjavik, Iceland, July 7-11, 2008, Proceedings, Part I: TackA: Algorithms, Automata, Complexity, and Games , pages 587–596, 2008. doi:10.1007/978-3-540-70575-8\_48 . Maria Chudnovsky, Neil Robertson, Paul Seymour, and Robin Thomas. The Strong PerfectGraph Theorem.
Annals of Mathematics , 164(1):51–229, 2006. URL: . Stephen A. Cook. The Complexity of Theorem-Proving Procedures. In
Proceedings of the3rd Annual ACM Symposium on Theory of Computing, May 3-5, 1971, Shaker Heights, Ohio,USA , pages 151–158, 1971. doi:10.1145/800157.805047 . Radu Curticapean.
The simple, little and slow things count: On parameterized countingcomplexity . PhD thesis, Saarland University, 2015. URL: http://scidok.sulb.uni-saarland.de/volltexte/2015/6217/ . Radu Curticapean, Holger Dell, and Dániel Marx. Homomorphisms are a good basis forcounting small subgraphs. In
Proceedings of the 49th Annual ACM SIGACT Symposium onTheory of Computing, STOC 2017, Montreal, QC, Canada, June 19-23, 2017 , pages 210–223,2017. doi:10.1145/3055399.3055502 . . Roth and P. Wellnitz 35 Radu Curticapean and Dániel Marx. Complexity of Counting Subgraphs: Only the Bounded-ness of the Vertex-Cover Number Counts. In , pages 130–139,2014. doi:10.1109/FOCS.2014.22 . Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, MarcinPilipczuk, Michal Pilipczuk, and Saket Saurabh.
Parameterized Algorithms . Springer, 2015. doi:10.1007/978-3-319-21275-3 . Víctor Dalmau and Peter Jonsson. The complexity of counting homomorphisms seen from theother side.
Theor. Comput. Sci. , 329(1-3):315–323, 2004. doi:10.1016/j.tcs.2004.08.008 . Holger Dell, Marc Roth, and Philip Wellnitz. Counting Answers to Existential Questions. In , 2019. Josep Díaz, Maria J. Serna, and Dimitrios M. Thilikos. Counting H-colorings of partial k-trees.
Theor. Comput. Sci. , 281(1-2):291–309, 2002. doi:10.1016/S0304-3975(02)00017-8 . Rod Downey and Michael Fellows. Fixed-parameter tractability and completeness III: Somestructural aspects of the W hierarchy. In
Complexity theory , pages 191–225. CambridgeUniversity Press, 1993. Martin E. Dyer and Catherine S. Greenhill. The complexity of counting graph homomorphisms.
Random Struct. Algorithms , 17(3-4):260–289, 2000. Martin E. Dyer and David Richerby. On the complexity of
Proceedings of the 42ndACM Symposium on Theory of Computing, STOC 2010, Cambridge, Massachusetts, USA, 5-8June 2010 , pages 725–734, 2010. doi:10.1145/1806689.1806789 . Jack Edmonds. Paths, Trees, and Flowers.
Canadian Journal of Mathematics , 17:449–467,1965. doi:10.4153/CJM-1965-045-4 . David Eppstein. Subgraph Isomorphism in Planar Graphs and Related Problems.
J. GraphAlgorithms Appl. , 3(3):1–27, 1999. doi:10.7155/jgaa.00014 . Tomás Feder and Moshe Y. Vardi. The Computational Structure of Monotone Monadic SNPand Constraint Satisfaction: A Study through Datalog and Group Theory.
SIAM J. Comput. ,28(1):57–104, 1998. doi:10.1137/S0097539794266766 . Jörg Flum and Martin Grohe. The Parameterized Complexity of Counting Problems.
SIAMJ. Comput. , 33(4):892–922, 2004. doi:10.1137/S0097539703427203 . Jörg Flum and Martin Grohe.
Parameterized Complexity Theory . Texts in TheoreticalComputer Science. An EATCS Series. Springer, 2006. doi:10.1007/3-540-29953-X . Markus Frick and Martin Grohe. Deciding first-order properties of locally tree-decomposablestructures.
J. ACM , 48(6):1184–1206, 2001. doi:10.1145/504794.504798 . M. R. Garey and David S. Johnson.
Computers and Intractability: A Guide to the Theory ofNP-Completeness . W. H. Freeman, 1979. M. R. Garey, David S. Johnson, and H. C. So. An Application of Graph Coloring toPrinted Circuit Testing (Working Paper). In , pages 178–183, 1975. doi:10.1109/SFCS.1975.3 . Oded Goldreich.
Computational Complexity - A Conceptual Perspective . Cambridge UniversityPress, 2008. Martin Grohe. The complexity of homomorphism and constraint satisfaction problems seenfrom the other side.
J. ACM , 54(1):1:1–1:24, 2007. doi:10.1145/1206035.1206036 . Martin Grohe, Thomas Schwentick, and Luc Segoufin. When is the evaluation of conjunctivequeries tractable? In
Proceedings on 33rd Annual ACM Symposium on Theory of Computing,July 6-8, 2001, Heraklion, Crete, Greece , pages 657–666, 2001. doi:10.1145/380752.380867 . Geňa Hahn and Claude Tardif. Graph homomorphisms: Structure and Symmetry. In
Graphsymmetry , pages 107–166. Springer, 1997. Frank Harary.
Graph theory . Addison-Wesley series in mathematics. Addison-Wesley Pub.Co., 1969. Pavol Hell and Jaroslav Nesetril. On the Complexity of H -coloring. J. Comb. Theory, Ser. B ,48(1):92–110, 1990. doi:10.1016/0095-8956(90)90132-J . Pavol Hell and Jaroslav Nešetřil.
Graphs and Homomorphisms . Oxford Lecture Series inMathematics and Its Applications. Oxford University Press, Oxford, 2004. URL: http://cds.cern.ch/record/1413573 . Richard E. Ladner. On the structure of polynomial time reducibility.
J. ACM , 22(1):155–171,1975. doi:10.1145/321864.321877 . Philippe G. H. Lehot. An Optimal Algorithm to Detect a Line Graph and Output Its RootGraph.
J. ACM , 21(4):569–575, October 1974. doi:10.1145/321850.321853 . László Lovász. Kneser’s Conjecture, Chromatic Number, and Homotopy.
J. Comb. Theory,Ser. A , 25(3):319–324, 1978. doi:10.1016/0097-3165(78)90022-5 . László Lovász.
Large Networks and Graph Limits , volume 60 of
Colloquium Publications . Amer-ican Mathematical Society, 2012. URL: . Dániel Marx. Can You Beat Treewidth?
Theory of Computing , 6(1):85–112, 2010. doi:10.4086/toc.2010.v006a005 . Hermann A. Maurer, Ivan Hal Sudborough, and Emo Welzl. On the Complexity of theGeneral Coloring Problem.
Information and Control , 51(2):128–145, 1981. doi:10.1016/S0019-9958(81)90226-6 . Catherine McCartin. Parameterized counting problems.
Ann. Pure Appl. Logic , 138(1-3):147–182, 2006. doi:10.1016/j.apal.2005.06.010 . Jaroslav Nešetřil. Homomorphisms of Derivative Graphs.
Discrete Mathematics , 1(3):257–268,1971. doi:10.1016/0012-365X(71)90014-8 . Jaroslav Nešetřil and Svatopluk Poljak. On the complexity of the subgraph problem.
Com-mentationes Mathematicae Universitatis Carolinae , 26(2):415–419, 1985. Rolf Niedermeier. Invitation to fixed-parameter algorithms.
Oxford Lecture Series in Mathem-atics and its Applications , 31, 2002. Neil Robertson and Paul D. Seymour. Graph minors. V. Excluding a planar graph.
J. Comb.Theory, Ser. B , 41(1):92–114, 1986. doi:10.1016/0095-8956(86)90030-4 . Neil Robertson, Paul D. Seymour, and Robin Thomas. Quickly Excluding a Planar Graph.
J.Comb. Theory, Ser. B , 62(2):323–348, 1994. doi:10.1006/jctb.1994.1073 . Marc Roth. Counting Restricted Homomorphisms via Möbius Inversion over Matroid Lattices.In , pages 63:1–63:14, 2017. doi:10.4230/LIPIcs.ESA.2017.63 . Marc Roth and Johannes Schmitt. Counting induced subgraphs: A Topological Approach to , pages 24:1–24:14, 2018. doi:10.4230/LIPIcs.IPEC.2018.24 . Richard P. Stanley.
Enumerative Combinatorics: Volume 1 . Cambridge University Press,2011. Julian R. Ullmann. An algorithm for subgraph isomorphism.
J. ACM , 23(1):31–42, 1976.URL: http://doi.acm.org/10.1145/321921.321925 , doi:10.1145/321921.321925 . Mario Valencia-Pabon and Juan-Carlos Vera. On the diameter of kneser graphs.
DiscreteMathematics , 305(1):383 – 385, 2005. doi:https://doi.org/10.1016/j.disc.2005.10.001 . Leslie G. Valiant. The Complexity of Computing the Permanent.
Theor. Comput. Sci. ,8:189–201, 1979. doi:10.1016/0304-3975(79)90044-6 . Hassler Whitney. Congruent Graphs and the Connectivity of Graphs. In
Hassler WhitneyCollected Papers , pages 61–79. Birkhäuser Boston, 1992. doi:https://doi.org/10.1007/978-1-4612-2972-8_4 . Dmitriy Zhuk. A Proof of CSP Dichotomy Conjecture. In ,pages 331–342, 2017. doi:10.1109/FOCS.2017.38 . . Roth and P. Wellnitz 37 A On Hardness of
Hom ( H → > ) In this section, we take a closer look at the proof of the following complexity classificationwhich is due to Dalmau and Jonsson. (cid:73)
Theorem A.1 ([19]) . Let H be a recursively enumerable class of graphs. (1) If the treewidth of H is bounded then Hom ( H → > ) is solvable in polynomial time. (2) Otherwise,
Hom ( H → > ) is W [ ] -hard under parameterized Turing-reductions. In particular, we are interested in the proof of Statement (2) of Theorem A.1, that is W [ ]-hardness for the problem Hom ( H → > ). The strategy of the proof is a line ofreasoning based on the Excluded Grid Theorem , which is, by now, well-established (seee.g. [19, 35, 15, 20]). Our goal in this section is to show the following consequences of theknown proofs of Statement (2) of Theorem A.1; recall that a core is a graph without ahomomorphism from itself to any of its proper subgraphs. (cid:73) Lemma A.2.
Let H be a recursively enumerable class of graphs of unbounded treewidth. (1) There exists a parameterized Turing-reduction from the problem
Clique to the problem
Hom ( H → > ) such that every oracle query ( H, G ) satisfies that the graph G is H -colorable. (2) If, additionally, the class H only contains connected cores, then there exists a para-meterized weakly parsimonious reduction from the problem Clique to the problem
Hom ( H → > ) such that every pair ( H, G ) in the image of the reduction satisfies thatthe graph G is connected and H -colorable. To accommodate readers unfamiliar with the proof of Theorem A.1 on the one hand, but torefrain from including the proof in full detail on the other hand, we provide an outline only.For technical reasons, we start by proving that the instances of the problem
Clique canbe assumed to be connected graphs. (cid:73)
Lemma A.3.
Let
ConnClique be the problem of, given a connected graph G and apositive integer k , computing the number of cliques of size k in G . Then we have that Clique ≤ fpt ConnClique . Proof.
Let (
G, k ) be an instance of
Clique . If the number k is 1, then the number of k -cliques in G is just the number of vertices | V ( G ) | of G . Hence, the reduction can output( P | V ( G ) |− , P i is the path with i + 1 edges.If the number k is 2, then the number of k -cliques in G is just the number of edges | E ( G ) | of G . Hence, the reduction can output ( P | E ( G ) |− , C . . . , C n be the connected components of G . For each i ∈ , . . . , n − C i and an arbitrary vertex incomponent C i +1 . As the number k is at least 3, this operation does not change the numberof k -cliques and thus the reduction can output the modified connected graph and k . (cid:74) Outline of the proofs of (2) of Theorem A.1 and Lemma A.2.
Let H denote a recursivelyenumerable class of graphs of unbounded treewidth. The goal is to show that the problem Hom ( H → > ) is W [ ]-hard. Recall that the Excluded Grid Theorem states that every class H of unbounded treewidth containsarbitrarily large grid minors [50]. The first step is the reduction from
Clique to cp-Hom ( (cid:1) → > ), where (cid:1) is the setof all k × k square grids (cid:1) k for k ∈ N . Intuitively, given an instance ( G, k ) of
Clique , weconstruct a (cid:1) k -colored graph G as follows: For each i ∈ { , . . . , k } , we add the set V i,i := { ( v, v ) | v ∈ V ( G ) } to the vertices of G . For every i, j ∈ { , . . . , k } with i = j , we add the set V i,j := { ( u, v ) | { u, v } ∈ E ( G ) } to the vertices of G . Finally, we add an edge between two vertices ( v, u ) ∈ V i,j and( v , u ) ∈ V i ,j if v = v and i = i , or if u = u and j = j . It can the be shown that thenumber of k -cliques in G equals the number cp - Hom ( (cid:1) k → G ) · ( k !) − , where the factor ( k !) − stems from the fact that the vertices of a k -clique are not ordered.Furthermore, the resulting graph G is connected if G is connected and G is (cid:1) k -colorablegiven by the homomorphism h that maps every vertex in V i,j to the grid vertex ( i, j ).The second step relies on the Excluded Grid Theorem [50]: If the class H has unboundedtreewidth, then for any number k , there is a graph H k ∈ H that has the grid (cid:1) k as a minor.Using this property of the class H , it can be shown that cp-Hom ( (cid:1) → > ) ≤ fpt cp-Hom ( H → > ) . A very clear presentation of this reduction is given by Curticapean [15, Lemma 5.8]. Inparticular, given graphs (cid:1) k and G , the reduction outputs a pair ( H k , ˆ G ) such that the graphˆ G is H k -colorable and ˆ G is connected if both G and H k are connected. Furthermore, notethat the graph H k can be found as H is recursively enumerable.We are now able to prove the second item of Lemma A.2: Using Lemma A.3 andthe properties of the previous reductions, we can, on input G and k , compute in time f ( k ) · | V ( G ) | O (1) (for some computable function f ), a pair ( H k , ˆ G ) of graphs such that (a) the graph ˆ G is connected, (b) the graph ˆ G is H k -colorable by some coloring c , and (c) the number of k -cliques in G is precisely cp - Hom ( H k → ˆ G ) · ( k !) − .Now recall that the condition of the second item of Lemma A.2 states that the graph H k isa core. Let h be a (not necessarily color-prescribed) homomorphism from H k to ˆ G . Then,the composition of h and the coloring c is an endomorphism of H k . As the graph H k is acore, it has no homomorphism to a proper subgraph. Hence, the homomorphism h ◦ c is anautomorphism and, in particular, h is color-prescribed if and only if h ◦ c is the identity. It isthen straightforward to show that cp - Hom ( H k → ˆ G ) = Hom ( H k → ˆ G ) · Aut ( H k ) − . This concludes the proof of the second item of Lemma A.2.For the first item, we cannot assume that the graph ˆ G is connected, as the graph H k mightbe disconnected. However, we still obtain an algorithm that, on input G and k , computes intime f ( k ) · | V ( G ) | O (1) (for some computable function f ), a pair ( H k , ˆ G ) of graphs such that Note that Curticapean uses the problem
PartitionedSub ( H ) which, however, is equivalent to theproblem cp-Hom ( H → > ) [15, Definition 5.2 and Remark 5.3]. A reader familiar with group actions will find a very easy proof based on the observation that theautomorphism group of H k acts on the set Hom ( H k → ˆ G ). . Roth and P. Wellnitz 39 (i) the graph ˆ G is H k -colorable by some coloring c , and (ii) the number of k -cliques in G is precisely cp - Hom ( H k → ˆ G ) · ( k !) − .Now, using the principle of inclusion and exclusion, it is possible to compute the number N ofhomomorphisms h from H k to ˆ G such that h ◦ c is an automorphism in time O (2 k ) ·| V ( ˆ G ) | O (1) if an oracle to cp - Hom ( H k → ? ) is provided. More precisely, we have that N = X J ⊆ V ( H k ) ( − | J | · Hom ( H k → ˆ G \ J ) , where ˆ G \ J is the graph obtained from ˆ G by deleting all vertices v for which c ( v ) ∈ J .Having obtained N , for the same reasons as in the previous case, the Turing-reduction canoutput N · Aut ( H k ) − . The first item of Lemma A.2 now holds as the graph ˆ G is H k -colorable and hence everysubgraph ˆ G \ J is H k -colorable as well. (cid:74) Note that the proofs of Lemma A.3 and the second item of Lemma A.2 immediately showthe following consequence for the decision version and parameterized many-one reductions [29,Definition 2.1]: (cid:73)
Corollary A.4.
Let H be a recursively enumerable class of connected cores of unboun-ded treewidth. Then there exists a parameterized many-one reduction from Clique to Hom ( H → > ) such that every pair ( H, G ) in the image of the reduction satisfies that G isconnected and H -colorable. B Proofs of Section 4B.1 Proof of Theorem 4.1
We prove Theorem 4.1 in two steps. First, in Lemma B.2, we show a polynomial-timealgorithm for graph classes H easy that do not contain F -colorable graphs of arbitrarily largetreewidth. After that, we prove W [1]-hardness for all other graph classes. Polynomial-Time Algorithm for the Tractable Cases
Let H easy denote any graph class such that for any graph H ∈ H easy , either H has a treewidthof at most c , or H is not F -colorable; where c = c ( H easy ) is a constant only depending on H easy . We obtain a polynomial-time algorithm for the (PPC) problem Hom ( H easy → G F )as follows. Given graphs H ∈ H easy and G ∈ G F , we check, using Bodlaender’s Algorithm [7],whether H has a treewidth tw ( H ) of at most c ( H easy ). Next, if tw ( H ) ≤ c ( H easy ), we use thestandard dynamic programming algorithm due to Díaz et. al [21] to compute Hom ( H → G ).Otherwise, that is if tw ( H ) > c ( H easy ), we output 0, as H is not F -colorable by definition of H easy . This last step is justified by the following observation. (cid:73) Observation B.1.
Let graphs
F, G, and H be given. If there is no homomorphism from H to F , but a homomorphism from G to F , then there is no homomorphism from H to G . Proof.
Choose any homomorphism g from G to F and suppose there was a homomorphism h from H to G . As the concatenation of two homomorphisms is again a homomorphism,in particular f ◦ g : H → F is again a homomorphism, which is a contradiction to theassumption that there is no homomorphism from H to F . (cid:74) In total, we obtain the following algorithm. (cid:73)
Lemma B.2.
For any graph classes H easy and G F , the (PPC) problem Hom ( H easy → G F ) can be solved in polynomial time. Proof.
The correctness follows directly from the definition of H easy and Observation B.1.For the running time, set c = c ( H easy ), k = | V ( H ) | , and n := | V ( G ) | Checking whetherthe given graph has a treewidth of at most c takes time c O ( c ) · k using Bodlaender’salgorithm[7]. Next, computing the number of homomorphisms from a graph with treewidthat most c takes time poly( k, c ) · n c + O (1) due to Díaz et. al [21]. Hence in total, our algorithmhas a running time of poly( k, c ) · n c + O (1) , which is polynomial, thus completing the proof. (cid:74) W [1] -Hardness for the Intractable Cases It remains to demonstrate W [ ]-hardness of Hom ( H → G F ) whenever the treewidth ofthe intersection H ∩ G F is unbounded. However, as we have seen in Lemma A.2, the existinghardness proof already shows the desired stronger result. (cid:73) Observation B.3.
Let H be a recursively enumerable class of graphs such that the treewidthof H ∩ G F is unbounded. Then we have that Clique ≤ fptT Hom ( H → G F ) . Proof.
We use Lemma A.2 (1) for the class
H ∩ G F : As every oracle query ( H, G ) satisfiesthat G is H -colorable by some coloring c and every graph H ∈ H ∩ G F is F -colorable bysome coloring c , we obtain that the composition c ◦ c is an F -coloring of G . (cid:74)(cid:73) Theorem 4.1 (repeated) . Let F be a graph, and let H be a recursively enumerable class ofgraphs. (1) If the treewidth of
H ∩ G F is bounded then the PPC problem Hom ( H → G F ) ispolynomial-time solvable. (2) Otherwise, the problem
Hom ( H → G F ) is W [ ] -hard. Proof.
Holds by Lemma B.2 and Observation B.3. (cid:74)
B.2 Proof of Theorem 4.3
We start with the proof of the following lemma. (cid:73)
Lemma B.4.
Let F be a fixed graph and let Q be a quantum graph such that supp ( Q ) ⊆G F . There exists a deterministic algorithm A that is given oracle access to the prob-lem Hom ( Q → ? ) and that, on input an F -colorable graph G , computes the number Hom ( H → G ) for every constituent H of Q . Furthermore, there are computable func-tions f and s such that the running time of the algorithm A is bounded by f ( | Q | ) · | V ( G ) | O (1) and every graph G for which the oracle is queried is F -colorable and has at most s ( | Q | ) ·| V ( G ) | vertices. Proof.
We follow the lines of the proof of Lemma 3.6 in [16]: Given an F -colorable graph G ,we wish to query the oracle for ( Q, G × H ) for certain graphs H . Recall that the tensorproduct satisfies Hom ( A → B × C ) = Hom ( A → B ) · Hom ( A → C ) , . Roth and P. Wellnitz 41 for all graphs A, B and C . Curticapean, Dell and Marx [16] discovered that a deep result ofLovász implies the existence of graphs H , . . . , H ‘ such that the following system of linearequations has a unique solution. Hom ( Q → G × H i ) = X H λ H · Hom ( H → G × H i ) = X H c H · Hom ( H → H i ) , where c H := λ H · Hom ( H → G ). In particular, the graphs H , . . . , H ‘ can be computedin time only depending on H . Consequently the number Hom ( H → G ) can be computedwhenever λ H = 0 by standard Gaussian elimination.Now, the only catch is the fact that we are only allowed to query the oracle for F -colorablegraphs. However, by Fact 2.3, the tensor product of an F -colorable graph with another (notnecessarily F -colorable) graph is always F -colorable. Consequently, the original proof ofCurticapean, Dell and Marx [16] transfers without modification to the F -colored setting. (cid:74)(cid:73) Theorem 4.3 (repeated) . Let F be a fixed graph and let H be a recursively enumerableclass of graphs. (1) If the matching number of
H ∩ G F is bounded then the problem Sub ( H → G F ) ispolynomial-time solvable. (2) Otherwise, the problem
Sub ( H → G F ) is W [ ] -hard. Proof.
Proving (1) is easy: Let c be the constant upper bound on the matching number ofgraphs in H ∩ G F . Now, given H ∈ H and G ∈ G F , we first compute the matching numberof H in polynomial time by the Blossom-Algorithm [25]. If the result is greater than c , thepromise tells us that H / ∈ G F , in which case we can output 0 as H would be F -colorable if itwas isomorphic to a subgraph of G ∈ G F . Otherwise, we use the algorithm given by the firstitem of Theorem 4.2.For W [ ]-hardness, we construct a reduction from the problem Hom ( spasms ( H ) ∩ G F → G F ) , where spasms ( H ) is the set of all spasms of graphs in H . We start with the followingobservation. (cid:66) Claim B.5.
The class spasms ( H ) ∩ G F has unbounded treewidth if the class H ∩ G F hasunbounded matching number. Proof.
Let b ∈ N be a positive integer. We show that there exists a graph of treewidth atleast b in the class spasms ( H ) ∩ G F . By assumption, there is a graph H ∈ H ∩ G F such that H contains a matching M of size at least | E ( F ) | · b ; recall that | E ( F ) | is a constant as thegraph F is fixed.Now let c be an F -coloring of H . For every edge e = { u, v } ∈ M , we let c ( e ) ∈ E ( F )be the image of e under the coloring. As | M | ≥ | E ( F ) | · b , we have that there is an edgeˆ e = { ˆ u, ˆ v } ∈ E ( F ) such that c ( e ) = ˆ e for at least b many edges of M . More precisely, thereare edges { u , v } , . . . , { u b , v b } ∈ M such that c ( u i ) = ˆ u and c ( v i ) = ˆ v for all i ∈ { , . . . , b } .As c is a coloring (and thus a homomorphism), we have that the sets U := { u , . . . , u b } and V := { v , . . . , v b } are independent. Consequently, we can contract vertices in U and V suchthat the matching M becomes a complete bipartite graph K b,b with b vertices on each side.Let ρ be the induced partition on V ( H ). Then the quotient graph H/ρ contains assubgraph K b,b , and H/ρ is still F -colorable as we only identified vertices that are containedin the same pre-image of the F -coloring c . Furthermore, H/ρ is a spasm as we did not createself-loops. Thus, we have that
H/ρ ∈ spasms ( H ) ∩ G F . As the treewidth of K b,b is b and the treewidth of a graph cannot increase by taking subgraphs, we obtain that H/ρ has treewidthat least b . (cid:67) Consequently, a reduction from
Hom ( spasms ( H ) ∩ G F → G F ) to Sub ( H → G F ) shows W [ ]-hardness of the latter problem by Theorem 4.1. For the construction of the reduction,we use the known fact that, given a graph H , there exists a quantum graph Q [ H ] with supp ( Q ) = spasms ( H ) and Hom ( Q [ H ] → G ) = Sub ( H → G ) for every graph G [43,Equation (6.2)], [16]. Therefore, given a graph ˆ H ∈ spasms ( H ) ∩ G F we can find (in timeonly depending on ˆ H ) a graph H ∈ H such that we have for all graphs G that Sub ( H → G ) = Hom ( Q [ H ] → G ) , and ˆ H ∈ supp ( Q [ H ]). Now let ˆ Q [ H ] be the quantum graph obtained from Q [ H ] by deletingall constituents that are not F -colorable. If G is F -colorable, we obtain from the previousequation that Sub ( H → G ) = Hom ( Q [ H ] → G ) = Hom ( ˆ Q [ H ] → G ) , as Hom ( H → G ) = 0 for all graphs H that are not F -colorable: Assuming otherwise, thereexists a homomorphism h from H to G which yields an F -coloring of H when composedwith the F -coloring of G , contradicting the assumption that H is not F -colorable.It follows that an oracle query ( H, G ) for
Sub ( H → G F ) computes Hom ( ˆ Q [ H ] → G ).As supp ( ˆ Q [ H ]) = spasms ( H ) ∩ G F , we can use Lemma B.4, which concludes the proof., we can use Lemma B.4, which concludes the proof.