Counting Restricted Homomorphisms via M\"obius Inversion over Matroid Lattices
Marc Roth

TL;DR
This paper develops a framework for classifying the complexity of counting restricted graph homomorphisms using M"obius inversion over matroid lattices, generalizing previous subgraph counting results and providing a complete FPT-hardness dichotomy.
Contribution
It introduces graphically restricted homomorphisms, extends complexity classification to these, and offers a comprehensive FPT versus #W[1]-hard dichotomy for various pattern classes.
Findings
Complete complexity dichotomy for counting graphically restricted homomorphisms.
Identification of FPT cases, including algorithms for certain pattern classes.
Extension of the dichotomy to linear combinations of homomorphisms.
Abstract
We present a framework for the complexity classification of parameterized counting problems that can be formulated as the summation over the numbers of homomorphisms from small pattern graphs H_1,...,H_l to a big host graph G with the restriction that the coefficients correspond to evaluations of the M\"obius function over the lattice of a graphic matroid. This generalizes the idea of Curticapean, Dell and Marx [STOC 17] who used a result of Lov\'asz stating that the number of subgraph embeddings from a graph H to a 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 homomorphisms that, inter alia, generalize subgraph embeddings as well as locally injective homomorphisms. We provide a complete parameterized complexity dichotomy for counting such homomorphisms, that is, we identify classes of…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Counting Restricted Homomorphisms via Möbius Inversion over Matroid Lattices
Marc Roth
Saarbrücken Graduate School of Computer Science
Cluster of Excellence (MMCI)
Saarland University
Abstract
We present a framework for the complexity classification of parameterized counting problems that can be formulated as the summation over the numbers of homomorphisms from small pattern graphs to a big host graph with the restriction that the coefficients correspond to evaluations of the Möbius function over the lattice of a graphic matroid. This generalizes the idea of Curticapean, Dell and Marx [STOC 17] who used a result of Lovász stating that the number of subgraph embeddings from a graph to a graph can be expressed as such a sum over the lattice of partitions of .
In the first step we introduce what we call graphically restricted homomorphisms that, inter alia, generalize subgraph embeddings as well as locally injective homomorphisms. We provide a complete parameterized complexity dichotomy for counting such homomorphisms, that is, we identify classes of patterns for which the problem is fixed-parameter tractable (FPT), including an algorithm, and prove that all other pattern classes lead to -hard problems. The main ingredients of the proof are the complexity classification of linear combinations of homomorphisms due to Curticapean, Dell and Marx [STOC 17] as well as a corollary of Rota’s NBC Theorem which states that the sign of the Möbius function over a geometric lattice only depends on the rank of its arguments.
We apply the general theorem to the problem of counting locally injective homomorphisms from small pattern graphs to big host graphs yielding a concrete dichotomy criterion. It turns out that — in contrast to subgraph embeddings — counting locally injective homomorphisms has “real” FPT cases, that is, cases that are fixed-parameter tractable but not polynomial time solvable under standard complexity assumptions. To prove this we show in an intermediate step that the subgraph counting problem remains -hard when both the pattern and the host graphs are restricted to be trees. We then investigate the more general problem of counting homomorphisms that are injective in the -neighborhood of every vertex. As those are graphically restricted as well, they can also easily be classified via the general theorem.
Finally we show that the dichotomy for counting graphically restricted homomorphisms readily extends to so-called linear combinations.
1 Introduction
In his seminal work about the complexity of computing the permanent Valiant [36] introduced counting complexity which has since then evolved into a well-studied subfield of computational complexity. Despite some surprising positive results like polynomial time 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 Eulerian cycles in directed graphs using the “BEST”-Theorem [2], most of the interesting problems turned out to be intractable. Therefore, several relaxations such as restrictions of input classes [40] and approximate counting [21, 12] were introduced. Another possible relaxation, the one this work deals with, is to consider parameterized counting problems as introduced by Flum and Grohe [15]. Here, problems come with an additional parameter and a problem is fixed-parameter tractable (FPT) if it can be solved in time where is the input size and is a computable function, which yields fast algorithms for large instances with small parameters. On the other hand, a problem is considered intractable if it is -hard. This stems from the fact that -hard problems do not allow an FPT algorithm unless standard assumptions such as the exponential time hypothesis (ETH) are wrong.
When investigating a family of related (counting) problems one could aim to simultaneously solve the complexity of as many problems as possible, rather than tackling a (possibly infinite) number of problems by hand. For example, instead of proving that counting paths in a graph is hard, then proving that counting cycles is hard and then proving that counting stars is easy, one should, if possible, find a criterion that allows a classification of those problems in hard and easy cases. Unfortunately, there are results like Ladner’s Theorem [23], stating that there are problems neither in nor -hard (assuming ), which give a negative answer to that goal in general. However, there are families of problems that have enough structure to allow so-called dichotomy results. One famous example, and to the best of the authors knowledge this was the first such result, is Schaefer’s dichotomy [31], stating that every instance of the generalized satisfiability problem is either polynomial time solvable or -complete. Since then much 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 for almost twenty years and indicates the difficulty of proving such dichotomy results, at least for decision problems. In counting complexity, however, it seems that obtaining such results is less cumbersome. One reason for this is the existence of some powerful techniques like polynomial interpolation [35], the Holant framework [37, 38, 4] as well as the principle of inclusion-exclusion which all have been used to establish very revealing dichotomy results such as [5, 9].
Examples of dichotomies in parameterized counting complexity are the complete classifications of the homomorphism counting problem due to Dalmau and Jonsson [11]111Ultimately, the results of [7] and this work rely on the dichotomy for counting homomorphisms and the subgraph counting problem due to Curticapean and Marx [9]. For the latter, one is given graphs and and wants to count the number of subgraphs of isomorphic to , parameterized by the size of . It is known that this problem is polynomial time solvable if there is a constant upper bound on the size of the largest matching of and -hard otherwise222On the other hand the complexity of the decision version of this problem, that is, finding a subgraph of isomorphic to , is still unresolved. Only recently it was shown in a major breakthrough that finding bicliques is hard [24].. The first step in this proof was the hardness result of counting matchings of size of Curticapean [6], which turned out to be the “bottleneck” problem and 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 parameterized reductions that, inter alia, allow a far easier proof of the general subgraph counting problem. Lovász result states that, given simple graphs and , it holds that
[TABLE]
where the sum is over the elements of the partition lattice of , is the set of embeddings333Note that embeddings and subgraphs are equal up to automorphisms, that is, counting embeddings and counting subgraphs are essentially the same problem. from to and is the set of homomorphisms from the graph obtained from by identifying vertices along to . Furthermore is the Möbius function. In their work Curticapean, Dell and Marx showed in a general theorem that a summation for pairwise non-isomorphic graphs is -hard if there is no upper bound on the treewidth of the pattern graphs and fixed-parameter tractable otherwise, using a dichotomy for counting homomorphisms due to Dalmau and Jonsson [11]. Having this, one only has to show two properties of (1) to obtain the dichotomy for . First, one has to show that a high matching number of implies that one of the graphs has high treewidth and second, that two (or more) terms with high treewidth and isomorphic graphs and do not cancel out (note that the Möbius function can be negative). As there is a closed form for the Möbius function over the partition lattice it was possible to show that whenever and are isomorphic the sign of the Möbius function is equal.
1.1 Our results
The motivation of this work is the question whether the result of Curticapean, Dell and Marx can be generalized to construct a framework for the complexity classification of counting problems that can be expressed as the summation over homomorphisms and it turns out that this is possible whenever the summation is over a the lattice of a graphic matroid and the coefficients are evaluations of the Möbius function over the lattice, capturing not only embeddings but also locally injective homomorphisms.
In Section 3 we introduce what we call graphically restricted homomorphisms: Intuitively, a graphical restriction of a graph is a set of forbidden binary vertex identifications of , modeled as a graph with vertex set and edges along the binary constraints. We write as the set of all graphs obtained from by contracting vertices along edges in and deleting multiedges, excluding those that contain selfloops. Now a graphically restricted homomorphism from to with respect to is a homomorphism from to that maps every pair of vertices that are adjacent in to different vertices in . We write for the set of all graphically restricted homomorphisms w.r.t. from to and provide a complete complexity classification for counting graphically restricted homomorphisms:
Theorem 1** (Intuitive version).**
*Computing is fixed-parameter tractable when parameterized by if the treewidth of every graph in is small. Otherwise the problem is -hard. *
In particular, we obtain the following algorithmic result:
Theorem 2**.**
*There exists a deterministic algorithm that computes in time , where is a computable function and is the maximum treewidth of every graph in . *
Having established the general dichotomy we observe that there exist graphical restrictions and such that is the set of all subgraph embeddings from to and is the set of all locally injective homomorphisms from to .
As a consequence we obtain a full complexity dichotomy for counting locally injective homomorphisms from small pattern graphs to big host graphs . To the best of the author’s knowledge, this is the first result about the complexity of counting locally injective homomorphisms.
Corollary 3** (Intuitive version).**
*Computing the number of locally injective homomorphisms from to is fixed-parameter tractable when parameterized by if the treewidth of every graph in is small. Otherwise the problem is -hard.
Moreover, there exists a deterministic algorithm that computes this number in time , where is a computable function and is the maximum treewidth of every graph in . *
We then observe that — in contrast to subgraph embeddings — counting locally injective homomorphisms has “real” FPT cases, that is, cases that are fixed-parameter tractable but not polynomial time solvable under standard assumptions. We show this by restricting the pattern graph to be a tree:
Corollary 4**.**
*Computing the number of locally injective homomorphisms from a tree to a graph can be done in deterministic time , that is, the problem is fixed-parameter tractable when parameterized by . On the other hand, the problem is -hard. *
To prove -hardness, we prove in an intermediate step that the subgraph counting problem remains hard when both graphs are restricted to be trees, which may be of independent interest:
Lemma 5**.**
*The problem of, given trees and , computing the number of subtrees of that are isomorphic to is -hard. *
After that we generalize locally injective homomorphisms to homomorphisms that are injective in the -neighborhood of every vertex and observe that those are also graphically 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 linear combinations of graphically restricted homomorphisms. Here one gets as input graphs together with positive coefficients and a graph and the goal is to compute
[TABLE]
for graphical restrictions . This generalizes for example problems like counting all trees of size in or counting all locally injective homomorphisms from all graphs of size to or a combination thereof. We find out that, under some conditions, the dichotomy criteria transfer immediately to linear combinations:
Theorem 6** (Intuitive version).**
*Computing is fixed-parameter tractable when parameterized by if the maximum treewidth of every graph in is small. Otherwise, if additionally has the same parity for every , the problem is -hard. *
Furthermore we observe that this theorem is not true on the -hardness side if we omit the parity condition.
1.2 Techniques
The main ingredients of the proofs of Theorem 1 and Theorem 2 are the complexity classification of linear combinations of homomorphisms due to Curticapean, Dell and Marx (see Lemma 3.5 and Lemma 3.8 in [7]) as well as a corollary of Rota’s NBC Theorem (see e.g. Theorem 4 in [30]). In the first step we prove the following identity for the number of graphically restricted homomorphisms via Möbius inversion:
[TABLE]
where the sum is over elements of the lattice of flats of the graphical matroid given by and is the graph obtained by contracting the vertices of along the flat . After that we use Rota’s Theorem to prove that none of the terms cancel out444Here “cancel out” means that it could be possible that and are isomorphic, but and all other are not isomorphic to . In this case, the term would vanish in the above identity., despite the fact that the Möbius function can be negative. More precisely we show that whenever , we have that and therefore, by Rota’s Theorem, .
The dichotomies for locally injective homomorphisms and homomorphisms that are injective in the -neighborhood of every vertex are mere applications of the general theorem. For -hardness of the subgraph counting problem restricted to trees, we adapt the idea of the “skeleton graph” by Goldberg and Jerrum [16] and reduce directly from computing the permanent. To transfer this result to locally injective homomorphisms we use the well-known observation that locally injective homomorphisms from a tree to a tree are embeddings.
Finally, we prove the dichotomy for linear combinations of graphically restricted homomorphisms by taking a closer look at the proof of Theorem 1. Here, the parity constraint of the vertices of the graphs in the linear combination assures that there are no graphs and and elements and of the matroid lattices of and such that and are isomorphic but and have ranks of different parities. Using this observation, Theorem 6 can be proven in the same spirit as Theorem 1.
2 Preliminaries
First we will introduce some basic notions: Given a finite set , we write or for the cardinality of . Given a natural number we let be the set . Given a real number we define the sign of to be if , [math] if and if .
A poset is a pair where is a set and is a binary relation on that is reflexive, transitive and anti-symmetric. Throughout this paper we will write if . A lattice is a poset such that every pair of elements has a least upper bound and a greatest lower bound that satisfy:
, and for all such that and it holds that .
, and for all such that and it holds that .
Given a finite set , a partition of is a set of pairwise disjoint subsets of such that . 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 lattice and called the partition lattice of . We will in particular encounter lattices of graphic matroids in our proofs.
2.1 Matroids
We will follow the definitions of Chapt. 1 of the textbook of Oxley [28].
Definition 7**.**
A matroid is a pair where is a finite set and such that
- (1)
, 2. (2)
if and then , and 3. (3)
if and then there exists such that .
We call the ground set and an element an independent set. A maximal independent set is called a basis. The rank of is the size of its bases555This is well-defined as every maximal independent set has the same size due to (3)..
Given a subset we define . Then is also a matroid and called the restriction of to . Now the rank of is the rank of . Equivalently, the rank of is the size of the largest independent set .
Furthermore we define the closure of as follows:
[TABLE]
Note that by definition . We say that is a flat if . We denote as the set of flats of . It holds that together with the relation of inclusion is a lattice, called the lattice of flats of . The least upper bound of two flats and is and the greatest lower bound is . It is known that the lattices of flats of matroids are exactly the geometric lattices666For the purpose of this paper we do not need the definition of geometric lattices but rather the equivalent 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. and we denote the set of those lattices as .
In Section 3 we take a closer look at (lattices of flats of) graphic matroids:
Definition 8**.**
Given a graph , the graphic matroid has ground set and a set of edges is independent if and only if it does not contain a cycle.
If is connected then a basis of is a spanning tree of . If consists of several connected components then a basis of induces spanning trees for each of those. Every subset of induces a partition of the vertices of where the blocks are the vertices of the connected components of and it holds that
[TABLE]
In particular, the flats of correspond bijectively to the partitions of vertices of into connected components as adding an element to such that the rank does not change will not change the connected components, too. For convenience we will therefore abuse notation and say, given an element of the lattice of flats of , that partitions the vertices of where the blocks are the vertices of the connected components of . The following observation will be useful in Section 3:
Lemma 9**.**
*Let for a graph . If the number of blocks of and are equal then . *
Proof*.*
Immediately follows from Equation (2). ■
We denote as the graph obtained from by contracting the vertices of that are in the same component of and deleting multiedges (but keeping selfloops). As the vertices of partition the vertices of , we think of the vertices of as subsets of vertices of and call them blocks. Furthermore we write for the block containing .
2.2 Graphs and homomorphisms
In this work all graphs are considered unlabeled and simple but may allow selfloops unless stated otherwise. We denote the set of all those graphs as . Furthermore we denote as the set of all unlabeled and simple graphs without selfloops.
For a graph we write for the number of vertices of and for the number of edges of . We denote as the number of connected components of . Furthermore, given a subset of edges, we denote as the graph with vertices and edges . Given a partition of vertices of a graph , we write as the graph obtained from by contracting the vertices of that are in the same component of and deleting multiedges (but keeping selfloops). As the vertices of partition the vertices of , we think of the vertices as subsets of vertices of and call them blocks. Furthermore we write for the block containing .
Given graphs and , a homomorphism from to is a mapping such that implies that . We denote as the set of all homomorphisms from to . A homomorphism is called embedding if it is injective and we denote as the set of all embeddings from to . An embedding from to is called an automorphism of . We denote as the set of all automorphisms of . Furthermore we let be the set of all subgraphs of that are isomorphic to . Then it holds that (see e.g. [25]).
Given a set and a function , we define the support of as follows:
[TABLE]
A graph parameter that will be of quite some importance to define the dichotomy criteria 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 is a pair , where is a tree whose every node is assigned a vertex subset , such that:
- (1)
. 2. (2)
For every , there exists such that and are contained in . 3. (3)
For every , the set induces a connected subtree of .
The width of is the size of the largest for minus and the treewidth of is the minimum width of any tree decomposition of . We write for the treewidth of . Given a finite set of graphs , we denote as the maximum treewidth of any graph in .
Examples of graphs with small treewidth are matchings, paths and more generally trees and forests or cycles. On the other hand, graphs with high treewidth are for example cliques, bicliques and grid graphs.
Throughout this paper we will often say that a set of graphs has bounded treewidth meaning that there is a constant such that the treewidth of every graph is bounded by .
2.3 Parameterized counting
We will mainly follow the definitions of Chapt. 14 of the textbook of Flum and Grohe [15]. A parameterized counting problem is a function together with a polynomial-time computable parameterization . A parameterized counting problem is fixed-parameter tractable if there exists a computable function such that it can be solved in time for any input . A parameterized Turing reduction from to is an FPT algorithm w.r.t. parameterization with oracle that on input computes and additionally satisfies that there exists a function such that for every oracle query it holds that . A parameterized counting problem is -hard if there exists an FPT Turing reduction from - to , where - is the problem of, given a graph and a parameter , computing the number of cliques of size in 777For a more detailed introduction to we recommend [15] to the interested reader.. Under standard assumptions (e.g. under the exponential time hypothesis) -hard problems are not fixed-parameter tractable.
The following two parameterized counting problems will be of particular importance in this work: Given a class of graphs , () is the problem of, given a graph and a graph , computing (). Both problems are parameterized by . Their complexity has already been classified:
Theorem 11** ([11]).**
*Let be a recursively enumerable class of graphs. If has bounded treewdith then can be solved in polynomial time. Otherwise is -hard. *
Theorem 12** ([9]).**
*Let be a recursively enumerable class of graphs. If has bounded matching number then can be solved in polynomial time. Otherwise is -hard. *
Recall that “bounded treewidth (matching number)” means that there is a constant such that the treewidth (size of the largest matching) of any graph in is bounded by .
2.4 Linear combinations of homomorphisms and Möbius inversion
Curticapean, Dell and Marx [7] introduced the following parameterized counting problem:
Definition 13** (Linear combinations of homomorphisms).**
Let be a set of functions with finite support888We can also think of being a set of lists.. We define the parameterized counting problem as follows:
Given and , compute
[TABLE]
Note that this problem generalizes . The following theorem will be the foundation of all complexity results in this paper:
Theorem 14** ([7], Lemma 3.5 and Lemma 3.8).**
*If has bounded treewidth then can be solved in time on input where and 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 simpler proof of Theorem 12. The idea is that every problem is equivalent to a problem . As all proofs in this work are in the same flavour, we will outline the technique here, using as an example. Therefore, we first need to introduce the so called Möbius inversion (we recommend reading [32] for a more detailed introduction):
Definition 15**.**
Let be a poset and be a function. Then the zeta transformation is defined as follows:
[TABLE]
Theorem 16** (Möbius inversion, see [32] or [30]).**
Let and as in Definition 15. Then there is a function such that for all it holds that
[TABLE]
* is called the Möbius function. *
The following identity is due to Lovász [25]:
[TABLE]
where and are partitions of vertices of and is the partition lattice of . Now Möbius inversion yields the following identity [25]:
[TABLE]
where is the Möbius function over the partition lattice. Therefore, for every class of graphs , there is a family of functions with finite support such that and are the same problems. Now Curticapean, Dell and Marx show that has unbounded matching number if and only if has unbounded treewidth. The critical point in this proof was to show that the sign of only depends on the number of blocks of , which implies that for two isomorphic graphs and , the terms and have the same sign in the above identity and therefore do not cancel out in the homomorphism basis. As there is a closed form for 999Here it is crucial that is the Möbius function over the (complete) partition lattice., the information about the sign could easily be extracted.
The motivation of this work is the question whether this can be made more general and it turns out that a corollary of Rota’s NBC Theorem [30] (see also [1]) captures exactly what we need:
Theorem 17** (See e.g. Theorem 4 in [30]).**
Let be a geometric lattice with unique minimal element and let be an element of . Then it holds that
[TABLE]
In the following we will show that combining Rota’s Theorem and the dichotomy for counting linear combinations of homomorphisms yields complete complexity classifications for the problems of counting those restricted homomorphisms that induce a Möbius inversion over the lattice of a graphic matroid, which are known to be geometric, when transformed into the homomorphism basis. Those include embeddings as well as locally injective homomorphisms.
3 Graphically restricted 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 to a graph such that , that is, only modifies edges of . We denote the set of all graphical restrictions as . Given graphs and and a graphical restriction , we define the set of graphically restricted homomorphisms w.r.t. from to as follows:
[TABLE]
Given a recursively enumerable class of graphs , we define the parameterized counting problem as follows: Given a graph and a graph , we parameterize by and wish to compute .
Assume for example that maps a graph to the complete graph with vertices . Then one can easily verify that .
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 and it holds that
[TABLE]
*where and are the relation and the Möbius function of the lattice . *
Proof*.*
Let and be fixed and let be the set of all homomorphisms such that and imply that . More precisely:
[TABLE]
We will first prove the following identities:
Claim 20**.**
For all it holds that
[TABLE]
Proof*.*
Every block in is a singleton and . Now the identity trivially follows from Definition 18. ■
Claim 21**.**
For all and it holds that
[TABLE]
Proof*.*
Let be the block of in . We define an equivalence relation over as follows:
[TABLE]
We write for the equivalence class of and let be the graph obtained from by further contracting different blocks and whenever and (note that this is well-defined by the definition of ). Now consider in the graphical matroid . Every block corresponds to a connected component of the flat given by . Now contracting different blocks and for in is a refinement of obtained by adding the edge in and taking the closure. Therefore the equivalence classes of and the refinements of in the matroid lattice correspond bijectively and we write for the equivalence class corresponding to . It remains to show that for every we have that
[TABLE]
This can be proven by constructing a bijection . We write for blocks in and for blocks in . On input , outputs the homomorphism in that maps a block to . This is well-defined as maps blocks and to the same vertex in if and only if they are subsumed by a common block in (recall that in the matroid lattice). On the other hand we can construct a mapping that given outputs the homomorphism in that maps a block to the image of the block (that subsumes ) according to . Now and . Consequently, is a bijection and Equation 5 holds. Now we have
[TABLE]
which proves the claim. ■
Now Claim 21 is a zeta transform over the matroid lattice of . By Möbius inversion (Theorem 16) we obtain that
[TABLE]
and hence, by Claim 20,
[TABLE]
■
Intuitively, we will now show that counting graphically restricted homomorphisms from to is hard if we can ”glue” vertices of together along edges of such that the resulting graph has no selfloops and high treewidth. We will capture this intuition formally:
Definition 22**.**
Let be a graph and let be a graphical restriction. A graph obtained from by contracting pairs of vertices and such that and deleting multiedges (but keeping selfloops) is called a -contraction of . If additionally , that is, the contraction did not yield selfloops, we call a -minor of . We denote the set of all -minors of as and given a class of graphs we denote the set of all -minors of all graphs in as .
Finally, we can classify the complexity of counting graphically restricted homomorphisms along the treewidth of their -minors:
Theorem 23** (Theorem 1 and Theorem 2, restated).**
Let be a graphical restriction and let be a recursively enumerable class of graphs. Then is FPT if has bounded treewidth and -hard otherwise. Furthermore, given , there exists a deterministic algorithm that computes in time
[TABLE]
*where is a computable function. *
Proof*.*
By Lemma 19 we have that
[TABLE]
Now, as has no selfloops, a term is zero whenever has a selfloop. Consequently, for every non-zero term , it holds that . Therefore, by Lemma 3.5 in [7], we obtain an algorithm computing in time
[TABLE]
for a computable function . This immediately implies that the problem is fixed-parameter tractable if has bounded treewidth. It remains to show that is -hard otherwise. By condensing all terms and where and are isomorphic, it follows that there exist coefficients for every such that
[TABLE]
We will now show that none of the is zero: It holds that
[TABLE]
Consider and such that . It follows that
[TABLE]
Now, as the lattice of is geometric, we can apply the corollary of Rota’s NBC Theorem (Theorem 17) and obtain that . Consequently every term in Equation (6) has the same sign and therefore . Now we define a function as follows
[TABLE]
and we set . Then the problems and are equivalent w.r.t. parameterized turing reductions. As for every it follows that has unbounded treewidth if and only if has unbounded treewidth. We conclude by Theorem 14 that is -hard in this case. ■
4 Locally injective homomorphisms
In this section we are going to apply the general dichotomy theorem to the concrete case of counting locally injective homomorphisms. A homomorphism from to is locally injective if for every it holds that is injective. We denote as the set of all locally injective homomorphisms from to and we define the corresponding counting problem for a class of graphs as follows: Given graphs and , compute . The parameter is . 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 homomorphisms are graphically restricted homomorphisms.
Lemma 24**.**
*Let be a graph and let be a graphical restriction defined as follows: . Then for all it holds that . *
Proof*.*
We prove both inclusions. Let and assume that is not locally injective. Then there exists such that is not injective which implies that there are and such that and are edges in and . By definition and therefore which is a contradiction.
Now let and assume that . Then there exist such that and . The former implies that and have a common neighbor in but this contradicts the fact that is locally injective. ■
We continue by stating the dichotomy for counting locally injective homomorphisms.
Corollary 25** (Corollary 3, restated).**
*Let be a recursively enumerable class of graphs.
Then is FPT if has bounded treewidth and -hard otherwise. Furthermore, there exists a deterministic algorithm that computes in time*
[TABLE]
*where is a computable function. *
Proof*.*
Follows immediately from Lemma 24 and Theorem 23. ■
We give an example for a hard instance of the problem: Let be the “windmill” graph of size , i.e., the graph with vertices , , and edges and for each . Furthermore we let be the set of all for .
Corollary 26**.**
* is -hard. *
Proof*.*
It turns out that every graph consisting of edges is a minor of some graph in . To see this let be a graph with edges. We enumerate the edges of as and identify each edge with the edge in . Now, whenever (or ) we contract vertices and (or and , respectively) in . As each and (or and , respectively) have the common neighbor , and furthermore and are never contracted, the resulting graph is a -minor of . If we now remove from along with every edge incident to , the resulting graph is isomorphic to . Consequently, the treewidth of is not bounded and hence is -hard by Theorem 23. ■
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 be the class of all trees. Counting locally injective homomorphisms from those graphs is fixed-parameter tractable:
Corollary 27**.**
* is FPT. In particular, there is a deterministic algorithm that computes for a tree in time*
[TABLE]
*where is a computable function. *
Proof*.*
According to Corollary 25 we only need to show that has treewidth . Indeed, every -minor of a tree is again a tree, and has therefore treewidth . To see this, consider a pair of vertices and that have a common neighbor in a tree . Then is the only path between and and consequently contracting and to a single vertex will not create a cycle in the resulting graph (recall that we delete multiedges). ■
On the other hand is unlikely to have a polynomial time algorithm.
Lemma 28**.**
* is -hard. *
We prove this lemma in the following subsection.
4.1 Counting subtrees of trees
The aim of this section is to prove Lemma 28. We start by giving an introduction to classical counting complexity which was established by Valiant in his seminal work about the complexity of computing the permament [36]. A (non-parameterized) counting problem is a function . The class of all counting problems solvable in polynomial time is called . On the other hand, the notion of intractability is -hardness. is the class of all counting problems reducible101010(Many-one) reductions in counting complexity differ slightly from many-one reductions in the decision world. However, for the purpose of this section we only need Turing reductions. We recommend Chap. 6.2 of [17] to the interested reader. to , the problem of computing the number of satisfying assignments of a given CNF formula. A counting problem is -hard if there exists a polynomial time Turing reduction from to , that is, an algorithm with oracle that solves in polynomial time. Toda [34] proved that which indicates that -hard problems are much harder than -complete problems.
To prove Theorem 28, we will first prove -hardness of the following intermediate problem: Given two trees , compute the number of subtrees of that are isomorphic to . We call this problem .
Lemma 29** (Lemma 5, restated).**
* is -hard. *
Related results are -hardness for counting all subtrees of a given graph [20] or even counting all subtrees of a given tree [16]. As the number of non-isomorphic trees with vertices is not bounded by a polynomial in , we do not know how to reduce directly from these problems. Instead we use a construction quite similar to the ”skeleton” graph in [16] to reduce from the problem of computing the permanent.
Given a quadratic matrix with elements the permanent of is defined as follows:
[TABLE]
where is the symmetric group with elements.
Theorem 30** ([36]).**
*Computing the permanent is -hard even when restricted to matrices with entries from . *
Proof* (Proof of Lemma 29).*
We reduce from computing the permanent of matrices with entries from . Given a quadratic matrix of size , we construct a tree as follows:
For every entry we create a vertex and add edges for every and . 2. 2.
Whenever we create a vertex and add edges . 3. 3.
For every column we create a vertices and add edges , ,, and . 4. 4.
Finally, we create a vertex and add edges for all . In the following we call the root.
We give an example in Figure 1 for a matrix
[TABLE]
We claim that for all quadratic matrices of size with entries from it holds that
[TABLE]
where is the quadratic matrix of size with s on the diagonal and [math]s everywhere else. In the following we write for a vertex in and for a vertex in . To prove the claim we first observe that whenever a subtree of is isomorphic to , the root of has to be mapped to the root of by the isomorphism as the roots are the only vertices with degree (which is why we needed as every other vertex has degree ). It follows that the vertices of are mapped to of which induces a permutation on elements, that is, an element . We will now partition the subtrees of isomorphic to by those permutations and write for the number of subtrees that induce . Now fix and consider a subtree that induces . It holds that for all the vertex has to be mapped to as those are the only vertices with degree exactly and furthermore, the vertices have to be mapped to (possibly permuted but the subtree of is the same). Now is adjacent to for each and therefore has to be adjacent to , that is . If this is not the case then there is no subtree that induces partition . Furthermore there is at most one subtree isomorphic to inducing because the image is enforced by , and for all . Consequently if for all it holds that and otherwise. Hence and therefore
[TABLE]
Now the reduction works as follows: If the input matrix has size we brute-force the output and otherwise we compute with the oracle for . ■
Now the proof of Lemma 28 relies on the fact that locally injective homomorphisms from a tree to a tree are embeddings.
Proof* (Proof of Lemma 28).*
It is a well-known fact that a locally injective homomorphism from a tree to a tree is injective. To see this assume that there are vertices and in that are mapped to the same vertex in . As is a tree there exists exactly one path between and in . It holds that as otherwise and would be adjacent and hence would have a selfloop in which is impossible. As is locally injective we have that , hence , and as is edge preserving there are edges and and a path from to in . This induces a cycle and contradicts the fact that is a tree.
Therefore . By Lovász [25] it holds for all and that
[TABLE]
where is the set of automorphisms of . If is a tree then can be computed in polynomial time (even for planar graphs [26],[18]). Therefore -hardness of follows by reducing from : Given trees we compute by querying the oracle and in polynomial time. Then we output
[TABLE]
■
5 Injectivity in r-neighborhood
The generalization from locally injective homomorphisms to homomorphisms that are injective in the -neighborhood of every vertex is straightforward. Given a graph and we denote as the -neighborhood of , that is, a vertex is contained in if and only if , where the distance between and in . We then define
[TABLE]
Furthermore we define the counting problem for a class of graphs accordingly. Defining such that
[TABLE]
for every graph immediately yields the dichotomy:
Corollary 31**.**
Let be a recursively enumerable class of graphs. Then is FPT if has bounded treewidth and -hard otherwise. Furthermore, there exists a deterministic algorithm that computes in time
[TABLE]
*where is a computable function. *
We continue using trees as an example by observing that there is a phase transition in the complexity of when we change from , in which case , to :
Corollary 32**.**
* is -hard for . In particular, assuming ETH 111111ETH is the “exponential time hypothesis”, stating that -SAT cannot be solved in subexponential time (see [19])., there is no algorithm that computes for a tree in time*
[TABLE]
*for any computable function . *
Proof*.*
We only need to show that has unbounded treewidth, as the ETH lower bound simply follows from the fact that FPT under ETH (see e.g. Chapt. 16 in [15]). Therefore we construct the graph as follows:
We add vertices , , , .
We add edges , and for .
Clearly, is a tree. Now we contract vertices and for all and end up in . As and , those contractions are according to and hence the resulting graph is a -minor of . From we can further contract vertices along the lines of the proof of Corollary 26 to obtain arbitrary graphs with edges as minors of elements of . Consequently the treewidth of is not bounded. ■
6 Extension to linear combinations
The introduction of linear combinations of graphically restricted homomorphisms is motivated by the following example: Consider the problem of, given a parameter and a graph , computing , where are paths, cliques and cycles consisting of vertices. As 121212Here maps every graph to the independent set of the same size implying that ., and are graphically restricted homomorphisms we know the complexity of computing each summand, but we cannot immediately infer the complexity of . As has treewidth it follows by Theorem 11 or Theorem 23 that can be computed in FPT time. Consequently, is equivalent (w.r.t. FPT Turing reductions) to computing . As cliques have -minors of unbounded treewidth and cycles have unbounded matching number, these problems are both -hard (see Theorem 25 and Theorem 12). Even if hardness of is intuitive, it is not obvious how to prove it, at least if one tries to reduce the computation of one summand to . Instead we will show that our framework allows less cumbersome reductions, at least for what we will call the congruent cases. We start by formally defining a linear combination of graphically restricted homomorphisms.
Definition 33**.**
Let be a set of computable functions with finite support. We define the parameterized counting problem as follows: Given and , compute the linear combination:
[TABLE]
Given a function we denote
[TABLE]
as the set of all -minors of and , respectively. Furthermore, we say that is congruent if for every and it holds that . We say that is congruent if all its elements are congruent.
If we let be the graphical restriction that maps a graph to the independent set with vertices and set such that , , and [math] otherwise then is equivalent to .
For congruent we can derive a complete complexity classification.
Theorem 34**.**
*The problem is fixed-parameter tractable if has bounded treewidth. Otherwise, if is additionally congruent, it is -hard. *
Proof*.*
The FPT algorithm for the positive result is straight-forward: As the treewidth of is bounded, we can on input and compute for every in time for a computable function by Theorem 23. Consequently, computing the sum takes time less than
[TABLE]
yielding fixed-parameter tractability.
Now assume that has unbounded treewidth and that is congruent and let and . Lemma 19 yields that
[TABLE]
Now let . It holds that the coefficient of in the above equation satisfies:
[TABLE]
If we fix some and such that we have that
[TABLE]
where the first equality follows from the fact that and the second from the corollary of Rota’s Theorem (Theorem 17). As is congruent, the parities of all such that are equal and consequently we have that , hence . Therefore, if we consider as the problem of computing linear combinations of homomorphisms (as we also did in the proof of Theorem 23), we infer that every -minor will be inluded in the combination. As the treewidth of those is not bounded we conclude by Theorem 11 that is -hard. ■
On the other hand, Theorem 34 is not true if we omit the constraint that is congruent: Consider the problem where is the class of all paths. It is fixed-parameter tractable as has bounded treewidth (see Theorem 11). Using Lovász identity [25] we have that for any and it holds that
[TABLE]
This is a linear combination of graphical homomorphisms (embeddings) including e.g. the term with coefficient . But has unbounded treewidth131313 is precisely the set of “spasms” of (see [7]). The claim follows by Fact 3.4 in [7] and consequently the treewidth of all -minors of this linear combination is unbounded, too. This shows that there exist non-congruent such that the treewidth of is not bounded but is fixed-parameter tractable.
Now it is easy to see that is -hard. Further problems whose hardness follows from Theorem 34 are for example:
Corollary 35**.**
The following problems are -hard: Given a graph and a parameter ,
- (1)
count all odd (or even) subgraphs of size bounded by of . 2. (2)
count all subgraphs of size of (follows also from **[7]**). 3. (3)
compute , i.e., the sum of all locally injective homomorphisms from windmills of size bounded by to . 4. (4)
compute , where is the biclique of size , that is, the complete bipartite graph with vertices on each side.
Proof* (Proof of Corollary 35).*
Each statement follows by Theorem 34:
- (1)
Let be the set of all odd graphs of size bounded by . Then it holds that
[TABLE]
As , the above equation clearly is a congruent instance of the linear combination problem. Furthermore contains cliques of size implying that the treewidth of the instance is not bounded. The same argument holds for the case of counting all even subgraphs. 2. (2)
Follows also along the same lines as (1) with the additional argument that we only count graphs of size exactly , implying that the parity is the same for all terms. 3. (3)
Congruence follows by the observation that has odd size for all . Unbounded treewidth follows with the same argument as in Corollary 26. 4. (4)
Congruence follows by the fact that has even size for all . Unbounded treewidth follows by observing that the class of all bicliques itself already has unbounded treewidth.
■
7 Conclusion and further work
We have shown that various parameterized counting problems can be expressed as a linear combination of homomorphisms over the lattice of graphic matroids, implying immediate complexity classifications along with fixed-parameter tractable algorithms for the positive cases. This results can be obtained without using often cumbersome tools like “gadgeting” or interpolation and relies only on the knowledge of the problem of counting homomorphisms and the comprehension of the cancellation behaviour when transforming a problem into this “homomorphism basis”. The latter, in turn, was nothing more than a question about the sign of the Möbius function, which was answered by Rota’s Theorem.
This framework, however, still has limits: It seems that, e.g., neither induced subgraphs nor edge-injective homomorphisms [8] are graphically restricted. Indeed, both can be expressed as a sum of homomorphisms over (non-geometric) lattices but the problem is that there are isomorphic terms with different signs in both cases. This suggests that a better understanding of the Möbius function over those lattices could yield even more general 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” every once in a while.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Andreas Blass and Bruce E Sagan. Möbius functions of lattices. Advances in mathematics , 127(1):94–123, 1997.
- 2[2] Graham R Brightwell and Peter Winkler. Note on counting eulerian circuits.
- 3[3] Andrei A Bulatov. A dichotomy theorem for nonuniform CS Ps. ar Xiv preprint ar Xiv:1703.03021 , 2017.
- 4[4] Jin-Yi Cai, Pinyan Lu, and Mingji Xia. Holographic algorithms by fibonacci gates and holographic reductions for hardness. In Proceedings of the 49th Annual Symposium on Foundations of Computer Science, FOCS , pages 644–653. IEEE, 2008.
- 5[5] Jin-Yi Cai, Pinyan Lu, and Mingji Xia. Computational complexity of holant problems. SIAM Journal on Computing , 40(4):1101–1132, 2011.
- 6[6] Radu Curticapean. Counting matchings of size k is #W[1]-hard. In Proceedings of the 40th International Colloquium on Automata, Languages, and Programming, ICALP, Part I , pages 352–363, Berlin, Heidelberg, 2013. Springer Berlin Heidelberg.
- 7[7] Radu Curticapean, Holger Dell, and Dániel Marx. Homomorphisms are a good basis for counting small subgraphs. In Proceedings of the 49th ACM Symposium on Theory of Computing, STOC , pages 210–223, 2017.
- 8[8] Radu Curticapean, Holger Dell, and Marc Roth. Counting edge-injective homomorphisms and matchings on restricted graph classes. In Proceedings of the 34th Symposium on Theoretical Aspects of Computer Science, STACS , pages 25:1–25:15, 2017.
