Counting Homomorphisms Modulo a Prime Number
CCounting Homomorphisms Modulo a PrimeNumber ∗ Amirhossein KazeminiaSimon Fraser [email protected] Andrei A. BulatovSimon Fraser [email protected]
Abstract
Counting problems in general and counting graph homomorphisms inparticular have numerous applications in combinatorics, computer science,statistical physics, and elsewhere. One of the most well studied problemsin this area is
GraphHom ( H ) — the problem of finding the number ofhomomorphisms from a given graph G to the graph H . Not only thecomplexity of this basic problem is known, but also of its many variantsfor digraphs, more general relational structures, graphs with weights, andothers. In this paper we consider a modification of GraphHom ( H ), the p GraphHom ( H ) problem, p a prime number: Given a graph G , findthe number of homomorphisms from G to H modulo p . In a series ofpapers Faben and Jerrum, and G¨obel et al. determined the complexity of GraphHom ( H ) in the case H (or, in fact, a certain graph derived from H )is square-free, that is, does not contain a 4-cycle. Also, G¨obel et al. foundthe complexity of p GraphHom ( H ) for an arbitrary prime p when H is atree. Here we extend the above result to show that the p GraphHom ( H )problem is p P-hard whenever the derived graph associated with H issquare-free and is not a star, which completely classifies the complexity of p GraphHom ( H ) for square-free graphs H . A homomorphism from a graph G to a graph H is an edge-preserving mappingfrom the vertex set of G to that of H . Graph homomorphisms provide a powerfulframework to model a wide range of combinatorial problems in computer science,as well as a number of phenomena in combinatorics and graph theory, suchas graph parameters [13, 14]. Two of the most natural problems related tograph homomorphisms is GraphHom ( H ): Given a graph G , decide whetherthere is a homomorphism from G to a fixed graph H , and its counting version GraphHom ( H ) of finding the number of such homomorphisms. Special casesof these problems include the k -Colouring and k -Colouring problems ( H is a ∗ This work was supported by an NSERC Discovery grant a r X i v : . [ c s . CC ] M a y -clique), Bipartiteness ( H is an edge), counting independent sets ( H is an edgewith a loop at one vertex) and many others.In general the GraphHom ( H ) and GraphHom ( H ) problems are NP-completeand H these problemsare significantly easier. Hell and Nesetril [12] were the first to address thisphenomenon in a systematic way. They proved that the GraphHom ( H ) problemis polynomial time solvable if and only if H has a loop or is bipartite, and GraphHom ( H ) is NP-complete otherwise. In the counting case a similar resultwas obtained by Dyer and Greenhill [4], in this case the GraphHom ( H ) problemis solvable in polynomial time if and only if H a complete graph with all loopspresent or a complete bipartite graph, otherwise the problem is GraphHom ( H ) problem we consider in this paperconcerns finding the number of homomorphisms modulo a natural number k . Thecorresponding problem will be denoted by k GraphHom ( H ). Although modularcounting has been considered by Valiant [17] in the context of holographicalgorithms, Faben and Jerrum [5] where the first who systematically consideredthe problem GraphHom ( H ). In particular, they posed a conjecture statingthat this problem is polynomial time solvable if and only if a certain graph H ∗ derived from H (to be defined later in this section) contains at most one vertex,and is complete in the class ⊕ P = P otherwise. Note that hardness results inthis area usually show completeness in a complexity class k P of counting thenumber of accepting paths in polynomial time nondeterministic Turing machinesmodulo k . The standard notion of reduction in this case is Turing reduction.Faben and Jerrum proved their conjecture in the case when H is a tree. Thisresult has been extended by G¨obel et al. first to the class of cactus graphs [8]and then to square-free graphs [9] (a graph is a square-free if it does not containa 4-cycle).In this paper we follow the lead of G¨obel et al. [10] and consider the problem p GraphHom ( H ) for a prime number p . We only consider loopless graphs withoutparallel edges. There are similarities with the (mod 2) case. In particular, thederived graph constructed in [5] can also be constructed following the sameprinciples, it is denoted H ∗ p , and it suffices to study p GraphHom ( H ) for thisgraph only. On the other hand, the problem is richer, as, for example, thepolynomial time solvable cases include complete bipartite graphs. G¨obel et al.[10] considered the case when H is a tree. Recall that a star is a completebipartite graph of the form K ,n . Stars are the only complete bipartite graphsthat are trees. The main result of [10] establishes that p GraphHom ( H ), H is atree, is polynomial time solvable if and only if H ∗ p is a star. We generalize thisresult to arbitrary square-free graphs. 2 heorem 1.1. Let H be a square-free graph and p a prime number. Then the p GraphHom ( H ) problem is solvable in polynomial time if and only if the graph H ∗ p is a star, and is p P-complete otherwise.
We now explain the main ideas behind our result, as well as, the majorityof results in this area. As it was observed by Faben and Jerrum [5], theautomorphism group
Aut ( H ) of graph H plays a very important role in solvingthe p GraphHom ( H ) problem. Let ϕ be a homomorphism from a graph G to H . Then composing ϕ with an element from Aut ( H ) we again obtain ahomomorphism from G to H . The set of all such homomorphisms forms theorbit of ϕ under the action of Aut ( H ). If Aut ( H ) contains an automorphism π of order p , the cardinality of the orbit of ϕ is divisible by p , unless π ◦ ϕ = ϕ ,that is, the range of ϕ is the set of fixed points Fix ( π ) of π ( a ∈ V ( H ) is a fixedpoint of π if π ( a ) = a ). Let H π denote the subgraph of H induced by Fix ( π ).We write H ⇒ p H (cid:48) if there is π ∈ Aut ( H ) such that H (cid:48) is isomorphic to H π . Wealso write H ⇒ ∗ p H (cid:48) if there are graphs H , . . . , H k such that H is isomorphicto H , H (cid:48) is isomorphic to H k , and H ⇒ p H ⇒ p · · · ⇒ p H k . Lemma 1.2 ([5]) . Let H be a graph and p a prime. Up to an isomorphismthere is a unique smallest (in terms of the number of vertices) graph H ∗ p suchthat H ⇒ ∗ p H ∗ p , and for any graph G it holds | Hom ( G, H ) | ≡ | Hom ( G, H ∗ p ) | (mod p ) . Moreover, H ∗ p does not have automorphisms of order p . The easiness part of Theorem 1.1 follows from the classification of the complex-ity of
GraphHom ( H ) by Dyer and Greenhill [4]. Since whenever GraphHom ( H )is polynomial time solvable, so is p GraphHom ( H ) for any p , Lemma 1.2 impliesthat if H ∗ p is a complete graph with all loops present or a complete bipartitegraph the problem p GraphHom ( H ) is also solvable in polynomial time. Werestrict ourselves to loopless square-free graphs, therefore, as H ∗ p is isomorphicto an induced subgraph of H , [4] only guarantees polynomial time solvabilitywhen H ∗ p is a star.Another ingredient in our result is the p P-hard problem we reduce to p GraphHom ( H ). In most of the cited works the hard problem used to prove thehardness of GraphHom ( H ) is the problem IS of finding the parity of thenumber of independent sets. This problem was shown to be P-complete byValiant [17]. We use a slightly different problem. For two positive real numbers λ , λ , let p BIS λ ,λ denote the following problem of counting weighted inde-pendent sets in bipartite graphs, where IS ( G ) denotes the set of all independentsets of G Name: p BIS λ ,λ Input: a bipartite graph G Output: Z λ ,λ ( G ) = (cid:80) I ∈IS ( G ) λ | V L ∩ I | λ | V R ∩ I | (mod p ).3t was shown by G¨obel et al. in [10] that p BIS λ ,λ is p P-complete for any λ , λ , unless one of them is equal to 0 (mod p ). The main technical statementwe prove here is the following Theorem 1.3.
Let H be a square-free graph such that H ∗ p is not a star. Thenthere are λ , λ (cid:54)≡ p ) such that p BIS λ ,λ is polynomial time reducibleto the p GraphHom ( H ) problem. We note that the requirement of being square-free is present in all results onmodular counting of graph homomorphism. Clearly, this is an artifact of thetechniques used in all these works, and so overcoming this requirement would bea substantial achievement.
We use [ n ] to denote the set { , ..., n } . Also, we usually abbreviate A \ { x } to A − x . Let k be a positive integer, then for a function f its k -fold compositionis denoted by f ( k ) = f ◦ f ◦ · · · ◦ f . Graphs.
In this paper, graphs are undirected, and have no parallel edgesor loops. For a graph G , the set of vertices of G is denoted by V ( G ), and theset of edges is denoted by E ( G ). We use uv to denote an edge of G . The set of neighbours of a vertex v ∈ V ( G ) is denoted by N G ( v ) = { u ∈ V ( G ) : uv ∈ E ( G ) } ,and the degree of v is denoted by deg ( v ).A set I ⊆ V ( G ) is an independent set of G if and only if uv is an edge of G for no u, v ∈ I . The set of all independent sets of G is denoted by IS ( G ). If G is a bipartite graph, the parts of a bipartition of V ( G ) will be denoted V R ( G )and V L ( G ) in no particular order. Homomorphisms. A homomorphism from a graph G to a graph H is amapping ϕ from V ( G ) to V ( H ) which preserves edges, i.e. for any uv ∈ E ( G ) thepair ϕ ( u ) ϕ ( v ) is an edge of H . The set of all homomorphisms from G to H , isdenoted by Hom ( G, H ). For a graph H the problem of counting homomorphismsfrom a graph G to H is denoted by GraphHom ( H ). The problem of findingthe number of homomorphisms from a given graph G to H modulo k is denotedby k GraphHom ( H ): Name: k GraphHom ( H ) Input: a graph G Output: | Hom ( G, H ) | (mod k ).It will be convenient to denote the vertices of the graph H by lowercaseGreek letters.A homomorphism ϕ from G to H is an isomorphism if it is bijective and forall u, v ∈ V ( G ), uv ∈ E ( G ) if and only if ϕ ( u ) ϕ ( v ) ∈ E ( H ). An automorphism of G is an isomorphism from graph G to itself. The automorphism group of G is denoted by Aut ( G ). An automorphism π is an automorphism of order k if k
4s the smallest positive integer such that π ( k ) is the identity transformation. A fixed point of an automorphism π of G is a vertex v ∈ V ( G ) such that v = π ( v ). Partially labelled graphs. A partial function from X to Y is a function f : X (cid:48) → Y for a subset X (cid:48) ⊆ X . For a graph H , a partial H -labelled graph G isa graph G (called the underlying graph of G ) equipped with a pinning function τ ,which is a partial function from V ( G ) to V ( H ). A homomorphism from a partial H -labelled graph G = ( G, τ ) to a graph H is a homomorphism σ : G → H thatextends the pinning function τ , that is, for all v ∈ dom( τ ), σ ( v ) = τ ( v ). The setof all such homomorphisms is denoted by Hom ( G , H ).In certain situations it will be convenient to use a slightly different viewon collections of homomorphisms of H -labelled graphs. A set of homomor-phisms ϕ from a graph G to H that map vertices x , x , ..., x r ∈ V ( G ) tovertices y , y , ..., y r ∈ V ( H ) such that ϕ ( x i ) = y i for i ∈ [ r ] is denoted by Hom (( G, x , x , ..., x r ) , ( H, y , y , ..., y r )) . Counting complexity classes.
The class A ∈ NP, an associated counting problem will be denotedby A . (Strictly speaking for every such problem the corresponding countingone is not uniquely defined, but in our case there will always be the ‘natural’one.) Classes k P, where k is a natural number are defined in a similar way,as counting the accepting paths in a polynomial time nondeterministic Turingmachine modulo k . For A ∈ NP the corresponding problem in k P is denotedby k A .Several kinds of reductions between counting problems have appeared inthe literature. The first one, parsimonious, was introduced in the foundationalpapers [15, 16] by Valiant. A counting problem A is parsimoniously reducible toa counting problem B , denoted A ≤ B , if there is a polynomial time algorithmthat, given an instance I of A , produces an instance J of B such that theanswers to I and J are the same. The other type of reduction frequently used forcounting problems is Turing reduction. Counting problem A is Turing reducible to problem B , denoted A ≤ T B , if there exists a polynomial time algorithmsolving A and using B as an oracle.These two types of reductions can be applied to modular counting as well.Turing reduction does not require any modifications. For parsimonious reductionwe say that a problem A from k P is parsimoniously reducible to a problem B from k P if there is a polynomial time algorithm that, given an instance I of A , produces an instance J of B such that the answers to I and J arecongruent modulo k . In this paper we mostly claim Turing reducibility, althoughour main technical result constructs a parsimonious reduction. However, theproof of Theorem 1.1 involves other reductions that are not always parsimonious.Problem k A is said to be k P -complete if it belongs to k P and every problemfrom k P is Turing reducible to k A . 5 Outline of the proof
In this section we outline our proof strategy and formally introduce all thenecessary intermediate problems and existing results. Fix a prime number p .As it was observed in the introduction, Lemma 1.2 proved by Faben andJerrum [5] combined with the classification by Dyer and Greenhill [4] proves theeasiness part of Theorem 1.1. We therefore focus on proving the hardness part.Again, by Lemma 1.2 we may assume that H does not have automorphisms oforder p .For the hardness part, we use two auxiliary problems. The first one is theproblem p BIS λ ,λ mentioned in the introduction. Let λ , λ ∈ { , . . . p − } ,and let G = ( V L ∪ V R , E ) be a bipartite graph. Define the following weightedsum over independent sets of G : Z λ ,λ ( G ) = (cid:88) I ∈IS ( G ) λ | V L ∩ I | λ | V R ∩ I | . The problem of computing function Z λ ,λ ( G ) for a given bipartite graph G ,prime number p and λ , λ ∈ { , . . . p − } , is defined as follows: Name: p BIS λ ,λ Input: a bipartite graph G Output: Z λ ,λ ( G ) (mod p ).The complexity of p BIS λ ,λ was determined by G¨obel, Lagodzinski andSeidel [10]. Theorem 3.1. [10] If λ ≡ p ) or λ ≡ p ) then the problem p BIS λ ,λ is solvable in polynomial time, otherwise it is p P -complete. The second auxiliary problem has been used in all works on p GraphHom ( H )starting from the initial paper by Faben and Jerrum [5]. It is the problem ofcounting homomorphisms from a given partially H -labelled graph G to a fixedgraph H modulo prime p . Name: p PartHom ( H ) Input: a partial H -labelled graph G = ( G, τ ) Output: | Hom ( G , H ) | (mod p ).The chain of reductions we use to prove the hardness part of Theorem 1.1 isthe following: p BIS λ ,λ ≤ T p PartHom ( H ∗ p ) ≤ T p GraphHom ( H ∗ p ) ≤ T p GraphHom ( H ) . (1)The last reduction is by Lemma 1.2. Acually, the two last problems in thechain are polynomial time interreducible through (modular) parsimonious reduc-tion. The second step, the reduction from p PartHom ( H ) to p GraphHom ( H )was proved by G¨obel, Lagodzinski and Seidel [10].6 heorem 3.2. [10] Let p be a prime number and let H be a graph that doesnot have any automorphism of order p . Then p PartHom ( H ) can be reduced to p GraphHom ( H ) through a polynomial time Turing reduction. Finally, the first reduction in the chain is our main contribution. We show itin three steps. Recall that we are reducing the problem of finding the numberof (weighted) independent sets in a bipartite graph to the problem of findingthe number of extensions of a partial homomorphism from a given graph to H . First, in Section 4 starting from a bipartite graph G we replace its verticesand edges with gadgets, whose exact structure we do not specify at that point.We call those gadget the vertex and edge gadgets. Then we show that if thevertex and edge gadgets satisfy certain conditions, in terms of the number ofhomomorphisms of a certain kind from the gadgets to H (Theorem 4.2), then Z λ ,λ ( G ) (mod p ) can be found in polynomial time from | Hom ( G , H ) | (mod p ),where G is the partially H -labelled graph constructed in the reduction. In thesecond step, Section 5, we introduce several variants of vertex and edge gadgetsand show some of their properties. Finally, in Section 6 we consider severalcases depending on the degree sequence of the graph H . In every case weconstruct vertex and edge gadgets that satisfy the conditions of Theorem 4.2,thus completing the reduction. Our goal in this section is to describe a general scheme of a reduction from p BIS λ ,λ to p PartHom ( H ), where p is prime and H is a square-free graph.The general idea is, given a bipartite graph G = ( V L ∪ V R , E ), where V L , V R is the bipartition of G , to construct a new partially H -labelled graph G (cid:48) , which isobtained from G by adding a copy of a vertex gadget J to every vertex of G , andreplacing every edge from E with a copy of an edge gadget K . The gadgets arepartially H -labelled graphs and their pinning functions will define the pinningfunction of G (cid:48) . Since G is a bipartite graph, the vertex gadget comes in twoversions, left, J L , and right, J R . Also, both vertex gadgets have a distinguishedvertex, s for J L and t for J R . The edge gadget K has two distinguished vertices, s and t . These distinguished vertices will be identified with the vertices of theoriginal graph G , as shown in Fig. 1.The gadgets J L , J R are associated with sets ∆ , ∆ ⊆ V ( H ) and vertices δ ∈ ∆ , δ ∈ ∆ , respectively. The pinning functions of J L , J R will be defined insuch a way that for any homomorphism ϕ of J L ( J R ) to H , vertex s (respectively, t ) is forced to be mapped to ∆ (respectively, ∆ ). For x ∈ V L let J L ( x ) denotethe copy of J L connected to x , that is, s in J L ( x ) is identified with x . For y ∈ V R the copy J R ( y ) is defined in the same way. The vertices δ , δ will helpto encode independent sets of G . Specifically, with every independent set I of G we will associate a set of homomorphisms ϕ : G (cid:48) → H such that for everyvertex x ∈ V L , x ∈ I if and only if ϕ ( x ) (cid:54) = δ (recall that x is also a vertex of G (cid:48) identified with s in J L ( x )); and similarly, for every y ∈ V R , y ∈ I if and only if ϕ ( y ) (cid:54) = δ . Finally, the edge gadgets K ( x, y ) replacing every edge xy ∈ E make7igure 1: The structure of graph G (cid:48) . The original graph G is on the left. Theresulting graph G (cid:48) is on the right: vertex gadgets J L , J R are added to everyvertex, and the only edge vx of G is replaced with a copy of gadget K .sure that every homomorphism from G (cid:48) to H is associated with an independentset.Note that just an association of independent sets with collections of homo-morphisms is not enough, the number of homomorphisms in those collectionshave to allow one to compute the function Z λ ,λ ( G ).Next we introduce conditions such that if for the graph H there are vertexand edge gadgets satisfying these conditions, then p BIS λ ,λ for some nonzero(modulo p ) λ , λ is reducible to p PartHom ( H ). Definition 4.1 (Hardness gadget) . A graph H has hardness gadgets if thereare ∆ , ∆ ⊆ V ( H ) , vertices δ ∈ ∆ and δ ∈ ∆ , and three partially H -labelledgraphs J L , J R , and K that satisfy the following properties:(i) | ∆ | − (cid:54)≡ p ) , | ∆ | − (cid:54)≡ p ) ;(ii) for any homomorphism σ : J L → H ( σ : J R → H ) it holds that σ ( s ) ∈ ∆ (respectively, σ ( t ) ∈ ∆ ); for any homomorphism σ : K → H it holds that σ ( s ) ∈ ∆ , σ ( t ) ∈ ∆ ;(iii) for any γ ∈ ∆ , γ ∈ ∆ , it holds | Hom (( J L , s ) , ( H, γ )) | ≡ | Hom (( J R , t ) , ( H, γ )) | ≡ p ) , and for any γ (cid:54)∈ ∆ , γ (cid:54)∈ ∆ , it holds Hom (( J L , s ) , ( H, γ )) = Hom (( J L , s ) , ( H, γ )) = ∅ ; (iv) for any α ∈ ∆ − δ , α ∈ ∆ − δ , it holds Hom (( K , s, t ) , ( H, α , α )) = ∅ ;(v) for any α ∈ ∆ − δ , it holds | Hom (( K , s, t ) , ( H, α , δ )) | ≡ p ) ;(vi) for any α ∈ ∆ − δ , it holds | Hom (( K , s, t ) , ( H, δ , α )) | ≡ p ) ;(vii) | Hom (( K , s, t ) , ( H, δ , δ )) | ≡ p ) . Theorem 4.2. If H has hardness gadgets, then for some λ , λ (cid:54)≡ p ) the problem p BIS λ ,λ is polynomial time reducible to p PartHom ( H ) . Inparticular, p PartHom ( H ) is p P-complete.Proof.
Let J L , J R , K be the collection of gadgets whose existence is the assump-tion of the theorem. Let also ∆ , ∆ ⊆ V ( H ) and δ ∈ ∆ , δ ∈ ∆ be sets andelements associated with the gadgets. Recall that we assume the existence ofdistinguished elements s, t in the gadgets. Let G = ( V L ∪ V R , E ) be a bipartitegraph. We give a detailed construction of a partially H -labelled graph G (cid:48) , seealso Fig. 1. • The vertex set of G (cid:48) consists of a disjoint copy of J L ( x ) for each x ∈ V L ,a disjoint copy of J R ( y ) for each y ∈ V R ; distinguished vertices s, t ofthe gadgets are identified with x and y , respectively. Also, the vertexset includes a disjoint copy of K ( x, y ) for each edge xy ∈ E . Again thedistinguished vertices s, t of K ( x, y ) are identified with x and y , respectively.More formally, V ( G (cid:48) ) = (cid:16) (cid:91) x ∈ V L V ( J L ( x )) (cid:17) ∪ (cid:16) (cid:91) y ∈ V R V ( J R ( y )) (cid:17) ∪ (cid:16) (cid:91) xy ∈ E V ( K ( x, y )) (cid:17) . • The edge set of G (cid:48) consists of a disjoint copy of the edge set of J L ( x ) foreach x ∈ V L , a disjoint copy of the edge set of J R ( y ) for each y ∈ V R , anda disjoint copy of K ( x, y ) for each edge xy ∈ E . More formally, E ( G (cid:48) ) = (cid:16) (cid:91) x ∈ V L E ( J L ( x )) (cid:17) ∪ (cid:16) (cid:91) y ∈ V R E ( J R ( y )) (cid:17) ∪ (cid:16) (cid:91) xy ∈ E E ( K ( x, y )) (cid:17) . • The pinning function τ of G (cid:48) is defined to be the union of the pinningfunctions of all the gadgets involved: function τ x , x ∈ V L , for J L ( x ),function τ y , y ∈ V R , for J R ( y ), and function τ xy , xy ∈ E , for K ( x, y ).More formally, τ = (cid:16) (cid:91) x ∈ V L τ x (cid:17) ∪ (cid:16) (cid:91) y ∈ V R τ y (cid:17) ∪ (cid:16) (cid:91) xy ∈ E τ xy (cid:17) . Let us set λ = | ∆ | − , λ = | ∆ | −
1. We now proceed to showing that Z λ ,λ ( G ) ≡ | Hom ( G (cid:48) , H ) | (mod p ). First, we show that every homomorphismcorresponds to an independent set.For each σ ∈ Hom ( G (cid:48) , H ), define χ σ = { x ∈ V L : σ ( x ) (cid:54) = δ } ∪ { y ∈ V R : σ ( y ) (cid:54) = δ } . We claim that χ σ is an independent set. Indeed, assume that for some σ ∈ Hom ( G (cid:48) , H ) the set χ σ is not an independent set in G , i.e. there are two vertices9 , b ∈ χ σ such that ab ∈ E ( G ). Without loss of generality, let a ∈ V L and b ∈ V R .By the construction of χ σ , σ ( a ) (cid:54) = δ and σ ( b ) (cid:54) = δ , by Definition 4.1(ii) wehave σ ( a ) ∈ ∆ − δ and σ ( b ) ∈ ∆ − δ . Then by Definition 4.1(iv) the set Hom ( K ( a, b ) , a, b ) , ( H, α , α )) is empty, that is σ is not a homomorphism. Acontradiction.Let ∼ χ be a relation on Hom ( G (cid:48) , H ) given by σ ∼ χ σ (cid:48) if and only if χ σ = χ σ (cid:48) .Obviously ∼ χ is an equivalence relation on Hom ( G (cid:48) , H ). We denote the class of Hom ( G (cid:48) , H ) / ∼ χ containing σ by [ σ ]. Clearly, the ∼ χ -classes correspond toindependent sets of G . We will need the corresponding mapping F : Hom ( G (cid:48) , H ) / ∼ χ −→ IS ( G ) , where F ([ σ ]) = χ σ First, we will prove that F is bijective, then compute the cardinalities ofclasses [ σ ]. Claim 1.
The function F is bijective. Proof of Claim 1.
By the definition of F , it is injective. To show surjectivitylet I ∈ IS ( G ) be an independent set. We construct a homomorphism σ ∈ Hom ( G (cid:48) , H ) such that χ σ = I :For every vertex x ∈ I ∩ V L , pick a vertex γ xI ∈ ∆ − δ and set σ ( x ) = γ xI .For every vertex y ∈ N G ( x ), set σ ( y ) = δ . For every vertex x (cid:48) ∈ V L \ I set σ ( x (cid:48) ) = δ . For every vertex y ∈ I ∩ V R , pick a vertex ω yI ∈ ∆ − δ and set σ ( y ) = ω yI . Note that in this case the value of σ ( y ) is not yet set, because y ∈ N G ( x ) for no x ∈ I . Finally, for every vertex y (cid:48) ∈ V R \ I set σ ( y (cid:48) ) = δ .As I is an independent set, for any v ∈ I and u ∈ N G ( v ) we have u (cid:54)∈ I . Byconstruction of σ , if xy ∈ E ( G ) and σ ( x ) = γ xI then σ ( y ) = δ . Similarly, if σ ( y ) = ω yI then x ∈ N G ( y ), and so σ ( x ) = δ . If none of the endpoints of an edge xy belongs to I then σ ( x ) = δ and σ ( y ) = δ . By Definition 4.1(iv),(v) and (vii) σ can be extended to a homomorphism from G (cid:48) to H . Hence F is surjective. Claim 2. | [ σ ] | ≡ ( | ∆ | − | V L ∩ χ σ | ( | ∆ | − | V R ∩ χ σ | (mod p ). Proof of Claim 2.
Is suffices to count the number of homomorphisms σ (cid:48) ∈ [ σ ].Since χ σ (cid:48) = χ σ , for every x (cid:54)∈ I the value σ (cid:48) ( x ) equals δ or δ depending onwhether x ∈ V L or x ∈ V R . As we have shown in Claim 1, for every vertex x ∈ I ∩ V L , σ (cid:48) ( x ) ∈ ∆ − δ , so there are | ∆ | − σ (cid:48) ( x ). Similarly,there are | ∆ | − σ (cid:48) ( y ) for every y ∈ I ∩ V R . Therefore | [ σ ] | = ( | ∆ | − | V L ∩ χ σ | ( | ∆ | − | V R ∩ χ σ | (cid:16) (cid:89) x ∈ V L | Hom ( J L ( x ) , x ) , ( H, σ (cid:48) ( x )) | (cid:17) × (cid:16) (cid:89) y ∈ V R | Hom ( J R ( y ) , y ) , ( H, σ (cid:48) ( y )) | (cid:17) × (cid:16) (cid:89) xy ∈ E | Hom ( K ( x, y ) , x, y ) , ( H, σ (cid:48) ( x ) , σ (cid:48) ( y )) | (cid:17) ≡ ( | ∆ | − | V L ∩ χ σ | ( | ∆ | − | V R ∩ χ σ | (mod p ) . Where the second equality is by Definition 4.1(iii), (v), (vi), (vii).10ssume that ∼ χ has M classes and σ i is a representative of the i -th class.Then | Hom ( G (cid:48) , H ) | = M (cid:88) i =1 | [ σ i ] |≡ M (cid:88) i =1 ( | ∆ | − | V L ∩ χ σi | ( | ∆ | − | V R ∩ χ σi | ≡ (cid:88) I ∈IS ( G ) ( | ∆ | − | V L ∩ I | ( | ∆ | − | V R ∩ I | ≡ Z | ∆ |− , | ∆ |− ( G ) (mod p ) . Therefore p BIS λ ,λ ≤ T p PartHom ( H ). By Definition 4.1(i) λ = | ∆ | − , λ = | ∆ | − (cid:54)≡ p ). As p BIS λ ,λ is p P-complete by Theorem 3.1,so is p PartHom ( H ). In this section we make the next iteration in constructing hardness gadgets andgive a generic structure of such gadgets that will later be adapted to specifictypes of the graph H .These gadgets make use of the square-freeness of graph H that we will applyin the following form. Lemma 5.1.
Let H be a square-free graph. Then for any α, β ∈ H , | N H ( α ) ∩ N H ( β ) | ≤ .Proof. If there are two different elements γ, δ in N H ( α ) ∩ N H ( β ), then α, γ, β, δ form a 4-cycle.We call a walk in H a non-consecutive-walk or nc-walk , if it does not traversean edge forth and them immediately back. More formally, an nc-walk is a walk v , v , . . . , v k such that for no i ∈ [ k −
1] we have v i − = v i +1 . Let W = γ γ · · · γ k be an nc-walk in H of length at least one. Then the edgegadget K is a path sv v · · · v k − t , where each v i is connected to another vertex u i which is pinned to γ i . More formally, the gadget K = ( K, τ ) is defined asfollows V ( K ) = { s, t } ∪ { v i , u i : i ∈ [ k − } ,E ( K ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k − } ∪ { sv , v k − t } . The pinning function is τ ( u i ) = γ i for all i ∈ [ k − emma 5.2 ( Shifting ) . Let H , W = γ γ · · · γ k , and K be as above. Then(1) For every θ ∈ N H ( γ ) − γ and σ ∈ Hom (( K , s ) , ( H, θ )) , we have σ ( v i ) = γ i − for all i ∈ [ k − .(2) For every θ ∈ N H ( γ k ) − γ k − and σ ∈ Hom (( K , t ) , ( H, θ )) , we have σ ( v i ) = γ i +1 for all i ∈ [ k − .Proof. If k = 1, then both cases are trivial. We prove item (1) by induction on j ∈ [ k − γ k γ k − · · · γ instead of γ γ · · · γ k .For j = 1, the vertex v must be mapped to a common neighbour of θ and γ because τ ( u ) = γ . It means σ ( v ) ∈ N H ( θ ) ∩ N H ( γ ) = { γ } , because γ ∈ N H ( θ ) ∩ N H ( γ ) and H is a square-free graph.Now assume that σ ( v j − ) = γ j − . Similar to the base case, σ ( v j ) ∈ N H ( γ j − ) ∩ N H ( γ j ). By the same argument, the only member of this intersectionis γ j − . Thus, σ ( v j ) = γ j − . Lemma 5.3 ( Counting ) . Let H be a square-free graph and let W = γ γ · · · γ k , k ≥ be an nc-walk in H . For any α s ∈ N H ( γ ) − γ and α t ∈ N H ( γ k ) − γ k − the following equalities hold(1) | Hom (( K , s, t ) , ( H, α s , α t )) | = 0 ,(2) | Hom (( K , s, t ) , ( H, γ , α t )) | = 1 ,(3) | Hom (( K , s, t ) , ( H, α s , γ k − )) | = 1 ,(4) | Hom (( K , s, t ) , ( H, γ , γ k − )) | = 1 + k − (cid:88) i =1 ( deg ( γ i ) − .Proof. For item (1), suppose towards contradiction that there is σ ∈ Hom (( K , s, t ) , ( H, α s , α t )). Then it implies σ ∈ Hom (( K , s ) , ( H, α s )). There-fore by Lemma 5.2 σ ( v i ) = γ i − for all i ∈ [ k − σ ∈ Hom (( K , t ) , ( H, α t )). Hence by Lemma 5.2 σ ( v i ) = γ i +1 for all i ∈ [ k − σ ∈ Hom (( K , s, t ) , ( H, γ , α t )). Then σ ∈ Hom (( K , t ) , ( H, α t )),and by Lemma 5.2 all the values of σ are uniquely determined, that is, there isonly one such σ . So | Hom (( K , s, t ) , ( H, γ , α t )) | = 1. The symmetric argumentworks for item (3).For item (4), note that there is a homomorphism σ ∈ Hom (( K , s, t ) , ( H, γ , γ k − ))such that σ ( v j ) = γ j +1 for all j ∈ [ k − σ ∈ Hom (( K , s, t ) , ( H, γ , γ k − )) is such that σ (cid:54) = σ , i.e. for some j ∈ [ k − σ ( v j ) (cid:54) = γ j +1 . Let j be the smallest such j . Then for every i > j , σ ( v i ) = γ i − is determined uniquely by Lemma 5.2 applied to thewalk γ j , . . . γ k − t and path v j , . . . , v k . Also we assumed, for all i < j , that σ ( v i ) = γ i +1 . The remaining case is i = j , in which the image of σ ( v j ) can be12hosen from N H ( γ j ) − γ j +1 . Thus, there are deg ( γ j ) − σ such that σ ( v j ) (cid:54) = γ j +1 is deg ( γ j ) −
1. Finally, | Hom (( K , s, t ) , ( H, γ , γ k − )) | = 1 + k − (cid:88) i =1 ( deg ( γ i ) − . In this section we construct a vertex gadget. The main role of these gadgets isto restrict the possible images of the designated vertices s and t as required inDefinition 4.1(ii), and then do it in such a way that property (iii) in Definition 4.1is also satisfied. We present vertex gadgets of two types.For the graph H and vertices α, β ∈ V ( H ), we define gadgets J L = ( J L , τ L )and J R = ( J R , τ R ) as follows: Graphs J L , J R are just edges sx and ty , respec-tively. The pinning functions are given by τ L ( x ) = α , τ R ( y ) = β .The next lemma follows straightforwardly from the definitions and guaranteesthat these gadgets satisfy items (ii) and (iii) of Definition 4.1 (note that (1) is adirect implication of (3)). Lemma 5.4.
For graph H , vertices α, β ∈ V ( H ) , and ∆ = N H ( α ) , ∆ = N H ( β ) the following hold(1) if σ ∈ Hom ( J L , H ) then σ ( s ) ∈ ∆ , and if σ ∈ Hom ( J R , H ) then σ ( t ) ∈ ∆ ,(2) for any γ ∈ ∆ and γ ∈ ∆ , it holds that | Hom (( J L , s ) , ( H, γ )) | = | Hom (( J R , t ) , ( H, γ )) | = 1 ,(3) for any γ (cid:48) (cid:54)∈ ∆ and γ (cid:48) (cid:54)∈ ∆ , it holds that Hom (( J L , s ) , ( H, γ (cid:48) )) = Hom (( J R , t ) , ( H, γ (cid:48) )) = ∅ . The other type of a vertex gadget uses a cycle in H .Let C = θγ γ · · · γ k θ be a cycle in H of length at least three. Gadgets J CL = ( J CL , τ CL ) and J CR = ( J CR , τ CR ) are defined as follows, see Fig. 2, V ( J CL ) = { s } ∪ { v i , u i : i ∈ [ k ] } ∪ { x } ,E ( J CL ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k ] } ∪ { sv , v k s, sx } . The pinning function is given by τ ( u i ) = γ i for all i ∈ [ k ] and τ ( x ) = θ .The gadget J CR is defined in the same way, except s is replaced with t . Lemma 5.5.
For a square-free graph H , a cycle C = θγ γ · · · γ k θ in H oflength at least three, and ∆ = { γ , γ k } the following hold(1) if σ ∈ Hom ( J CL , H ) or σ ∈ Hom ( J CR , H ) , then σ ( s ) ∈ { γ , γ k } and σ ( t ) ∈ { γ , γ k } , respectively; J CL based on the cycle C = θγ γ · · · γ k θ . Theedges of the gadget are shown by dash-dot lines, and the pinning function bydashed lines. (2) for any γ ∈ ∆ , | Hom (( J CL , s ) , ( H, γ )) | = | Hom (( J CR , t ) , ( H, γ )) | = 1 , (3) for any γ (cid:48) (cid:54)∈ ∆ Hom (( J CL , s ) , ( H, γ (cid:48) )) =
Hom (( J CR , t ) , ( H, γ (cid:48) )) = ∅ . Proof.
For item (1) the cycle C is an nc-walk, therefore Lemma 5.2 can be applied.Clearly, σ ( v ) ∈ N H ( θ ) for any homomorphism σ ∈ Hom ( J CL , H ). Suppose thatthere exists σ ∈ Hom ( J CL , H ) such that σ ( s ) = α ∈ N H ( θ ) \ { γ , γ k } . Then σ ∈ Hom (( J CL , s ) , ( H, α )), hence by Lemma 5.2 σ ( v i ) = γ i − for all i ∈ [ k ].Also, in a similar way σ ( v i ) = γ i +1 for all i ∈ [ k ], a contradiction.A proof for J CR is analogous.For item (2) without loss of generality assume that σ ∈ Hom (( J CL , s ) , ( H, γ )),or in other words σ ( s ) = γ . Since C is an nc-walk by Lemma 5.2 it holds σ ( v i ) = γ i +1 for all i ∈ [ k ], we just need to set γ k +1 = θ . Therefore σ isdetermined uniquely. The same argument works if σ ∈ Hom (( J CL , s ) , ( H, γ k )),and for J CR .Item (3) follows straightforwardly by Lemma 5.5(1). p PartHom ( H ) In this section we prove the hardness part of Theorem 1.1. More specificallywe will apply Theorem 4.2 and the constructions from Section 5 to show that p BIS λ ,λ is Turing reducible to p PartHom ( H ).We consider three cases depending on the existence of vertices of certaindegree in H . In each of the three cases we use slightly different variations ofvertex and edge gadgets. 14 ase 1. The graph H has at least two vertices α and β such that deg ( α ) , deg ( β ) (cid:54)≡ p ).Let S = { γ ∈ V ( H ) : deg ( γ ) (cid:54)≡ p } ; we know that S contains at leasttwo elements. Pick α, β ∈ S such that the distance between them is minimal.Let W = αγ · · · γ k − γ k β be a shortest path between α, β . By the choice of W , deg ( γ i ) ≡ p ) for all i ∈ [ k ].We make an edge gadget K = ( K, τ ) for this case based on this path asdefined in Section 5.1. More precisely, V ( K ) = { s, t } ∪ { v i , u i : i ∈ [ k ] } ,E ( K ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k ] } ∪ { sv , v k t } . The pinning function is given by τ ( u i ) = γ i for all i ∈ [ k ].Any path is a nc-walk, so we can apply Lemma 5.3 to W . For the gadgetswe use ∆ = N H ( α ) , ∆ = N H ( β ) and δ = γ , δ = γ k . This satisfies property(i) of hardness gadgets, because deg ( α ) , deg ( β ) (cid:54)≡ p ). Then for any α s ∈ ∆ − δ and α t ∈ ∆ − δ we have(1) | Hom (( K , s, t ) , ( H, α s , α t )) | = 0;(2) | Hom (( K , s, t ) , ( H, γ , α t )) | ≡ p );(3) | Hom (( K , s, t ) , ( H, α s , γ k )) | ≡ p )Also, for any i ∈ [ k ] we have deg ( γ i ) ≡ p ), and so | Hom (( K , s, t ) , ( H, γ , γ k )) | = 1 + k (cid:88) i =1 ( deg ( γ i ) −
1) = 1 + 0 ≡ p ) . Hence,(4) | Hom (( K , s, t ) , ( H, γ , γ k )) | ≡ p ).Thus K satisfies properties (iv), (v), (vi), and (vii) of hardness gadgets.For a vertex gadget we use the first type, that is J L , J R are just edges sx and ty , respectively, see Fig. 3. By Lemma 5.4 these gadgets satisfy properties(ii) and (iii) of hardness gadgets.Thus Theorem 4.2 yields a required reduction.15igure 3: Vertex and edge gadgets based on the path W = αγ · · · γ k β . Thevertex gadgets J L and J R are shown as dot-dashed boxes. The pinning functionis shown by dashed lines. Case 2.
Graph H has exactly one vertex θ such that deg ( θ ) (cid:54)≡ p ).In this case we further split into two subcases. However, before we proceedwith that we rule out the case of trees. Lemma 6.1.
Let H be a tree that has no automorphism of order p and is nota star. Then H has at least two vertices α and β such that deg ( α ) , deg ( β ) (cid:54)≡ p ) .Proof. Let P = v v · · · v l − v l be a maximal path in H , l is the length of P .Since H is not a star, l > v , v l must be leaves, because otherwise deg ( v ) > deg ( v l ) > P can be extended in at least one direction.Next, we show that deg ( v ) , deg ( v l − ) (cid:54)≡ p ). Indeed, if deg ( v ) ≡ p ), then deg ( v ) > p because v is not a leaf itself. Therefore N H ( v ) − v = { w , w , · · · , w kp − } for some k > L = { w , . . . , w p − } and define σ to be the mapping from H to itself given by σ ( w ) = (cid:40) w if w ∈ V ( H ) \ Lw i +1 (mod p ) if w = w i such that w i ∈ L. Then, as is easily seen, σ is an automorphism of H of order p . Indeed, for anyedge xy ∈ E ( H ), if x, y (cid:54)∈ L , then σ ( x ) σ ( y ) = xy ∈ E ( H ); if x = w i ∈ L , then y = v , thus σ ( w i ) σ ( v ) = w i +1(mod p ) v ∈ E ( H ); finally, both x and y cannotbelong to L . It is a contradiction with the assumptions on H . Hence, the degreesof v and v l − are not equal to 1 (mod p ).Thus, we may assume that H is not a tree. Case 2.1.
The vertex θ , deg ( θ ) (cid:54)≡ p ), is on a cycle C .In this case the edge gadget is based on the cycle C . More precisely, let C = θγ γ · · · γ k θ be a cycle in H of length at least 3 and such that for all i ∈ [ k ]it holds that deg ( v i ) ≡ p ) and deg ( θ ) (cid:54)≡ p ). We define gadget16 = ( K, τ ) as follows:– V ( K ) = { s, t } ∪ { v i , u i : i ∈ [ k ] } ;– E ( K ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k ] } ∪ { sv , v k t } ;– the labeling function is given by τ ( u i ) = γ i for all i ∈ [ k ].Set ∆ = ∆ = N H ( θ ) and δ = γ , δ = γ k . These parameters satisfyproperty (i) of a hardness gadget, because deg ( θ ) (cid:54)≡ p ). A cycle is annc-walk, so we can apply Lemma 5.3 to obtain the following Lemma 6.2.
Let H be a square-free graph and K an edge gadget based on thecycle C = θγ γ · · · γ k θ in H . For any α s ∈ ∆ − δ and α t ∈ ∆ − δ ,(1) | Hom (( K , s, t ) , ( H, α s , α t )) | = 0 ;(2) | Hom (( K , s, t ) , ( H, δ , α t )) | ≡ p ) ;(3) | Hom (( K , s, t ) , ( H, α s , δ )) | ≡ p ) ;(4) | Hom (( K , s, t ) , ( H, δ , δ )) | ≡ p ) .Proof. The cycle C is an nc-walk. Therefore by Lemma 5.3 items (1), (2), and(3) hold. For item (4) note that deg ( γ i ) ≡ p ) for all i ∈ [ k ], therefore | Hom (( K , s, t ) , ( H, γ , γ k )) | = 1 + k (cid:88) i =1 ( deg ( γ i ) −
1) = 1 + 0 ≡ p ) . By Lemma 6.2 gadget K satisfies properties (iv), (v), (vi), and (vii) ofhardness gadgets.For vertex gadgets we take J L , J R (which are just edges) defined in Section 5.2,with α = β = θ , see Fig 4. By Lemma 5.4, these gadgets satisfy properties (ii)and (iii) of hardness gadgets.Finally, by Theorem 4.2 p BIS λ ,λ is Turing reducible to p PartHom ( H ). Case 2.2.
The vertex θ is not on any cycle.Since H is not a tree, it contains at least one cycle; let C be such a cycle.Let P = γ γ k +1 γ k +2 · · · γ k + k (cid:48) θ be a shortest path from a vertex γ on cycle C = γ γ γ · · · γ k γ , k ≥
2, to θ . Note that deg ( γ i ) ≡ p ) for all γ i , i ∈ { , . . . , k + k (cid:48) } . Edge gadget K in this case is based on the walk W = θγ k + k (cid:48) · · · γ k +2 γ k +1 γ γ γ · · · γ k γ γ k +1 γ k +2 · · · γ k + k (cid:48) θ. Note that W is an nc-walk. More precisely, the gadget K = ( K, τ ) is defined asfollows:– V ( K ) = { s, t } ∪ { v i , u i : i ∈ [ k + 2 k (cid:48) + 2] } ;17igure 4: Hardness gadgets corresponding to the cycle C = θγ · · · γ k θ . Thevertex gadgets J L and J R are shown by dot-dashed lines. The pinning functionis shown by dashed lines.– E ( K ) = { v i v i +1 : i ∈ [ k + 2 k (cid:48) + 1] } ∪ { v i u i : i ∈ [ k + 2 k (cid:48) + 2] } ∪ { sv , v k +2 k (cid:48) +2 t } ;– the pinning function is given by τ ( u i ) = γ k + k (cid:48) +1 − i ≤ i ≤ k (cid:48) ,γ i − k (cid:48) − k (cid:48) + 1 ≤ i ≤ k + k (cid:48) + 1 ,γ i = k + k (cid:48) + 2 ,γ i − k (cid:48) − k + k (cid:48) + 3 ≤ i ≤ k + 2 k (cid:48) + 2 . Set δ = δ = γ k + k (cid:48) and ∆ = ∆ = N H ( θ ). These parameters satisfyproperty (i) of hardness gadgets, because deg ( θ ) (cid:54)≡ p ). As W is annc-walk, by Lemma 5.3 for any α ∈ N H ( θ ) − γ k + k (cid:48) , we have(1) | Hom (( K , s, t ) , ( H, α, α )) | = 0;(2) | Hom (( K , s, t ) , ( H, γ k + k (cid:48) , α )) | ≡ p );(3) | Hom (( K , s, t ) , ( H, α, γ k + k (cid:48) )) | ≡ p ).Also, deg ( γ i ) ≡ p ) for all i ∈ [ k + k (cid:48) ] ∪ { } . Therefore | Hom (( K , s, t ) , ( H, γ k + k (cid:48) , γ k + k (cid:48) )) | = 1 + k + k (cid:48) (cid:88) i =1 ( deg ( γ i ) −
1) = 1 + 0 ≡ p ) . Hence,(4) | Hom (( K , s, t ) , ( H, γ k + k (cid:48) , γ k + k (cid:48) )) | ≡ p ).Thus the gadget K satisfies properties (iv), (v), (vi), and (vii) of hardnessgadgets. 18igure 5: Gadget K based on the nc-walk W = θγ k + k (cid:48) · · · γ k +2 γ k +1 γ γ γ · · · γ k γ γ k +1 γ k +2 · · · γ k + k (cid:48) θ . The vertex gadgets J L and J R corresponding to θ are shown by dot-dashed lines. The pinningfunction is shown by dashed lines.Finally, for vertex gadgets we again use gadgets J L , J R introduced in Sec-tion 5.2, with α = β = θ , see Fig 5. By Lemma 5.4, these gadgets satisfyproperties (ii) and (iii) of hardness gadgets. Thus, by Theorem 4.2 p BIS λ ,λ , λ = λ = | N H ( θ ) | − p PartHom ( H ). Case 3.
For every vertex γ ∈ V ( H ) it holds deg ( γ ) ≡ p ).By Lemma 6.1, H is not a tree, therefore it contains a cycle C = θγ γ · · · γ k θ such that k ≥
2. Set δ = γ , δ = γ k and ∆ = ∆ = { γ , γ k } . These parame-ters satisfy property (i) of hardness gadgets, because | ∆ | = | ∆ | (cid:54)≡ p ).An edge gadget K is based on this cycle C as in Case 2.1. More precisely, wedefine gadget K = ( K, τ ) as follows:– V ( K ) = { s, t } ∪ { v i , u i : i ∈ [ k ] } ;– E ( K ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k ] } ∪ { sv , v k t } ;– the labeling function is given by τ ( u i ) = γ i for all i ∈ [ k ].A cycle is an nc-walk, so as in Case 2.1 we can apply Lemma 5.3 to obtainthe following Lemma 6.3.
Let H be a square-free graph and K an edge gadget based on thecycle C = θγ γ · · · γ k θ , k ≥ , in H . For any α s ∈ ∆ − δ and α t ∈ ∆ − δ ,(1) | Hom (( K , s, t ) , ( H, α s , α t )) | = 0 ;(2) | Hom (( K , s, t ) , ( H, δ , α t )) | ≡ p ) ;(3) | Hom (( K , s, t ) , ( H, α s , δ )) | ≡ p ) ; | Hom (( K , s, t ) , ( H, δ , δ )) | ≡ p ) . Since deg ( γ ) ≡ p ) for every γ ∈ V ( H ), By Lemma 6.3 K satisfiesproperties (iv), (v), (vi), and (vii) of hardness gadgets.For vertex gadgets we choose J CL , J CR defined in Section 5.2, see Fig 6.More precisely, gadgets J CL = ( J CL , τ CL ) and J CR = ( J CR , τ CR ) are definedas follows, see Fig. 2, V ( J CL ) = { s } ∪ { v i , u i : i ∈ [ k ] } ∪ { x } ,E ( J CL ) = { v i v i +1 : i ∈ [ k − } ∪ { v i u i : i ∈ [ k ] } ∪ { sv , v k s, sx } . The pinning function is given by τ ( u i ) = γ i for all i ∈ [ k ] and τ ( x ) = θ (for J CR , τ ( y ) = θ ). Gadget J CR is defined the same way with replacement of s with t and x with y . By Lemma 5.5, these gadgets satisfy properties (ii) and (iii) of hardnessgadgets. Therefore, by Theorem 4.2, p BIS λ ,λ , λ = λ = |{ γ , γ k }| − p PartHom ( H ).Figure 6: Hardness gadgets based on cycle C = θγ · · · γ k θ . On the left are thevertex gadgets J CL and J CR shown by dot-dashed lines with J CR inside J CL . J CL is the cycle containing vertex s , and J CR is the cycle containing vertex t .The remaining vertices of the gadgets are not labelled. The pinning function isshown by dashed lines. On the right, the edge gadget K is highlighted. Again,the pinning function is represented by dashed lines. References [1] Ivona Bez´akov´a, Andreas Galanis, Leslie Ann Goldberg, and Daniel Ste-fankovic. Inapproximability of the independent set polynomial in the com-plex plane. In
Proceedings of the 50th Annual ACM SIGACT Symposiumon Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29,2018 , pages 1234–1240, 2018. 202] Andrei A. Bulatov and Martin Grohe. The complexity of partition functions.
Theor. Comput. Sci. , 348(2-3):148–186, 2005.[3] Jin-Yi Cai, Xi Chen, and Pinyan Lu. Graph homomorphisms with complexvalues: A dichotomy theorem. In
Automata, Languages and Programming,37th International Colloquium, ICALP 2010, Bordeaux, France, July 6-10,2010, Proceedings, Part I , pages 275–286, 2010.[4] Martin Dyer and Catherine Greenhill. The complexity of counting graphhomomorphisms.
Random Structures and Algorithms , 17(3–4):260–289,2000.[5] John Faben and Mark Jerrum. The complexity of parity graph homomor-phism: An initial investigation.
Theory of Computing , 11:35–57, 2015.[6] Andreas Galanis, Leslie Ann Goldberg, and Mark Jerrum. Approxi-mately counting h-colorings is $ \ \ mathrm { BIS } $-hard. SIAM J. Comput. ,45(3):680–711, 2016.[7] Andreas Galanis, Leslie Ann Goldberg, and Mark Jerrum. A complexitytrichotomy for approximately counting list H -colorings. TOCT , 9(2):9:1–9:22, 2017.[8] Andreas G¨obel, Leslie Ann Goldberg, and David Richerby. The complexityof counting homomorphisms to cactus graphs modulo 2.
ACM Trans.Comput. Theory , 6(4):17:1–17:29, August 2014.[9] Andreas G¨obel, Leslie Ann Goldberg, and David Richerby. Countinghomomorphisms to square-free graphs, modulo 2.
ACM Trans. Comput.Theory , 8(3):12:1–12:29, May 2016.[10] Andreas G¨obel, J. A. Gregor Lagodzinski, and Karen Seidel. Countinghomomorphisms to trees modulo a prime. In , pages 49:1–49:13, 2018.[11] Leslie Ann Goldberg, Martin Grohe, Mark Jerrum, and Marc Thurley. Acomplexity dichotomy for partition functions with mixed signs.
SIAM J.Comput. , 39(7):3336–3402, 2010.[12] Pavol Hell and Jaroslav Neˇsetˇril. On the complexity of H -coloring. Journalof Combinatorial Theory, Ser.B , 48:92–110, 1990.[13] Pavol Hell and Jaroslav Neˇsetˇril.
Graphs and homomorphisms , volume 28of
Oxford Lecture Series in Mathematics and its Applications . OxfordUniversity Press, 2004.[14] L´aszl´o Lov´asz.
Large Networks and Graph Limits , volume 60 of
ColloquiumPublications . American Mathematical Society, 2012.2115] Leslie G. Valiant. The complexity of computing the permanent.
Theor.Comput. Sci. , 8:189–201, 1979.[16] Leslie G. Valiant. The complexity of enumeration and reliability problems.
SIAM J. Comput. , 8(3):410–421, 1979.[17] Leslie G. Valiant. Accidental algorthims. In