Fine-grained complexity of the graph homomorphism problem for bounded-treewidth graphs
aa r X i v : . [ c s . CC ] F e b Fine-grained complexity of the graph homomorphism problemfor bounded-treewidth graphs ∗Karolina Okrasa †1,2 and Paweł Rzążewski ‡1,21
Faculty of Mathematics and Information Science, Warsaw University of Technology, Poland Faculty of Mathematics, Informatics and Mechanics, University of WarsawFebruary 20, 2020
Abstract
For graphs G and H , a homomorphism from G to H is an edge-preserving mapping from the vertexset of G to the vertex set of H . For a fixed graph H , by Hom( H ) we denote the computational problemwhich asks whether a given graph G admits a homomorphism to H . If H is a complete graph with k vertices, then Hom( H ) is equivalent to the k - Coloring problem, so graph homomorphisms can be seenas generalizations of colorings. It is known that
Hom( H ) is polynomial-time solvable if H is bipartiteor has a vertex with a loop, and NP-complete otherwise [Hell and Nešetřil, JCTB 1990].In this paper we are interested in the complexity of the problem, parameterized by the treewidthof the input graph G . If G has n vertices and is given along with its tree decomposition of width tw( G ) , then the problem can be solved in time | V ( H ) | tw( G ) · n O (1) , using a straightforward dynamicprogramming. We explore whether this bound can be improved. We show that if H is a projectivecore , then the existence of such a faster algorithm is unlikely: assuming the Strong Exponential TimeHypothesis (SETH), the Hom( H ) problem cannot be solved in time ( | V ( H ) | − ε ) tw( G ) · n O (1) , for any ε > . This result provides a full complexity characterization for a large class of graphs H , as almostall graphs are projective cores.We also notice that the naive algorithm can be improved for some graphs H , and show a complexityclassification for all graphs H , assuming two conjectures from algebraic graph theory. In particular,there are no known graphs H which are not covered by our result.In order to prove our results, we bring together some tools and techniques from algebra and fromfine-grained complexity. ∗ The extended abstract of this work was presented during the conference SODA 2020 [40] † E-mail: [email protected] . Supported by the ERC grant CUTACOMBS (no. 714704). ‡ E-mail: [email protected] . Supported by Polish National Science Centre grant no.2018/31/D/ST6/00062.
Introduction
Many problems that are intractable for general graphs become significantly easier if the structure of theinput instance is “simple”. One of the most successful measures of such a structural simplicity is the treewidth of a graph, whose notion was rediscovered by many authors in different contexts [3, 22, 42, 1].Most classic NP-hard problems, including
Independent Set , Dominating Set , Hamiltonian Cycle , or
Coloring , can be solved in time O ∗ ( f (tw( G ))) , where tw( G ) is the treewidth of the input graph G (inthe O ∗ ( · ) notation we suppress factors polynomial in the input size) [2, 7, 11, 13]. In other words, manyproblems become polynomially solvable for graphs with bounded treewidth.In the past few years the notion of fine-grained complexity gained popularity, and the researchersbecame interested in understanding what is the optimal dependence on the treewidth, i.e., the function f in the complexity of algorithms solving particular problems. This led to many interesting algorithmicresults and lower bounds [49, 6, 31, 35, 41, 13]. Note that the usual assumption that P = NP is not strongenough to obtain tight bounds for the running times of algorithms. In the negative results we usuallyassume the Exponential Time Hypothesis (ETH), or the Strong Exponential Time Hypothesis (SETH) [29,30]. Informally speaking, the ETH asserts that 3-
Sat with n variables and m clauses cannot be solved intime o ( n + m ) , while the SETH implies that CNF-Sat with n variables and m clauses cannot be solved intime (2 − ε ) n · m O (1) , for any ε > .For example, it is known that for every fixed k , the k - Coloring problem can be solved in time O ∗ ( k tw( G ) ) ,if a tree decomposition of G of width tw( G ) is given [5, 13]. On the other hand, Lokshtanov, Marx, andSaurabh showed that this result is essentially optimal, assuming the SETH. Theorem 1 (Lokshtanov, Marx, Saurabh [36]).
Let k > be a fixed integer. Assuming the SETH, the k - Coloring problem on a graph G cannot be solved in time O ∗ (cid:16) ( k − ε ) tw( G ) (cid:17) for any ε > . Homomorphisms
For two graphs G and H , a homomorphism is an edge-preserving mapping from V ( G ) to V ( H ) . The graph H is called the target of the homomorphism. The existence of a homomorphismfrom any graph G to the complete graph K k is equivalent to the existence of a k -coloring of G . Because ofthat we often refer to a homomorphism to H as an H -coloring and think of vertices of H as colors. We alsosay that a graph G is H -colorable if it admits a homomorphism to H . For a fixed graph H , by Hom ( H ) wedenote the computational problem which asks whether a given instance graph G admits a homomorphismto H . Clearly Hom ( K k ) is equivalent to k - Coloring .Since k - Coloring is arguably one of the best studied computational problems, it is interesting toinvestigate how these results generalize to
Hom ( H ) for non-complete targets H . For example, it is knownthat k - Coloring is polynomial-time solvable for k , and NP-complete otherwise. A celebrated resultby Hell and Nešetřil [26] states that Hom ( H ) is polynomially solvable if H is bipartite or has a vertex witha loop, and otherwise is NP-complete. The polynomial part of the theorem is straightforward and the maincontribution was to prove hardness for all non-bipartite graphs H . The difficulty comes from the fact thatthe local structure of the graph H is not very helpful, but we need to consider H as a whole. This is thereason why the proof of Hell and Nešetřil uses a combination of combinatorial and algebraic arguments.Several alternative proofs of the result have appeared [10, 46], but none of them is purely combinatorial.When it comes to the running times of algorithms for k - Coloring , it is well-known that the trivial O ∗ ( k n ) algorithm for k - Coloring , where n is the number of vertices of the input graph, can be improvedto O ∗ ( c n ) for a constant c which does not depend on k (currently the best algorithm of this type hasrunning time O ∗ (2 n ) [4]). Analogously, we can ask whether the trivial O ∗ ( | H | n ) algorithm for Hom ( H )can be improved, where by | H | we mean the number of vertices of H . There are several algorithms with1unning times O ∗ ( c ( H ) n ) , where c ( H ) is some structural parameter of H , which could be much smallerthan | H | [20, 50, 43]. However, the question whether there exists an absolute constant c , such that forevery H the Hom ( H ) problem can be solved in time O ∗ ( c n ) , remained open. Finally, it was answered inthe negative by Cygan et al. [12], who proved that the O ∗ ( | H | n ) algorithm is essentially optimal, assumingthe ETH.Using a standard dynamic programming approach, Hom ( H ) can be solved in time O ∗ ( | H | t ) , if an inputgraph is given along with its tree decomposition of width t [5, 13]. Theorem 1 asserts that this algorithmis optimal if H is a complete graph with at least 3 vertices, unless the SETH fails. A natural extension ofthis result would be to provide analogous tight bounds for non-complete targets H .Egri, Marx, and Rzążewski [15] considered this problem in the setting of list homomorphisms . Let H bea fixed graph. The input of the LHom ( H ) problem consists of a graph G , whose every vertex is equippedwith a list of vertices of the target H . We ask if G has a homomorphism to H , respecting the lists. Egri etal. provided a full complexity classification for the case if H is reflexive, i.e., every vertex has a loop. It isperhaps worth mentioning that a P / NP-complete dichotomy for LHom ( H ) was first proved for reflexivegraphs as well: If H is a reflexive graph, then the LHom ( H ) problem is polynomial time-solvable if H isan interval graph, and NP-complete otherwise [17]. Egri et al. defined a new graph invariant i ∗ ( H ) , basedon incomparable sets of vertices, and a new graph decomposition, and proved the following. Theorem 2 (Egri, Marx, Rzążewski [15]).
Let H be a fixed non-interval reflexive graph with i ∗ ( H ) = k .Let t be the treewidth of an instance graph G .(a) Assuming a tree decomposition of G of width t is given, the LHom ( H ) problem can be solved in time O ∗ ( k t ) .(b) There is no algorithm solving the LHom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > , unless the SETHfails. In this paper we are interested in showing tight complexity bounds for the complexity of the non-listvariant of the problem. Let us point out that despite the obvious similarity of
Hom ( H ) and LHom ( H )problems, they behave very differently when it comes to showing hardness results. Note that if H ′ is aninduced subgraph of H , then any instance of LHom ( H ′ ) is also an instance of LHom ( H ), where the verticesof V ( H ) \ V ( H ′ ) do not appear in any list. Thus in order to prove hardness of LHom ( H ), it is sufficient tofind a “hard part” H ′ of H , and perform a reduction for the LHom ( H ′ ) problem. The complexity dichotomyfor LHom ( H ) was proven exactly along these lines [17, 18, 19]. Also the proof of Theorem 2 (b) heavilyuses the fact that we can work with some local subgraphs of H and ignore the rest of vertices. In particular,all these proofs are purely combinatorial.On the other hand, in the Hom ( H ) problem, we need to capture the structure of the whole graph H ,which is difficult using only combinatorial tools. This is why typical tools used in this area come fromabstract algebra and algebraic graph theory.For more information about graph homomorphisms we refer the reader to the comprehensive mono-graph by Hell and Nešetřil [28]. Our contribution
It is well known that in the study of graph homomorphisms the crucial role is playedby the graphs that are cores , i.e., they do not have a homomorphism to any of its proper subgraphs. Inparticular, in order to provide a complete complexity classification of
Hom ( H ), it is sufficient to considerthe case that H is a connected core (we explain this in more detail in Section 3). Also, the complexitydichotomy by Hell and Nešetřil [26] implies that Hom ( H ) is polynomial-time solvable if H is a graph onat most two vertices. So from now on let us assume that H is a fixed core which is non-trivial, i.e., has atleast three vertices. 2e split the analysis into two cases, depending on the structure of H . First, in Section 4.1, we considertargets H that are projective (the definition of this class is rather technical, so we postpone it to Section 2.2).We show that for projective cores the straightforward dynamic programming on a tree decomposition isoptimal, assuming the SETH. Theorem 3.
Let H be a non-trivial projective core on k vertices, and let n and t be, respectively, the numberof vertices and the treewidth of an instance graph G .(a) Even if H is given as a input, the Hom ( H ) problem can be solved in time O ( k + k t +1 · n ) , assuming atree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > ,unless the SETH fails. The proof brings together some tools and ideas from algebra and fine-grained complexity theory. Themain technical ingredient is the construction of a so-called edge gadget , i.e., a graph F with two specifiedvertices u ∗ and v ∗ , such that:(a) for any distinct vertices x, y of H , there is a homomorphism from F to H , which maps u ∗ to x and v ∗ to y , and(b) in any homomorphism from F to H , the vertices u ∗ and v ∗ are mapped to distinct vertices of H .Using this gadget, we can perform a simple and elegant reduction from k - Coloring . If G is an instanceof k - Coloring , we construct an instance G ∗ of Hom ( H ) by taking a copy of G and replacing each edge xy with a copy of the edge gadget, whose u ∗ -vertex is identified with x , and v ∗ -vertex is identified with y .By the properties of the edge gadget it is straightforward to observe that G ∗ is H -colorable if and only if G is k -colorable. Since the size of F depends only on H , we observe that the treewidth of G ∗ differs fromthe treewidth of G by an additive constant, which is sufficient to obtain the desired lower bound.Although the statement of Theorem 3 might seem quite specific, it actually covers a large class ofgraphs. We say that a property P holds for almost all graphs , if the probability that a graph chosen atrandom from the family of all graphs with vertex set { , , . . . , n } satisfies P tends to 1 as n → ∞ . Helland Nešetřil observed that almost all graphs are cores [27], see also [28, Corollary 3.28]. Moreover, Łuczakand Nešetřil proved that almost all graphs are projective [37]. From these two results, we can obtain thatalmost all graphs are projective cores. This, combined by Theorem 3, implies the following. Corollary 4.
For almost all graphs H , the Hom ( H ) problem on instance graphs with treewidth t cannot besolved in time O ∗ (cid:0) ( | H | − ε ) t (cid:1) for any ε > , unless the SETH fails. In Section 4.2 we consider the case that H is a non-projective core. First, we show that the approachthat we used for projective cores cannot work in this case: it appears that one can construct the edgegadget for a core H with the properties listed above if and only if H is projective. What makes studyingnon-projective cores difficult is that we do not understand their structure well. In particular, we know thata graph H = H × H , where H and H are non-trivial and × denotes the direct product of graphs (seeSection 2.2 for a formal definition), is non-projective, and by choosing H and H appropriately, we canensure that H is a core. However, we do not know whether there are any non-projective non-trivial con-nected cores that are indecomposable , i.e., they cannot be constructed using direct products. This problemwas studied in a slightly more general setting by Larose and Tardif [34, Problem 2], and it remains wideopen. We restate it here, only for restricted case that H is a core, which is sufficient for our purpose. Conjecture 1.
Let H be a connected non-trivial core. Then H is projective if and only if it is indecomposable. H thatare built using the direct product. If H = H × . . . × H m and each H i is non-trivial and indecomposable,we call H × . . . × H m a prime factorization of H . For such H we show a lower complexity bound for Hom ( H ), under an additional assumption that one of the factors H i of H is truly projective .The definition of truly projective graphs is rather technical and we present it in Section 4.2. Graphswith such a property (actually, a slightly more restrictive one) were studied by Larose [32, Problems 1b.and 1b’.] in connection with some problems related to unique colorings, considered by Greenwell andLovász [21]. Larose [32, 33] defined and investigated even more restricted class of graphs, called stronglyprojective (see Section 5 for the definition). We know that every strongly projective graph is truly projective,and every truly projective graph is projective. Larose [32, 33] proved that all known projective graphs arein fact strongly projective. This raises a natural question whether projectivity and strong projectivity arein fact equivalent [32, 33]. Of course, an affirmative answer to this question would in particular meanthat all projective cores are truly projective. Again, we state the problem in this weaker form, which issufficient for our application. Conjecture 2.
Every projective core is truly projective.
Actually, if we assume both Conjecture 1 and Conjecture 2, we are able to provide a full complexityclassification for the
Hom ( H ) problem, parameterized by the treewidth of the input graph. Theorem 5.
Assume that Conjecture 1 and Conjecture 2 hold. Let H be a non-trivial connected core withprime factorization H × . . . × H m , and define k := max i ∈ [ m ] | H i | . Let n and t be, respectively, the numberof vertices and the treewidth of an instance graph G .(a) Even if H is given as an input, the Hom ( H ) problem can be solved in time O ( | H | + k t +1 · n ) , assuminga tree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > ,unless the SETH fails. Let us point out that despite some work on both conjectures [34, 32, 33], we know no graph H forwhich the bounds from Theorem 5 do not hold. For n ∈ N , we denote the set { , , . . . , n } by [ n ] . All graphs considered in this paper are finite, undirectedand do not contain parallel edges. For a graph G , by V ( G ) and E ( G ) we denote the set of vertices andthe set of edges of G , respectively, and we write | G | for the number of vertices of G . Let K ∗ be the single-vertex graph with a loop. A graph is ramified if it has no two distinct vertices u and v such that the openneighborhood of u is contained in the open neighborhood of v . An odd girth of a graph G , denoted by og( G ) , is the length of a shortest odd cycle in G . For a graph G , denote by ω ( G ) and χ ( G ) , respectively,the size of the largest clique contained in G and the chromatic number of G .A tree decomposition of a graph G is a pair (cid:16) T , { X a } a ∈ V ( T ) (cid:17) , in which T is a tree, whose vertices arecalled nodes and { X a } a ∈ V ( T ) is the family of subsets (called bags ) of V ( G ) , such that1. every v ∈ V ( G ) belongs to at least one bag X a ,2. for every uv ∈ E ( G ) there is at least one bag X a such that u, v ∈ X a ,3. for every v ∈ V ( G ) the set T v := { a ∈ V ( T ) | v ∈ X a } induces a connected subgraph of T .4he width of a tree decomposition (cid:16) T , { X a } a ∈ V ( T ) (cid:17) is the number max a ∈ V ( T ) | X a | − . The minimumpossible width of a tree decomposition of G is called the treewidth of G and denoted by tw( G ) . In particular,if T is a path, then a tree decomposition (cid:16) T , { X a } a ∈ V ( T ) (cid:17) is called a path decomposition . The pathwidth of G , denoted by pw( G ) , is the minimum possible width of a path decomposition of G . Clearly for everygraph G it holds that tw( G ) pw( G ) . For graphs G and H , a function f : V ( G ) → V ( H ) is a homomorphism if it preserves edges, i.e., forevery uv ∈ E ( G ) it holds that f ( u ) f ( v ) ∈ E ( H ) (see Figure 1). If G admits a homomorphism to H , wedenote this fact by G → H and we write f : G → H if f is a homomorphism from G to H . If there isno homomorphism from G to H , we write G H . Graphs G and H are homomorphically equivalent if G → H and H → G , and incomparable if G H and H G . Observe that homomorphic equivalence isan equivalence relation on the class of all graphs. An endomorphism of G is any homomorphism f : G → G .Figure 1: An example of a homomorphism from G (left) to H (right). Patterns on the vertices indicate themapping.A graph G is a core if G H for every proper subgraph H of G . Equivalently, we can say G is a coreif and only if every endomorphism of G is an automorphism (i.e., an isomorphism from G to G ). Notethat a core is always ramified. If H is a subgraph of G such that G → H and H is a core, we say that H is a core of G . Notice that if H is a subgraph of G , then it always holds that H → G , so every graphis homomorphically equivalent to its core. Moreover, if H is a core of G , then H is always an inducedsubgraph of G , because every endomorphism f : G → H restricted to H must be an automorphism. Itwas observed by Hell and Nešetřil that every graph has a unique core (up to an isomorphism) [27]. Notethat if f : G → H is a homomorphism from G to its core H , then it must be surjective.We say that a core is trivial if it is isomorphic to K , K ∗ , or K . It is easy to observe that thesethree graphs are the only cores with fewer than 3 vertices. In general, finding a core of a given graphis computationally hard; in particular, deciding if a graph is a core is coNP-complete [27]. However, thegraphs whose cores are trivial are simple to describe. Observation 6.
Let G be a graph, whose core H is trivial.(a) H ≃ K if and only if χ ( G ) = 1 , i.e., G has no edges,(b) H ≃ K if and only if χ ( G ) = 2 , i.e., G is bipartite and has at least one edge,(c) H ≃ K ∗ if and only if G has a vertex with a loop. (cid:3) In particular, there are no non-trivial cores with loops. The following conditions are necessary for G to have a homomorphism into H . 5 bservation 7 ([28]). Assume that G → H and G and H have no loops. Then ω ( G ) ω ( H ) , χ ( G ) χ ( H ) , and og( G ) > og( H ) . (cid:3) We denote by H + . . . + H m a disconnected graph with connected components H , . . . , H m . Observethat if f is a homomorphism from G = G + . . . + G ℓ to H = H + . . . + H m , then it maps everyconnected component of G into some connected component of H . Also note that a graph does not have tobe connected to be a core, in particular the following characterization follows directly from the definitionof a core. Observation 8.
A disconnected graph H is a core if and only if its connected components are pairwise in-comparable cores. (cid:3) An example of a pair of incomparable cores is shown in Figure 2: it is the
Grötzsch graph , denoted by G G , and the clique K . Clearly, og( G G ) > og( K ) and χ ( G G ) > χ ( K ) , so by Observation 7, they areincomparable. Therefore, by Observation 8, the graph G G + K is a core.Figure 2: An example of incomparable cores, the Grötzsch graph (left) and K (right).Finally, let us observe that we can construct arbitrarily large families of pairwise incomparable cores.Let us start the construction with an arbitrary non-trivial core H . Now suppose we have constructed pair-wise incomparable cores H , H , . . . , H k , and we want to construct H k +1 . Let ℓ = max i ∈{ ,...,k } og( H i ) , r = max i ∈{ ,...,k } χ ( H i ) . By the classic result of Erdős [16], there is a graph H with og( H ) > ℓ and χ ( H ) > r . We set H k +1 to be the core of H . Observe that og( H k +1 ) = og( H ) > ℓ and χ ( H k +1 ) = χ ( H ) > r , so, by Observation 7, we have that for every i ∈ { , . . . , k } the core H k +1 is incomparablewith H i . Define the direct product of graphs H and H , denoted by H × H , as follows: V ( H × H ) = { ( x, y ) | x ∈ V ( H ) and y ∈ V ( H ) } and E ( H × H ) = { ( x , y )( x , y ) | x x ∈ E ( H ) and y y ∈ E ( H ) } . If H = H × H , then H × H is a factorization of H , and H and H are its factors . Clearly, the binaryoperation × is commutative, so will identify H × H and H × H . Since × is also associative, we canextend the definition for more than two factors: H × · · · × H m − × H m := ( H × · · · × H m − ) × H m . ¯ x :=( x , . . . , x k ) and ¯ y := ( y , . . . , y k ) , we will treat tuples (¯ x, ¯ y ) , ( x , . . . , x k , y , . . . , y k ) , (¯ x, y , . . . , y k ) ,and ( x , . . . , x k , ¯ y ) as equivalent. This notation is generalized to more factors in a natural way. We denoteby H m the product of m copies of H .The direct product appears in the literature under different names: tensor product , cardinal product , Kronecker product , relational product . It is also called categorical product , because it is the product in thecategory of graphs (see [23, 39] for details).Note that if H × H has at least one edge, then H × H ≃ H if and only if H ≃ K ∗ . We say that agraph H is directly indecomposable (or indecomposable for short) if the fact that H = H × H implies thateither H ≃ K ∗ or H ≃ K ∗ . A graph that is not indecomposable, is decomposable . A factorization, whereeach factor is directly indecomposable and not isomorphic to K ∗ , is called a prime factorization . Clearly, K ∗ does not have a prime factorization.The following property will be very useful (see also Theorem 8.17 in [23]). Theorem 9 (McKenzie [38]).
Any connected non-bipartite graph with more than one vertex has a uniqueprime factorization into directly indecomposable factors (with possible loops).
Let H × . . . × H m be some factorization of H (not necessary prime) and let i ∈ [ m ] . A function π i : V ( H ) → V ( H i ) such that for every ( x , . . . , x m ) ∈ V ( H ) it holds that π i ( x , . . . , x m ) = x i is a projection on the i -th coordinate . It follows from the definition of the direct product that every projection π i is a homomorphism from H to H i .Below we summarize some basic properties of direct products. Observation 10.
Let H be a graph on k vertices. Then(a) H × K consists of k isolated vertices, in particular its core is K ,(b) if H has at least one edge, then the core of H × K is K ,(c) the graph H m contains a subgraph isomorphic to H , which is induced by the set { ( x, . . . , x ) | x ∈ V ( H ) } ;in particular, if m > , then H m is never a core,(d) if H = H × . . . × H m and H , H , . . . , H m are connected, then H is connected if and only if at mostone H i is bipartite,(e) if H = H × . . . × H m , then for every G it holds that G → H if and only if G → H i for all i ∈ [ m ] .Proof. Items (a), (b), (c) are straightforward to observe. Item (d) follows from a result of Weichsel [51],see also [23, Corollary 5.10]. To prove (e), consider a homomorphism f : G → H . Clearly, H → H i forevery i ∈ [ m ] because each projection π i : H → H i is a homomorphism. So π i ◦ f is a homomorphismfrom G to H i . On the other hand, if we have some f i : G → H i for every i ∈ [ m ] , then we can define ahomomorphism f : G → H by f ( x ) := ( f ( x ) , . . . , f m ( x )) .A homomorphism f : H m → H is idempotent , if for every x ∈ V ( H ) it holds that f ( x, x, . . . , x ) = x .One of the main characters of the paper is the class of projective graphs , considered e.g. in [32, 33, 34]. Agraph H is projective (or idempotent trivial ), if for every m > , every idempotent homomorphism from H m to H is a projection. Observation 11. If H is a projective core and f : H m → H is a homomorphism, then f ≡ g ◦ π i for some i ∈ [ m ] and some automorphism g of H . roof. If f is idempotent, then it is a projection and we are done. Assume f is not idempotent and define g : V ( H ) → V ( H ) by g ( x ) = f ( x, . . . , x ) . The function g is an endomorphism of H and H is a core, so g is in fact an automorphism of H . Observe that g − ◦ f is an idempotent homomorphism, so it is equalto π i for some i ∈ [ m ] , because H is projective. From this we get that f ≡ g ◦ π i .It is known that projective graphs are always connected [34]. Observe that the definition of projectivegraphs does not imply that their recognition is decidable. However, an algorithm to recognize these graphsfollows from the following, useful characterization. Theorem 12 (Larose, Tardif [34]).
A connected graph H with at least three vertices is projective if andonly if every idempotent homomorphism from H to H is a projection. Recall from the introduction that almost all graphs are projective cores [28, 37]. It appears that theproperties of projectivity and being a core are independent. In particular, the graph in Figure 3 is not acore, as it can be mapped to a triangle. However, Larose [32] proved that all non-bipartite, connected,ramified graphs which do not contain C as a (non-necessarily induced) subgraph, are projective (this willbe discussed in more detail in Section 5, see Theorem 26). On the other hand, there are also non-projectivecores, an example is G G × K , see Figure 2. We discuss such graphs in detail in Section 4.2.Figure 3: An example of a projective graph which is not a core. Note that if two graphs H and H are homomorphically equivalent, then the Hom ( H ) and Hom ( H )problems are also equivalent. So in particular, because every graph is homomorphically equivalent to itscore, we may restrict our attention to graphs H which are cores. Also, recall from Observation 6 that Hom ( H ) can be solved in polynomial time if H is isomorphic to K ∗ , K , or K . So we will be interestedonly in non-trivial cores H . In particular, we will assume that H is non-bipartite and has no loops.We are interested in understanding the complexity bound of the Hom ( H ) problem, parameterized bythe treewidth of the input graph. The dynamic programming approach (see Bodlaender et al. [5]) gives usthe following upper bound. Theorem 13 (Bodlaender et al. [5]).
Let H be a graph on k vertices. Even if H is a part of the input, the Hom ( H ) problem can be solved in time O ( k t +1 · n ) , assuming a tree decomposition of width t of the instancegraph on n vertices is given. By Theorem 1, this bound is tight (up to the polynomial factor) if H is a complete graph with at leastthree vertices, unless the SETH fails. We are interested in extending this result for other graphs H .First, let us observe that there are cores, for which the bound from Theorem 13 can be improved. Indeed,let H be a decomposable core, isomorphic to H × . . . × H m (see discussion in Section 4.2 for more aboutcores that are products.). Recall from Observation 10 (e) that for every graph G it holds that G → H if and only if G → H i for every i ∈ [ m ] . G of Hom ( H ), we can call the algorithm from Theorem 13 to solve Hom ( H i ) foreach i ∈ [ m ] and return a positive answer if and only if we get a positive answer in each of the calls.Since Hammack and Imrich [24] presented an algorithm for finding the prime factorization of H in time O ( | H | ) , we obtain the following result. Theorem 14.
Let H be a core with prime factorization H × . . . × H m . Even if H is given as a part ofthe input, the Hom ( H ) problem can be solved in time O (cid:16) | H | + max j ∈ [ m ] | H j | t +1 · n (cid:17) , assuming a treedecomposition of width t of the instance graph with n vertices is given. (cid:3) Let us conclude this section with two lemmas, which justify why we restrict our attention to connectedcores. Assume H = H + . . . + H m is a disconnected core. The first lemma shows how to solve Hom ( H )using an algorithm for finding homomorphisms to connected target graphs. Lemma 15.
Consider a disconnected core H = H + . . . + H m . Assume that for every i ∈ [ m ] the Hom ( H i )problem can be solved in time O ( | H i | + n d · c ( H i ) t ) for an instance G with n vertices, given along with itstree decomposition of width t , where c is some function and d is a constant. Then, even in H is given as aninput, the Hom ( H ) problem can be solved in time O (cid:16) | H | + n d · max i ∈ [ m ] c ( H i ) t · | H | (cid:17) .Proof. First, observe that if G is disconnected, say G = G + . . . + G ℓ , then G → H if and only if G i → H for every i ∈ [ ℓ ] . Also, any tree decomposition of G can be easily transformed to a tree decomposition of G i of at most the same width. It means that if the instance graph is disconnected, we can just considerthe problem separately for each of its connected components. So we assume that G is connected. Then G → H if and only if G → H i for some i ∈ [ m ] . We find the connected components of H in time O ( | H | ) and then solve Hom ( H i ) for each i ∈ [ m ] (for the same instance G ) in time O ( | H i | + n d · c ( H i ) t ) . Wereturn a positive answer for Hom ( H ) if and only if we get a positive answer for at least one i ∈ [ m ] . Thetotal complexity of this algorithm is O (cid:16) | H | + | H | + . . . + | H m | + n d · ( c ( H ) t + . . . + c ( H m ) t ) (cid:17) = O (cid:16) | H | + n d · max i ∈ [ m ] c ( H i ) t · | H | (cid:17) , as | H | + . . . + | H m | ( | H | + . . . + | H m | ) = | H | .The second lemma shows that even if we assume H to be fixed, we cannot solve Hom ( H ) faster than wesolve Hom ( H i ), for each connected component H i of H . We state it in a stronger version, parameterizedby the pathwidth of an instance graph. Lemma 16.
Let H = H + . . . + H m be a fixed, disconnected core. Assume that the Hom ( H ) problem canbe solved in time O ∗ ( α pw( G ) ) for an instance G given along with its optimal path decomposition. Then forevery i ∈ [ m ] the Hom ( H i ) problem can be solved in time O ∗ ( α pw( G ) ) .Proof. Again, we may restrict our attention only to connected instances, as otherwise we can solve theproblem separately for each instance. Consider a connected instance G of Hom ( H i ) on n vertices andpathwidth t . Let V ( H i ) = { z , . . . , z k } and let u be some fixed vertex of G . We construct an instance G ∗ of Hom ( H ) as follows. We take a copy G ′ of G and a copy e H ki of H ki , and identify the vertex correspondingto u in G ′ with the vertex corresponding to ( z , . . . , z k ) in e H ki . Denote this vertex of G ∗ by ¯ z . Observethat H i a connected, non-trivial core, so Observation 10 (d) implies that e H ki is connected. Since G is alsoconnected, G ∗ must be connected.We claim that G → H i if and only if G ∗ → H . Indeed, if f : G → H i , then there exists j ∈ [ k ] suchthat f ( u ) = z j , so we can define a homomorphism g : G ∗ → H i (which is also a homomorphism from G ∗ to H ) by g ( x ) = ( f ( x ) if x ∈ V ( G ′ ) ,π j ( x ) otherwise.9learly, both f and π j are homomorphisms. Recall that ¯ z is a cutvertex in G ∗ obtained by identifying u from G ′ and ( z , . . . , z k ) from e H ki . Furthermore, we have g (¯ z ) = f ( u ) = π j ( z , . . . , z k ) = z j , so g is ahomomorphism from G ∗ to H .Conversely, if we have g : G ∗ → H , we know that g maps G ∗ to a connected component H j of H , for some j ∈ [ m ] , because G ∗ is connected. But G ∗ contains an induced copy e H ki of H ki , so also aninduced copy of H i , say e H i (recall Observation 10 (c)). So g | V ( e H i ) is in fact a homomorphism from H i to H j . Recall from Observation 7 that since H + . . . + H m is a core, its connected components are pairwiseincomparable cores – so j must be equal to i . It means that g | V ( G ′ ) is a homomorphism from G ′ to H i , sowe conclude that G → H i .Note that the number of vertices of G ∗ is n + | H ki | − | H ki | · n . Now let (cid:16) T , { X a } a ∈ V ( T ) (cid:17) be a pathdecomposition of G of width t , and let b be a node of T , such that u ∈ X b . Let T ∗ be the path obtainedfrom T by inserting a new node b ′ as the direct successor of b . Define X b ′ := X b ∪ V ( H ki ) . Clearly, (cid:16) T ∗ , { X a } a ∈ V ( T ∗ ) (cid:17) is a path decomposition of G ∗ . This means that pw( G ∗ ) t + | H ki | . The graph H i isfixed, so the number of vertices of H ki is a constant. By our assumption we can decide if G ∗ → H in time α pw( G ∗ ) · c ·| G ∗ | d , so we can decide if G → H i in time α pw( G ∗ ) · c · ( | H ki | n ) d α t α | H ki | · c ·| H ki | d n d = α t · c ′ · n d ,where c ′ = c · α | H ki | · | H ki | d .Let us point out that the assumptions in Lemma 15 (that H is given as an input) and Lemma 16(that H is fixed) correspond, respectively, to the assumptions in statements (a) and (b) of Theorem 3 andTheorem 5. In this section we will investigate the lower bounds for the complexity of
Hom ( H ). The section is splitinto two main parts. In Section 4.1 we consider projective cores. Then, in Section 4.2, we consider non-projective cores. The main result of this section is Theorem 3.
Theorem 3.
Let H be a non-trivial projective core on k vertices, and let n and t be, respectively, the numberof vertices and the treewidth of an instance graph G .(a) Even if H is given as a input, the Hom ( H ) problem can be solved in time O ( k + k t +1 · n ) , assuming atree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > ,unless the SETH fails. Observe that Theorem 3 (a) follows from Theorem 13, so we need to show the hardness counterpart,i.e., the statement (b). A crucial building block in our reduction will be the graph called the edge gadget ,whose construction is described in the following lemma.
Lemma 17.
For every non-trivial projective core H , there exists a graph F with two specified vertices u ∗ and v ∗ , satisfying the following:(a) for every x, y ∈ V ( H ) such that x = y , there exists a homomorphism f : F → H such that f ( u ∗ ) = x and f ( v ∗ ) = y , b) for every f : F → H it holds that f ( u ∗ ) = f ( v ∗ ) .Proof. Let V ( H ) = { z , . . . , z k } . For i ∈ [ k ] denote by z k − i the ( k − -tuple ( z i , . . . , z i ) and by z i the ( k − -tuple ( z , . . . , z i − , z i +1 , . . . z k ) . We claim that F := H ( k − k and vertices u ∗ := ( z k − , . . . , z k − k ) and v ∗ := ( z , . . . , z k ) satisfy the statement of the lemma. Note that the vertices of F are k ( k − -tuples.To see that (a) holds, observe that if x and y are distinct vertices from V ( H ) , then there always exists i ∈ [ k ( k − such that π i ( u ∗ ) = x and π i ( v ∗ ) = y . This means that π i is a homomorphism from F = H k ( k − to H satisfying π i ( u ∗ ) = x and π i ( v ∗ ) = y .To prove (b), recall that since H is projective, by Observation 11, the homomorphism f is a compositionof some automorphism g of H and π i for some i ∈ [ k ( k − . Observe that u ∗ and v ∗ are defined in a waysuch that π j ( u ∗ ) = π j ( v ∗ ) for every j ∈ [ k ( k − . As g is an automorphism, it is injective, which givesus f ( u ∗ ) = g ( π i ( u ∗ )) = g ( π i ( v ∗ )) = f ( v ∗ ) .Finally, we are ready to prove Theorem 3 (b). The high-level idea is to start with an instance of k - Coloring , where k = | H | , and replace each edge by the gadget constructed in Lemma 17. Then thehardness will follow from Theorem 1. Actually, Lokshtanov, Marx, Saurabh [36] proved the following,slightly stronger version of Theorem 1. Theorem 1’ (Lokshtanov, Marx, Saurabh [36]).
Let k > be a fixed integer. Assuming the SETH, the k - Coloring problem on a graph G cannot be solved in time O ∗ (cid:16) ( k − ε ) pw( G ) (cid:17) for any ε > . This allows us to prove a slightly stronger version of Theorem 3 (b), where we consider the problemparameterized by the pathwidth of the instance graph.
Theorem 3’ (b).
Let H be a fixed non-trivial projective core on k vertices. There is no algorithm solving the Hom ( H ) problem for instance graph G in time O ∗ (cid:16) ( k − ε ) pw( G ) (cid:17) for any ε > , unless the SETH fails.Proof of Theorem 3’ (b). Note that since H is non-trivial, we have k > . Recall that since H is projective,it is also connected [34]. We reduce from k - Coloring , let G be an instance with n vertices and pathwidth t . We construct an instance G ∗ of Hom ( H ) as follows. First, for every z ∈ V ( G ) we introduce a vertex z ′ of V ( G ∗ ) . Let V ′ denote the set of these vertices. Now, for every edge xy of G , we introduce to G ∗ a copyof the edge gadget, constructed in Lemma 17, and denote it by F xy . We identify the vertices u ∗ and v ∗ of F xy with vertices x ′ and y ′ , respectively. This completes the construction of G ∗ .We claim that G is k -colorable if and only if G ∗ → H . Indeed, let ϕ be a k -coloring of G . For simplicityof notation, we label the colors used by ϕ in the same way as the vertices of H , i.e., z , z , . . . , z k . Define g : V ′ → V ( H ) by setting g ( v ′ ) := ϕ ( v ′ ) Now consider an edge xy of G and the edge gadget F xy .Since c is a proper coloring, we have g ( x ′ ) = g ( y ′ ) . So by Lemma 17 (a), we can find a homomorphism f xy : F xy → H , such that f xy ( x ′ ) = g ( x ′ ) and f xy ( y ′ ) = g ( y ′ ) . Repeating this for every edge gadget, wecan extend g to a homomorphism from G ∗ to H .Conversely, from Lemma 17 (b), we know that for any f : G ∗ → H and every edge xy of G it holdsthat f ( x ′ ) = f ( y ′ ) , so any homomorphism from G ∗ to H induces a k -coloring of G .The number of vertices of G ∗ is at most | F | n . Now let T be a path decomposition of G of width t ,denote its consecutive bags by X , X , . . . , X m . Let us extend it to a path decomposition of G ∗ . For eachedge xy of G there exists b ∈ [ m ] such that x, y ∈ X b . We introduce a bag X b ′ := X b ∪ V ( F xy ) as a direct11uccessor of X b . It is straightforward to observe that by repeating this step for every edge of G , we obtaina path decomposition of G ∗ of width at most t + | F | . Recall that H is fixed, so | F | is a constant. So if wecould decide if G ∗ → H in time ( k − ε ) pw( G ∗ ) · c · | G ∗ | d ( k − ε ) t + | F | · c · | F | d · n d , where c and d aresome constants, then we would be able to decide if G is k -colorable in time ( k − ε ) t · c ′ · n d ′ for constants c ′ = c · ( k − ε ) | F | · | F | d and d ′ = 2 d . By Theorem 1’, this contradicts the SETH. Now we will focus on non-trivial connected cores, which are additionally non-projective, i.e., they do notsatisfy the assumptions of Theorem 3. First, let us argue that the approach from Section 4.1 cannot workin this case. In particular, we will show that an edge gadget with properties listed in Lemma 17 cannot beconstructed for non-projective graphs H .We will need the definition of constructible sets , see Larose and Tardif [34]. For a graph H , a set C ⊆ V ( H ) is constructible if there exists a graph K , an ( ℓ + 1) -tuple of vertices x , . . . , x ℓ ∈ V ( K ) andan ℓ -tuple of vertices y , . . . , y ℓ ∈ V ( H ) such that { y ∈ V ( H ) | ∃ f : K → H such that f ( x i ) = y i for every i ∈ [ ℓ ] and f ( x ) = y } = C. We can think of C as the set of colors that might appear on the vertex x , when we precolor each x i with thecolor y i and try to extend this partial mapping to a homomorphism to H . The tuple ( K, x , . . . , x ℓ , y , . . . , y ℓ ) is called a construction of C .It appears that the notion of constructible sets is closely related to projectivity. Theorem 18 (Larose, Tardif [34]).
A graph H on at least three vertices is projective if and only if everysubset of its vertices is constructible. Now we show that Lemma 17 cannot work for non-projective graphs H . Proposition 19.
Let H be a fixed non-trivial connected core. Then an edge gadget F with properties listedin Lemma 17 exists if and only if H is projective.Proof. The ‘if’ statement follows from Lemma 17. Let k := | H | and suppose that there exists a graph F with properties given in Lemma 17. Consider a set C ⊆ V ( H ) and define ℓ := | C | . Let { y , . . . , y k − ℓ } be the complement of C in V ( H ) . Take k − ℓ copies of F , say F , . . . , F k − ℓ and denote the vertices u ∗ and v ∗ of the i -th copy F i by u ∗ i and v ∗ i , respectively. Identify the vertices u ∗ i of all these copies, denotethe obtained vertex by u ∗ , and the obtained graph by K . Now set x := u ∗ and for each i ∈ [ k − ℓ ] set x i := v ∗ i .It is easy to verify that this is a construction of the set C . Indeed, observe that if x ∈ C , then, fromLemma 17 (a), for each copy F i there exists a homomorphism f i : F i → H such that f i ( v ∗ i ) = f i ( x i ) = y i and f i ( u ∗ ) = f i ( x ) = x . Combining these homomorphisms yields a homomorphism f : K → H . Onthe other hand, if x C , then x = y i for some i ∈ [ k − ℓ ] . But from Lemma 17 (b) we know that for everyhomomorphism f : F i → H it holds that x = y i = f ( v ∗ i ) = f ( u ∗ ) = f ( x ) , so x cannot be mapped to x by any extension to a homomorphism from K to H .Observe that if H is projective, then it must be indecomposable. Indeed, assume that for some non-trivial H it holds that H = H × H , H K ∗ and H K ∗ . Consider a homomorphism f : ( H × H ) → H × H , defined as f (( x, y ) , ( x ′ , y ′ )) = ( x, y ′ ) . Note that it is idempotent, but not a projection, so H isnot projective. 12n the light of the observation above, it is natural to ask whether indecomposability implies projectivity.This problem was already stated e.g. by Larose and Tardif [34, Problem 2] and, to the best of our knowledge,no significant progress in this direction was made. Let us recall it here. Conjecture 1.
Let H be a connected non-trivial core. Then H is projective if and only if it is indecomposable. Since we know no connected non-trivial non-projective cores that are indecomposable, in the remain-der of the section we will assume that H is a decomposable, non-trivial connected core. By Theorem 9 weknow that H has a unique prime factorization H × . . . × H m for some m > . To simplify the notation,for any given homomorphism f : G → H × . . . × H m and i ∈ [ m ] , we define f i ≡ π i ◦ f . Then for eachvertex x of G it holds that f ( x ) = ( f ( x ) , . . . , f m ( x )) , and f i is a homomorphism from G to H i .The following observation follows from Observation 10. Observation 20.
Let H be a connected, non-trivial core with factorization H = H × . . . × H m , such that H i K ∗ for all i ∈ [ m ] . Then for i ∈ [ m ] the graph H i is a connected non-trivial core, incomparable with H j for j ∈ [ m ] \ { i } . (cid:3) Now let us consider the complexity of
Hom ( H ), where H has a prime factorization H × H × . . . H m for m > . By Theorem 14, the problem can be solved in time O (cid:16) | H | + max j ∈ [ m ] | H j | t +1 · n (cid:17) , where n and t are, respectively, the number of vertices and the width of a given tree decomposition of the inputgraph. We believe that this bound is tight, and we prove a matching lower bound, up to the polynomialfactor, under some additional assumption.We say that a graph H is truly projective if it has at least three vertices and for every s > and everyconnected core W incomparable with H , it holds that if f : H s × W → H satisfies f ( x, x, . . . , x, y ) = x for all x ∈ V ( H ) , y ∈ V ( W ) , then f is a projection.It is easy to verify that truly projective graphs are projective. Indeed, by Theorem 12, we need toshow that any idempotent homomorphism g : H → H is a projection. Consider a core W , which isincomparable with H , and a homomorphism f : H × W → H , defined by f ( x , x , y ) := g ( x , x ) .Since H is truly projective, f is a projection, and so is g .Again, we state and prove the stronger version of a lower bound, parameterized by the pathwidth ofan instance graph. Theorem 21.
Let H be a fixed non-trivial connected core, with prime factorization H × . . . × H m . Assumethere exists i ∈ [ m ] such that H i is truly projective. Unless the SETH fails, there is no algorithm solving the Hom ( H ) problem for instance graph G in time O ∗ (cid:16) ( | H i | − ε ) pw( G ) (cid:17) , for any ε > . The proof of Theorem 21 is similar to the proof of Theorem 3’ (b). We start with constructing anappropriate edge gadget. We will use the following result (to avoid introducing new definitions, we statethe theorem in a sightly weaker form, using the terminology used in this paper, see also [23, Theorem8.18]).
Theorem 22 (Dörfler, [14]).
Let ϕ be an automorphism of a connected, non-bipartite, ramified graph H ,with the prime factorization H × . . . × H m . Then for each i ∈ [ m ] there exists an automorphism ϕ ( i ) of H i such that ϕ i ( t , . . . , t m ) ≡ ϕ ( i ) ( t i ) .
13n particular, it implies the following.
Corollary 23.
Let µ be an automorphism of a connected, non-trivial core H = H × R , where H is inde-composable and R K ∗ . Then there exist automorphisms µ (1) : H → H and µ (2) : R → R such that µ ( t, t ′ ) ≡ ( µ (1) ( t ) , µ (2) ( t ′ )) .Proof. By Observation 20, R is a non-trivial core, so it admits the unique prime factorization, say R = H × . . . × H m . Therefore H × H × . . . × H m is the unique prime factorization of H . From Theorem 22we know that for each i ∈ [ m ] there exists an automorphism ϕ ( i ) of H i such that µ ( t , . . . , t m ) ≡ ( ϕ (1) ( t ) , . . . , ϕ ( m ) ( t m )) . Define µ (1) by setting µ (1) ( t ) := ϕ (1) ( t ) for every vertex t ∈ V ( H ) . Analo-gously, we define µ (2) by setting µ (2) ( t , . . . , t m ) := ( ϕ (2) ( t ) , . . . , ϕ ( m ) ( t m )) for every vertex ( t , . . . , t m ) of R (for each i ∈ [ m ] \ { } we have t i ∈ V ( H i ) ). It is straightforward to verify that µ (1) and µ (2) satisfythe statement of the corollary.In the following lemma we construct an edge gadget, that will be used in the hardness reduction. Theconstruction is similar to the one in Lemma 17, but more technically complicated. Lemma 24.
Let H = H × R be a connected, non-trivial core, such that H is truly projective and R K ∗ .Let w be a fixed vertex of R . Then there exists a graph F and vertices u ∗ , v ∗ of F , satisfying the followingconditions:(a) for every xy ∈ E ( H ) there exists f : F → H such that f ( u ∗ ) = ( x, w ) and f ( v ∗ ) = ( y, w ) ,(b) for any f : F → H it holds that f ( u ∗ ) f ( v ∗ ) ∈ E ( H ) .Proof. Let E ( H ) = { e , . . . , e s } and let e i = u i v i for every i ∈ [ s ] (clearly, one vertex can appear manytimes as some u i or v j ). Consider the vertices u :=( u , . . . , u s , v , . . . , v s ) v :=( v , . . . , v s , u , . . . , u s ) of H s . Let F := H s × R , and let u ∗ := ( u, w ) and v ∗ := ( v, w ) . We will treat vertices u and v as s -tuples, and vertices u ∗ and v ∗ as (2 s + 1) -tuples.Observe that, if xy ∈ E ( H ) , then, by the definition of u ∗ and v ∗ , there exists i ∈ [2 s ] such that x = π i ( u ) and y = π i ( v ) . Define a function f : V ( F ) → V ( H ) as f ( x , . . . , x s , r ) := ( π i ( x , . . . , x s ) , r ) .Observe that this is a homomorphism, for which f ( u ∗ ) = f ( u, w ) = ( x, w ) and f ( v ∗ ) = f ( v, w ) = ( y, w ) ,which is exactly the condition (a) in the statement of Lemma 24.We prove (b) in two steps. First, we observe the following. Claim.
Let ϕ : F → H . If for every z ∈ V ( H ) and r ∈ V ( R ) it holds that ϕ ( z, . . . , z, r ) = z then ϕ ( u ∗ ) ϕ ( v ∗ ) ∈ E ( H ) .Proof of Claim. Recall that R is a connected core incomparable with H , and H is truly projective. Itmeans that if ϕ : H s × R → H satisfies the assumption of the claim, then it is equal to π i for some i ∈ [2 s ] . From the definition of u ∗ and v ∗ we have that π i ( u ∗ ) π i ( v ∗ ) ∈ E ( H ) . (cid:4) Note that the set { ( z, . . . , z, r ) ∈ F | z ∈ V ( H ) , r ∈ V ( R ) } induces in F a subgraph isomorphic to H , let us call it e H . Let σ be an isomorphism from e H to H defined as σ ( z, . . . , z, r ) := ( z, r ) .Consider any homomorphism f : F → H . We observe that f | V ( e H ) is an isomorphism from e H to H ,because H is a core. If f | V ( e H ) ≡ σ then for every z ∈ V ( H ) and r ∈ V ( R ) it holds that f ( z, . . . , z, r ) = ( z, . . . , z, r ) = z , so, by the Claim above, we are done. If not, observe that there exists the inverseisomorphism g : H → e H such that g ◦ f | V ( e H ) is the identity function on V ( e H ) . Define µ := σ ◦ g .Observe that µ is an endomorphism of H × R , so an automorphism, since H × R is a core. Also notethat ( µ ◦ f ) : F → H × R is a homomorphism such that for every ( z, . . . , z, r ) ∈ V ( e H ) it holds that ( µ ◦ f )( z, . . . , z, r ) = ( σ ◦ g ◦ f )( z, . . . , z, r ) = ( σ ◦ id)( z, . . . , z, r ) = σ ( z, . . . , z, r ) = ( z, r ) , so ( µ ◦ f ) ( z, . . . , z, z ′ ) = z . This means that µ ◦ f satisfies the assumption of the Claim, so ( µ ◦ f ) ( u ∗ )( µ ◦ f ) ( v ∗ ) ∈ E ( H ) . (1)Clearly, for every vertex ¯ z of F it holds that ( µ ◦ f ) (¯ z ) = µ (cid:16) f (¯ z ) , f (¯ z ) (cid:17) = µ (cid:16) f (¯ z ) , f (¯ z ) (cid:17) , µ (cid:16) f (¯ z ) , f (¯ z ) (cid:17)! . (2)Note that Corollary 23 implies that there exist automorphisms µ (1) and µ (2) of H and R , respectively,such that for every ¯ z ∈ V ( F ) it holds that µ (cid:0) f (¯ z ) , f (¯ z ) (cid:1) = µ (1) ( f (¯ z )) µ (cid:0) f (¯ z ) , f (¯ z ) (cid:1) = µ (2) ( f (¯ z )) , (3)In particular, (2) and (3) imply that ( µ ◦ f ) = µ (1) ◦ f . Combining this with (1) we get that (cid:16) µ (1) ◦ f (cid:17) ( u ∗ ) (cid:16) µ (1) ◦ f (cid:17) ( v ∗ ) ∈ E ( H ) . (4)Since µ (1) is the automorphism of H , there exists the inverse automorphism (cid:16) µ (1) (cid:17) − of H . Because (cid:16) µ (1) (cid:17) − is an automorphism, (4) implies that f ( u ∗ ) f ( v ∗ ) ∈ E ( H ) , which completes the proof.Now we can proceed to the proof of Theorem 21. Proof of Theorem 21.
Since × is commutative, without loss of generality we can assume that H is trulyprojective. Define R := H × . . . × H m , so H = H × R . Since H is truly projective, it is projective, soTheorem 3’ (b) can be applied here. Hence we known that assuming the SETH, there is no algorithm whichsolves instances of Hom ( H ) with n vertices and pathwidth t in time O ∗ (cid:0) ( | H | − ε ) t (cid:1) , for any ε > .Let G be an instance of Hom ( H ) with n vertices and pathwidth t . The construction of the instance G ∗ of Hom ( H ) is analogous as in the proof of Theorem 3’ (b). Let w be a fixed vertex of R and let F be agraph obtained by calling Lemma 24 for H and w . For every vertex z of G , we introduce to G ∗ a vertex z ′ .Then we add a copy F xy of F for every pair of vertices x ′ , y ′ , which corresponds to an edge xy in G , andidentify vertices x ′ and y ′ with vertices u ∗ and v ∗ of F xy , respectively. As in the proof of Theorem 3’ (b),we observe that G ∗ is a yes-instance of Hom ( H ) if and only if G is a yes-instance of Hom ( H ). Moreover, | G ∗ | | F | · n and pw( G ∗ ) t + | F | . Thus, if we could decide if G ∗ → H in time O ∗ (cid:16) ( | H | − ε ) pw( G ∗ ) (cid:17) ,then we would be able to decide if G → H in time O ∗ (cid:0) ( | H | − ε ) t (cid:1) . By Theorem 3’ (b), such an algorithmcontradicts the SETH.Note that combining the results from Theorem 14 and Theorem 21 we obtain a tight complexity boundfor graphs H , whose largest factor is truly projective.15 orollary 25. Let H be a non-trivial, connected core with prime factorization H × . . . × H m and let H i be the factor with the largest number of the vertices. Assume that H i is truly projective. Let n and t be,respectively, the number of vertices and the treewidth of an instance graph G .(a) Even if H is a part of the input, the Hom ( H ) problem can be solved in time O (cid:0) | H | + | H i | t +1 · n (cid:1) , if atree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( | H i | − ε ) t (cid:1) for any ε > , unless the SETH fails. (cid:3) Recall that in Theorem 21 and Corollary 25 we presented lower complexity bounds for
Hom ( H ) in thecase that one of factors of H is truly projective. In the light of Conjecture 2, we would like to weaken thisassumption by substituting “truly projective” with “projective”. Let us discuss the possibility of obtainingsuch a result.As mentioned in the introduction, a class of graphs very close to truly projective graphs was consideredby Larose [32]. In the same paper, he defined and studied the so-called strongly projective graphs . A graph H on at least three vertices is strongly projective, if for every connected graph W on at least two verticesand every s > , the only homomorphisms f : H s × W → H satisfying f ( x, . . . , x, y ) = x for all x ∈ V ( H ) and y ∈ V ( W ) , are projections. Note that this definition is very similar, but more restrictivethan the definition of truly projective graphs. Indeed, for truly projective graphs H we restricted thehomomorphisms from H s × W to H only for connected cores W , that are incomparable with H . Thus it isclear that every strongly projective graph is truly projective, and, as observed before, every truly projectivegraph is projective. Among other properties of strongly projective graphs, Larose [32, 33] shows that theirrecognition is decidable – note that this does not follow directly from the definition.Let us recall some results on strongly projective graphs, as they show that many natural graphs satisfythe assumptions of Theorem 21 and Corollary 25. We say that graph is square-free if it does not contain acopy of C as a (not necessarily induced) subgraph. Larose proved the following. Theorem 26 (Larose [32]). If H is a square-free, connected, non-bipartite core, then it is strongly projective. Example.
Consider the graph G B on 21 vertices, shown on Figure 4 (left), it is called the Brinkmanngraph [9]. It is connected, its chromatic number is 4 and its girth is 5. In particular, it is square-free. Thusby Theorem 26 we know that G B is strongly projective. By exhaustive computer search we verified that K × G B is a core. Let us consider the complexity of Hom ( K × G B ) for input graphs with n verticesand treewidth t . The straightforward dynamic programming approach from Theorem 13 results in therunning time O ∗ (63 t ) . However, Theorem 14 gives us a faster algorithm, whose running time is O ∗ (21 t ) .Moreover, by Corollary 25 we know that this algorithm is likely to be asymptotically optimal, i.e., there isno algorithm with running time O ∗ ((21 − ε ) t ) for any ε > and any constants c, d , unless the SETH fails.A graph is said to be primitive if there is no non-trivial partition of its vertices which is invariant underall automorphisms of this graph (see e.g. [47]). Theorem 27 (Larose [32]). If H is an indecomposable primitive core, then it is strongly projective. In particular, Theorem 27 implies that Kneser graphs are strongly projective [32]. Note that Knesergraphs might have 4-cycles, so this statement does not follow from Theorem 26.16igure 4: The Brinkmann graph (left) and the Chvátal graph (right).Interestingly, Larose [32, 33] proved that members of all known families of projective graphs are infact strongly projective (and thus of course truly projective). He also asked whether the same holds for allprojective graphs. We recall this problem in a weaker form, which would be sufficient in our setting.
Conjecture 2.
Every projective core is truly projective.
Clearly, if both Conjecture 1 and Conjecture 2 are true, there is another characterization of non-trivialindecomposable connected cores.
Observation 28.
Assume that Conjecture 1 and Conjecture 2 hold. Let H be a connected non-bipartite core.Then H is indecomposable if and only if it is truly projective. (cid:3) Note that Theorem 3, Corollary 25, and Observation 28 imply the following result.
Theorem 5.
Assume that Conjecture 1 and Conjecture 2 hold. Let H be a non-trivial connected core withprime factorization H × . . . × H m , and define k := max i ∈ [ m ] | H i | . Let n and t be, respectively, the numberof vertices and the treewidth of an instance graph G .(a) Even if H is given as an input, the Hom ( H ) problem can be solved in time O ( | H | + k t +1 · n ) , assuminga tree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > ,unless the SETH fails. We believe that the bounds from Theorem 5 are tight for all connected cores. Recall that in Lemma 15and Lemma 16 we showed that in order to prove tight bounds for the
Hom ( H ) problem, we can restrictourselves to connected cores H . Observe that combining these reductions with the result of Theorem 5,we obtain the following complexity bounds. Theorem 29.
Assume that Conjecture 1 and Conjecture 2 hold. Let H = H + . . . + H ℓ be a non-trivial coreand let H i, × . . . × H i,m i be the prime factorization of H i , for every i ∈ [ ℓ ] . Define k := max i ∈ [ ℓ ] ,j ∈ [ m i ] | H i,j | .Let n and t be, respectively, the number of vertices and the treewidth of an instance graph G .(a) Even if H is given as an input, the Hom ( H ) problem can be solved in time O ( | H | + n · k t +1 · | H | ) ,assuming a tree decomposition of G of width t is given.(b) Even if H is fixed, there is no algorithm solving the Hom ( H ) problem in time O ∗ (cid:0) ( k − ε ) t (cid:1) for any ε > ,unless the SETH fails. H = H × H is a connected, non-trivial core and H K ∗ , H K ∗ , then H and H must beincomparable cores. We believe it would be interesting to know if the opposite implication holds as well.To motivate the study on this problem, we state the following conjecture. Conjecture 3.
Let H and H be connected, indecomposable, incomparable cores. Then H × H is a core. Note that it is straightforward to verify that if H and H are ramified, then their direct product H × H is ramified as well. As every core is in a particular ramified, this is a necessary condition for Conjecture 3to hold.We confirmed the conjecture by exhaustive computer search for some small graphs. In particular, theconjecture is true for graphs K × H , where H is any 4-vertex-critical, triangle-free graph with at most 14vertices [8], the Grötzsch graph (see Figure 2), the Brinkmann graph (see Figure 4 (left)), or the Chvátalgraph (see Figure 4 (right)).Let us point out that the spirit of Conjecture 3 is similar to the spirit of the recently disproved Hedet-niemi’s conjecture [25, 44, 45, 48], which also asked how the properties of homomorphisms of factor graphsaffect the properties of homomorphisms of their product.
Acknowledgment.
The authors are grateful to D. Marx for introducing us to the problem, and to B.Larose, C. Tardif, B. Martin, and Mi. Pilipczuk for useful comments.
References [1] S. Arnborg, D. G. Corneil, and A. Proskurowski. Complexity of finding embeddings in a k -tree. SIAMJournal on Algebraic Discrete Methods , 8(2):277–284, Apr. 1987.[2] S. Arnborg and A. Proskurowski. Linear time algorithms for NP-hard problems restricted to partial k -trees. Discrete Applied Mathematics , 23(1):11–24, 1989.[3] U. Bertele and F. Brioschi.
Nonserial dynamic programming . Academic Press, 1972.[4] A. Björklund, T. Husfeldt, and M. Koivisto. Set partitioning via inclusion-exclusion.
SIAM J. Comput. ,39(2):546–563, 2009.[5] H. L. Bodlaender, P. Bonsma, and D. Lokshtanov. The fine details of fast dynamic programming overtree decompositions. In
International Symposium on Parameterized and Exact Computation , pages41–53. Springer, 2013.[6] H. L. Bodlaender, M. Cygan, S. Kratsch, and J. Nederlof. Deterministic single exponential time algo-rithms for connectivity problems parameterized by treewidth.
Inf. Comput. , 243:86–111, 2015.[7] H. L. Bodlaender and A. M. C. A. Koster. Combinatorial optimization on graphs of bounded treewidth.
Comput. J. , 51(3):255–269, 2008.[8] G. Brinkmann, K. Coolsaet, J. Goedgebeur, and H. Mélot. House of Graphs: A database of interestinggraphs.
Discrete Applied Mathematics , 161(1-2):311–314, 2013.[9] G. Brinkmann and M. Meringer. The smallest 4-regular 4-chromatic graphs with girth 5.
GraphTheory Notes of New York , 32:40–41, 1997. 1810] A. A. Bulatov. H -coloring dichotomy revisited. Theor. Comput. Sci. , 349(1):31–39, 2005.[11] B. Courcelle. The monadic second-order logic of graphs. I. Recognizable sets of finite graphs.
Inf.Comput. , 85(1):12–75, 1990.[12] M. Cygan, F. V. Fomin, A. Golovnev, A. S. Kulikov, I. Mihajlin, J. Pachocki, and A. Socała. Tight lowerbounds on graph embedding problems.
J. ACM , 64(3):18:1–18:22, 2017.[13] M. Cygan, F. V. Fomin, Ł. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh.
Parameterized algorithms . Springer, 2015.[14] W. Dörfler. Primfaktorzerlegung und Automorphismen des Kardinalproduktes von Graphen.
GlasnikMatematički , 9:15–27, 1974.[15] L. Egri, D. Marx, and P. Rzążewski. Finding list homomorphisms from bounded-treewidth graphsto reflexive graphs: a complete complexity characterization. In R. Niedermeier and B. Vallée, edi-tors, , volume 96 of
LIPIcs , pages 27:1–27:15. Schloss Dagstuhl - Leibniz-Zentrum fuerInformatik, 2018.[16] P. Erdős. Graph theory and probability.
Canadian Journal of Mathematics , 11:34–38, 1959.[17] T. Feder and P. Hell. List homomorphisms to reflexive graphs.
Journal of Combinatorial Theory, SeriesB , 72(2):236 – 250, 1998.[18] T. Feder, P. Hell, and J. Huang. List homomorphisms and circular arc graphs.
Combinatorica , 19(4):487–505, 1999.[19] T. Feder, P. Hell, and J. Huang. Bi-arc graphs and the complexity of list homomorphisms.
Journal ofGraph Theory , 42(1):61–80, 2003.[20] F. V. Fomin, P. Heggernes, and D. Kratsch. Exact algorithms for graph homomorphisms.
TheoryComput. Syst. , 41(2):381–393, 2007.[21] D. Greenwell and L. Lovász. Applications of product colouring.
Acta Mathematica Hungarica , 25(3-4):335–340, 1974.[22] R. Halin. S-functions for graphs.
Journal of Geometry , 8(1):171–186, Mar 1976.[23] R. Hammack, W. Imrich, and S. Klavžar.
Handbook of product graphs . CRC press, 2011.[24] R. H. Hammack and W. Imrich. On cartesian skeletons of graphs.
Ars Mathematica Contemporanea ,2(2):191–205, 2009.[25] S. T. Hedetniemi. Homomorphisms of graphs and automata. Technical report, 1966.[26] P. Hell and J. Nešetřil. On the complexity of H -coloring. J. Comb. Theory, Ser. B , 48(1):92–110, 1990.[27] P. Hell and J. Nešetřil. The core of a graph.
Discrete Mathematics , 109(1-3):117–126, 1992.[28] P. Hell and J. Nešetřil.
Graphs and homomorphisms . Oxford University Press, 2004.1929] R. Impagliazzo and R. Paturi. On the complexity of k -SAT. J. Comput. Syst. Sci. , 62(2):367–375, 2001.[30] R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential complexity?
J.Comput. Syst. Sci. , 63(4):512–530, 2001.[31] T. Kociumaka and M. Pilipczuk. Deleting vertices to graphs of bounded genus.
Algorithmica ,81(9):3655–3691, 2019.[32] B. Larose. Families of strongly projective graphs.
Discussiones Mathematicae Graph Theory , 22:271–292, 2002.[33] B. Larose. Strongly projective graphs.
Canadian Journal of Mathematics , 54(4):757–768, 2002.[34] B. Larose and C. Tardif. Strongly rigid graphs and projectivity.
Multiple-Valued Logic , 7:339–361, 2001.[35] D. Lokshtanov, D. Marx, and S. Saurabh. Lower bounds based on the Exponential Time Hypothesis.
Bulletin of the EATCS , 105:41–72, 2011.[36] D. Lokshtanov, D. Marx, and S. Saurabh. Known algorithms on graphs of bounded treewidth areprobably optimal.
ACM Trans. Algorithms , 14(2):13:1–13:30, 2018.[37] T. Łuczak and J. Nešetřil. Note on projective graphs.
Journal of Graph Theory , 47(2):81–86, 2004.[38] R. McKenzie. Cardinal multiplication of structures with a reflexive relation.
Fundamenta Mathemati-cae , 70(1):59–101, 1971.[39] D. J. Miller. The categorical product of graphs.
Canadian Journal of Mathematics , 20:1511–1521, 1968.[40] K. Okrasa and P. Rzążewski. Fine-grained complexity of graph homomorphism problem for bounded-treewidth graphs. In S. Chawla, editor,
Proceedings of the 2020 ACM-SIAM Symposium on DiscreteAlgorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020 , pages 1578–1590. SIAM, 2020.[41] M. Pilipczuk. Problems parameterized by treewidth tractable in single exponential time: A logicalapproach. In
MFCS 2011 , volume 6907, pages 520–531. Springer, 2011.[42] N. Robertson and P. D. Seymour. Graph minors. III. Planar tree-width.
J. Comb. Theory, Ser. B , 36(1):49–64, 1984.[43] P. Rzążewski. Exact algorithm for graph homomorphism and locally injective graph homomorphism.
Inf. Process. Lett. , 114(7):387–391, 2014.[44] N. Sauer. Hedetniemi’s conjecture—a survey.
Discrete Mathematics , 229(1-3):261–292, 2001.[45] Y. Shitov. Counterexamples to hedetniemi’s conjecture.
Annals of Mathematics , 190(2):663–667, 2019.[46] M. H. Siggers. A new proof of the H -coloring dichotomy. SIAM Journal on Discrete Mathematics ,23(4):2204–2210, 2010.[47] D. H. Smith. Primitive and imprimitive graphs.
The Quarterly Journal of Mathematics , 22(4):551–557,1971.[48] C. Tardif. Hedetniemi’s conjecture, 40 years later.
Graph Theory Notes NY , 54(46-57):2, 2008.2049] J. M. M. van Rooij, H. L. Bodlaender, and P. Rossmanith. Dynamic programming on tree decom-positions using generalised fast subset convolution. In A. Fiat and P. Sanders, editors,
Algorithms -ESA 2009, 17th Annual European Symposium, Copenhagen, Denmark, September 7-9, 2009. Proceedings ,volume 5757 of
Lecture Notes in Computer Science , pages 566–577. Springer, 2009.[50] M. Wahlström. New plain-exponential time classes for graph homomorphism.
Theory Comput. Syst. ,49(2):273–282, 2011.[51] P. M. Weichsel. The Kronecker product of graphs.