Restricted CSPs and F-Free Digraph Algorithmics
Abstract
In recent years, much attention has been placed on the complexity of graph homomorphism problems when the input is restricted to -free and -subgraph-free graphs. We consider the directed version of this research line, by addressing the question is it true that digraph homomorphism problems have a versus -complete dichotomy when the input is restricted to -free (resp. -subgraph-free) digraphs? Our main contribution in this direction shows that if is -complete, then there is a positive integer such that remains -hard even for -subgraph-free digraphs. Moreover, becomes polynomial-time solvable for -subgraph-free acyclic digraphs. We then verify the questions above for digraphs on three vertices and a family of smooth tournaments. We prove these results by establishing a connection between -(subgraph)-free algorithmics and constraint satisfaction theory. On the way, we introduce restricted CSPs, i.e., problems of the form restricted to yes-instances of – these were called restricted homomorphism problems by Hell and Nešetřil. Another main result of this paper presents a P versus NP-complete dichotomy for these problems. Moreover, this complexity dichotomy is accompanied by an algebraic dichotomy in the spirit of the finite domain CSP dichotomy.
Keywords and phrases:
Digraph homomorphisms, constraint satisfaction problems, subgraph-free algorithmicsCategory:
Track B: Automata, Logic, Semantics, and Theory of ProgrammingFunding:
Santiago Guzmán-Pro: Funded by the European Research Council (Project POCOCOP, ERC Synergy Grant 101071674). Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Mathematics of computing Graph theory ; Theory of computation Graph algorithms analysis ; Theory of computation LogicEditors:
Keren Censor-Hillel, Fabrizio Grandoni, Joël Ouaknine, and Gabriele PuppisSeries and Publisher:

