Counting Restricted Homomorphisms via Möbius Inversion over Matroid Lattices
aa r X i v : . [ c s . CC ] J un Counting Restricted Homomorphisms viaMöbius Inversion over Matroid Lattices
Marc RothSaarbrücken Graduate School of Computer ScienceCluster of Excellence (MMCI), Saarland University
We present a framework for the complexity classification of parameterizedcounting problems that can be formulated as the summation over the num-bers of homomorphisms from small pattern graphs H , . . . , H ℓ to a big hostgraph G with the restriction that the coefficients correspond to evaluationsof the Möbius function over the lattice of a graphic matroid. This general-izes the idea of Curticapean, Dell and Marx [STOC 17] who used a result ofLovász stating that the number of subgraph embeddings from a graph H toa graph G can be expressed as such a sum over the lattice of partitions of H .In the first step we introduce what we call graphically restricted homomor-phisms that, inter alia, generalize subgraph embeddings as well as locallyinjective homomorphisms. We provide a complete parameterized complexitydichotomy for counting such homomorphisms, that is, we identify classes ofpatterns for which the problem is fixed-parameter tractable (FPT), includingan algorithm, and prove that all other pattern classes lead to r -neighborhood of every vertex. As those are graphically1estricted as well, they can also easily be classified via the general theorem.Finally we show that the dichotomy for counting graphically restricted ho-momorphisms readily extends to so-called linear combinations. In his seminal work about the complexity of computing the permanent Valiant [36] in-troduced counting complexity which has since then evolved into a well-studied subfieldof computational complexity. Despite some surprising positive results like polynomialtime algorithms for counting perfect matchings in planar graphs by the FKT method[33, 22], counting spanning trees by Kirchhoff’s Matrix Tree Theorem or counting Eu-lerian cycles in directed graphs using the “BEST”-Theorem [2], most of the interestingproblems turned out to be intractable. Therefore, several relaxations such as restric-tions of input classes [40] and approximate counting [21, 12] were introduced. Anotherpossible relaxation, the one this work deals with, is to consider parameterized countingproblems as introduced by Flum and Grohe [15]. Here, problems come with an addi-tional parameter k and a problem is fixed-parameter tractable (FPT) if it can be solvedin time g ( k ) · poly( n ) where n is the input size and g is a computable function, whichyields fast algorithms for large instances with small parameters. On the other hand, aproblem is considered intractable if it is = NP), which give a negative answer to that goal in general. However,there are families of problems that have enough structure to allow so-called dichotomyresults. One famous example, and to the best of the authors knowledge this was the firstsuch result, is Schaefer’s dichotomy [31], stating that every instance of the generalizedsatisfiability problem is either polynomial time solvable or NP-complete. Since thenmuch work has been done to generalize this result, culminating in recent announcements([3],[41],[29]) of a proof of the Feder-Vardi-Conjecture [13]. This question was open foralmost twenty years and indicates the difficulty of proving such dichotomy results, atleast for decision problems. In counting complexity, however, it seems that obtainingsuch results is less cumbersome. One reason for this is the existence of some powerfultechniques like polynomial interpolation [35], the Holant framework [37, 38, 4] as well asthe principle of inclusion-exclusion which all have been used to establish very revealingdichotomy results such as [5, 9].Examples of dichotomies in parameterized counting complexity are the complete classi-2cations of the homomorphism counting problem due to Dalmau and Jonsson [11] andthe subgraph counting problem due to Curticapean and Marx [9]. For the latter, one isgiven graphs H and G and wants to count the number of subgraphs of G isomorphic to H , parameterized by the size of H . It is known that this problem is polynomial timesolvable if there is a constant upper bound on the size of the largest matching of H and . The first step in this proof was the hardness result of countingmatchings of size k of Curticapean [6], which turned out to be the “bottleneck” problemand was then reduced to the general problem.This approach, first finding the hard obstructions and then reducing to the general case,seemed to be the canonical way to tackle such problems. However, recently Curticapean,Dell and Marx [7] discovered that a result of Lovász [25] implies the existence of pa-rameterized reductions that, inter alia, allow a far easier proof of the general subgraphcounting problem. Lovász result states that, given simple graphs H and G , it holds that Emb ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) , (1)where the sum is over the elements of the partition lattice of V ( H ), Emb ( H, G ) is theset of embeddings from H to G and Hom ( H/ρ, G ) is the set of homomorphisms fromthe graph
H/ρ obtained from H by identifying vertices along ρ to G . Furthermore µ is the Möbius function. In their work Curticapean, Dell and Marx showed in a generaltheorem that a summation P ℓi =1 c i · Hom ( H i , G ) for pairwise non-isomorphic graphs H i is H i andfixed-parameter tractable otherwise, using a dichotomy for counting homomorphismsdue to Dalmau and Jonsson [11]. Having this, one only has to show two properties of(1) to obtain the dichotomy for Emb . First, one has to show that a high matchingnumber of H implies that one of the graphs H/ρ has high treewidth and second, thattwo (or more) terms with high treewidth and isomorphic graphs
H/ρ and
H/σ do notcancel out (note that the Möbius function can be negative). As there is a closed formfor the Möbius function over the partition lattice it was possible to show that whenever
H/ρ and
H/σ are isomorphic the sign of the Möbius function is equal.
The motivation of this work is the question whether the result of Curticapean, Dell andMarx can be generalized to construct a framework for the complexity classification ofcounting problems that can be expressed as the summation over homomorphisms and itturns out that this is possible whenever the summation is over a the lattice of a graphicmatroid and the coefficients are evaluations of the Möbius function over the lattice, Ultimately, the results of [7] and this work rely on the dichotomy for counting homomorphisms On the other hand the complexity of the decision version of this problem, that is, finding a subgraphof G isomorphic to H , is still unresolved. Only recently it was shown in a major breakthrough thatfinding bicliques is hard [24]. Note that embeddings and subgraphs are equal up to automorphisms, that is, counting embeddingsand counting subgraphs are essentially the same problem. graphically restricted homomorphisms : Intuitively,a graphical restriction τ ( H ) of a graph H is a set of forbidden binary vertex identificationsof H , modeled as a graph with vertex set V ( H ) and edges along the binary constraints.We write τ - M ( H ) as the set of all graphs obtained from H by contracting vertices alongedges in τ ( H ) and deleting multiedges, excluding those that contain selfloops. Now agraphically restricted homomorphism from H to G with respect to τ is a homomorphismfrom H to G that maps every pair of vertices u, v ∈ V ( H ) that are adjacent in τ ( H )to different vertices in G . We write Hom τ ( H, G ) for the set of all graphically restrictedhomomorphisms w.r.t. τ from H to G and provide a complete complexity classificationfor counting graphically restricted homomorphisms: Theorem 1 (Intuitive version).
Computing
Hom τ ( H, G ) is fixed-parameter tractablewhen parameterized by | V ( H ) | if the treewidth of every graph in τ - M ( H ) is small. Oth-erwise the problem is -hard. In particular, we obtain the following algorithmic result:
Theorem 2.
There exists a deterministic algorithm that computes
Hom τ ( H, G ) intime g ( | V ( H ) | ) · | V ( G ) | tw ( τ - M ( H ))+1 , where g is a computable function and tw ( τ - M ( H )) is the maximum treewidth of every graph in τ - M ( H ) . Having established the general dichotomy we observe that there exist graphical restric-tions τ clique and τ Li such that Hom τ clique ( H, G ) is the set of all subgraph embeddings from H to G and Hom τ Li ( H, G ) is the set of all locally injective homomorphisms from H to G .As a consequence we obtain a full complexity dichotomy for counting locally injectivehomomorphisms from small pattern graphs H to big host graphs G . To the best ofthe author’s knowledge, this is the first result about the complexity of counting locallyinjective homomorphisms. Corollary 3 (Intuitive version).
Computing the number of locally injective homo-morphisms from H to G is fixed-parameter tractable when parameterized by | V ( H ) | if thetreewidth of every graph in τ Li - M ( H ) is small. Otherwise the problem is -hard.Moreover, there exists a deterministic algorithm that computes this number in time g ( | V ( H ) | ) · | V ( G ) | tw ( τ Li - M ( H ))+1 , where g is a computable function and tw ( τ Li - M ( H )) is the maximum treewidth of every graph in τ Li - M ( H ) . We then observe that — in contrast to subgraph embeddings — counting locallyinjective homomorphisms has “real” FPT cases, that is, cases that are fixed-parametertractable but not polynomial time solvable under standard assumptions. We show thisby restricting the pattern graph to be a tree:
Corollary 4.
Computing the number of locally injective homomorphisms from a tree T to a graph G can be done in deterministic time g ( | V ( T ) | ) · | V ( G ) | , that is, the problem isfixed-parameter tractable when parameterized by | V ( T ) | . On the other hand, the problemis -hard.
4o prove
Lemma 5.
The problem of, given trees T and T , computing the number of subtrees of T that are isomorphic to T is -hard. After that we generalize locally injective homomorphisms to homomorphisms that areinjective in the r -neighborhood of every vertex and observe that those are also graphi-cally restricted and consequently obtain a counting dichotomy as well.Finally, we show in Section 6 that all results can easily be extended to so-called linearcombinations of graphically restricted homomorphisms. Here one gets as input graphs H , . . . , H ℓ together with positive coefficients c , . . . , c ℓ and a graph G and the goal is tocompute ℓ X i =1 c i · Hom τ i ( H i , G ) , for graphical restrictions τ , . . . , τ ℓ . This generalizes for example problems like countingall trees of size k in G or counting all locally injective homomorphisms from all graphsof size k to G or a combination thereof. We find out that, under some conditions, thedichotomy criteria transfer immediately to linear combinations: Theorem 6 (Intuitive version).
Computing P ℓi =1 c i · Hom τ i ( H i , G ) is fixed-parametertractable when parameterized by max i {| V ( H i ) |} if the maximum treewidth of every graphin S ℓi τ i - M ( H i ) is small. Otherwise, if additionally | V ( H i ) | has the same parity for every i ∈ [ ℓ ] , the problem is -hard. Furthermore we observe that this theorem is not true on the
The main ingredients of the proofs of Theorem 1 and Theorem 2 are the complexityclassification of linear combinations of homomorphisms due to Curticapean, Dell andMarx (see Lemma 3.5 and Lemma 3.8 in [7]) as well as a corollary of Rota’s NBCTheorem (see e.g. Theorem 4 in [30]). In the first step we prove the following identityfor the number of graphically restricted homomorphisms via Möbius inversion:
Hom τ ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) , where the sum is over elements of the lattice of flats of the graphical matroid given by τ ( H ) and H/ρ is the graph obtained by contracting the vertices of H along the flat5 . After that we use Rota’s Theorem to prove that none of the terms cancel out , de-spite the fact that the Möbius function can be negative. More precisely we show thatwhenever H/ρ ∼ = H/σ , we have that rk ( ρ ) = rk ( σ ) and therefore, by Rota’s Theorem, sgn ( µ ( ∅ , ρ )) = sgn ( µ ( ∅ , σ )).The dichotomies for locally injective homomorphisms and homomorphisms that are injec-tive in the r -neighborhood of every vertex are mere applications of the general theorem.For H i and H j and elements ρ i and ρ j of the matroid lattices of τ i ( H i ) and τ j ( H j ) such that H i /ρ i and H j /ρ j are isomorphic but ρ i and ρ j have ranks of different parities. Usingthis observation, Theorem 6 can be proven in the same spirit as Theorem 1. First we will introduce some basic notions: Given a finite set S , we write | S | or S forthe cardinality of S . Given a natural number ℓ we let [ ℓ ] be the set { , . . . , ℓ } . Given areal number r we define the sign sgn ( r ) of r to be 1 if r >
0, 0 if r = 0 and − r < poset is a pair ( P, ≤ ) where P is a set and ≤ is a binary relation on P that is reflexive,transitive and anti-symmetric. Throughout this paper we will write y ≥ x if x ≤ y .A lattice is a poset ( L, ≤ ) such that every pair of elements x, y ∈ L has a least upperbound x ∨ y and a greatest lower bound x ∧ y that satisfy: ◦ x ∨ y ≥ x , x ∨ y ≥ y and for all z such that z ≥ x and z ≥ y it holds that z ≥ x ∨ y . ◦ x ∧ y ≤ x , x ∧ y ≤ y and for all z such that z ≤ x and z ≤ y it holds that z ≤ x ∧ y .Given a finite set S , a partition of S is a set ρ of pairwise disjoint subsets of S such that˙ S s ∈ ρ s = S . We call the elements of ρ blocks . For two partitions ρ and σ we write ρ ≤ σ if every element of ρ is a subset of some element of σ . This binary relation is a latticeand called the partition lattice of S . We will in particular encounter lattices of graphicmatroids in our proofs. We will follow the definitions of Chapt. 1 of the textbook of Oxley [28]. Here “cancel out” means that it could be possible that
H/ρ and
H/σ are isomorphic, but µ ( ∅ , ρ ) = − µ ( ∅ , σ ) and all other H/ρ ′ are not isomorphic to H/ρ . In this case, the term
Hom ( H/ρ, G ) wouldvanish in the above identity. efinition 7. A matroid M is a pair ( E, I ) where E is a finite set and I ⊆ P ( E ) suchthat(1) ∅ ∈ I ,(2) if A ∈ I and B ⊆ A then B ∈ I , and(3) if A, B ∈ I and | B | < | A | then there exists a ∈ A \ B such that B ∪ { a } ∈ I .We call E the ground set and an element A ∈ I an independent set . A maximal inde-pendent set is called a basis . The rank rk ( M ) of M is the size of its bases .Given a subset X ⊆ E we define I| X := { A ⊆ X | A ∈ I} . Then M | X := ( X, I| X )is also a matroid and called the restriction of M to X . Now the rank rk ( X ) of X isthe rank of M | X . Equivalently, the rank of X is the size of the largest independent set A ⊆ X .Furthermore we define the closure of X as follows: cl ( X ) := { e ∈ E | rk ( X ∪ { e } ) = rk ( X ) } . Note that by definition rk ( X ) = rk ( cl ( X )). We say that X is a flat if cl ( X ) = X . Wedenote L ( M ) as the set of flats of M . It holds that L ( M ) together with the relationof inclusion is a lattice, called the lattice of flats of M . The least upper bound of twoflats X and Y is cl ( X ∪ Y ) and the greatest lower bound is X ∩ Y . It is known that thelattices of flats of matroids are exactly the geometric lattices and we denote the set ofthose lattices as L .In Section 3 we take a closer look at (lattices of flats of) graphic matroids: Definition 8.
Given a graph H = ( V, E ) ∈ G , the graphic matroid M ( H ) has groundset E and a set of edges is independent if and only if it does not contain a cycle.If H is connected then a basis of H is a spanning tree of H . If H consists of severalconnected components then a basis of M ( H ) induces spanning trees for each of those.Every subset X of E induces a partition of the vertices of H where the blocks are thevertices of the connected components of H | X and it holds that rk ( X ) = | V ( H ) | − c ( H | X ) . (2)In particular, the flats of M ( H ) correspond bijectively to the partitions of vertices of H into connected components as adding an element to X such that the rank does not changewill not change the connected components, too. For convenience we will therefore abusenotation and say, given an element ρ of the lattice of flats of M ( H ), that ρ partitionsthe vertices of H where the blocks are the vertices of the connected components of H | ρ .The following observation will be useful in Section 3: This is well-defined as every maximal independent set has the same size due to (3). For the purpose of this paper we do not need the definition of geometric lattices but rather theequivalent one in terms of lattices of flats and therefore omit it. We recommend e.g. Chapt. 3 of [39]and Chapt. 1.7 of [28] to the interested reader. emma 9. Let ρ, σ ∈ L ( M ( H )) for a graph H ∈ G . If the number of blocks of ρ and σ are equal then rk ( ρ ) = rk ( σ ) .Proof. Immediately follows from Equation (2). (cid:4)
We denote
H/ρ as the graph obtained from H by contracting the vertices of H thatare in the same component of ρ and deleting multiedges (but keeping selfloops). As thevertices of H/ρ partition the vertices of H , we think of the vertices of H/ρ as subsets ofvertices of H and call them blocks . Furthermore we write [ v ] for the block containing v . In this work all graphs are considered unlabeled and simple but may allow selfloopsunless stated otherwise. We denote the set of all those graphs as G ◦ . Furthermore wedenote G as the set of all unlabeled and simple graphs without selfloops.For a graph G we write n for the number of vertices V ( G ) of G and m for the numberof edges E ( G ) of G . We denote c ( G ) as the number of connected components of G .Furthermore, given a subset X of edges, we denote G | X as the graph with vertices V ( G )and edges X . Given a partition of vertices ρ of a graph H , we write H/ρ as the graphobtained from H by contracting the vertices of H that are in the same component of ρ and deleting multiedges (but keeping selfloops). As the vertices of H/ρ partition thevertices of H , we think of the vertices as subsets of vertices of H and call them blocks .Furthermore we write [ v ] for the block containing v .Given graphs H and G , a homomorphism from H to G is a mapping ϕ : V ( H ) → V ( G )such that { u, v } ∈ E ( H ) implies that { ϕ ( u ) , ϕ ( v ) } ∈ E ( G ). We denote Hom ( H, G ) asthe set of all homomorphisms from H to G . A homomorphism is called embedding if itis injective and we denote Emb ( H, G ) as the set of all embeddings from H to G . Anembedding from H to H is called an automorphism of H . We denote Aut ( H ) as the setof all automorphisms of H . Furthermore we let Sub ( H, G ) be the set of all subgraphs of G that are isomorphic to H . Then it holds that Aut ( H ) · Sub ( H, G ) =
Emb ( H, G )(see e.g. [25]).Given a set S and a function α : S → Q , we define the support of α as follows: supp ( α ) := { s ∈ S | α ( s ) = 0 } . A graph parameter that will be of quite some importance to define the dichotomycriteria is the treewidth of a graph, capturing how “tree-like” a graph is:
Definition 10 (Chapt. 7 in [10]). A tree decomposition of a graph G ∈ G is a pair T = ( T, { X t } t ∈ V ( T ) ), where T is a tree whose every node t is assigned a vertex subset X t ⊆ V ( G ), such that:(1) S t ∈ V ( T ) X t = V ( G ).(2) For every { u, v } ∈ E ( G ), there exists t ∈ V ( T ) such that u and v are contained in X t . 83) For every u ∈ V ( G ), the set T u := { t ∈ V ( T ) | u ∈ X t } induces a connectedsubtree of T .The width of T is the size of the largest X t for t ∈ V ( T ) minus 1 and the treewidth of G is the minimum width of any tree decomposition of G . We write tw ( G ) for the treewidthof G . Given a finite set of graphs M , we denote tw ( M ) as the maximum treewidth ofany graph in M .Examples of graphs with small treewidth are matchings, paths and more generallytrees and forests or cycles. On the other hand, graphs with high treewidth are forexample cliques, bicliques and grid graphs.Throughout this paper we will often say that a set C of graphs has bounded treewidth meaning that there is a constant B such that the treewidth of every graph H ∈ C isbounded by B . We will mainly follow the definitions of Chapt. 14 of the textbook of Flum and Grohe[15]. A parameterized counting problem is a function F : { , } ∗ → N together witha polynomial-time computable parameterization k : { , } ∗ → N . A parameterizedcounting problem is fixed-parameter tractable if there exists a computable function g such that it can be solved in time g ( k ( x )) · | x | O (1) for any input x . A parameterizedTuring reduction from ( F, k ) to ( F ′ , k ′ ) is an FPT algorithm w.r.t. parameterization k with oracle ( F ′ , k ′ ) that on input x computes F ( x ) and additionally satisfies that thereexists a function g ′ such that for every oracle query y it holds that k ′ ( y ) ≤ g ( k ( x )).A parameterized counting problem ( F, k ) is k - clique to ( F, k ), where k - clique is the problem of, given a graph G and a parameter k , computing the number of cliques of size k in G . Under standardassumptions (e.g. under the exponential time hypothesis) C ⊆ G , Hom ( C ) ( Emb ( C )) is the problem of,given a graph H ∈ C and a graph G ∈ G , computing Hom ( H, G ) (
Emb ( H, G )). Bothproblems are parameterized by V ( H ). Their complexity has already been classified: Theorem 11 ([11]).
Let C be a recursively enumerable class of graphs. If C hasbounded treewdith then Hom ( C ) can be solved in polynomial time. Otherwise Hom ( C ) is -hard. Theorem 12 ([9]).
Let C be a recursively enumerable class of graphs. If C has boundedmatching number then Emb ( C ) can be solved in polynomial time. Otherwise Emb ( C ) is -hard. Recall that “bounded treewidth (matching number)” means that there is a constant B such that the treewidth (size of the largest matching) of any graph in C is boundedby B . For a more detailed introduction to .4 Linear combinations of homomorphisms and Möbius inversion Curticapean, Dell and Marx [7] introduced the following parameterized counting prob-lem:
Definition 13 (Linear combinations of homomorphisms).
Let A be a set of func-tions a : G → Q with finite support . We define the parameterized counting problem Hom ( A ) as follows:Given a ∈ A and G ∈ G , compute X H ∈ supp( a ) a ( H ) · Hom ( H, G ) , parameterized by max H ∈ supp( a ) V ( H ) . Note that this problem generalizes
Hom ( C ). The following theorem will be the foun-dation of all complexity results in this paper: Theorem 14 ([7], Lemma 3.5 and Lemma 3.8). If A has bounded treewidth then Hom ( A ) can be solved in time g ( | supp( α ) | ) · n O (1) on input ( α, G ) where n = | V ( G ) | and g is a computable function. Otherwise the problem is -hard. In their paper, the authors show how this result can be used to give a much simplerproof of Theorem 12. The idea is that every problem
Emb ( C ) is equivalent to a prob-lem Hom ( A ). As all proofs in this work are in the same flavour, we will outline thetechnique here, using Emb ( C ) as an example. Therefore, we first need to introduce theso called Möbius inversion (we recommend reading [32] for a more detailed introduction): Definition 15.
Let ( P, ≤ ) be a poset and h : P → C be a function. Then the zetatransformation ζh is defined as follows: ζh ( σ ) := X ρ ≥ σ h ( ρ ) . Theorem 16 (Möbius inversion, see [32] or [30]).
Let ( P, ≤ ) and h as in Defini-tion 15. Then there is a function µ P : P × P → Z such that for all σ ∈ P it holdsthat h ( σ ) = X ρ ≥ σ µ P ( σ, ρ ) · ζh ( ρ ) .µ P is called the Möbius function . The following identity is due to Lovász [25]:
Hom ( H/σ, G ) = X ρ ≥ σ Emb ( H/ρ, G ) , We can also think of A being a set of lists. σ and ρ are partitions of vertices of H and ≥ is the partition lattice of H . NowMöbius inversion yields the following identity [25]: Emb ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) , where µ is the Möbius function over the partition lattice. Therefore, for every class ofgraphs C , there is a family of functions with finite support A such that Emb ( C ) and Hom ( A ) are the same problems. Now Curticapean, Dell and Marx show that C hasunbounded matching number if and only if A has unbounded treewidth. The criticalpoint in this proof was to show that the sign of µ ( ∅ , ρ ) only depends on the numberof blocks of ρ , which implies that for two isomorphic graphs H and H , the terms Hom ( H , G ) and Hom ( H , G ) have the same sign in the above identity and thereforedo not cancel out in the homomorphism basis. As there is a closed form for µ ( ∅ , ρ ) , theinformation about the sign could easily be extracted.The motivation of this work is the question whether this can be made more general andit turns out that a corollary of Rota’s NBC Theorem [30] (see also [1]) captures exactlywhat we need: Theorem 17 (See e.g. Theorem 4 in [30]).
Let L be a geometric lattice with uniqueminimal element ⊥ and let ρ be an element of L . Then it holds that sgn ( µ L ( ⊥ , ρ )) = ( − rk ( ρ ) . In the following we will show that combining Rota’s Theorem and the dichotomy forcounting linear combinations of homomorphisms yields complete complexity classifica-tions for the problems of counting those restricted homomorphisms that induce a Möbiusinversion over the lattice of a graphic matroid, which are known to be geometric, whentransformed into the homomorphism basis. Those include embeddings as well as locallyinjective homomorphisms.
In the following we write ∅ for the minimal element of a matroid lattice. Definition 18. A graphical restriction is a computable mapping τ that maps a graph H ∈ G to a graph H ′ ∈ G such that V ( H ) = V ( H ′ ), that is, τ only modifies edges of H . We denote the set of all graphical restrictions as T. Given graphs H and G and agraphical restriction τ , we define the set of graphically restricted homomorphisms w.r.t. τ from H to G as follows: Hom τ ( H, G ) := { ϕ ∈ Hom ( H, G ) | ∀ u, v ∈ V ( H ) : { u, v } ∈ E ( τ ( H )) ⇒ ϕ ( u ) = ϕ ( v ) } . Given a recursively enumerable class of graphs C ⊆ G , we define the parameterizedcounting problem Hom τ ( C ) as follows: Given a graph H ∈ C and a graph G ∈ G , weparameterize by | V ( H ) | and wish to compute Hom τ ( H, G ). Here it is crucial that µ is the Möbius function over the (complete) partition lattice. τ clique maps a graph H to the complete graph with vertices V ( H ). Then one can easily verify that Hom τ clique ( H, G ) =
Emb ( H, G ).The following lemma is an application of Möbius inversion (and slightly generalizes[25]).
Lemma 19.
Let τ be a graphical restriction. Then for all graphs H ∈ G ◦ and G ∈ G itholds that Hom τ ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) , (3) where ≤ and µ are the relation and the Möbius function of the lattice L ( M ( τ ( H ))) .Proof. Let τ and H be fixed and let Hom ( H/ρ, G )[ τ ] be the set of all homomorphisms ϕ ∈ Hom ( H/ρ, G ) such that { u, v } ∈ E ( τ ( H )) and [ u ] = [ v ] imply that ϕ ([ u ]) = ϕ ([ v ]).More precisely: Hom ( H/ρ, G )[ τ ] := { ϕ ∈ Hom ( H/ρ, G ) | ∀ u, v ∈ V ( H ) : { u, v } ∈ E ( τ ( H )) ∧ [ u ] = [ v ] ⇒ ϕ ([ u ]) = ϕ ([ v ]) } . We will first prove the following identities:
Claim 20.
For all G ∈ G it holds that Hom ( H/ ∅ , G )[ τ ] = Hom τ ( H, G ) . Proof.
Every block in H/ ∅ is a singleton and H ∼ = H/ ∅ . Now the identity triviallyfollows from Definition 18. (cid:4) Claim 21.
For all G ∈ G and σ ∈ L ( M ( τ ( H ))) it holds that Hom ( H/σ, G ) = X ρ ≥ σ Hom ( H/ρ, G )[ τ ] (4) Proof.
Let [ v ] be the block of v in H/σ . We define an equivalence relation ∼ τ over Hom ( H/σ, G ) as follows: ϕ ∼ τ ψ : ⇔ ∀{ u, v } ∈ E ( τ ( H )) : ϕ ([ u ]) = ϕ ([ v ]) ⇔ ψ ([ u ]) = ψ ([ v ]) . We write [ ϕ ] τ for the equivalence class of ϕ and let H/ [ ϕ ] τ be the graph obtained from H/σ by further contracting different blocks [ u ] and [ v ] whenever { u, v } ∈ E ( τ ( H )) and ϕ ([ u ]) = ϕ ([ v ]) (note that this is well-defined by the definition of ∼ τ ). Now consider σ inthe graphical matroid M ( τ ( H )). Every block [ v ] corresponds to a connected componentof the flat given by σ . Now contracting different blocks [ u ] and [ v ] for { u, v } in E ( τ ( H ))is a refinement of σ obtained by adding the edge { u, v } in M ( τ ( H )) and taking theclosure. Therefore the equivalence classes of ∼ τ and the refinements of σ in the matroidlattice correspond bijectively and we write [ ρ ] τ for the equivalence class correspondingto ρ . It remains to show that for every ρ ≥ σ we have that | [ ρ ] τ | = Hom ( H/ρ, G )[ τ ] . (5)12his can be proven by constructing a bijection b . We write [ v ] σ for blocks in H/σ and [ v ] ρ for blocks in H/ρ . On input ϕ ∈ [ ρ ] τ , b outputs the homomorphism in Hom ( H/ρ, G )[ τ ]that maps a block [ v ] ρ to ϕ ([ v ] σ ). This is well-defined as ϕ maps blocks [ u ] σ and [ v ] σ tothe same vertex in G if and only if they are subsumed by a common block in H/ρ (recallthat ρ ≥ σ in the matroid lattice). On the other hand we can construct a mapping b ′ that given ψ ∈ Hom ( H/ρ, G )[ τ ] outputs the homomorphism in [ ρ ] τ that maps ablock [ v ] σ to the image of the block [ v ] ρ (that subsumes [ v ] σ ) according to ψ . Now b ◦ b ′ = id Hom ( H/ρ,G )[ τ ] and b ′ ◦ b = id [ ρ ] τ . Consequently, b is a bijection and Equation 5holds. Now we have Hom ( H/σ, G )= (cid:12)(cid:12)(cid:12)(cid:12) ˙ [ [ ϕ ] τ ∈ Hom ( H/σ,G ) / ∼ τ [ ϕ ] τ (cid:12)(cid:12)(cid:12)(cid:12) = (cid:12)(cid:12)(cid:12)(cid:12) ˙ [ ρ ≥ σ [ ρ ] τ (cid:12)(cid:12)(cid:12)(cid:12) = X ρ ≥ σ | [ ρ ] τ | = X ρ ≥ σ Hom ( H/ρ, G )[ τ ]which proves the claim. (cid:4) Now Claim 21 is a zeta transform over the matroid lattice of M ( τ ( H )). By Möbiusinversion (Theorem 16) we obtain that Hom ( H/ ∅ , G )[ τ ] = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) , and hence, by Claim 20, Hom τ ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) . (cid:4) Intuitively, we will now show that counting graphically restricted homomorphismsfrom H to G is hard if we can ”glue” vertices of H together along edges of τ ( H ) suchthat the resulting graph has no selfloops and high treewidth. We will capture thisintuition formally: Definition 22.
Let H ∈ G be a graph and let τ be a graphical restriction. A graph H ′ ∈ G ◦ obtained from H by contracting pairs of vertices u and v such that { u, v } ∈ E ( τ ( H )) and deleting multiedges (but keeping selfloops) is called a τ - contraction of H .If additionally H ′ ∈ G , that is, the contraction did not yield selfloops, we call H ′ a τ - minor of H . We denote the set of all τ -minors of H as τ - M ( H ) and given a class ofgraphs C ⊆ G we denote the set of all τ -minors of all graphs in C as τ - M ( C ).Finally, we can classify the complexity of counting graphically restricted homomor-phisms along the treewidth of their τ -minors: Theorem 23 (Theorem 1 and Theorem 2, restated).
Let τ be a graphical restric-tion and let C ⊆ G be a recursively enumerable class of graphs. Then Hom τ ( C ) isFPT if τ - M ( C ) has bounded treewidth and -hard otherwise. Furthermore, given H, G ∈ G , there exists a deterministic algorithm that computes
Hom τ ( H, G ) in time g ( | V ( H ) | ) · | V ( G ) | tw ( τ - M ( H ))+1 , where g is a computable function. roof. By Lemma 19 we have that
Hom τ ( H, G ) = X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G ) . Now, as G has no selfloops, a term Hom ( H/ρ, G ) is zero whenever
H/ρ has a selfloop.Consequently, for every non-zero term
Hom ( H/ρ, G ), it holds that
H/ρ ∈ τ - M ( H ).Therefore, by Lemma 3.5 in [7], we obtain an algorithm computing Hom τ ( H, G ) intime g ( | V ( H ) | ) · | V ( G ) | tw ( τ - M ( H ))+1 , for a computable function g . This immediately implies that the problem Hom τ ( C )is fixed-parameter tractable if τ - M ( C ) has bounded treewidth. It remains to showthat Hom τ ( C ) is Hom ( H/ρ, G ) and
Hom ( H/σ, G ) where
H/ρ and
H/σ are isomorphic, it follows that there exist coeffi-cients c H [ H ′ ] for every H ′ ∈ τ - M ( H ) such that Hom τ ( H, G ) = X H ′ ∈ τ - M ( H ) c H [ H ′ ] · Hom ( H ′ , G ) . We will now show that none of the c H [ H ′ ] is zero: It holds that c H [ H ′ ] = X ρ ≥∅ H ′ ∼ = H/ρ µ ( ∅ , ρ ) . (6)Consider ρ and ρ ′ such that H/ρ ∼ = H/ρ ′ ∼ = H ′ . It follows that rk ( ρ ) = | V ( H ) | − c ( H/ρ ) = | V ( H ) | − c ( H ′ ) = | V ( H ) | − c ( H/ρ ′ ) = rk ( ρ ′ ) . Now, as the lattice of M ( τ ( H )) is geometric, we can apply the corollary of Rota’sNBC Theorem (Theorem 17) and obtain that sgn ( µ ( ∅ , ρ )) = ( − rk ( ρ ) = ( − rk ( ρ ′ ) = sgn ( µ ( ∅ , ρ ′ )). Consequently every term in Equation (6) has the same sign and therefore c H [ H ′ ] = 0. Now we define a function a H : G → Q as follows a H ( F ) := ( c H [ F ] if F ∈ τ - M ( H )0 otherwiseand we set A C = { a H | H ∈ C } . Then the problems Hom ( A C ) and Hom τ ( C ) areequivalent w.r.t. parameterized turing reductions. As c H [ H ′ ] = 0 for every H ′ ∈ τ - M ( H )it follows that A C has unbounded treewidth if and only if τ - M ( C ) has unboundedtreewidth. We conclude by Theorem 14 that Hom τ ( C ) is (cid:4) In this section we are going to apply the general dichotomy theorem to the concretecase of counting locally injective homomorphisms. A homomorphism ϕ from H to G locally injective if for every v ∈ V ( H ) it holds that ϕ | N ( v ) is injective. We denote Li - Hom ( H, G ) as the set of all locally injective homomorphisms from H to G and wedefine the corresponding counting problem Li - Hom ( C ) for a class of graphs C ⊆ G asfollows: Given graphs H ∈ C and G ∈ G , compute Li - Hom ( H, G ). The parameter is | V ( H ) | . Locally injective homomorphisms have already been studied by Nešetřil in 1971[27] and were applied in the context of distance constrained labelings of graphs (see [14]for an overview). As well as subgraphs embeddings, locally injective homomorphismsare graphically restricted homomorphisms. Lemma 24.
Let H ∈ G be a graph and let τ Li ( H ) = ( V ( H ) , E Li ( H )) be a graphicalrestriction defined as follows: E Li ( H ) = {{ u, w } | u = w ∧ ∃ v : { u, v } , { w, v } ∈ E ( H ) } .Then for all G ∈ G it holds that Hom τ Li ( H, G ) = Li - Hom ( H, G ) .Proof. We prove both inclusions. Let ϕ ∈ Hom τ Li ( H, G ) and assume that ϕ is not locallyinjective. Then there exists v ∈ V ( H ) such that ϕ | N ( v ) is not injective which impliesthat there are u and w such that { u, v } and { w, v } are edges in H and ϕ ( u ) = ϕ ( w ).By definition { u, w } ∈ E Li ( H ) = E ( τ Li ( H )) and therefore ϕ / ∈ Hom τ Li ( H, G ) which is acontradiction.Now let ϕ ∈ Li - Hom ( H, G ) and assume that ϕ / ∈ Hom τ Li ( H, G ). Then there exist u, w ∈ V ( H ) such that { u, w } ∈ E ( τ Li ( H )) and ϕ ( u ) = ϕ ( w ). The former impliesthat u and w have a common neighbor v in H but this contradicts the fact that ϕ islocally injective. (cid:4) We continue by stating the dichotomy for counting locally injective homomorphisms.
Corollary 25 (Corollary 3, restated).
Let C ⊆ G be a recursively enumerable classof graphs.Then Li - Hom ( C ) is FPT if τ Li - M ( C ) has bounded treewidth and -hard otherwise.Furthermore, there exists a deterministic algorithm that computes Li - Hom ( H, G ) intime g ( | V ( H ) | ) · | V ( G ) | tw ( τ Li - M ( H ))+1 , where g is a computable function.Proof. Follows immediately from Lemma 24 and Theorem 23. (cid:4)
We give an example for a hard instance of the problem: Let W k be the “wind-mill” graph of size k , i.e., the graph with vertices a , v , . . . , v k , w , . . . , w k and edges { a, v i } , { v i , w i } and { w i , a } for each i ∈ [ k ]. Furthermore we let W be the set of all W k for k ∈ N . Corollary 26. Li - Hom ( W ) is -hard.Proof. It turns out that every graph consisting of k edges is a minor of some graph in τ Li - M ( W k ). To see this let F be a graph with k edges. We enumerate the edges of F as e , . . . , e k and identify each edge e i = { x i , y i } with the edge { v i , w i } in W k . Now,15henever x i = x j (or x i = y j ) we contract vertices v i and v j (or v i and w j , respectively)in W k . As each v i and v j (or v i and w j , respectively) have the common neighbor a , andfurthermore v i and w i are never contracted, the resulting graph W ′ k is a τ Li -minor of W k .If we now remove a from W ′ k along with every edge incident to a , the resulting graph isisomorphic to F . Consequently, the treewidth of τ Li - M ( W ) is not bounded and hence Li - Hom ( W ) is (cid:4) In contrast to embeddings where every FPT case is also polynomial time solvable,there are “real” FPT cases when it comes to locally injective homomorphisms. Let
T ⊆ G be the class of all trees. Counting locally injective homomorphisms from thosegraphs is fixed-parameter tractable:
Corollary 27. Li - Hom ( T ) is FPT. In particular, there is a deterministic algorithmthat computes Li - Hom ( T, G ) for a tree T in time g ( | V ( T ) | ) · | V ( G ) | , where g is a computable function.Proof. According to Corollary 25 we only need to show that τ - M ( T ) has treewidth 1.Indeed, every τ Li -minor of a tree is again a tree, and has therefore treewidth 1. To seethis, consider a pair of vertices u and w that have a common neighbor v in a tree T ∈ T .Then ( u, v, w ) is the only path between u and w and consequently contracting u and w to a single vertex will not create a cycle in the resulting graph (recall that we deletemultiedges). (cid:4) On the other hand Li - Hom ( T ) is unlikely to have a polynomial time algorithm. Lemma 28. Li - Hom ( T ) is -hard. We prove this lemma in the following subsection.
The aim of this section is to prove Lemma 28. We start by giving an introductionto classical counting complexity which was established by Valiant in his seminal workabout the complexity of computing the permament [36]. A (non-parameterized) countingproblem is a function F : { , } ∗ → N . The class of all counting problems solvable inpolynomial time is called FP. On the other hand, the notion of intractability is to SAT , the problem ofcomputing the number of satisfying assignments of a given CNF formula. A countingproblem F is SAT to F , that is, an algorithm with oracle F that solves SAT in polynomial time. Toda [34] (Many-one) reductions in counting complexity differ slightly from many-one reductions in the decisionworld. However, for the purpose of this section we only need Turing reductions. We recommendChap. 6.2 of [17] to the interested reader. ⊆ P which indicates that T , T , compute the number Sub ( T , T ) of subtrees of T that are isomorphic to T . We call this problem Sub ( T , T ). Lemma 29 (Lemma 5, restated).
Sub ( T , T ) is -hard. Related results are all subtrees of a given graph [20] or evencounting all subtrees of a given tree [16]. As the number of non-isomorphic trees with n vertices is not bounded by a polynomial in n , we do not know how to reduce directlyfrom these problems. Instead we use a construction quite similar to the ”skeleton” graphin [16] to reduce from the problem of computing the permanent.Given a quadratic matrix A with elements ( a i,j ) i,j ∈ [ n ] the permanent of A is defined asfollows: perm ( A ) = X π ∈ S n n Y i =1 a i,π ( i ) , where S n is the symmetric group with n elements. Theorem 30 ([36]).
Computing the permanent is -hard even when restricted to ma-trices with entries from { , } .Proof (Proof of Lemma 29). We reduce from computing the permanent of matrices withentries from { , } . Given a quadratic matrix A of size n , we construct a tree T A asfollows:1. For every entry a i,j we create a vertex v i,j and add edges { v i,j , v i +1 ,j } for every i ∈ [ n −
1] and j ∈ [ n ].2. Whenever a i,j = 1 we create a vertex b i,j and add edges { b i,j , v i,j } .3. For every column c j we create a vertices u j , w j , x j , y j , z j and add edges { u j , v ,j } , { v n,j , w j } , { w j , x j } , { w j , y j } and { w j , z j } .4. Finally, we create a vertex r and add edges { a, u j } for all j ∈ [ n ]. In the followingwe call r the root.We give an example in Figure 1 for a matrix A = . We claim that for all quadratic matrices A of size n ≥ { , } it holdsthat perm ( A ) = Sub ( T id n , T A ) , T id (left) and T A (right).where id n is the quadratic matrix of size n with 1s on the diagonal and 0s everywhereelse. In the following we write v for a vertex in T A and v ′ for a vertex in T id n . To provethe claim we first observe that whenever a subtree of T A is isomorphic to T id n , the root r ′ of T id n has to be mapped to the root r of T A by the isomorphism as the roots are theonly vertices with degree n (which is why we needed n ≥ ≤ u ′ , . . . , u ′ n of T id n are mapped to u , . . . , u n of T A which induces a permutation on n elements, that is, an element π ∈ S n . We willnow partition the subtrees of T A isomorphic to T id n by those permutations and write Sub ( T id n , T A )[ π ] for the number of subtrees that induce π . Now fix π and consider asubtree that induces π . It holds that for all j ∈ [ n ] the vertex w ′ j has to be mapped to w π ( j ) as those are the only vertices with degree exactly 4 and furthermore, the vertices x ′ j , y ′ j , z ′ j have to be mapped to x π ( j ) , y π ( j ) , z π ( j ) (possibly permuted but the subtree of T A is the same). Now v ′ i,i is adjacent to b ′ i,i for each i ∈ [ n ] and therefore v i,π ( i ) has tobe adjacent to b i,π ( i ) , that is a i,π ( i ) = 1. If this is not the case then there is no subtreethat induces partition π . Furthermore there is at most one subtree isomorphic to T id n inducing π because the image is enforced by r ′ , w ′ j and v ′ i,i for all i, j ∈ [ n ]. Consequently Sub ( T id n , T A )[ π ] = 1 if for all i ∈ [ n ] it holds that a i,π ( i ) = 1 and Sub ( T id n , T A )[ π ] = 0otherwise. Hence Sub ( T id n , T A )[ π ] = Q ni =1 a i,π ( i ) and therefore perm ( A ) = X π ∈ S n n Y i =1 a i,π ( i ) = X π ∈ S n Sub ( T id n , T A )[ π ] = Sub ( T id n , T A ) . Now the reduction works as follows: If the input matrix A has size ≤ Sub ( T id n , T A ) with the oracle for Sub ( T , T ). (cid:4) Proof (Proof of Lemma 28).
It is a well-known fact that a locally injective homomor-phism ϕ from a tree T to a tree T is injective. To see this assume that there arevertices v and u in T that are mapped to the same vertex in T . As T is a tree thereexists exactly one path v = w , w , . . . , w ℓ , w ℓ +1 = u between v and u in T . It holds that ℓ ≥ v and u would be adjacent and hence ϕ ( u ) = ϕ ( v ) would have a self-loop in T which is impossible. As ϕ is locally injective we have that ϕ ( v ) = ϕ ( w ), hence u = w , and as ϕ is edge preserving there are edges { ϕ ( v ) , ϕ ( w ) } and { ϕ ( w ) , ϕ ( w ) } and a path from ϕ ( w ) to ϕ ( w ℓ +1 ) = ϕ ( u ) = ϕ ( v ) in T . This induces a cycle andcontradicts the fact that T is a tree.Therefore Emb ( T , T ) = Li - Hom ( T , T ). By Lovász [25] it holds for all H and G that Sub ( H, G ) =
Emb ( H, G ) Aut ( H ) , where Aut ( H ) is the set of automorphisms of H . If H is a tree then Aut ( H ) can becomputed in polynomial time (even for planar graphs [26],[18]). Therefore Li - Hom ( T ) follows by reducing from Sub ( T , T ): Given trees T , T we compute Li - Hom ( T , T ) by querying the oracle and Aut ( T ) in polynomial time. Then weoutput Li - Hom ( T , T ) Aut ( T ) = Emb ( T , T ) Aut ( T ) = Sub ( T , T ) . (cid:4) The generalization from locally injective homomorphisms to homomorphisms that areinjective in the r -neighborhood of every vertex is straightforward. Given a graph H and v ∈ V ( H ) we denote N r ( v ) as the r -neighborhood of v , that is, a vertex u is containedin N r ( v ) if and only if d H ( u, v ) ≤ r , where d H ( u, v ) the distance between u and v in H .We then define Li [ r ]- Hom ( H, G ) := { ϕ ∈ Hom ( H, G ) | ∀ v ∈ V ( H ) : ϕ | N r ( v ) is injective } . Furthermore we define the counting problem Li [ r ]- Hom ( C ) for a class of graphs C accordingly. Defining τ Li [ r ] such that E ( τ Li [ r ] ( H )) = {{ u, w } | u = w ∧ ∃ v : 1 ≤ d H ( u, v ) ≤ r ∧ ≤ d H ( w, v ) ≤ r } for every graph H ∈ G immediately yields the dichotomy: Corollary 31.
Let C ⊆ G be a recursively enumerable class of graphs. Then Li [ r ] - Hom ( C ) is FPT if τ Li [ r ] - M ( C ) has bounded treewidth and -hard otherwise. Furthermore,there exists a deterministic algorithm that computes Li [ r ] - Hom ( H, G ) in time g ( | V ( H ) | ) · | V ( G ) | tw ( τ Li [ r ] - M ( H ))+1 , where g is a computable function.
19e continue using trees as an example by observing that there is a phase transi-tion in the complexity of Li [ r ]- Hom ( T ) when we change from r = 1, in which case Li [ r ]- Hom ( H, G ) = Li - Hom ( H, G ), to r = 2: Corollary 32. Li [ r ] - Hom ( T ) is -hard for r ≥ . In particular, assuming ETH , there is no algorithm that computes Li [ r ] - Hom ( T, G ) for a tree T in time g ( | V ( T ) | ) · | V ( G ) | O (1) , for any computable function g .Proof. We only need to show that τ Li [ r ] - M ( T ) has unbounded treewidth, as the ETHlower bound simply follows from the fact that FPT = T k,k as follows: ◦ We add vertices a , u , . . . , u k , v , . . . , v k , w , . . . , w k . ◦ We add edges { a, u i } , { a, v i } and { v i , w i } for i ∈ [ k ].Clearly, T k,k is a tree. Now we contract vertices w i and u i for all i ∈ [ k ] and end up in W k .As d T k,k ( a, w i ) = 2 and d T k,k ( a, u i ) = 1, those contractions are according to τ Li [ r ] ( T k,k )and hence the resulting graph is a τ Li [ r ] -minor of T k,k . From W k we can further contractvertices along the lines of the proof of Corollary 26 to obtain arbitrary graphs with k edges as minors of elements of τ Li [ r ] - M ( T k,k ). Consequently the treewidth of τ Li [ r ] ( T ) isnot bounded. (cid:4) The introduction of linear combinations of graphically restricted homomorphisms is mo-tivated by the following example: Consider the problem E of, given a parameter k and a graph G ∈ G , computing Hom ( P k , G ) + Li - Hom ( K k , G ) + Emb ( C k , G ), where P k , K k , C k are paths, cliques and cycles consisting of k vertices. As Hom , Li - Hom and
Emb are graphically restricted homomorphisms we know the complexity of computingeach summand, but we cannot immediately infer the complexity of E . As P k hastreewidth 1 it follows by Theorem 11 or Theorem 23 that Hom ( P k , G ) can be com-puted in FPT time. Consequently, E is equivalent (w.r.t. FPT Turing reductions) tocomputing Li - Hom ( K k , G ) + Emb ( C k , G ). As cliques have τ Li -minors of unboundedtreewidth and cycles have unbounded matching number, these problems are both E is intuitive, it is notobvious how to prove it, at least if one tries to reduce the computation of one summandto E . Instead we will show that our framework allows less cumbersome reductions, atleast for what we will call the congruent cases. We start by formally defining a linearcombination of graphically restricted homomorphisms. ETH is the “exponential time hypothesis”, stating that k -SAT cannot be solved in subexponentialtime (see [19]). Here τ maps every graph to the independent set of the same size implying that τ - M ( C ) = C . efinition 33. Let A be a set of computable functions a : G × T → Q ≥ with finitesupport. We define the parameterized counting problem LC ( A ) as follows: Given a ∈ A and G ∈ G , compute the linear combination : X ( H,τ ) ∈ supp ( a ) a ( H, τ ) · Hom τ ( H, G ) , parameterized by supp ( a ) + max ( H,τ ) ∈ supp( a ) V ( H ) ! . Given a function a ∈ A we denoteT- M ( a ) := [ ( H,τ ) ∈ supp ( a ) τ - M ( H ) and T- M ( A ) := [ a ∈A T- M ( a )as the set of all τ -minors of a and A , respectively. Furthermore, we say that a is congruent if for every ( H , ∗ ) and ( H , ∗ ) ∈ supp ( a ) it holds that Parity ( V ( H )) = Parity ( V ( H )).We say that A is congruent if all its elements are congruent.If we let τ is be the graphical restriction that maps a graph H to the independent setwith vertices V ( H ) and set A = { a k | k ∈ N } such that a k ( P k , τ is ) = 1, a k ( K k , τ Li ) = 1, a k ( C k , τ clique ) = 1 and 0 otherwise then LC ( A ) is equivalent to E .For congruent A we can derive a complete complexity classification. Theorem 34.
The problem LC ( A ) is fixed-parameter tractable if T - M ( A ) has boundedtreewidth. Otherwise, if A is additionally congruent, it is -hard.Proof. The FPT algorithm for the positive result is straight-forward: As the treewidthof T- M ( A ) is bounded, we can on input a ∈ A and G ∈ G compute Hom τ ( H, G )for every (
H, τ ) ∈ supp ( a ) in time g ( V ( H )) · n O (1) for a computable function g byTheorem 23. Consequently, computing the sum takes time less than supp ( a ) · g max ( H,τ ) ∈ supp( a ) V ( H ) ! · n O (1) yielding fixed-parameter tractability.Now assume that T- M ( A ) has unbounded treewidth and that A is congruent and let a ∈ A and G ∈ G . Lemma 19 yields that X ( H,τ ) ∈ supp ( a ) a ( H, τ ) · Hom τ ( H, G )= X ( H,τ ) ∈ supp ( a ) a ( H, τ ) · X ρ ≥∅ µ ( ∅ , ρ ) · Hom ( H/ρ, G )= X ( H,τ ) ∈ supp ( a ) X ρ ≥∅ a ( H, τ ) · µ ( ∅ , ρ ) · Hom ( H/ρ, G )Now let
H ∈ T- M ( A ). It holds that the coefficient d ( H ) of Hom ( H , G ) in the aboveequation satisfies: d ( H ) = X ( H,τ ) ∈ supp ( a ) X ρ ≥∅H∼ = H/ρ a ( H, τ ) · µ ( ∅ , ρ )21f we fix some ( H, τ ) ∈ supp ( a ) and ρ ∈ L ( M ( τ ( H ))) such that H ∼ = H/ρ we have that sgn ( a ( H, τ ) · µ ( ∅ , ρ )) = sgn ( µ ( ∅ , ρ )) = ( − rk ( ρ ) = ( − V ( H ) − c ( H/ρ ) = ( − V ( H ) − c ( H ) , where the first equality follows from the fact that a ( H, τ ) > a is congruent, the parities of all H such that ( H, ∗ ) ∈ supp ( a ) are equal and consequently we have that sgn ( d ( H )) =( − V ( H ) − c ( H ) , hence d ( H ) = 0. Therefore, if we consider LC ( A ) as the problemof computing linear combinations of homomorphisms (as we also did in the proof ofTheorem 23), we infer that every τ -minor will be inluded in the combination. As thetreewidth of those is not bounded we conclude by Theorem 11 that LC ( A ) is (cid:4) On the other hand, Theorem 34 is not true if we omit the constraint that A is congruent:Consider the problem Hom ( P ) where P is the class of all paths. It is fixed-parametertractable as P has bounded treewidth (see Theorem 11). Using Lovász identity [25] wehave that for any P k ∈ P and G ∈ G it holds that Hom ( P k , G ) = X ρ ≥∅ Emb ( P k /ρ, G ) . This is a linear combination of graphical homomorphisms (embeddings) including e.g.the term
Emb ( P k / ∅ , G ) = Emb ( P k , G ) with coefficient 1. But τ clique - M ( P ) has un-bounded treewidth and consequently the treewidth of all τ -minors of this linear com-bination is unbounded, too. This shows that there exist non-congruent A such that thetreewidth of T- M ( A ) is not bounded but LC ( A ) is fixed-parameter tractable.Now it is easy to see that E is Corollary 35.
The following problems are -hard: Given a graph G ∈ G and aparameter k ,(1) count all odd (or even) subgraphs of size bounded by k of G .(2) count all subgraphs of size k of G (follows also from [7]).(3) compute P ki =1 Li - Hom ( W i , G ) , i.e., the sum of all locally injective homomor-phisms from windmills of size bounded by k to G .(4) compute P ki =1 Li - Hom ( K i,i , G ) + Emb ( K i,i , G ) , where K i,i is the biclique of size i , that is, the complete bipartite graph with i vertices on each side.Proof (Proof of Corollary 35). Each statement follows by Theorem 34: τ clique - M ( P k ) is precisely the set of “spasms” of P k (see [7]). The claim follows by Fact 3.4 in [7] Odd k ⊆ G be the set of all odd graphs of size bounded by k . Then it holdsthat X H ∈ Odd k Sub ( H, G ) = X H ∈ Odd k Aut ( H ) − · Emb ( H, G ) . As Aut ( H ) − >
0, the above equation clearly is a congruent instance of the linearcombination problem. Furthermore
Odd k contains cliques of size ≥ k − k , implying that the parity is the same for all terms.(3) Congruence follows by the observation that W i has odd size for all i ≥
1. Un-bounded treewidth follows with the same argument as in Corollary 26.(4) Congruence follows by the fact that K i,i has even size for all i ≥
1. Unboundedtreewidth follows by observing that the class of all bicliques itself already hasunbounded treewidth. (cid:4)
We have shown that various parameterized counting problems can be expressed as alinear combination of homomorphisms over the lattice of graphic matroids, implyingimmediate complexity classifications along with fixed-parameter tractable algorithmsfor the positive cases. This results can be obtained without using often cumbersometools like “gadgeting” or interpolation and relies only on the knowledge of the problemof counting homomorphisms and the comprehension of the cancellation behaviour whentransforming a problem into this “homomorphism basis”. The latter, in turn, was nothingmore than a question about the sign of the Möbius function, which was answered byRota’s Theorem.This framework, however, still has limits: It seems that, e.g., neither induced subgraphsnor edge-injective homomorphisms [8] are graphically restricted. Indeed, both can beexpressed as a sum of homomorphisms over (non-geometric) lattices but the problem isthat there are isomorphic terms with different signs in both cases. This suggests that abetter understanding of the Möbius function over those lattices could yield even moregeneral complexity classifications of parameterized counting problems.
Acknowledgements
The author is very grateful to Holger Dell and Radu Curticapean for fruitful discussions.Furthermore the author thanks Cornelius Brand for saying “Tutte Polynomial” everyonce in a while. 23 eferences [1] Andreas Blass and Bruce E Sagan. Möbius functions of lattices.
Advances inmathematics , 127(1):94–123, 1997.[2] Graham R Brightwell and Peter Winkler. Note on counting eulerian circuits.[3] Andrei A Bulatov. A dichotomy theorem for nonuniform CSPs. arXiv preprintarXiv:1703.03021 , 2017.[4] Jin-Yi Cai, Pinyan Lu, and Mingji Xia. Holographic algorithms by fibonacci gatesand holographic reductions for hardness. In
Proceedings of the 49th Annual Sympo-sium on Foundations of Computer Science, FOCS , pages 644–653. IEEE, 2008.[5] Jin-Yi Cai, Pinyan Lu, and Mingji Xia. Computational complexity of holant prob-lems.
SIAM Journal on Computing , 40(4):1101–1132, 2011.[6] Radu Curticapean. Counting matchings of size k is
Proceedingsof the 40th International Colloquium on Automata, Languages, and Programming,ICALP, Part I , pages 352–363, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.[7] Radu Curticapean, Holger Dell, and Dániel Marx. Homomorphisms are a goodbasis for counting small subgraphs. In
Proceedings of the 49th ACM Symposium onTheory of Computing, STOC , pages 210–223, 2017.[8] Radu Curticapean, Holger Dell, and Marc Roth. Counting edge-injective homo-morphisms and matchings on restricted graph classes. In
Proceedings of the 34thSymposium on Theoretical Aspects of Computer Science, STACS , pages 25:1–25:15,2017.[9] Radu Curticapean and Dániel Marx. Complexity of counting subgraphs: Only theboundedness of the vertex-cover number counts. In
Proceedings of the 55th AnnualSymposium on Foundations of Computer Science, FOCS , pages 130–139, 2014.[10] Marek Cygan, Fedor V Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx,Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh.
Parameterized algorithms ,volume 3. Springer.[11] Víctor Dalmau and Peter Jonsson. The complexity of counting homomorphismsseen from the other side.
Theoretical Computer Science , 329(1):315–323, 2004.[12] Martin Dyer, Leslie Ann Goldberg, and Mark Jerrum. An approximation trichotomyfor Boolean
Journal of Computer and System Sciences , 76(3):267–277, 2010.[13] Tomás Feder and Moshe Y Vardi. The computational structure of monotonemonadic snp and constraint satisfaction: A study through datalog and group theory.
SIAM Journal on Computing , 28(1):57–104, 1998.2414] Jiří Fiala and Jan Kratochvíl. Locally constrained graph homomor-phisms—structure, complexity, and applications.
Computer Science Review ,2(2):97–111, 2008.[15] Jörg Flum and Martin Grohe. The parameterized complexity of counting problems.
SIAM J. Comput. , 33(4):892–922, 2004.[16] Leslie Ann Goldberg and Mark Jerrum. Counting unlabelled subtrees of a treeis
Computational Complexity: A Conceptual Perspective . CambridgeUniversity Press, 2008.[18] John E Hopcroft and Robert Endre Tarjan. Isomorphism of planar graphs. In
Complexity of computer computations , pages 131–152. Springer, 1972.[19] Russell Impagliazzo and Ramamohan Paturi. Complexity of k-SAT. In
Proceedingsof the 14th Annual IEEE Conference on Computational Complexity, 1999 , pages237–240. IEEE, 1999.[20] Mark Jerrum. Counting trees in a graph is
Inf. Process. Lett. ,51(3):111–116, 1994.[21] Mark Jerrum and Alistair Sinclair. Approximating the permanent.
SIAM Journalon computing , 18(6):1149–1178, 1989.[22] Pieter W. Kasteleyn. Graph theory and crystal physics. In
Graph Theory andTheoretical Physics , pages 43–110. Academic Press, 1967.[23] Richard E Ladner. On the structure of polynomial time reducibility.
Journal of theACM (JACM) , 22(1):155–171, 1975.[24] Bingkai Lin. The parameterized complexity of k-biclique. In
Proceedings of the26th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA , pages 605–615. Society for Industrial and Applied Mathematics, 2015.[25] László Lovász. Operations with structures.
Acta Mathematica Hungarica , 18(3-4):321–328, 1967.[26] Rudolf Mathon. A note on the graph isomorphism counting problem.
InformationProcessing Letters , 8(3):131–136, 1979.[27] Jaroslav Nešetřil. Homomorphisms of derivative graphs.
Discrete Mathematics ,1(3):257–268, 1971.[28] James G. Oxley.
Matroid Theory . Oxford University Press, 1992.[29] Arash Rafiey, Jeff Kinne, and Feder Tomás. Dichotomy for digraph homomorphismproblems. arXiv preprint arXiv:1701.02409 , 2017.2530] Gian-Carlo Rota. On the foundations of combinatorial theory I. Theory of möbiusfunctions.
Probability theory and related fields , 2(4):340–368, 1964.[31] Thomas J Schaefer. The complexity of satisfiability problems. In
Proceedings ofthe tenth annual ACM Symposium on Theory of Computing, STOC , pages 216–226.ACM, 1978.[32] Richard P Stanley. Enumerative combinatorics: Volume 1. 2011.[33] Harold N. V. Temperley and Michael E. Fisher. Dimer problem in statistical me-chanics - an exact result.
Philosophical Magazine , 6(68):1478–6435, 1961.[34] Seinosuke Toda. PP is as hard as the polynomial-time hierarchy.
SIAM Journal ofComputing , 20(5):865–877, 1991.[35] Salil P Vadhan. The complexity of counting in sparse, regular, and planar graphs.
SIAM Journal on Computing , 31(2):398–427, 2001.[36] Leslie G. Valiant. The complexity of computing the permanent.
Theoretical Com-puter Science , 8(2):189–201, 1979.[37] Leslie G Valiant. Accidental algorthims. In
Proceedings of the 47th Annual Sympo-sium on Foundations of Computer Science, FOCS , pages 509–517. IEEE, 2006.[38] Leslie G Valiant. Holographic algorithms.
SIAM Journal on Computing , 37(5):1565–1594, 2008.[39] Dominic JA Welsh.
Matroid theory . Courier Corporation, 2010.[40] Mingji Xia, Peng Zhang, and Wenbo Zhao. Computational complexity of countingproblems on 3-regular planar graphs.
Theoretical Computer Science , 384(1):111–125,2007.[41] Dmitriy Zhuk. The proof of CSP dichotomy conjecture. arXiv preprintarXiv:1704.01914arXiv preprintarXiv:1704.01914