Surjective H-Colouring: New Hardness Results
Petr Golovach, Matthew Johnson. Barnaby Martin, Daniel Paulusma and, Anthony Stewart

TL;DR
This paper investigates the computational complexity of the Surjective H-Colouring problem, establishing NP-completeness for a broad class of graphs and classifying complexity for all graphs up to four vertices.
Contribution
It proves NP-completeness for Surjective H-Colouring on certain graphs and classifies the problem's complexity for all graphs with up to four vertices.
Findings
NP-completeness for connected graphs with two non-adjacent self-loop vertices
Complete classification of complexity for graphs with up to four vertices
Extension of previous results on homomorphism problems
Abstract
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 f(u) and f(v) of H whenever there is an edge between vertices u and v of G. The H-Colouring problem is to decide whether or not a graph G allows a homomorphism to a fixed graph H. We continue a study on a variant of this problem, namely the Surjective H-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 Surjective H-Colouring for every graph H on at most four vertices.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
11institutetext: 1Department of Informatics, University of Bergen, Bergen, Norway
2School of Engineering and Computing Sciences, Durham University,
South Road, Durham, DH1 3LE, U.K.
matthew.johnson2,barnaby.d.martin,daniel.paulusma,a.g.stewart@durham.ac.uk
Surjective -Colouring: New Hardness Results††thanks: Supported by the Research Council of Norway via the project “CLASSIS” and the Leverhulme Trust (RPG-2016-258).
Petr A. Golovach1
Matthew Johnson2
Barnaby Martin2
Daniël Paulusma2
Anthony Stewart2
Abstract
A homomorphism from a graph to a graph is a vertex mapping from the vertex set of to the vertex set of such that there is an edge between vertices and of whenever there is an edge between vertices and of . The -Colouring problem is to decide if a graph allows a homomorphism to a fixed graph . We continue a study on a variant of this problem, namely the Surjective -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 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 Surjective -Colouring for every graph on at most four vertices.
1 Introduction
The well-known Colouring problem is to decide if the vertices of a given graph can be properly coloured with at most colours for some given integer . If we exclude from the input and assume it is fixed, we obtain the -Colouring problem. A homomorphism from a graph to a graph is a vertex mapping , such that there is an edge between and in whenever there is an edge between and in . We observe that -Colouring is equivalent to the problem of asking if a graph allows a homomorphism to the complete graph on vertices. Hence, a natural generalization of the -Colouring problem is the -Colouring problem, which asks if a given graph allows a homomorphism to an arbitrary fixed graph . We call this fixed graph the target graph. Throughout the paper we consider undirected graphs with no multiple edges. We assume that an input graph contains no vertices with self-loops (we call such vertices reflexive), whereas a target graph may contain such vertices. We call 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 -Colouring problem, a number of its variants and their relations to each other. In particular, we will focus on the surjective variant: a homomorphism from a graph to a graph is (vertex-)surjective if is surjective, that is, if for every vertex there exists at least one vertex with .
The computational complexity of -Colouring has been determined completely. The problem is trivial if contains a reflexive vertex (we can map each vertex of the input graph to ). If has no reflexive vertices, then the Hell-Nešetřil dichotomy theorem [11] tells us that -Colouring is solvable in polynomial time if is bipartite and that it is NP-complete otherwise.
The List -Colouring problem takes as input a graph and a function that assigns to each a list . The question is whether allows a homomorphism to the target with for every . Feder, Hell and Huang [4] proved that List -Colouring is polynomial-time solvable if is a bi-arc graph and NP-complete otherwise (we refer to [4] for the definition of a bi-arc graph). A homomorphism from to an induced subgraph of is a retraction if for every , and we say that retracts to . A retraction from to can be viewed as a list-homomorphism: choose if , and if . The corresponding decision problem is called -Retraction. The computational complexity of -Retraction has not yet been classified. Feder et al. [5] determined the complexity of the -Retraction problem whenever is a pseudo-forest (a graph in which every connected component has at most one cycle). They also showed that -Retraction is NP-complete if 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 from a graph to a graph to be surjective when restricted to the open neighbourhood of every vertex of , we say that is an -role assignment. The corresponding decision problem is called -Role Assignment and its computational complexity has been fully classified [8]. We refer to the survey of Fiala and Kratochvíl [7] 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 allows a surjective homomorphism to a given graph is NP-complete even if and 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 , which yields the following problem:
Surjective -Colouring
* Instance:*
a graph .
Question:
does there exist a surjective homomorphism from to ?
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 to a graph 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 is a compaction from to , we say that compacts to . The corresponding decision problem is known as the -Compaction problem. A full classification of this problem is still wide open. However partial results are known, for example when is a reflexive cycle, an irreflexive cycle, or a graph on at most four vertices [16, 18, 19], or when is restricted to some special graph class [15]. Vikas also showed that whenever -Retraction is polynomial-time solvable, then so is -Compaction [18]. Whether the reverse implication holds is not known. A complete complexity classification of Surjective -Colouring is also still open. Below we survey the known results.
We first consider irreflexive target graphs . The Surjective -Colouring problem is NP-complete for every such graph if is non-bipartite, as observed by Golovach et al. [10]. The straightforward reduction is from the corresponding -Colouring problem, which is NP-complete due to the aforementioned Hell-Nešetřil dichotomy theorem. However, the complexity classifications of -Colouring and Surjective -Colouring do not coincide: there exist bipartite graphs for which Surjective -Colouring is NP-complete, for instance when is the graph obtained from a 6-vertex cycle to each of which vertices we add a path of length 3 [1], or when is the 6-vertex cycle itself [17].
We now consider target graphs with at least one reflexive vertex. Unlike the -Colouring problem, the presence of a reflexive vertex does not make the Surjective -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 is a tree (in this context, a connected graph with no cycles of length at least 3) then Surjective -Colouring is polynomial-time solvable if is loop-connected and NP-complete otherwise. As such the following question is natural:
Is Surjective -Colouring NP-complete for every connected graph that is not loop-connected?
The reverse statement is not true (if P NP): Surjective -Colouring is NP-complete when is the 4-vertex cycle with a self-loop in each of its vertices. This result has been shown by Martin and Paulusma [13] and independently by Vikas, as announced in [15]. Recall also that Surjective -Colouring is NP-complete if is irreflexive (and thus loop-connected) and non-bipartite.
It is known that Surjective -Colouring is polynomial-time solvable whenever -Compaction is [1]. Recall that -Compaction is polynomial-time solvable whenever -Retraction is [18]. Hence, for instance, the aforementioned result of Feder, Hell and Huang [4] implies that Surjective -Colouring is polynomial-time solvable if is a bi-arc graph. We also recall that -Retraction is NP-complete whenever is a connected graph that is not loop-connected [5]. Hence, an affirmative answer to the above question would mean that for these target graphs the complexities of -Retraction, -Compaction and Surjective -Colouring coincide.
In Figure 1 we display the relationships between the different problems discussed. In particular, it is a major open problem whether the computational complexities of -Compaction, -Retraction and Surjective -Colouring coincide for each target graph . 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 Surjective -Colouring problem to a well-known conjecture of Feder and Vardi [6], which states that the -Constraint Satisfaction problem has a dichotomy when is some fixed finite target structure and which is equivalent to conjecturing that -Retraction has a dichotomy [6]. We refer to the survey of Bodirsky, Kara and Martin [1] for more details on the Surjective -Colouring problem from a constraint satisfaction point of view.
1.1 Our Results
We present further progress on the research question of whether Surjective -Colouring is NP-complete for every connected graph that is not loop-connected. We first consider the case where the target graph is a connected graph with exactly two reflexive vertices that are non-adjacent. In Section 2 we prove that Surjective -Colouring is indeed NP-complete for every such target graph . In the same section we slightly generalize this result by showing that it holds even if the reflexive vertices of can be partitioned into two non-adjacent sets of twin vertices. This enables us to classify in Section 3 the computational complexity of Surjective -Colouring for every graph on at most four vertices, just as Vikas [19] did for the -Compaction problem. A classification of Surjective -Colouring for target graphs on at most four vertices has also been announced by Vikas in [15]. As we will illustrate for one particular case, it is interesting to note that NP-hardness proofs for -Compaction of [19] may lift to NP-hardness for Surjective -Colouring. However, this is not true for the reflexive cycle , where a totally new proof was required.
1.2 Future Work
To conjecture a dichotomy of Surjective -Colouring between P and NP-complete seems still to be difficult. Our first goal is to prove that Surjective -Colouring is NP-complete for every connected graph 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 Surjective -Colouring, -Compaction and -Retraction. However, completely achieving this goal also seems far from trivial. Our classification for target graphs up to four vertices does show such an equivalence for these cases (see Section 3).
2 Two Non-Adjacent Reflexive Vertices
We say that a graph is -reflexive if it contains exactly reflexive vertices that are non-adjacent. In this section we will prove that Surjective -Colouring is NP-complete whenever 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 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 with more than two reflexive vertices as long as these reflexive vertices can be partitioned into two non-adjacent sets of twin vertices.
2.1 Factor Cuts
Let be a connected graph. For and , let denote the number of edges of incident with . For a partition of , let denote the set of edges between and in .
Let and be positive integers, . Let be a partition of and let . Then is an -factor cut of if, for all , , and, for all , . Observe that if a vertex exists with degree at most , then there is a trivial -factor cut . Two distinct vertices and in are -factor roots of if, for each -factor cut of , and 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.
-Factor Cut with Roots
* Instance:*
a connected graph with roots and .
Question:
does have an -factor cut?
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 and belong to different parts of the partition. That is, we actually define -Factor Cut with Roots to be a promise problem in which we assume that if an -factor cut exists then it has the property that and 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 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 Cut with 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 [14] 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 that are pairwise adjacent to each other).
Lemma 1
Let , and be positive integers where and . Let be a graph that contains a clique on vertices. Then, for every -factor cut of , either or .
Proof
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 to and every vertex in is linked by an edge of to , we have , contradicting the definition of an -factor cut.
Theorem 2.1
Let and be positive integers, . Then -Factor Cut with Roots is NP-complete.
Proof
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
- (1)
is an instance of -Factor Cut with Roots (that is, if has an -factor cut , then and or, possibly, vice versa if ), 2. (2)
if has an -factor cut, then has a matching cut, and 3. (3)
if has a matching cut, then has an -factor cut.
We note that (1) is an atypical feature of an NP-completeness proof as, unusually for -Factor Cut with Roots, it is not immediate to recognize a problem instance. We let .
Case 1: .
Let . Construct from by first adding a complete graph on vertices and adding edges from to every vertex of . Then, for each , add edges from to vertices of 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 ). Thus, as is connected, we can find a vertex that has a neighbour in . But 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 and, for each , the edges from to . For each , . For each , . So is a matching cut of ; 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 , then we can assume that and (else relabel them for the purpose of constructing ), and then is a -factor cut of .
Case 2: .
Let . Construct from by first adding a complete graph on vertices and adding edges from to every vertex of , and then adding a complete graph on vertices and adding edges from to every vertex of . Then, for each , add edges from to vertices of in such a way that no vertex of has more than one neighbour in . Afterwards, for each , add edges from 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 and ) and (else it would be empty). Thus, as is connected, we can find a vertex that has a neighbour in . But 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 is connected and contains vertices of both and , we can find a vertex that has a neighbour in . But also has neighbours in and so has more than 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 . This proves (2).
To prove (3), we note that if is a matching cut of , then we can assume that and (else relabel them for the purpose of constructing ), and then is an -factor cut of .
2.2 The Hardness Reduction
Let be a connected 2-reflexive target graph. Let and be the two (non-adjacent) reflexive vertices of . The length of a path is its number of edges. The distance between two vertices and in a graph is the length of a shortest path between them and is denoted . We define two induced subgraphs and of whose vertex sets partition . First contains those vertices of that are closer to than to ; and contains those vertices that are at least as close to as to (so contains any vertex equidistant to and ). That is, and . See Figure 2 for an example. The following lemma follows immediately from our assumption that is connected.
Lemma 2
Both and are connected. Moreover, for every and for every .
Let denote the size of a largest clique in . From graphs and we construct graphs and , respectively, in the following way:
for each , create a vertex ; 2. 2.
for , create vertices ; 3. 3.
for , create vertices ; 4. 4.
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 by a clique of size . Similarly, is the graph obtained by taking and replacing 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 in Figure 2.
Let denote the distance between and . Let be the set of neighbours of that are each on some shortest path (thus of length ) from to in . 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 2.1. Hence, consider an instance of -Factor Cut with Roots, where is a connected graph and and form the (ordered) pair of -factor roots of . Recall that we assume that is irreflexive.
We say that we identify two vertices and 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 or . From , , and 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. 2. 2.
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 incident to ; 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 and incident to , 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. 3. 3.
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 .
See Figure 4 for an example of a graph .
The next lemma describes a straightforward property of graph homomorphisms that will prove useful.
Lemma 3
If there exists a homomorphism then for every pair of vertices .
We now prove the key property of our construction.
Lemma 4
For every homomorphism from to , there exists at least one clique with and at least one clique with .
Proof
Since for each and any edge incident to , every clique in is of size at least , we find that must map at least two of its vertices to a reflexive vertex, so either to or . Hence, for every , we find that maps at least one vertex of to either or .
We prove the lemma by contradiction. We will assume that does not map any vertex of any to , 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:
[TABLE]
In fact by applying Lemma 3 we can generalize this further to any vertex mapped to by :
[TABLE]
For every we define a value as follows:
[TABLE]
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 either belongs to a clique or is a vertex of a path or between two cliques. If belongs to a clique or is an end-vertex of such a path, then is either in or adjacent to a vertex in (since at least one vertex in maps to ). Hence . Finally, suppose is an inner vertex of a path or . By definition, such a path has length . Then 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.
Claim 2
If there exists a surjective homomorphism from to , then for any integer :
[TABLE]
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 vertices in which are at a distance from , there must be at least vertices in that are at distance at least from every vertex that maps to . This means we can say for any distance :
[TABLE]
Combining this inequality with Claim 1 yields, for every distance :
[TABLE]
Now let . Then we only have to consider vertices in . Hence, for every :
[TABLE]
By construction, for any with we have that and thus . Therefore, no vertex with is involved in the equation above, so we can write:
[TABLE]
Hence Claim 2 is proven.
We first present the intuition behind the final part of the proof. Consider the graphs , and in the example shown in Figure 5. We recall that every vertex (other than or ) 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 ), we will prove that there is at least one vertex in which is further from in than it is from and that cannot be mapped to and thus violates the surjectivity constraint. In Figure 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 (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 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 :
[TABLE]
Now let . Using the same arguments, we see that , and thus by definition. Note that, had we instead supposed that it was 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 as possible, subject to the condition that . Let . We see that for any vertex 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 within . We also observe that is possible. So is well defined and, in fact, we have that .
We now consider the mapping of vertices in at a distance from . We recall that for every in and that for a vertex of distance at least from in , it holds that . Combining this with equation (2) yields that:
[TABLE]
However, for we find that, in addition to vertices in equidistant from and , there is at least one vertex that is closer to than , namely , for which it holds that . It therefore follows that there are fewer vertices with than there are vertices with and hence we see that:
[TABLE]
By combining equations (3) and (4), we see that:
[TABLE]
As , this contradicts Claim 2 and concludes the proof of Lemma 4.
We are now ready to state our main result.
Theorem 2.2
For every connected -reflexive graph , the Surjective -Colouring problem is NP-complete.
Proof
Let be a connected -reflexive graph with reflexive vertices and at distance from each other. Let be the size of a largest clique in . 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 has an -factor cut if and only if there exists a surjective homomorphism from to .
First suppose that has an -factor cut . By definition, and . We define a homomorphism as follows. For every , we let map to . This shows that is surjective. It remains to define on the other vertices. For every , let map all of to if is in and let map all of to if is in (note that this is consistent with how we defined so far). For each with , we map the vertices of the paths and to . For each with , we map the vertices of the paths and to . We are left to show that the vertices of the remaining paths and can be mapped to appropriate vertices of .
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 , all but at most vertices of these red cliques have been mapped to already if and all but at most vertices have been mapped to 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 and in , so that is a homomorphism from to (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 from to . For a clique , we may choose any edge incident to , such that is a clique of size . Since contains no cliques larger than , we find that maps each clique (which has size ) to a clique in 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 . By definition, maps all of to a clique containing and all of to a clique containing . Hence, the vertices of the two paths and must be mapped to the vertices of a shortest path between and . At most red neighbours of every with can be mapped to a vertex other than . This is because these red neighbours form a clique. As such they must be mapped onto vertices that form a clique in . As such vertices lie on a shortest path from to , the clique in has size at most . Similarly, at most red neighbours of every with can be mapped to a vertex other than . As such, is an -factor cut in .
2.3 A Small Extension
Two vertices and in a graph 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 with reflexive vertices and after introducing reflexive true twins of and reflexive true twins of . 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 if and only if there exists a surjective homomorphism from to .
Theorem 2.3
For every connected -reflexive graph and integers , Surjective -Colouring is NP-complete.
3 Target Graphs Of At Most Four Vertices
In this section we classify the computational complexity of Surjective -Colouring for every target graph 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 Figure 1.
Lemma 5 ([19])
Let be a graph with connected components . If Surjective -Colouring is NP-complete for some , then Surjective -Colouring is also NP-complete.
Lemma 6 ([1])
For every graph , if -Compaction is polynomial-time solvable, then Surjective -Colouring is polynomial-time solvable.
We also need two results of Golovach, Paulusma and Song. Recall that in our context a tree is a connected graph with no cycles of length at least 3.
Lemma 7 ([10])
Let be an irreflexive non-bipartite graph. Then Surjective -Colouring is NP-complete.
Lemma 8 ([10])
Let be a tree. Then Surjective -Colouring is solvable in polynomial time if is loop-connected and NP-complete otherwise.
Recall that denotes the reflexive cycle on four vertices (see also Figure 6).
Lemma 9 ([13])
The Surjective -Colouring problem is NP-complete.
We let 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 , , , 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 and are displayed in Figure 6 as well.
We are now ready to state our main result.
Theorem 3.1
Let be a graph with . Then Surjective -Colouring is NP-complete if some connected component of is not loop-connected or is an irreflexive complete graph on at least three vertices, or . Otherwise Surjective -Colouring is polynomial-time solvable.
Proof
Let be a graph on at most four vertices. If is a loop-connected forest (that is, every component of is loop-connected) or has a dominating reflexive vertex, then Vikas [19] showed that -Compaction is in P. Hence, Surjective -Colouring is in P by Lemma 6. If contains a component that is a non-loop-connected tree, then Surjective -Colouring is NP-complete by Lemmas 5 and 8. If is an irreflexive non-bipartite graph, then Surjective -Colouring is NP-complete by Lemma 7.
Note that the above cases cover all graphs on at most three vertices, all disconnected graphs on four vertices and all trees on four vertices. The only two graphs on at most three vertices for which Surjective -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 on four vertices for which Surjective -Colouring is NP-complete are those that contain these two graphs as connected components. The only trees on four vertices for which Surjective -Colouring is NP-complete are those that are not loop-connected. Hence the theorem holds for every graph on at most three vertices, for every disconnected graph on four vertices and for every tree on four vertices.
From now on we assume that is a connected graph on four vertices that is not a tree. Then 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 is the cycle on four vertices. There are six cases to consider (see also Figure 7). If is reflexive, then Surjective -Colouring is NP-complete by Lemma 9. If is not loop-connected, then is 2-reflexive, and thus Surjective -Colouring is NP-complete by Theorem 2.2. In the remaining four cases is loop-connected. For each of these target graphs, Vikas [19] showed that -Compaction is in P. Hence, Surjective -Colouring is in P by Lemma 6. We find that the theorem holds when is a cycle on four vertices.
Suppose is the complete graph on four vertices. There are five cases to consider (see also Figure 8). If is irreflexive, then Surjective -Colouring is NP-complete by Lemma 7 (as is non-bipartite as well). For each of the other four target graphs, Vikas [19] showed that -Compaction is in P. Hence, Surjective -Colouring is in P by Lemma 6. We find that the theorem holds when is the complete graph on four vertices.
Suppose is the diamond. There are nine cases to consider (see also Figure 9). If is irreflexive, then Surjective -Colouring is NP-complete by Lemma 7 (as is non-bipartite as well). If is not loop-connected, then is 2-reflexive, and thus Surjective -Colouring is NP-complete by Theorem 2.2. For the remaining seven target graphs, Vikas [19] showed that -Compaction is in P. Hence, Surjective -Colouring is in P by Lemma 6. We find that the theorem holds when is the diamond.
Suppose is the paw with vertices and edges , , and and possibly one or more loops. There are twelve cases to consider (see also Figure 10). If is irreflexive, then Surjective -Colouring is NP-complete by Lemma 7 (as is non-bipartite as well). If is not loop-connected, then the set of reflexive vertices is formed by one or two vertices from and . Then Surjective -Colouring is NP-complete by Theorem 2.3. We are left with nine cases. Vikas [19] showed that -Compaction is in P for all of these cases except for the case where is the only reflexive vertex. Hence, for eight of these nine cases, Surjective -Colouring is in P by Lemma 6.
We are left to consider the case in which is the (only) reflexive vertex. Recall that we denote this target by . Theorem 3.5 of [19] 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 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 [19], 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 [19], 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 [19] 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 is the paw. This completes the proof of Theorem 3.1.
Theorem 3.1 corresponds to Vikas’ complexity classification of -Compaction for targets graphs of at most four vertices. Vikas [19] showed that -Compaction and -Retraction are polynomially equivalent for target graphs of at most four vertices. Thus, we obtain the following corollary.
Corollary 1
Let be a graph on at most four vertices. Then the three problems Surjective -Colouring, -Compaction and -Retraction are polynomially equivalent.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] M. Bodirsky, J. Kára and B. Martin, The complexity of surjective homomorphism problems – a survey, Discrete Applied Mathematics 160 (2012) 1680–1690.
- 2[2] T. Feder and P. Hell, List homomorphisms to reflexive graphs, Journal of Combinatorial Theory, Series B 72 (1998) 236-250.
- 3[3] T. Feder, P. Hell and J. Huang, List homomorphisms and circular arc graphs, Combinatorica 19 (1999) 487-505.
- 4[4] T. Feder, P. Hell and J. Huang, Bi-arc graphs and the complexity of list homomorphisms, Journal of Graph Theory 42 (2003) 61-80.
- 5[5] T. Feder, P. Hell, P. Jonsson, A. Krokhin and G. Nordh, Retractions to pseudoforests, SIAM Journal on Discrete Mathematics 24 (2010) 101-112.
- 6[6] 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 Computing 28 (1998) 57–104.
- 7[7] J. Fiala and J. Kratochvíl, Locally constrained graph homomorphisms – structure, complexity, and applications, Computer Science Review 2 (2008) 97-111.
- 8[8] J. Fiala, and D. Paulusma, A complete complexity classification of the role assignment problem, Theoretical Computer Science 349 (2005) 67-81.
