A homomorphism from a graph G to a graph H is a vertex mapping f from the vertex set of G to the vertex set of H such that there is an edge between vertices and of H whenever there is an edge between vertices u and v of G. The H-Colouring problem is to decide if a graph G allows a homomorphism to a fixed graph H. We continue a study on a variant of this problem, namely the SurjectiveH-Colouring problem, which imposes the homomorphism to be vertex-surjective. We build upon previous results and show that this problem is NP-complete for every connected graph H that has exactly two vertices with a self-loop as long as these two vertices are not adjacent. As a result, we can classify the computational complexity of SurjectiveH-Colouring for every graph H on at most four vertices.
The well-known Colouring problem is to decide if the vertices of a given graph can be properly coloured with at most k colours for some given integer k. If we exclude k from the input and assume it is fixed, we obtain the k-Colouring problem. A homomorphism from a graph to a graph is a vertex mapping , such that there is an edge between and in H whenever there is an edge between u and v in G, that is, for every pair of vertices , if , then . We observe that k-Colouring is equivalent to the problem of asking if a graph allows a homomorphism to the complete graph on k vertices. Hence, a natural generalization of the k-Colouring problem is the H-Colouring problem, which asks if a given graph allows a homomorphism to an arbitrary fixed graph H. We call this fixed graph H the target graph. Throughout the paper we consider undirected graphs with no multiple edges. We assume that an input graph G contains no vertices with self-loops (we call such vertices reflexive), whereas a target graph H may contain such vertices. We call H reflexive if all its vertices are reflexive, and irreflexive if all its vertices are irreflexive.
For a survey on graph homomorphisms we refer the reader to the textbook of Hell and Nešetřil [12]. Here, we will discuss the H-Colouring problem, a number of its variants and their relations to each other. In particular, we will focus on the surjective variant: a homomorphism f from a graph G to a graph H is (vertex-)surjective if f is surjective, that is, if for every vertex there exists at least one vertex with .
The computational complexity of H-Colouring has been determined completely. The problem is trivial if H contains a reflexive vertex u (we can map each vertex of the input graph to u). If H has no reflexive vertices, then the Hell-Nešetřil dichotomy theorem [11] tells us that H-Colouring is solvable in polynomial time if H is bipartite and that it is NP-complete otherwise.
The ListH-Colouring problem takes as input a graph G and a function L that assigns to each a list . The question is whether G allows a homomorphism f to the target H with for every . Feder, Hell and Huang [3] proved that ListH-Colouring is polynomial-time solvable if H is a bi-arc graph and NP-complete otherwise (we refer to [3] for the definition of a bi-arc graph). A homomorphism f from G to an induced subgraph H of G is a retraction if for every , and we say that G retracts to H. A retraction from G to H can be viewed as a list-homomorphism: choose if , and if . The corresponding decision problem is called H-Retraction. The computational complexity of H-Retraction has not yet been classified. Feder et al. [4] determined the complexity of the H-Retraction problem whenever H is a pseudo-forest (a graph in which every connected component has at most one cycle). They also showed that H-Retraction is NP-complete if H contains a connected component in which the reflexive vertices induce a disconnected graph.
As mentioned, we impose a (vertex-)surjectivity condition on the graph homomorphism. Such a condition can be imposed locally or globally. If we require a homomorphism f from a graph G to a graph H to be surjective when restricted to the neighbourhood of every vertex u of G, we say that f is an H-role assignment. The corresponding decision problem is called H-Role Assignment and its computational complexity has been fully classified [7]. We refer to the survey of Fiala and Kratochvíl [6] for further details on locally constrained homomorphisms and from here on only consider global surjectivity.
It has been shown that deciding whether a given graph G allows a surjective homomorphism to a given graph H is NP-complete even if G and H both belong to one of the following graph classes: disjoint unions of paths; disjoint unions of complete graphs; trees; connected cographs; connected proper interval graphs; and connected split graphs [9]. Hence it is natural, just as before, to fix H, which yields the following problem:
We emphasize that we are considering vertex-surjectivity and that being vertex-surjective is a different condition than being edge-surjective. A homomorphism from a graph G to a graph H is called edge-surjective or a compaction if for any edge with there exists an edge with and . Note that the edge-surjectivity condition does not hold for any self-loops . If f is a compaction from G to H, we say that G compacts to H. The corresponding decision problem is known as the H-Compaction problem. A full classification of this problem is still wide open. However partial results are known, for example when H is a reflexive cycle, an irreflexive cycle, or a graph on at most four vertices [16–18], or when G is restricted to some special graph class [19]. Vikas also showed that whenever H-Retraction is polynomial-time solvable, then so is H-Compaction [17]. Whether the reverse implication holds is not known. A complete complexity classification of SurjectiveH-Colouring is also still open. Below we survey the known results.
We first consider irreflexive target graphs H. The SurjectiveH-Colouring problem is NP-complete for every such graph H if H is non-bipartite, as observed by Golovach et al. [10]. The straightforward reduction is from the corresponding H-Colouring problem, which is NP-complete due to the aforementioned Hell-Nešetřil dichotomy theorem. However, the complexity classifications of H-Colouring and SurjectiveH-Colouring do not coincide: there exist bipartite graphs H for which SurjectiveH-Colouring is NP-complete, for instance when H is the graph obtained from a 6-vertex cycle to each of which vertices we add a path of length 3 [1], or when H is the 6-vertex cycle itself [20].
We now consider target graphs with at least one reflexive vertex. Unlike the H-Colouring problem, the presence of a reflexive vertex does not make the SurjectiveH-Colouring problem trivial to solve. We call a connected graph loop-connected if all its reflexive vertices induce a connected subgraph. Golovach, Paulusma and Song [10] showed that if H is a tree (in this context, a connected graph with no cycles of length at least 3) then SurjectiveH-Colouring is polynomial-time solvable if H is loop-connected and NP-complete otherwise. As such the following question is natural:
The reverse statement is not true (if P≠ NP): SurjectiveH-Colouring is NP-complete when H is the 4-vertex cycle with a self-loop in each of its vertices. This result has been shown by Martin and Paulusma [14] and independently by Vikas, as announced in [19]. Recall also that SurjectiveH-Colouring is NP-complete if H is irreflexive (and thus loop-connected) and non-bipartite.
It is known that SurjectiveH-Colouring is polynomial-time solvable whenever H-Compaction is [1]. Recall that H-Compaction is polynomial-time solvable whenever H-Retraction is [17]. Hence, for instance, the aforementioned result of Feder, Hell and Huang [3] implies that SurjectiveH-Colouring is polynomial-time solvable if H is a bi-arc graph. We also recall that H-Retraction is NP-complete whenever H is a connected graph that is not loop-connected [4]. Hence, an affirmative answer to the above question would mean that for these target graphs H the complexities of H-Retraction, H-Compaction and SurjectiveH-Colouring coincide.
In Fig. 1 we display the relationships between the different problems discussed. In particular, it is a major open problem whether the computational complexities of H-Compaction, H-Retraction and SurjectiveH-Colouring coincide for each target graph H. Even showing this for specific cases, such as the case , has been proven to be non-trivial. If it is true, it would relate the SurjectiveH-Colouring problem to the well-known conjecture of Feder and Vardi [5], recently proved by Bulatov [2] and Zhuk [21], which states that the -Constraint Satisfaction problem has a dichotomy when is some fixed finite target structure and which is equivalent to conjecturing that H-Retraction has a dichotomy [5].
We refer to the survey of Bodirsky, Kara and Martin [1] for more details on the SurjectiveH-Colouring problem from a constraint satisfaction point of view and to a recent paper of Larose, Martin and Paulusma [13] for some initial results on SurjectiveH-Colouring for directed graphs.
Relations between H-Colouring and its variants. An arrow from one problem to another indicates that the latter problem is polynomial-time solvable for a target graph H if the former is polynomial-time solvable for H. Reverse arrows do not hold for the leftmost and rightmost arrows, as witnessed by the reflexive 4-vertex cycle for the rightmost arrow and by any reflexive tree that is not a reflexive interval graph for the leftmost arrow (Feder, Hell and Huang [3] showed that the only reflexive bi-arc graphs are reflexive interval graphs). It is not known if the reverse direction holds for the two middle arrows.
Our results
We present further progress on the research question of whether SurjectiveH-Colouring is NP-complete for every connected graph H that is not loop-connected. We first consider the case where the target graph H is a connected graph with exactly two reflexive vertices that are non-adjacent. In Section 2 we prove that SurjectiveH-Colouring is indeed NP-complete for every such target graph H. In the same section we slightly generalize this result by showing that it holds even if the reflexive vertices of H can be partitioned into two non-adjacent sets of twin vertices. This enables us to classify in Section 3 the computational complexity of SurjectiveH-Colouring for every graph H on at most four vertices, just as Vikas [18] did for the H-Compaction problem. A classification of SurjectiveH-Colouring for target graphs H on at most four vertices has also been announced by Vikas in [19]. As we will illustrate for one particular case, it is interesting to note that NP-hardness proofs for H-Compaction of [18] may lift to NP-hardness for SurjectiveH-Colouring. However, this is not true for the reflexive cycle , where a totally new proof was required.
Two non-adjacent reflexive vertices
We say that a graph is 2-reflexive if it contains exactly 2 reflexive vertices that are non-adjacent. In this section we will prove that SurjectiveH-Colouring is NP-complete whenever H is connected and 2-reflexive. The problem is readily seen to be in NP. Our NP-hardness reduction uses similar ingredients as the reduction of Golovach, Paulusma and Song [10] for proving NP-hardness when H is a tree that is not loop-connected. There are, however, a number of differences. For instance, we will reduce from a factor cut problem instead of the less general matching cut problem used in [10]. We will explain these two problems and prove NP-hardness for the former one in Section 2.1. Then in Section 2.2 we give our hardness reduction, and in Section 2.3 we extend our result to be valid for target graphs H with more than two reflexive vertices as long as these reflexive vertices can be partitioned into two non-adjacent sets of twin vertices.
Factor cuts
Let be a connected graph. For and , let denote the number of edges of E incident with v. For a partition of , let denote the set of edges between and in G.
Let i and j be positive integers, . Let be a partition of and let . Then is an -factor cut of G if, for all , , and, for all , . Observe that if a vertex v exists with degree at most j, then there is a trivial -factor cut . Two distinct vertices s and t in are -factor roots of G if, for each -factor cut of G, s and t belong to different parts of the partition and, if , and (of course, if , we do not require the latter condition as is also an -factor cut). We note that when no -factor cut exists, every pair of vertices is a pair of -factor roots. We define the following decision problem.
We emphasize that the -factor roots are given as part of the input. That is, the problem asks whether or not an -factor cut exists, but we know already that if it does, then s and t belong to different parts of the partition. That is, we actually define -Factor Cut with Roots to be a promise problem. In such a problem the input is “promised” to belong to some specific subset of inputs; we refer to the survey of Goldreich [8] for details. In the definition of -Factor Cut with Roots, we assume that if an -factor cut exists then it has the property that s and t belong to different parts of the partition. The promise class may not itself be polynomially recognizable, but one may readily find a subclass of it that is polynomially recognizable and includes all the instances we need for NP-hardness. In fact this will become clear when reading our proof but we refer also to [10] where such a subclass is given for the case . A -factor cut of G is also known as a matching cut, as no two edges in have a common end-vertex, that is, is a matching. Similarly -Factor Cut with Roots is known as Matching Cutwith Roots and was proved NP-complete by Golovach, Paulusma and Song [10] (by making an observation about the proof of the result of Patrignani and Pizzonia [15] that deciding whether or not any given graph has a matching cut is NP-complete).
We will prove the NP-completeness of -Factor Cut with Roots after first presenting a helpful lemma (a clique is a subset of vertices of G that are pairwise adjacent to each other).
Let i, j and k be positive integers whereand. Let G be a graph that contains a clique K on k vertices. Then, for every-factor cutof G, eitheror.
If the lemma is false, then for some -factor cut , we can choose and . Let . Since every vertex in is linked by an edge of M to and every vertex in is linked by an edge of M to , we have , contradicting the definition of an -factor cut. □
Let i and j be positive integers,. Then-Factor Cut with RootsisNP-complete.
If , then the problem is Matching Cut with Roots which, as we noted, is known to be NP-complete [10]. We split the remaining cases in two according to whether or not . In each case, we construct a polynomial time reduction from Matching Cut with Roots. In particular, we take an instance of Matching Cut with Roots, and construct a graph that is a supergraph of and show that
is an instance of -Factor Cut with Roots (that is, if has an -factor cut , then and or, possibly, vice versa if ),
if has an -factor cut, then G has a matching cut, and
if G has a matching cut, then has an -factor cut.
We note that (1) is an atypical feature of an NP-completeness proof. We need to prove (1), as -Factor Cut with Roots is a promise problem. Hence it is not immediate to recognize an instance of it. We let .
().
Let . Construct from G by first adding a complete graph K on k vertices and adding edges to G that go from s to every vertex of . Then, for each , add edges to G that go from v to vertices of K in such a way that no vertex of has more than one neighbour in .
Let be a -factor cut of . The vertices of induce a clique on vertices. So, by Lemma 1, or .
Suppose that . Then must contain vertices of both (otherwise would be empty) and (at least s). Thus, as G is connected, we can find a vertex that has a neighbour in . But v also has neighbours in and so has at least 2 neighbours in , contradicting the definition of a -factor cut.
So we must have that . Let and be a partition of , and let and and notice that is the union of M and, for each , the edges from v to . For each , . For each , . So is a matching cut of G; this proves (2). And as , we have, by the definition of factor roots, ; this proves (1).
To prove (3), we note that if is a matching cut of G, then we can assume that and (else relabel them for the purpose of constructing ), and then is a -factor cut of .
().
Let . Construct from G by first adding a complete graph on k vertices and adding edges from s to every vertex of , and then adding a complete graph on k vertices and adding edges from t to every vertex of . Then, for each , add edges from v to vertices of in such a way that no vertex of has more than one neighbour in . Afterwards, for each , add edges from v to vertices of in such a way that no vertex of has more than one neighbour in .
Let be an -factor cut of . The vertices of induce a clique on at least vertices. So, by Lemma 1, or . Similarly or .
Suppose that and are both subsets of . Then must contain vertices of both (at least s and t) and (else it would be empty). Thus, as G is connected, we can find a vertex that has a neighbour in . But v also has neighbours in and neighbours in and so has at least neighbours in , contradicting the definition of an -factor. By an analogous argument and cannot both be subsets of .
Suppose that and . As G is connected and contains vertices of both and , we can find a vertex that has a neighbour in . But v also has neighbours in and so has more than i neighbours in , contradicting the definition of a -factor.
Thus we have that and are subsets of separate parts and, moreover, either or . Thus (1) is proved, and we have, in either case, that each vertex in is joined by edges to vertices in , and each vertex in is joined by edges to vertices in . Therefore each vertex in is joined to at most one vertex in , and each vertex in is joined to at most one vertex in . Thus is a matching cut of G. This proves (2).
To prove (3), we note that if is a matching cut of G, then we can assume that and (else relabel them for the purpose of constructing ), and then is an -factor cut of .
□
The hardness reduction
Let H be a connected 2-reflexive target graph. Let p and q be the two (non-adjacent) reflexive vertices of H. The length of a path is its number of edges. The distance between two vertices u and v in a graph G is the length of a shortest path between them and is denoted . We define two induced subgraphs and of H whose vertex sets partition . First contains those vertices of H that are closer to p than to q; and contains those vertices that are at least as close to q as to p (so contains any vertex equidistant to p and q). That is, and . See Fig. 2 for an example.
The statement of the lemma follows immediately from our assumption that H is connected and the definitions of and . □
Let ω denote the size of a largest clique in H. From graphs and we construct graphs and , respectively, in the following way:
for each , create a vertex ;
for p, create ω vertices ;
for q, create ω vertices ;
for , add an edge in between any two vertices and if and only if is an edge of .
We note that is the graph obtained by taking and replacing p by a clique of size ω. Similarly, is the graph obtained by taking and replacing q by a clique of size ω. We say that are the roots of and that are the roots of . Figure 3 shows an example of the graphs and obtained from the graph H in Fig. 2.
An example of the construction of graphs and from a connected 2-reflexive target graph H with .
The graphs (left) and (right) resulting from the graph H in Fig. 2.
Let denote the distance between p and q. Let be the set of neighbours of p that are each on some shortest path (thus of length ℓ) from p to q in H. Let be the size of a largest clique in . We define and similarly. We will reduce from -Factor Cut with Roots, which is NP-complete due to Theorem 1. Hence, consider an instance of -Factor Cut with Roots, where G is a connected graph and s and t form the (ordered) pair of -factor roots of G. Recall that we assume that G is irreflexive.
We say that we identify two vertices u and v of a graph when we remove them from the graph and replace them with a single vertex that we make adjacent to every vertex that was adjacent to u or v. From , , and G we construct a new graph as follows:
For each edge , we do as follows. We create four vertices, , , and . We also create two paths and , each of length , between and , and between and , respectively. If we identify and and and to get paths of length 0.
For each vertex , we do as follows. First we construct a clique on ω vertices. We denote these vertices by . We then make every vertex in adjacent to both and for every edge e incident to u; we call and a red and blue neighbour of , respectively; if , then the vertex obtained by identifying two vertices and , or and is simultaneously a red neighbour of one clique and a blue neighbour of another one. Finally, for every two edges e and incident to u, we make and adjacent, that is, the set of red neighbours of form a clique, whereas the set of blue neighbours form an independent set.
We add by identifying and for , and we add by identifying and for . We denote the vertices in and in by their label in or .
An example of a graph G and the corresponding graph .
The next lemma describes a straightforward property of graph homomorphisms that will prove useful.
If there exists a homomorphismthenfor every pair of vertices.
We now use the fact that the cliques consist of ω vertices to prove the key property of our construction.
For every homomorphism h fromto H, there exists at least one cliquewithand at least one cliquewith.
Since for each and any edge e incident to u, every clique in is of size at least , we find that h must map at least two of its vertices to a reflexive vertex, so either to p or q. Hence, for every , we find that h maps at least one vertex of to either p or q.
We prove the lemma by contradiction. We will assume that h does not map any vertex of any to q, thus for all . We will note later that if instead for all we can obtain a contradiction in the same way.
We consider two vertices and such that . Without loss of generality let . We shall refer to these vertices as and respectively. We now consider a vertex . By Lemma 3, and . In other words:
In fact by applying Lemma 3 we can generalize this further to any vertex mapped to p by h:
For every we define an upper bound on the distance of v to a vertex mapped to p as follows (see also Claim 1):
for all.
We prove Claim 1 by showing that , which suffices due to (1). First suppose . We may assume, without loss of generality, that . So , as .
Now suppose . Then v either belongs to a clique or is a vertex of a path or between two cliques. If v belongs to a clique or is an end-vertex of such a path, then v is either in or adjacent to a vertex in (since at least one vertex in maps to p). Hence . Finally, suppose v is an inner vertex of a path or . By definition, such a path has length . Then v is at most distance from a vertex in a clique, which we know is either in or adjacent to a vertex in . Hence . This proves Claim 1.
We use Claim 1 to prove the following claim, which is crucial for obtaining a contradiction, as we will explain immediately after proving the claim.
If there exists a surjective homomorphism fromto H, then for any integer:
We prove Claim 2 as follows. Using the fact that with a surjective homomorphism every vertex must be mapped to, we see from Lemma 3 that if there are n vertices in H which are at a distance d from p, there must be at least n vertices in that are at distance at least d from every vertex that maps to p. This means we can say for any distance :
Combining this inequality with Claim 1 yields, for every distance :
Now let . Then we only have to consider vertices in . Hence, for every :
By construction, for any with we have that and thus . Therefore, no vertex with is involved in the equation above, so we can write:
Hence Claim 2 is proven.
An example of a graph H with corresponding graphs and . Vertices in H equidistant from p are plotted at the same vertical position and likewise vertices and with are plotted at the same vertical position. The vertices and corresponding are highlighted.
We first present the intuition behind the final part of the proof. Consider the graphs , and H in the example shown in Fig. 5. We recall that every vertex v (other than p or q) has a single corresponding vertex in or . We may naturally want to map the vertices of onto the vertices of , which is possible by definition of . However, when we try to map the vertices of onto the vertices of , with (for some i), we will prove that there is at least one vertex in which is further from p in H than it is from q and that cannot be mapped to and thus violates the surjectivity constraint. In Fig. 5 this vertex, which will play a special role in our proof, is shown in red. In the example of this figure, and we observe that there are ten vertices in H (including ) with but only nine vertices (excluding ) in with which could be mapped to these vertices. This contradicts Claim 2.
We now formally prove that our initial assumption that for all contradicts Claim 2. For every vertex x in there is a corresponding vertex such that , where the latter equality follows from the construction of . From Lemma 2 we find that for every . Hence , and for all :
Now let . Using the same arguments, we see that , and thus by definition. Note that, had we instead supposed that it was q to which everything mapped, we would instead have a strict inequality. As it turns out, we only need the weaker inequality.
We now look for a vertex in , such that is as far from p as possible, subject to the condition that . Let . We see that for any vertex x in such that , it is the case that . Note that there may be no vertices with in which case is simply the farthest vertex from p within . We also observe that is possible. So j is well defined and, in fact, we have that .
We now consider the mapping of vertices in at a distance from p. We recall that for every x in and that for a vertex of distance at least from q in H, it holds that . Combining this with equation (2) yields that:
However, for we find that, in addition to vertices in equidistant from p and q, there is at least one vertex that is closer to q than p, namely , for which it holds that . It therefore follows that there are fewer vertices with than there are vertices x with and hence we see that:
By combining equations (3) and (4), we see that:
As , this contradicts Claim 2 and concludes the proof of Lemma 4. □
We are now ready to state our main result.
For every connected 2-reflexive graph H, theSurjectiveH-Colouringproblem isNP-complete.
Let H be a connected 2-reflexive graph with reflexive vertices p and q at distance from each other. Let ω be the size of a largest clique in H. We define the graphs , , and , sets an , and values , as above. Recall that the problem is readily seen to be in NP and that we reduce from -Factor Cut with Roots. From , and an instance of the latter problem we construct the graph . We claim that G has an -factor cut if and only if there exists a surjective homomorphism h from to H.
First suppose that G has an -factor cut . By definition, and . We define a homomorphism h as follows. For every , we let h map to x. This shows that h is surjective. It remains to define h on the other vertices. For every , let h map all of to p if u is in and let h map all of to q if u is in (note that this is consistent with how we defined h so far). For each with , we map the vertices of the paths and to p. For each with , we map the vertices of the paths and to q. We are left to show that the vertices of the remaining paths and can be mapped to appropriate vertices of H.
Note that the red neighbours of each form a clique (whereas all blue vertices of each form an independent set and inner vertices of paths and have degree 2). However, as is an -factor cut of G, all but at most vertices of these red cliques have been mapped to p already if and all but at most vertices have been mapped to q already if . By definition of and , this means that we can map the vertices of the paths and with for and to vertices of appropriate shortest paths between p and q in H, so that h is a homomorphism from to H (recall that we already showed surjectivity). In particular, the clique formed by the red neighbours of each is mapped to a clique in or .
Now suppose that there exists a surjective homomorphism h from to H. For a clique , we may choose any edge e incident to u, such that is a clique of size . Since H contains no cliques larger than ω, we find that h maps each clique (which has size ) to a clique in H that contains a reflexive vertex. Note that at least two vertices of are mapped to a reflexive vertex. Hence we can define the following partition of . We let and . Lemma 4 tells us that and . We define .
Let be an arbitrary edge in M. By definition, h maps all of to a clique containing p and all of to a clique containing q. Hence, the vertices of the two paths and must be mapped to the vertices of a shortest path between p and q. At most red neighbours of every with can be mapped to a vertex other than p. This is because these red neighbours form a clique. As such they must be mapped onto vertices that form a clique in H. As such vertices lie on a shortest path from p to q, the clique in H has size at most . Similarly, at most red neighbours of every with can be mapped to a vertex other than q. As such, is an -factor cut in G. □
A small extension
Two vertices u and v in a graph G are true twins if they are adjacent to each other and share the same neighbours in . Let be a graph obtained from a connected 2-reflexive graph H with reflexive vertices p and q after introducing i reflexive true twins of p and j reflexive true twins of q. In the graph we increase the cliques to size . We call the resulting graph . Then it is readily seen that there exists a surjective homomorphism from to H if and only if there exists a surjective homomorphism from to .
For every connected 2-reflexive graph H and integers,Surjective-ColouringisNP-complete.
Target graphs of at most four vertices
In this section we classify the computational complexity of SurjectiveH-Colouring for every target graph H with at most four vertices. We require a number of lemmas. The first lemma is proved for compaction and not vertex-surjection. However, the only property of compaction used is vertex-surjection and so it is easy to see it holds in this modified form. The second lemma is also displayed in Fig. 1.
We let D denote the irreflexive diamond, that is, the irreflexive complete graph on four vertices minus an edge. The (irreflexive) paw is the graph obtained from the triangle after attaching a pendant vertex to one of the vertices of the triangle, that is, the graph with vertices , , y, z and edges , , , . We let denote the graph obtained from the paw after adding a loop to its vertex of degree 1 (that is, following the above notation, the loop ). Both D and are displayed in Fig. 6 as well.
We are now ready to state our main result.
Let H be a graph with. ThenSurjectiveH-ColouringisNP-complete if some connected component of H is not loop-connected or is an irreflexive complete graph on at least three vertices, or. OtherwiseSurjectiveH-Colouringis polynomial-time solvable.
Let H be a graph on at most four vertices. If H is a loop-connected forest (that is, every component of H is loop-connected) or H has a dominating reflexive vertex, then Vikas [18] showed that H-Compaction is in P. Hence, SurjectiveH-Colouring is in P by Lemma 6. If H contains a component that is a non-loop-connected tree, then SurjectiveH-Colouring is NP-complete by Lemmas 5 and 8. If H is an irreflexive non-bipartite graph, then SurjectiveH-Colouring is NP-complete by Lemma 7.
Note that the above cases cover all graphs H on at most three vertices, all disconnected graphs H on four vertices and all trees H on four vertices. The only two graphs H on at most three vertices for which SurjectiveH-Colouring is NP-complete are the irreflexive cycle on three vertices and the 3-vertex path in which the two end-vertices are reflexive. The only disconnected graphs H on four vertices for which SurjectiveH-Colouring is NP-complete are those that contain these two graphs as connected components. The only trees H on four vertices for which SurjectiveH-Colouring is NP-complete are those that are not loop-connected. Hence the theorem holds for every graph H on at most three vertices, for every disconnected graph H on four vertices and for every tree H on four vertices.
From now on we assume that H is a connected graph on four vertices that is not a tree. Then H is either the cycle on four vertices, the complete graph on four vertices, the diamond or the paw. We consider each of these cases separately.
Suppose H is the cycle on four vertices. There are six cases to consider (see also Fig. 7). If H is reflexive, then SurjectiveH-Colouring is NP-complete by Lemma 9. If H is not loop-connected, then H is 2-reflexive, and thus SurjectiveH-Colouring is NP-complete by Theorem 2. In the remaining four cases H is loop-connected. For each of these target graphs, Vikas [18] showed that H-Compaction is in P. Hence, SurjectiveH-Colouring is in P by Lemma 6. We find that the theorem holds when H is a cycle on four vertices.
All cycles H on four vertices.
All complete graphs H on four vertices.
All diamonds H on four vertices.
Suppose H is the complete graph on four vertices. There are five cases to consider (see also Fig. 8). If H is irreflexive, then SurjectiveH-Colouring is NP-complete by Lemma 7 (as H is non-bipartite as well). For each of the other four target graphs, Vikas [18] showed that H-Compaction is in P. Hence, SurjectiveH-Colouring is in P by Lemma 6. We find that the theorem holds when H is the complete graph on four vertices.
All paws H on four vertices.
Suppose H is the diamond. There are nine cases to consider (see also Fig. 9). If H is irreflexive, then SurjectiveH-Colouring is NP-complete by Lemma 7 (as H is non-bipartite as well). If H is not loop-connected, then H is 2-reflexive, and thus SurjectiveH-Colouring is NP-complete by Theorem 2. For the remaining seven target graphs, Vikas [18] showed that H-Compaction is in P. Hence, SurjectiveH-Colouring is in P by Lemma 6. We find that the theorem holds when H is the diamond.
Suppose H is the paw with vertices , , y, z and edges , , and and possibly one or more loops. There are twelve cases to consider (see also Fig. 10). If H is irreflexive, then SurjectiveH-Colouring is NP-complete by Lemma 7 (as H is non-bipartite as well). If H is not loop-connected, then the set of reflexive vertices is formed by one or two vertices from and z. Then SurjectiveH-Colouring is NP-complete by Theorem 3. We are left with nine cases. Vikas [18] showed that H-Compaction is in P for all of these cases except for the case where z is the only reflexive vertex. Hence, for eight of these nine cases, SurjectiveH-Colouring is in P by Lemma 6.
We are left to consider the case in which z is the (only) reflexive vertex. Recall that we denote this target by . Theorem 3.5 of [18] proves that -Compaction is NP-complete using a reduction from -Retraction (which is NP-complete), but we will argue the proof works also for Surjective-Colouring. It is shown that (i) a graph G retracts to if and only if a certain graph retracts to if and only if (iii) compacts to . The salient part of the proof is Lemma 3.5.2 of [18], in which it is argued that (ii) and (iii) are equivalent. We note that if a graph retracts to another graph, then there exists a surjective homomorphism from the first graph to the second graph. Hence, we need to verify only whether retracts to should there exist a surjective homomorphism from to . In the proof of Lemma 3.5.2 of [18], the properties of compaction are only used three times. The first two are paragraph 2, line 2 and paragraph 7, line 4 (in the proof of Lemma 3.5.2). The only property used of compaction on these two occasions is vertex surjection. Finally, compaction is alluded to in the final paragraph of the proof, but here any homomorphism would have the desired property. Thus, Vikas [18] has actually proved that retracts to if and only if has a surjective homomorphism to , and it follows that Surjective-Colouring is NP-complete.
From the above we conclude that the theorem holds in all cases when H is the paw. This completes the proof of Theorem 4. □
Theorem 4 corresponds to Vikas’ complexity classification of H-Compaction for targets graphs H of at most four vertices. Vikas [18] showed that H-Compaction and H-Retraction are polynomially equivalent for target graphs H of at most four vertices. Thus, we obtain the following corollary.
Let H be a graph on at most four vertices. Then the three problemsSurjectiveH-Colouring, H-Compactionand H-Retractionare polynomially equivalent.
Conclusions
We proved that SurjectiveH-Colouring is NP-complete for every connected graph H that has exactly two vertices with a self-loop as long as these two vertices are not adjacent. This enabled us to classify the computational complexity of SurjectiveH-Colouring for every graph H on at most four vertices. To conjecture a dichotomy of SurjectiveH-Colouring between P and NP-complete seems still to be difficult. Our first goal is to prove that SurjectiveH-Colouring is NP-complete for every connected graph H that is not loop-connected. However, doing this via using our current techniques does not seem straightforward and we may need new hardness reductions. Another way forward is to prove polynomial equivalence between the three problems SurjectiveH-Colouring, H-Compaction and H-Retraction. Completely achieving this goal also seems far from trivial. We note that our classification for target graphs H up to four vertices in Section 3 shows such an equivalence for these cases.
Footnotes
Acknowledgement
Supported by the Research Council of Norway via the project “CLASSIS” and the Leverhulme Trust (RPG-2016-258).
References
1.
M.Bodirsky, J.Kára and B.Martin, The complexity of surjective homomorphism problems – a survey, Discrete Applied Mathematics160 (2012), 1680–1690. doi:10.1016/j.dam.2012.03.029.
2.
A.A.Bulatov, A dichotomy theorem for nonuniform CSPs, in: Proc. FOCS 2017, pp. 319–330.
3.
T.Feder, P.Hell and J.Huang, Bi-arc graphs and the complexity of list homomorphisms, Journal of Graph Theory42 (2003), 61–80. doi:10.1002/jgt.10073.
4.
T.Feder, P.Hell, P.Jonsson, A.Krokhin and G.Nordh, Retractions to pseudoforests, SIAM Journal on Discrete Mathematics24 (2010), 101–112. doi:10.1137/080738866.
5.
T.Feder and M.Y.Vardi, The computational structure of monotone monadic SNP and constraint satisfaction: A study through datalog and group theory, SIAM Journal on Computing28 (1998), 57–104. doi:10.1137/S0097539794266766.
6.
J.Fiala and J.Kratochvíl, Locally constrained graph homomorphisms – structure, complexity, and applications, Computer Science Review2 (2008), 97–111. doi:10.1016/j.cosrev.2008.06.001.
7.
J.Fiala and D.Paulusma, A complete complexity classification of the role assignment problem, Theoretical Computer Science349 (2005), 67–81. doi:10.1016/j.tcs.2005.09.029.
8.
O.Goldreich, On promise problems (a survey), Lecture Notes in Computer Science3895 (2006), 254–290. doi:10.1007/11685654_12.
P.A.Golovach, D.Paulusma and J.Song, Computing vertex-surjective homomorphisms to partially reflexive trees, Theoretical Computer Science457 (2012), 86–100. doi:10.1016/j.tcs.2012.06.039.
11.
P.Hell and J.Nešetřil, On the complexity of H-colouring, Journal of Combinatorial Theory, Series B48 (1990), 92–110. doi:10.1016/0095-8956(90)90132-J.
12.
P.Hell and J.Nešetřil, Graphs and Homomorphisms, Oxford University Press, 2004.
13.
B.Larose, B.Martin and D.Paulusma, Surjective H-colouring over reflexive digraphs, in: Proc. STACS 2018, 4 Leibniz International Proceedings in Informatics, Vol. 96, 2018, pp. 49:1–49:14.
14.
B.Martin and D.Paulusma, The computational complexity of disconnected cut and -partition, Journal of Combinatorial Theory, Series B111 (2015), 17–37. doi:10.1016/j.jctb.2014.09.002.
15.
M.Patrignani and M.Pizzonia, The complexity of the matching-cut problem, in: Proc. WG 2001, Lecture Notes in Computer Science, Vol. 2204, 2001, pp. 284–295.
16.
N.Vikas, Computational complexity of compaction to reflexive cycles, SIAM Journal on Computing32 (2002), 253–280. doi:10.1137/S0097539701383522.
17.
N.Vikas, Compaction, retraction, and constraint satisfaction, SIAM Journal on Computing33 (2004), 761–782. doi:10.1137/S0097539701397801.
18.
N.Vikas, A complete and equal computational complexity classification of compaction and retraction to all graphs with at most four vertices and some general results, Journal of Computer and System Sciences71 (2005), 406–439. doi:10.1016/j.jcss.2004.07.003.
19.
N.Vikas, Algorithms for partition of some class of graphs under compaction and vertex-compaction, Algorithmica67 (2013), 180–206. doi:10.1007/s00453-012-9720-9.
20.
N.Vikas, Computational complexity of graph partition under vertex-compaction to an irreflexive hexagon, in: Proc. MFCS 2017, Leibniz International Proceedings in Informatics, Vol. 83, 2017, pp. 69:1–69:14.
21.
D.Zhuk, A proof of CSP dichotomy conjecture, in: FOCS 2017, pp. 331–342.