As little as a few years ago, most graph theorists, while passively aware of a few classical results on graph homomorphisms, would not include homomorphisms among the topics of central interest in graph theory. We believe that this perception is changing, principally because of the usefulness of the homomorphism perspective… At the same time, the homomorphism framework strengthens the link between graph theory and other parts of mathematics, making graph theory more attractive, and understandable, to other mathematicians. Pavol Hell and Jaroslav Nešetřil, Graphs and Homomorphisms, 2004 [21].
1 Introduction
Story of the main questions
The Hell-Nešetřil theorem asserts that if is a finite undirected graph, then is polynomial-time solvable whenever is either a bipartite graph or contains a loop, and otherwise is -complete. In recent years, much attention has been placed on the complexity of graph homomorphism problems when the input is restricted to -free and -subgraph-free graphs, i.e., to graphs avoiding as an induced subgraph, and as a subgraph, respectively. In [17], the authors show that is polynomial-time solvable when the input is restricted to -free graphs. Moreover, they show that there are finitely many -free obstructions to . Also, in [8] the authors prove that becomes tractable if the input is restricted to -free graphs, while Huang [22] proved that remains -hard even for -free graphs. In general, several complexity classifications are known for with input restriction to -free graphs (see, e.g., [18, Theorem 7]), however, a complete complexity classification of graph colouring problems with input restriction to -(subgraph)-free graphs remains wide open.
The finite domain CSP dichotomy [28] (announced independently by Bulatov [11] and Zhuk [27]) asserts that digraph colouring problems also exhibit a P versus NP-complete dichotomy. In this paper we consider the directed version of the research line described above, where we consider the following to be the long-term question of this variant: Is there a versus -complete dichotomy of where the input is restricted (1) to -free digraphs? and (2) to -subgraph-free digraphs?111Note that a negative answer to any of these questions implies that if , then there are finite digraphs and such that restricted to -free digraphs is -intermediate – which we believe to be a more natural problem than the current -intermediate problems constructed in the literature. At this point we do not conjecture either a positive or a negative answer to the previous questions.
The Sparse Incomparability Lemma [24] asserts that if is -hard, then it remains -hard even for high-girth digraphs. Hence, both questions above have a positive answer whenever is not an oriented forest. Motivated by the literature on graph colouring problems restricted to -free and -subgraph-free digraphs, we consider the restriction of these questions to the case when is a directed path .
Question 1.
Is there a versus -complete dichotomy of where the input is restricted
-
1.
to -free digraphs?
-
2.
to -subgraph-free digraphs?
In our effort to settle Question 1 we stumble into three more questions which we also address in this paper. Allow us to elaborate. Clearly, if if -hard even for -subgraph-free digraphs, then is -hard for -free digraphs. In turn, if restricted to -homomorphism-free digraphs is -hard, then restricted to -subgraph-free digraphs is -hard as well. It is well-known that a digraph is -homomorphism-free if and only if homomorphically maps to the transitive tournament in vertices (see, e.g, Observation 6). Hence, a simple way to find complexity lower bounds to the problems in Question 1 is to consider the complexity of restricted to .
The last problems have the following natural generalization: decide restricted to input digraphs in . We denote this problem by . These problems have been called restricted homomorphism problems [10, 9] and it was conjectured by Hell and Nešetřil that when and are undirected graphs, then , or is bipartite, and in these cases restricted to is in ; and otherwise it is -hard. This was later confirmed by Brewster and Graves [9], where they actually propose a hardness condition for a broader family of digraphs (see Theorem 5 below). It is then natural to ask our second main question.
Question 2.
Is there a versus -hard dichotomy of problems parametrized by finite digraphs (structures) and ?
Clearly, every digraph that admits a homomorphism to some transitive tournament must be an acyclic digraph. A natural question of a digraph , for which is NP-complete, is to ask if this problem remains NP-complete on acyclic instances. Notice that this is the same problem as . If is an undirected graph, then of course this will be true (choose any total order of the vertex set and orient the edges according to this ordering). However, when is an arbitrary digraph, the situation is not a priori clear. Indeed, it is addressed for some small digraphs by Hell and Mishra in [20]. They prove, for example, that – where is drawn in the forthcoming Figure 4 – does indeed remain NP-complete on acyclic inputs. The general question is not posed in [20], but it is perfectly natural, and we address it here.
Question 3.
If is -hard for a finite graph , does remain -hard for acyclic instances? Equivalently, is -hard whenever is -hard?
Some readers might have already noticed that there is a third natural question motivated by the previous paragraph: is there a versus -complete dichotomy of restricted to -homomorphism-free digraphs? Or more generally: is there a versus -hard dichotomy of where the input is restricted to -homomorphism-free digraphs? (where is a fixed finite set of digraphs). This question can already be settled from results in the literature: every such problem can be coded into monotone monadic strict NP (MMSNP), and Feder and Vardi [14] proved that if finite domain CSPs have a P versus NP-complete dichotomy, then MMSNP exhibits the same dichotomy. However, we provide an alternative prove of this fact in Section 5.
Story of the paper
Our paper splits into two parts. The first part focuses on relational structures, of which digraphs are somewhat canonical examples, while the second part focuses on digraphs specifically. In Figure 1 we depict the flow of ideas and results of this paper.
Within the first part (Sections 3–5), we begin by introducing restricted CSPs (RCSPs) which have been studied as restricted homomorphism problems in [10, 9]. In particular, we elaborate a connection with promise CSPs (PCSPs) that enables one to view RCSPs as PCSPs.
Our first main result shows that, for every pair of finite digraphs (structures), and the problem with input restricted to is either in P or NP-hard (settling Question 2). Moreover, this complexity classification is accompanied with an algebraic dichotomy (Theorem 18) which stems from the finite domain CSP dichotomy result. We push the previous complexity dichotomy to finite domain CSPs with restrictions in GMSNP (guarded monotone strict NP) [19, Section 4.4]. Another contribution of this work builds again on the finite domain CSP dichotomy to present a new proof of the complexity dichotomy for finite domain CSP restricted to -homomorphism-free digraphs (structures): we avoid going via MMSNP to the infinite domain CSP setting, and stay in the finite domain world via Lemma 21 (Section 5).
In the second part of the paper (Sections 6–9), we leverage results from the first part, in order to study digraph CSPs, where the ultimate focus will be on -free and -subgraph-free algorithmics.
Our second main result shows that, if is a digraph and is -complete, then there is a positive integer such that remains -complete even for -subgraph-free acyclic inputs (settling Question 3). Moreover, can be chosen so that is polynomial-time solvable for -subgraph-free acyclic inputs. This also yields a partial answer to Question 1: for every digraph there is a positive integer such that Question 1 has a positive answer restricted to . We complement this general partial answer by settling Question 1 for digraphs on three vertices (Theorems 31 and 32), and for a family of smooth tournaments (Theorems 33 and Theorem 34). We note that eventual hardness on -subgraph-free instances does not hold in general for , if is an infinite digraph. We provide a counterexample (Example 27) which is otherwise well-behaved (for example, by being -categorical). As byproducts of our work we see that there are finitely many minimal -obstructions to for each positive integer [19, Theorem 55], and if is not an oriented path, then (and ) is -hard even for -subgraph-free instances (Theorem 36).
2 Preliminaries
2.1 Relational structures and digraphs
For a finite relational signature , a relational (-)structure on domain consists of relations , …, , where is the arity of . We denote the cardinality of as . We tend to conflate the relation symbol and actual relation since this will not introduce confusion.
For some signature , the loop is the structure on one element all of whose relations are maximally full, that is, contains one tuple – the structure clearly depends on the signature , but in this work will always be clear from context.
Directed graphs (digraphs) are relational structures on the signature where is a binary relation. A digraph is a graph if is symmetric, i.e. iff . We will use the same blackboard font notation for digraphs as we do for relational structures.
Given a positive integer we denote by the directed cycle on vertices, by the directed path on vertices, by the transitive tournament on vertices. Similarly we denote by the complete graph on vertices, and we think of it as a digraph with edges for every .
A (directed) walk on a (directed) graph is a sequence of vertices such that for every there is a (directed) edge . An oriented graph is a digraph with no pair of symmetric edges, i.e., a loopless -free digraph.
A tree is an oriented digraph whose underlying graph has no cycle (equivalently, is an orientation of a traditional undirected tree). It follows that trees are -free. A forest is a disjoint union of trees. A structure is a core if all of its endomorphisms are self-embeddings. If is finite then this is equivalent to all endomorphisms being automorphisms.
2.2 Constraint satisfaction problems
Given a pair of digraphs and a homomorphism is a vertex mapping such that, for every that is an edge of , the image is an edge of . If such a homomorphism exists, we write , and otherwise . We follow the notation of constraint satisfaction theory, and denote by the class of finite digraphs such that . We also denote by the computational problem of deciding if an input digraph belongs to .
The finite-domain CSP dichotomy is commonly stated in terms of polymorphisms. A polymorphism of a structure is a homomorphism , and in this case we say that is an -ary polymorphism. A -ary polymorphism satisfies the Sigger’s identity if
The Sigger’s identity is one of several identities that equivalently describe the tractability frontier for finite domain CSPs.
Theorem 4 (Equivalent to Theorem 1.4 in [28]).
For every finite structure one of the following holds.
-
Either has a polymorphism that satisfies the Sigger’s identity, and in this case is polynomial-time solvable, or
-
otherwise, pp-constructs , and in this case is -complete.
2.3 Smooth digraphs
A digraph is smooth if it has no sources nor sinks. A digraph is hereditarily hard if is -complete for every loopless digraph such that . Bang-Jensen, Hell, and Niven conjectured that a smooth digraph is hereditarily hard whenever does not homomorphically map to a disjoint union of directed cycles [2, Conjecture 2.5], and this was later confirmed by Barto, Kozik, and Niven proved in [4]. As far as we are aware, the most general result regarding hardness of restricted CSP problems is Theorem 3 in [9].
Theorem 5 (Theorem 3 in [9]).
If is a hereditarily hard digraph and is a finite digraph such that then is -hard.
2.4 Duality pairs
A pair of digraphs (relational structure) are called a duality pair if for every digraph it is the case that if and only if . It was proved in [25] that for every tree there is a digraph such that is a duality pair. Moreover, they also proved that if is a duality pair, then is homomorphically equivalent to a tree. A well-known example of a family of duality pairs is the following one.
Observation 6.
For every positive integer the directed path together with the transitive tournament are duality pair.
Given a set of digraphs , we denote by the set of digraphs such that for every . It is straightforward to observe that for any such set , there is a (possibly infinite) digraph such that . A generalized duality is a pair of finite sets of digraphs such that When we simply write . In particular, for every set of trees there is a digraph such that is a generalized duality [16, Theorem 11].
2.5 Large girth
A well-known result from Erdős [13] about -colourabilty states that for every pair of positive integers there is a graph with girth strictly larger than and such that does not admit a proper -colouring. This result generalizes to arbitrary relational structures, and it is known as the Sparse Incomprability Lemma [24] – in order to stay within the scope of this paper, we state it for digraphs.
Given a digraph (structure) , the incidence graph of is the undirected bipartite graph with vertex set , for a vertex of and an edge of . There is an (undirected) edge in if and only if . The girth of is half the length of the shortest cycle in . Notice that if has a pair of symmetric arcs, its girth is , and otherwise, it is the graph theoretic girth of the underlying graph of .
Theorem 7 (Sparse Incomparability Lemma [24]).
For every digraph and every pair of positive integers and there is a digraph with the following properties:
-
,
-
the girth of is larger than ,
-
if and only if for every digraph on at most vertices,
-
can be constructed in polynomial time (from ).
3 Restricted constraint satisfaction problems
Promise problems (not to be confused with Promise CSPs) can be thought as decision problems with input restrictions. Formally [26], a promise problem is a pair of decidable sets. A solution to is a decidable set such that . We say that the promise problem is polynomial-time solvable if it has a solution in P, and if every solution is NP-hard, we say that is -hard.
Given a pair of (possibly infinite) structures and (with the same finite signature) whose CSPs are decidable, the restricted CSP is the promise problem . In this case, we call the template of the restricted CSP, is called the domain and the restriction. In particular, if is finite we say that is a finite domain RCSP, and if is finite, we say that is an RCSP with finite restriction.
Informally, the promise problem is where the input is promised to belong to . For instance, is essentially the problem of deciding whether an input -colourable graph is -colourable.
Notice that for any digraph (structure) the problems and are the same problems where is the loop. So every decidable CSP is captured by an RCSP with finite restriction. One of the main results of this work shows that every RCSP with finite restriction is log-space equivalent to a CSP. It follows from the proof that every finite domain RCSP with finite restriction is log-space equivalent to a finite domain CSP, and thus, finite domain restricted CSPs with finite restrictions have a P versus NP-hard dichotomy. Moreover, the reduction mentioned in this paragraph are obtained by restricted primitive positive construction (rpp-constructions), which are the natural cousins of pp-constructions for CSPs [5] and for PCSPs [3].
3.1 Restricted primitive positive constructions
Several reductions in graph algorithmics arise from gadget reductions. For instance, a standard way of proving that is -complete can be done with the following gadget reduction from . On input to , consider the graph obtained from by replacing every edge by a path (see, e.g., [21] where this is called an indicator construction). So in this case, the path on four vertices is the gadget associated to this reduction). The algebraic approach to CSPs proposes a general framework encompassing gadget reductions between constraint satisfaction problems. In this section we introduce primitive positive constructions, and restricted primitive positive constructions.
Primitive positive constructions
Given a pair of finite relational signature and , a primitive positive definition (of in )222When the signatures are clear from context we will simply say talk about a primitive positive definition. of dimension is a finite set of primitive positive formulas indexed by , and for each of arity the formula has free variables.
For every primitive positive definition of in we associate a mapping from -structures to -structures as follows. Given a -structure the pp power of is the structure
-
with domain , and
-
for each of arity the interpretation of in consists of the tuples such that .
We say that a structure pp-constructs a structure is there is a primitive positive definition such that , i.e., is homomorphically equivalent to . For instance, if is the -dimensional primitive positive definition consisting of
then the pp power of the -cycle is the complete graph (see Figure 2).
Remark 8.
For every fixed primitive positive definition , the pp-power is a monotone construction with respect to the homomorphism order, i.e., if , then (because existential positive formulas are preserved by homomorphism [6, Theorem 2.5.2]).
Gadget replacements
For every primitive positive formula without equalities333If a primitive positive formula contains a conjunct , we obtain an equivalent formula by deleting the conjunct and replacing each occurrence of the variable by the variable . we construct a structure with a distinguished tuples of vertices as follows.
-
The domain of consists of a vertex for every (free or bounded) variable of .
-
The distinguished vertices are the vertices .
-
For every relation symbol there is a tuple if and only if contains the conjunct where is the tuple of vertices corresponding to the tuple of variables .
The structure is sometimes called the canonical database of . For instance, if is the formula considered above, the the canonical database of is the directed with vertices , and the distinguished vertices are and .
The canonical database and the primitive positive formula are closely related: for every structure and a tuple of elements of
(see, e.g., [6, Proposition 1.2.5]).
Building on canonical databases, for every -dimensional primitive positive definition of in we associate a mapping from -structures to -structures as follows. Given a -structure the gadget replacement is the -structure obtained from where
-
for each vertex we introduce vertices , and
-
for each of arity , and every tuple we introduce a fresh copy of and we identify each -tuple with .
Going back to our on going example and taking , the gadget replacement is isomorphic to the directed -cycle (see Figure 2 for a depiction).
It is straightforward to observe that, in general, for every primitive positive definition , the gadget replacement can be constructed in logarithmic space from . Also, these mapping behave like adjoints (see, e.g., Observation 4.4 in [23]).
Log-space reductions and rpp-constructions
We say that a (not necessarily finite) restricted CSP template rpp-constructs a restricted CSP template if there is a primitive positive definition such that
Remark 9.
Every primitive positive formula is satisfiable in some finite structure, e.g., in the loop . This implies that for every primitive positive definition of in the pp-power of the (-)loop is homomorphically equivalent to the (-)loop . In particular, this implies that the following statements are equivalent for every -structure and every -structure .
-
pp-constructs .
-
rpp-constructs .
-
rpp-constructs for ever structure .
As mentioned above, pp-constructions compose, and building on this fact, it is straightforward to observe that rpp-constructions compose (see also [19, Lemma 13]).
Lemma 10.
Consider three restricted CSP templates , , and . If rpp-constructs , and rpp-constructs , then rpp-constructs .
Also, rpp-constructions yield log-space reductions between RCSPs as pp-constructions do for CSPs (the reader can find a proof in [19, Lemma 14]).
Lemma 11.
Consider two (not necessarily finite) restricted CSP templates and . If rpp-constructs , then there is a log-space reduction from to .
Example 12.
Observe that the restricted template rpp-constructs the template via the formula
Indeed, we already noticed that the pp power is isomorphic to . It is also not hard to observe that the pp power is homomorphically equivalent to the loop . Hence, by Lemma 11 we conclude that is -hard, i.e., deciding if a -colourable graph admits a homomorphism to is -hard.
4 Finite domain restrictions
In this section we show that for every restricted CSP template with finite restriction, there is a structure such that and are log-space equivalent. Moreover, if is also a finite structure, then is a finite structure. It thus follows from the finite domain dichotomy [11, 27] that restricted CSPs with finite domain and finite restriction, have a P versus NP-complete dichotomy.
4.1 Exponential structures
Given a pair of -structures and the exponential is the -structure
-
with vertex set all functions , and
-
for each of arity there is an -tuple belongs to the interpretation of in if and only if whenever .
In Figure 3 we depict an exponential digraph construction. This image is also found in [21], where the reader can also find further discussion and properties; we list two of them (see also [15, Corollary 1.5.12]).
Lemma 13.
The following statements hold for all -structures and .
-
is isomorphic to .
-
if and only if .
Corollary 14.
For every pair of (possibly infinite) -structures and , the restricted CSP template rpp-constructs the template .
Proof.
Let be the trivial primitive positive definition of in , i.e., for each or arity let . So for every structure the equality holds. Clearly, , and notice that is homomorphically equivalent to : since , it follows from the second item in Lemma 13 that , and clearly , so ; conversely, , so by Lemma 13, , and since , it follows that . Therefore, is a primitive positive definition witnessing that the claim of the lemma holds.
Lemma 15.
Let be a finite relational signature, and be a (possible infinite) -structure. If is a finite -structure, then the restricted template rpp-constructs the template .
Proof.
We first show that rpp-constructs , and we consider the case of digraphs but it naturally generalizes to -structures for finite . Let and consider the following -dimensional primitive positive definition , where
Notice that for any structure the pp-power is isomorphic to . Indeed, identify a tuple of with the function defined by , it now follows from the definition of the exponential structure and of that this mapping is an isomorphism. In particular, notice that contains the loop (the identity function is a loop on ). Hence,
i.e., is a witness to the fact that rpp-constructs .
We discuss two applications of this lemma. The first one being that rpp-constructions between RCSP templates with finite restrictions are captured by (standard) pp-constructions.
Theorem 16.
The following statements are equivalent for every pair of restricted templates and with finite restrictions.
-
rpp-constructs and,
-
pp-constructs .
In particular, and are mutually rpp-constructible (and so and are log-space Turing-equivalent).
Proof.
Suppose that pp-constructs , so by Remark 9 the template rpp-constructs . By Lemma 15, rpp-constructs , and by Corollary 14 rpp-constructs . Hence, by composing rpp-constructions (Lemma 10), we conclude that rpp-constructs . The converse implication follows with similar arguments: rpp-constructs (Lemma 15), and rpp-constructs (Corollary 14); by composing rpp-constructions we see that rpp-constructs , and it thus follows that pp-constructs (Remark 9).
The second application of Lemma 15 is the following statement which is analogous to the case of CSPs and pp-constructions (see, e.g., [6, Theorem 3.2.2]).
Corollary 17.
The following statements are equivalent for every (possibly infinite) structure and a finite structure with a finite signature.
-
The restricted template rpp-constructs .
-
The restricted template rpp-constructs every restricted template where is a finite structure (and a possibly infinite structure).
-
The structure pp-constructs .
If any of these equivalent statements hold, then is -hard.
Proof.
By the first item of Lemma 13 we know that is isomorphic to , and so pp-constructs if and only if pp-constructs . Hence, the equivalence between the first and third itemized statement follows from Theorem 16. Also, the second statement clearly implies the third one. Finally, we show that the first item implies the second one. It is well-known that that pp-constructs every finite structure (see, e.g., [6, Corollary 3.2.1]). So, by Remark 9 rpp-constructs every finite domain template (where is a possibly infinite structure). Again, by composing rpp-constructions, we conclude that rpp-constructs . The equivalence between the three itemized statement is now settled. The final statement holds because pp-construction yield log-space reduction (see, e.g., Corollary 3.5 in [5]), and because is -hard.
4.2 A dichotomy for finite domain RCSPs
The dichotomy for finite domain CSPs asserts that if is a finite structure, then either pp-constructs , and in this case is -complete; or otherwise, is polynomial-time solvable. We apply the results of this section to obtain an analogous (actually, equivalent) statement for finite domain CSPs with finite restrictions.
Theorem 18.
For every pair of finite structures one of the following statements hold.
-
Either rpp-constructs (and consequently, is -hard), or
-
is polynomial-time solvable.
Proof.
Suppose that the first itemized statement does not hold, and assume (otherwise, is in , and thus is polynomial-time solvable). Since does not rpp-construct , it follows from Corollary 17 that does not pp-construct . Hence, the finite domain dichotomy implies that is in . By the “in particular” statement of Theorem 16 we know that and are polynomial-time equivalent, and we thus conclude that is polynomial-time solvable.
RCSPs also make sense in the infinite setting, but this diverges from the main axis of this paper. Regarding finite domain RCSPs with infinite restrictions, the dichotomy from Theorem 18 can be leveraged into a dichotomy for finite-domain with certain tame infinite restrictions [19, Theorem 23]. Regarding infinite domain RCSPs we have little hope since infinite domain CSPs remain far from being understood. However, the tractability conjecture is a generalization of the Feder-Vardi conjecture to a broad class of “well-behaved” infinite structures. In the full version of this paper, we see that the tractability conjecture has an equivalent statement in terms of RCSPs of “well-behaved” infinite structures with finite restrictions [19, Theorem 24].
4.3 A small remark regarding PCSPs
Theorem 16 asserts in particular that is log-space equivalent to . The following statement strengthens this connection by showing that these two problems are further log-space equivalent to – the proofs are quite straightforward, and we leave them for the full version [19, Section 4.6].
Lemma 19.
For every possibly infinite structure and a (possibly infinite) structure and a finite structure, the following problems are polynomial-time equivalent.
-
the constraint satisfaction problem ,
-
the promise constraint satisfaction problem , and
-
the restricted constraint satisfaction problem .
Corollary 20.
For every non-bipartite graph and every finite digraph one of the following holds.
-
Either , and in this case is polynomial-time solvable,
-
or , and in this case is -hard.
5 Homomorphism-free restrictions
As mentioned above, the reader familiar with monotone monadic strict NP (MMSNP) can notice that digraph (finite domain) CSPs with input restriction to -homomorphism-free digraphs (structures) can be solved by infinite domain CSPs expressible in MMSNP. Thus, these problems exhibit a P versus NP-complete dichotomy (see, e.g., [7, 14]). Feder and Vardi reduce problems in MMSNP to finite domain CSPs. Their reduction changes the input signature, and then uses the Sparse Incomparability Lemma. Here, we prove the following lemma which allows us to preserve the signature by using duality pairs, and then, as Feder and Vardi, we proceed via Sparse Incomparability (see Section 5 in [19]).
Lemma 21.
For every finite set of structures and every finite digraph (structure) , there is a finite set of structures such that the following problems are polynomial-time equivalent:
-
deciding if an input structure belongs to for some , and
-
restricted to -homomorphism-free structures.
Theorem 22.
For every finite digraph (structure) and every finite set of digraphs (structures) , restricted to -homomorphism-free digraphs (structures) is either in or -complete.
6 Acyclic digraphs and bounded paths
In this section we apply our results above, and the theory of constraint satisfaction to obtain results in the context of -(subgraph)-free algorithmics. The main result of this section settles Question 3 (Theorem 25).
Consider a finite digraph , and let be a positive integer. For a given function and for each we define a function
where is the projection of onto .
Lemma 23.
Let be a digraph, a positive integer, and and -ary polymorphism of . If there are with such that , then is an -ary polymorphism of , and if satisfies the equalities
for some , then satisfies the equalities
Proof.
We first see that is an -ary polymorphism of . Let be an edge of , i.e., is an edge for for each . Since , it follows that is an edge of . Since is a polymorphism, it must be the case that is an edge of . Recall that the projection is a homomorphism from onto , and so
Finally, since , it follows that is an edge of , and thus is an -ary polymorphism of .
Now, let , and for each let , so
Since satisfies the loop condition for and , it follows that
And thus, , and since the choice of was arbitrary, the claim of this lemma follows.
Theorem 24.
For every finite digraph one of the following statements holds.
-
Either has a polymorphism satisfying the Sigger’s identity, and is in for every positive integer , or
-
otherwise, is -hard for every large enough .
Proof.
The first item holds by Theorem 4, and because if is in , then is in for every positive integer . Now, suppose that does not have a polymorphism satisfying the Sigger’s identity. Since can be verified in polynomial-time (see, e.g., Observation 6), it follows that and are polynomial-time equivalent. Let , and consider a polymorphism . Clearly, there are functions from to , and since for each every is a -ary function of , it follows from the choice of that there are such that . So, by Lemma 23 if satisfies the Sigger’s identity, then satisfies the Sigger’s identity. Since does not have such a polymorphism, then does not have such a polymorphism, and hence is -hard (see, e.g., Theorem 4). Moreover, since is polynomial-time equivalent to , it follows that is -hard. Finally, it is straightforward to observe that if is at least as hard as , and so, if is the smallest integer such that does not have a Sigger’s polymorphism, then witnesses that the second itemized statement holds.
As promised, we apply the framework of RCSPs to the context of -(subgraph)-free algorithmics – recall that the class of -subgraph-free acyclic digraphs equals the class of -homomorphism-free digraphs.
Theorem 25.
For every digraph such that is -hard, there is a positive integer such that remains -complete even for -subgraph-free acyclic digraphs. Moreover, there is such an such that is polynomial-time solvable when the input is a -subgraph-free acyclic digraphs.
Proof.
If the claim is trivial, so we assume that . Notice that a digraph is acyclic and has no directed path on vertices if and only if there is no homomorphism . Also, since is -complete and we are assuming that , it follows from Theorem 4 that has no Siggers polymorphism. The claim of this theorem now follows from these simple arguments and Theorem 24.
Corollary 26.
Let be a digraph such that is -hard. Then, there are positive integers and such that
-
is -hard for -free digraphs whenever , and
-
is -hard for -subgraph-free digraphs whenever .
The following example shows this corollary fails in the infinite (-categorical) setting. A structure is -categorical if for every positive integer the automorphism group of defines finitely many orbits of -tuples.
Example 27.
Let be the disjoint union of and the rational numbers with the strict linear order. It is straightforward to observe that -Colouring reduces to , and that every acyclic digraph is a yes-instance of . Hence, is -complete, but it is polynomial-time solvable on acyclic instances. The fact that is -categorical follows from its definition – it is the disjoin union of two -categorical digraphs.
7 Digraphs on three vertices
In this section we answer Question 1 for digraphs on three vertices. A loopless digraph on three vertices either contains two directed cycles and its CSP is -complete, or otherwise its CSP is polynomial-time solvable. Hence, we focus on the three loopless digraphs on three vertices: (obtained from the directed cycle by adding one edge), (obtained from the directed cycle by adding two edges), and – see also Figure 4.
Also note that these three digraphs are hereditarily hard (see, e.g., Conjecture 2.5 in [2] proved in [4]), and it thus follows from Theorem 5 that is -hard for . In turn, this implies that for such digraphs the problem is -hard even restricted to -(subgraph)-free digraphs.
Remark 28.
If a -subgraph-free weakly connected digraph contains (as a subgraph) a directed -cycle , then . Indeed, since is -subgraph-free and , it must be the case that the out- and in-neighbourhood of each is a subset of (and so, the claim follows because is weakly connected).
We now show that is tractable when the input is restricted to -subgraph-free digraphs. To do so, we reduce this problem to the list version of where is the digraph depicted in Figure 5, and we briefly argue that this problem is polynomial-time solvable.
Lemma 29.
The digraph from Figure 5 has a conservative majority polymorphism. In particular, can be solved in polynomial time.
Proof.
We define a conservative majority function , and we then argue that it is a polymorphism. We denote by the projection onto the first coordinate, and by the majority operation when . Also, we simplify our writing by implicitly assuming that in the -th itemized case of the following definition, neither of the first cases holds.
It is clear that is a symmetric conservative majority function. It is routine verifying that is indeed a polymorphism. The fact that can be solved in polynomial time now follows from [12] because the same function defines a majority polymorphism of .
Lemma 30.
can be solved in polynomial-time when the input is restricted to -subgraph-free digraphs.
Proof.
Consider a loopless weakly connected digraph with no directed -cycles. Let be the subset of vertices of incident to some symmetric edge, and let be the digraph obtained from after removing exactly one edge from each symmetric pair of edges. It is straightforward to observe there is no homomorphism from the directed path on four vertices to . Hence, by Observation 6, homomorphically maps to considered as a -structure where is a binary predicate and a unary predicate (this simply means that there is a homomorphism such that every vertex in is mapped to a vertex in ). Also note that if and only if there is a homomorphism where , i.e., if and only if (as -structures). It follows from these arguments that restricted to -subgraph-free digraphs reduces in polynomial time to . It is not hard to observe that the core of is the structure depicted in Figure 5, whose CSP can be solved in polynomial time (Lemma 29).
An algorithm that solves in polynomial time when the input is restricted to -subgraph-free digraphs processes each weakly connected component of the input and accepts if and only if the following subroutine accepts each weakly connected component. On a weakly connected component of , the subroutine distinguishes whether is -subgraph-free: if not, it accepts if is either or , and rejects otherwise – this step is consistent and correct because (see Remark 28); if is -free, then the subroutine accepts or rejects according to the reduction to explained above. Given the arguments in the previous paragraph, it is clear that this algorithm is consistent, correct, and runs in polynomial time.
Theorem 31.
The following statements hold for every positive integer .
-
If , then , , and are solvable in polynomial-time when the input is restricted to -subgraph-free digraphs.
-
If , then , , and are -hard even if the input is restricted to -subgraph-free digraphs.
Proof.
The second item follows from the arguments above. The first item holds for because every loopless -subgraph-free digraph is -colourable [19, Observation 38]. Similarly, every loopless -subgraph-free digraph admits a homomorphism to [19, Lemma 39]. Hence, the first itemized statement holds for . Finally, the tractability of restricted to -subgraph-free digraphs follows by Lemma 30.
Contrary to the -subgraph-free case, the CSPs of , , and have different behaviours with respect to -free input restrictions. Due to space restrictions, we limit ourselves to present a proof idea, and refer the reader to Section 7.2 in the full version for a complete proof.
Theorem 32.
The following statements hold for every positive integer .
-
is solvable in quadratic time for -free digraphs if , and -hard even for -free digraphs if ,
-
is solvable in linear time for -free digraphs if , and -hard even for -free digraphs if , and
-
is -hard even for -free digraphs.
Proof idea.
The case of is straightforward since is -complete for symmetric digraphs. The hard cases from the first and second item follow with standard gadget reductions; see [19, Lemma 43] for the former, and [19, Lemma 45] for the latter. Now, notice that restricted to -free digraphs reduces to . Indeed, a symmetric digraph maps to if and only if is bipartite. Finally, the tractability of restricted to -free digraphs is proved in [19, Lemma 44], where on a given -free digraph , the idea of the algorithm is the following. At each step there are three sets such that the mapping if defines a partial homomorphism from to . We extend these sets to in such a way that the partial homomorphism defined by extends to a homomorphism from if and only if the partial homomorphism defined by extends to a homomorphism from .
8 A family of smooth tournaments
In this section we answer Question 1 for a natural family of smooth tournaments . Given a positive integer , we denote by the tournament obtained from be reversing the edge from the source to the sink (see Figure 6). In particular, , and , so is polynomial-time solvable for , and -complete for (see, e.g., [1]).
Since is a hereditarily hard digraph ([2, Conjecture 2.5] proved in [4]) and , it follows that is -hard (Theorem 5). Equivalently, is -hard for digraphs with no directed walk on vertices, and since , is polynomial-time solvable for digraphs with no directed walk on vertices. However, if we only forbid as a subgraph (and not homomorphically), it turns out that is -hard even for -subgraph-free digraphs. This hardness proof uses a similar gadget reduction as in the case of [19, Lemma 47].
Theorem 33.
For every pair of positive integers and the following statements hold.
-
If or , then is in for -subgraph-free digraphs.
-
If and , then is -hard even for -subgraph-free digraphs.
Proof.
The hard cases follow from [19, Lemma 47]. The polynomial-time cases when follow because when . For, , the polynomial-time cases follow by Lemma 48 in [19] that is in for -subgraph-free digraphs because is an oriented graph and contains .
The idea of deterministically extending a partial homomorphism to solve on -free instances can also be used to see that is polynomial-time solvable on -free instances. Moreover, in this case it also follows that there are finitely many minimal -free obstruction to , and with a little extra work, we can even spell out these minimal obstructions. To streamline this paper, we present these lists in the full version of this paper [19, Section 8.2]. For now, we answer Question 1.2 for , where the hard cases are proved in Lemma 47 from [19], and the tractable ones are an immediate consequence of Theorem 55 in [19].
Theorem 34.
For every positive integer and one of the following holds
-
and in this case is tractable where the input is restricted to -free digraphs, or
-
and in this case is -complete where the input is restricted to -free digraphs.
9 Omitting a single digraph
As mentioned in the introduction, the long-term question of the research line introduced in this paper is the following.
Question 35.
Is there a versus -complete dichotomy of where the input is restricted
-
1.
to -free digraphs?
-
2.
to -subgraph-free digraphs?
Having settled Question 1 for the digraphs on three vertices and for the family of tournaments , a natural next step is tackling Question 35 for these digraphs. In [19, Section 9], we discuss several results in this direction which follow from our previous work. We present the current landscape in Tables 1 and 2 in [19]. Here, we merge the main results of Section 9 in [19] (Theorem 57 and Corollary 60) in the following statement.
Theorem 36.
For every positive integer the problems and are -hard even when the input is restricted to -subgraph-free digraphs, whenever is not a disjoint union of oriented paths, or when is a connected digraph with .
10 Conclusion and outlook
In this paper we have brought together homomorphisms, digraphs and -(subgraph-)free algorithmics. In doing so, we have uncovered a series of results concerning not only restricted CSPs, but also hardness of digraph CSPs under natural restrictions such as acyclicity. Our work raises numerous open problems, which we believe deserve attention in the future. Besides Questions 1 and 35, we ask the following.
-
Is it true that for every finite structure and every (possibly infinite) , if does not rpp-construct , then is polynomial-time solvable?
-
Do finite-domain RCSPs (with possibly infinite restriction) exhibit a P vs. NP-hard dichotomy? (Assuming
-
Characterize the class of finite digraphs (structures) such that is -hard for every finite such that (assuming ).
-
Characterize the class of finite digraphs (structures) that persistently construct , i.e., the template rpp-constructs whenever . See also [19, Observation 63].
-
Characterize the class of finite digraphs (structures) such that is -hard whenever (assuming ).
-
Since reduces to on acyclic instances (Theorem 25), and the latter is equivalent to we ask: is it true that for every finite digraph the (infinite) digraph pp-constructs ?
-
Is it true that for every tournament there a finitely many -free minimal obstructions to ? (Compare to [19, Theorem 55]).
References
- [1] Jørgen Bang-Jensen, Pavol Hell, and Gary MacGillivray. The complexity of colouring by semicomplete digraphs. SIAM Journal on Discrete Mathematics, 1(3):281–298, 1988. doi:10.1137/0401029.
- [2] Jorgen Bang-Jensen, Pavol Hell, and Gary MacGillivray. Hereditarily hard H-colouring problems. Discrete Mathematics, 138:75–92, 1995. doi:10.1016/0012-365X(94)00189-P.
- [3] Libor Barto, Jakub Bulín, Andrei A. Krokhin, and Jakub Opršal. Algebraic approach to promise constraint satisfaction. J. ACM, 68(4):28:1–28:66, 2021. doi:10.1145/3457606.
- [4] Libor Barto, Marcin Kozik, and Todd Niven. The CSP dichotomy holds for digraphs with no sources and no sinks (a positive answer to a conjecture of Bang-Jensen and Hell). SIAM Journal on Computing, 38(5), 2009. doi:10.1137/070708093.
- [5] Libor Barto, Jakub Opršal, and Michael Pinsker. The wonderland of reflections. Israel Journal of Mathematics, 223(1):363–398, 2018. doi:10.1007/s11856-017-1621-9.
- [6] Manuel Bodirsky. Complexity of Infinite-Domain Constraint Satisfaction. Lecture Notes in Logic (52). Cambridge University Press, Cambridge, United Kingdom; New York, NY, 2021. doi:10.1017/9781107337534.
- [7] Manuel Bodirsky, Florent R. Madelaine, and Antoine Mottet. A proof of the algebraic tractability conjecture for monotone monadic SNP. SIAM J. Comput., 50(4):1359–1409, 2021. doi:10.1137/19M128466X.
- [8] Flavia Bonomo, Maria Chudnovsky, Peter Maceli, Oliver Schaudt, Maya Stein, and Mingxian Zhong. Three-Coloring and List Three-Coloring of Graphs Without Induced Paths on Seven Vertices. Combinatorica, 38:779–801, 2018. doi:10.1007/s00493-017-3553-8.
- [9] Richard C. Brewster and Timothy Graves. On the restricted homomorphism problem. Discret. Appl. Math., 156(14):2823–2826, 2008. doi:10.1016/j.dam.2007.03.028.
- [10] Richard C. Brewster, Pavol Hell, and Gary MacGillivray. The complexity of restricted graph homomorphisms. Discret. Math., 167-168:145–154, 1997. Selected Papers 15th British Combinatorial Conference. doi:10.1016/S0012-365X(96)00223-3.
- [11] Andrei A. Bulatov. A dichotomy theorem for nonuniform CSPs. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, pages 319–330, 2017. doi:10.1109/FOCS.2017.37.
- [12] Víctor Dalmau and Andrei A. Krokhin. Majority constraints have bounded pathwidth duality. Eur. J. Comb., 29(4):821–837, 2008. doi:10.1016/j.ejc.2007.11.020.
- [13] P. Erdős. Graph theory and probability. Canadian Journal of Mathematics, 11:34–38, 1959.
- [14] Tomás Feder and Moshe Y. Vardi. The computational structure of monotone monadic SNP and constraint satisfaction: a study through Datalog and group theory. SIAM Journal on Computing, 28:57–104, 1999. doi:10.1137/S0097539794266766.
- [15] Jan Foniok. Homomorphisms and structural properties of relational systems. Doctoral Thesis, Charles University Prague, Faculty of Mathematics and Physics, 2007.
- [16] Jan Foniok, Jaroslav Nešetřil, and Claude Tardif. Generalised dualities and maximal finite antichains in the homomorphism order of relational structures. European J. Combin., 29(4):881–899, 2008. doi:10.1016/j.ejc.2007.11.017.
- [17] Jan Goedgebeur, Jorik Jooken, Karolina Okrasa, Pawel Rzazewski, and Oliver Schaudt. Minimal obstructions to C5-coloring in hereditary graph classes. In Rastislav Královic and Antonín Kucera, editors, 49th International Symposium on Mathematical Foundations of Computer Science, MFCS 2024, August 26-30, 2024, Bratislava, Slovakia, volume 306 of LIPIcs, pages 55:1–55:15, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2024.55.
- [18] Petr A. Golovach, Matthew Johnson, Daniël Paulusma, and Jian Song. A survey on the computational complexity of coloring graphs with forbidden subgraphs. J. Graph Theory, 84(4):331–363, 2017. doi:10.1002/jgt.22028.
- [19] Santiago Guzmán-Pro and Barnaby Martin. Restricted CSPs and F-free Digraph Algorithmics. Preprint arXiv:2502.17596, 2025. doi:10.48550/arXiv.2502.17596.
- [20] Pavol Hell and Aurosish Mishra. H-coloring degree-bounded (acyclic) digraphs. Theor. Comput. Sci., 554:40–49, 2014. doi:10.1016/j.tcs.2014.06.014.
- [21] Pavol Hell and Jaroslav Nešetřil. On the complexity of H-coloring. Journal of Combinatorial Theory, Series B, 48:92–110, 1990. doi:10.1016/0095-8956(90)90132-J.
- [22] S. Huang. Improved complexity results on k-coloring. European J. Combin., 51:336–346, 2016. doi:10.1016/j.ejc.2015.06.005.
- [23] Andrei Krokhin, Jakub Opršal, Marcin Wrochna, and Stanislav Živný. Topology and adjunction in promise constraint satisfaction. SIAM J. Comput., 52(1):38–79, 2023. doi:10.1137/20m1378223.
- [24] Gábor Kun. Constraints, MMSNP, and expander relational structures. Combinatorica, 33(3):335–347, 2013. doi:10.1007/s00493-013-2405-4.
- [25] Jaroslav Nesetril and Claude Tardif. Duality theorems for finite structures (characterising gaps and good characterisations). J. Comb. Theory B, 80(1):80–97, 2000. doi:10.1006/jctb.2000.1970.
- [26] Alan L. Selman. Promise problems complete for complexity classes. Inf. Comput., 78(2):87–97, 1988. doi:10.1016/0890-5401(88)90030-2.
- [27] Dmitriy Zhuk. A proof of CSP dichotomy conjecture. In Chris Umans, editor, 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 331–342. IEEE Computer Society, 2017. https://arxiv.org/abs/1704.01914. doi:10.1109/FOCS.2017.38.
- [28] Dmitriy Zhuk. A proof of the CSP dichotomy conjecture. J. ACM, 67(5):30:1–30:78, 2020. doi:10.1145/3402029.