This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

\newclass\PromiseNP

PromiseNP

On the Complexity of Restoring Corrupted Coloringsthanks: Work partially supported by the Emil Aaltonen Foundation (J.L).

Marzio De Biasi E-mail: marziodebiasi@gmail.com    Juho Lauri Tampere University of Technology, Finland. E-mail: juho.lauri@tut.fi
Abstract

In the rr-Fix problem, we are given a graph GG, a (non-proper) vertex-coloring c:V(G)[r]c:V(G)\to[r], and a positive integer kk. The goal is to decide whether a proper rr-coloring cc^{\prime} is obtainable from cc by recoloring at most kk vertices of GG. Recently, Junosza-Szaniawski, Liedloff, and Rzążewski [SOFSEM 2015] asked whether the problem has a polynomial kernel parameterized by the number of recolorings kk. In a full version of the manuscript, the authors together with Garnero and Montealegre, answered the question in the negative: for every r3r\geq 3, the problem rr-Fix does not admit a polynomial kernel unless \NP\coNP/\poly\NP\subseteq\coNP/\poly. Independently of their work, we give an alternative proof of the theorem. Furthermore, we study the complexity of rr-Swap, where the only difference from rr-Fix is that instead of kk recolorings we have a budget of kk color swaps. We show that for every r3r\geq 3, the problem rr-Swap is \W[1]\W[1]-hard whereas rr-Fix is known to be FPT. Moreover, when rr is part of the input, we observe both Fix and Swap are \W[1]\W[1]-hard parameterized by treewidth. We also study promise variants of the problems, where we are guaranteed that a proper rr-coloring cc^{\prime} is indeed obtainable from cc by some finite number of swaps. For instance, we prove that for r=3r=3, the problems rr-Fix-Promise and rr-Swap-Promise are \NP\NP-hard for planar graphs. As a consequence of our reduction, the problems cannot be solved in 2o(n)2^{o(\sqrt{n})} time unless the Exponential Time Hypothesis (ETH) fails.

1 Introduction

Computational models are sometimes too idealized, and do not capture all information available or relevant to a problem. Moreover, in a dynamic world, constraints change over time due to more information becoming available. A problem arising frequently in practice in e.g., scheduling [27] is graph coloring. An assignment of rr colors to the vertices of a graph G=(V,E)G=(V,E) is an rr-coloring. Formally, an rr-coloring c:V[r]c:V\to[r] is said to be proper if c(u)c(v)c(u)\neq c(v) for every uvEuv\in E. In the graph coloring problem, the goal is to find the smallest rr for which a graph is rr-colorable. This quantity is known as the chromatic number of GG, and is denoted by χ(G)\chi(G). Graph coloring is one of the most central problems in discrete mathematics and optimization. For a general introduction to the topic, we refer the reader to the book [17].

Suppose we have a graph GG for which we have computed a proper vertex-coloring using χ(G)\chi(G) colors. Then due to constraints changing, a malicious adversary, or e.g., a system failure, the coloring is corrupted by redistributing the vertex colors over the graph GG. How hard is it to restore the corrupted coloring to some optimal proper coloring of GG? In 2006, Clark, Holliday, Holliday, Johnson, Trimm, Rubalcaba, and Walsh [5] introduced and investigated this problem under the name chromatic villainy. For restoring a corrupted coloring, they used the following operation called a swap. A swap between two distinct vertices uu and vv is the operation of assigning to uu the color that appears on vv, and vice versa. Formally, let cc be a vertex-coloring of a graph GG. The villainy of cc, denoted by B(c)B(c), is the minimum number of swaps to be performed to transform cc into some proper vertex-coloring of GG. The quantity B(c)B(c) can also be seen as the minimum number of recolorings with the constraint that each color used in the new coloring cc^{\prime} must be used the same number of times as in cc. In addition to the graph-theoretic viewpoint, there has been interest in the computational aspects of chromatic villainy [31].

Very recently, Junosza-Szaniawski, Liedloff, and Rzążewski [20] studied a problem they call rr-Fix. In the problem, we are given a graph G=(V,E)G=(V,E), a non-proper rr-coloring cc of V(G)V(G), and an integer kk. The task is to decide whether a proper vertex-coloring cc^{\prime} is obtainable from cc using at most kk vertex recolorings. The authors observe the problem is \NP\NP-complete, and give several positive complexity results as well. In particular, using the framework of Björklund, Husfeldt, and Koivisto [1] they obtain a O(2n)O^{*}(2^{n})-time and exponential space algorithm, where nn is the number of vertices in the input graph. Furthermore, they show that for any fixed rr, the problem is fixed-parameter tractable (FPT) parameterized by the number of recolorings kk. Finally, in the same paper, the authors show that for graphs of treewidth tt, the problem can be solved in O(nrt+2)O(nr^{t+2}) time. For a discussion on several related reoptimization and reconfiguration problems, we refer the reader to [20]. We also note that their results are considerably expanded in a full version of the manuscript currently under review [13].

The main difference between rr-Fix and chromatic villainy as defined by Clark et al. [5] is the basic operation used. In rr-Fix it is a recoloring, whereas in chromatic villainy it is a swap. For this reason, we shall refer to the computational problem arising from chromatic villainy as rr-Swap. That is, the input to rr-Swap is exactly the same as it is in rr-Fix, but instead of kk recolorings we have a budget of kk swaps. Strictly speaking, there is another difference. In fact, in chromatic villainy, the corrupted vertex-coloring is not an arbitrary one, but has an additional property that could possibly be exploited. Namely, the property is that by using some finite number swaps, a proper vertex-coloring is indeed obtainable from the given one. Additional promises of properties of a problem are captured by the notion of a promise problem. Promise problems were introduced and studied by Even, Selman, and Yacobi [9], and they have several applications (for a survey, see [14]). In fact, it seems fair to argue that promise problems model real-world problems more accurately. Indeed, Goldreich [14] writes: “… I contend that almost all readers refer to this notion when thinking about computational problems, although they may be often unaware of this fact”. Motivated by these facts, we also separate two additional problems, rr-Fix-Promise and rr-Swap-Promise, for which the input is guaranteed to satisfy additional properties (a precise definition is provided in Section 2).

In this context, it is natural to investigate whether a hard problem becomes easy when the set of instances is restricted. A priori, it is unknown how the addition of a promise affects the computational complexity of a problem. For example, it is hard to decide whether a graph contains a Hamiltonian cycle, even if we are promised it contains at most one such cycle [18]. In the other direction, one can efficiently find a satisfying assignment for an nn-variable SAT formula that promises to have at least 2n/n2^{n}/n satisfying assignments. However, as shown by Valiant and Vazirani [30], it is hard to find an assignment even when the formula is promised to have exactly one solution.

Motivation.  The problems rr-Fix and rr-Swap are tightly related to local search which is a core technique in solving combinatorial optimization and operations research problems in practice. In local search, one aims to improve upon the current solution by replacing it with a better solution in its neighborhood. Specifically, the neighborhood is defined by the set of allowed operations that modify the current solution. Plausibly, the larger the neighborhood, the less likely is the local search to get stuck in a local optimum. On the other hand, the allowed operations should not be too demanding to compute. In fact, there has been significant interest in applying methods from parameterized complexity to analyzing local search procedures (see e.g., [21, 23, 11, 29, 7]).

The studied problems are also related to combinatorial reconfiguration problems, in particular rr-coloring reconfiguration [19, 4, 32]. In this problem, we are given two proper rr-colorings for a graph, and asked whether one can be transformed into the other by changing one color at a time, maintaining a proper coloring throughout. We argue that in the context of local search, the property of maintaining a proper rr-coloring at each step can be relaxed: we are only interested in eventually arriving at a solution. To further motivate the use of promise conditions, we remark that there are rr-coloring problems in which we know the sizes of the color classes (if an rr-coloring exists). These include well-known problems arising from coding theory, such as partitioning of the nn-dimensional Hamming space into binary codes with certain properties [28].

Our results.  We continue the investigation of the complexity of restoring corrupted colorings. Specifically, we further study the complexity of rr-Fix, under different basic operations and/or promise conditions.

  • For Section 3, our main result is that for any fixed r3r\geq 3, the problem rr-Swap is \W[1]\W[1]-hard parameterized by the number of swaps kk. Moreover, the same is true for rr-Swap-Promise. This should be contrasted with the positive FPT result of Junosza-Szaniawski et al. [20] for rr-Fix. In addition, we observe both problems rr-Fix and rr-Swap become \W[1]\W[1]-hard for treewidth when the number of colors rr is part of the input. The constructions exhibit gadget ideas we use for the sections to follow.

  • In Section 4, we prove that under plausible complexity assumptions, rr-Fix has no polynomial kernel parameterized by the number of recolorings kk, for every r3r\geq 3. We stress that while mentioned as an open problem in [20], the question was subsequently answered by Garnero, Junosza-Szaniawski, Liedloff, Montealegre, and Rzążewski in a full version [13] of [20]. Our result was obtained independently of their work, and uses slightly different ideas.

  • Finally, in Section 5, we consider the complexity of the promise variants of the problems (see Section 2 for precise definitions). We show that for r=3r=3, both rr-Swap-Promise and rr-Fix-Promise are \NP\NP-hard for planar graphs. Moreover, the problems cannot be solved in 2o(n)2^{o(\sqrt{n})} time unless the Exponential Time Hypothesis fails. On the positive side, using known results, we derive an algorithm for the problem working in 2O(n)2^{O(\sqrt{n})} time.

2 Preliminaries

All graphs in this paper are simple and undirected. For graph-theoretic notion not defined here, we refer the reader to [8]. We write [n][n] to denote the set {1,2,,n}\{1,2,\ldots,n\}.

2.1 Promises and problem statements

A promise problem is a generalization of a decision problem, where the input is guaranteed to belong to a restricted subset among all possible inputs [15].

Definition 1 (Promise problem).

A promise problem is a pair of disjoint sets of strings (SY,SN)(S_{Y},S_{N}), and their union SYSNS_{Y}\cup S_{N} is called the promise set. An algorithm AA decides a promise problem if for every xSY,A(x)=1x\in S_{Y},A(x)=1 and for every xSN,A(x)=0x\in S_{N},A(x)=0; for strings that do not belong to the promise set xSYSNx\notin S_{Y}\cup S_{N} the algorithm AA must halt, but can answer arbitrarily.

A promise problem is in \PromiseNP\PromiseNP, the promise extension of \NP\NP, if there exists a polynomial pp and a polynomial-time verifier VV such that for every xSYx\in S_{Y} there exists yy of length at most p(|x|)p(|x|) such that V(x,y)=1V(x,y)=1 and for every xSNx\in S_{N} and every yy it holds that V(x,y)=0V(x,y)=0. For a more comprehensive treatment, we refer the reader to [15].

We are then ready to formally define the problems studied in this work. For the promise variants, a coloring cc^{\prime} is said to be a permutation of a proper vertex-coloring cc if cc^{\prime} can be obtained from cc by a finite number of swaps. In other words, the sizes of the color classes of cc^{\prime} match those of an optimal proper coloring.

rr-Fix
Instance: A graph G=(V,E)G=(V,E), an rr-coloring c:V[r]c:V\to[r], and a positive integer kk.
Question: Can cc be made into a proper rr-coloring of GG using at most kk recolorings?

rr-Fix-Promise
Instance: A graph G=(V,E)G=(V,E), an rr-coloring c:V[r]c:V\to[r], and a positive integer kk.
Promise: χ(G)=r\chi(G)=r, and cc is a permutation of an optimal proper vertex-coloring of GG.
Question: Can cc be made into a proper rr-coloring of GG using at most kk recolorings?

Note that the number of recolorings needed is precisely the minimum Hamming distance between the given coloring cc and a valid coloring cc^{\prime} (if existing).

Similarly, we also define rr-Swap and rr-Swap-Promise, where instead of at most kk recolorings we have a budget of at most kk swaps.

rr-Swap
Instance: A graph G=(V,E)G=(V,E), an rr-coloring c:V[r]c:V\to[r], and a positive integer kk.
Question: Can cc be made into a proper rr-coloring of GG using at most kk swaps?

rr-Swap-Promise
Instance: A graph G=(V,E)G=(V,E), an rr-coloring c:V[r]c:V\to[r], and a positive integer kk.
Promise: χ(G)=r\chi(G)=r, and cc is a permutation of an optimal proper vertex-coloring of GG.
Question: Can cc be made into a proper rr-coloring of GG using at most kk swaps?

At first glance, the promise conditions might seem to make the two problems rr-Fix-Promise and rr-Swap-Promise similar: one could think that two recolorings correspond to a swap because if we recolor a vertex, then by the promise, the color must be reinserted elsewhere. However, it is easy to build graphs in which this does not hold. For example, consider a graph GG constructed from a triangle with the vertices v1v_{1}, v2v_{2}, v3v_{3} colored c1c_{1}, c2c_{2}, c3c_{3}, respectively. Also, connect vertices to GG such that v1v_{1} has three pendants (neighbours) colored c1c_{1} and three pendants colored c2c_{2}; v2v_{2} has three pendants colored c2c_{2} and three pendants colored c3c_{3}; and v3v_{3} has three pendants colored c3c_{3} and three pendants colored c1c_{1}. Clearly, three recolorings are enough to get a proper coloring. Indeed, we color v1v_{1} with c3c_{3}, v2v_{2} with c1c_{1}, and v3v_{3} with c2c_{2}, and are done. In contrast, in the swap variant, two swaps needed (e.g., swap colors on v1v_{1} and v3v_{3}, and then colors on v3v_{3} and v2v_{2}).

2.2 FPT-reductions and (kernelization) lower bounds

In this subsection, we briefly review the necessary basics of parameterized complexity.

Definition 2.

Let A,BΣ×A,B\subseteq\Sigma^{*}\times\mathbb{N} be parameterized problems. A parameterized reduction from AA to BB is an algorithm such that given an instance (x,k)(x,k) of AA, it outputs an instance (x,k)(x^{\prime},k^{\prime}) of BB such that

  1. 1.

    (x,k)(x,k) is a YES-instance of AA iff (x,k)(x^{\prime},k^{\prime}) is a YES-instance of BB,

  2. 2.

    kg(k)k^{\prime}\leq g(k) for some computable function gg, and

  3. 3.

    the running time is f(k)|x|O(1)f(k)\cdot|x|^{O(1)} for some computable function ff.

In the Clique problem, we are given a graph GG and an integer kk. The task is to decide whether GG contains a complete subgraph on kk vertices. The class of problems reducible to Clique under parameterized reductions is denoted by \W[1]\W[1]. We define hardness and completeness analogously to classical complexity, but assume parameterized reductions. That is, a problem is said to be \W[1]\W[1]-hard if Clique (and thus each problem in \W[1]\W[1]) can be reduced to it by a parameterized reduction. It is widely believed that \FPT\W[1]\FPT\neq\W[1].

Let us recall the well-known Exponential Time Hypothesis (ETH), which is often the assumption used for excluding the existence of algorithms that are considerably faster than e.g., brute-force.

Conjecture 3 (Exponential Time Hypothesis [16]).

There exists a constant c>0c>0, such that there is no algorithm solving 33-SAT in time O(2cn)O^{*}(2^{cn}), where nn is the number of variables.

Suppose φ\varphi is an instance of 33-SAT with nn variables and mm clauses. It holds that if there is a linear reduction from 33-SAT to, say, a graph problem XX, then the problem XX cannot be solved in time 2o(n+m)2^{o(n^{\prime}+m^{\prime})}, where nn^{\prime} and mm^{\prime} denote the number of vertices and edges, respectively. Similar reasoning can be applied for \W[1]\W[1]-hard problems. For instance, it is known that there is no f(k)no(k)f(k)n^{o(k)}-time algorithm for Independent Set for any computable function ff, unless ETH fails. Then the existence of a parameterized reduction with a linear parameter dependence from Independent Set to a problem XX^{\prime} implies a lower bound for XX^{\prime} under ETH. For more examples and discussion, we refer the reader to [6, 25].

Finally, let us then mention the machinery we use to obtain kernelization lower bounds later on (for more details, see [2, 6]).

Definition 4.

An equivalence relation \mathcal{R} on Σ\Sigma^{*} is a polynomial equivalence relation if (1) there is an algorithm that given two strings x,yΣx,y\in\Sigma^{*} decides whether (x,y)\mathcal{R}(x,y) in (|x|+|y|)O(1)(|x|+|y|)^{O(1)} time; and (2) for any finite set SΣS\subseteq\Sigma^{*} the equivalence relation \mathcal{R} partitions the elements of SS into at most (maxxS|x|)O(1)(\max_{x\in S}|x|)^{O(1)} classes.

Definition 5 (Cross-composition).

Let LΣL\subseteq\Sigma^{*} and let QΣ×Q\subseteq\Sigma^{*}\times\mathbb{N} be a parameterized problem. We say LL cross-composes into QQ if there is a polynomial equivalence relation \mathcal{R} and an algorithm which, given tt strings x1,x2,,xtx_{1},x_{2},\ldots,x_{t} belonging to the same equivalence class of \mathcal{R}, computes an instance (x,k)Σ×(x^{*},k^{*})\in\Sigma^{*}\times\mathbb{N} in time polynomial in Σi=1t|xi|\Sigma_{i=1}^{t}|x_{i}| such that (1) (x,k)Q(x^{*},k^{*})\in Q iff xiLx_{i}\in L for some i[t]i\in[t]; and (2) kk^{\prime} is bounded polynomially in maxi=1t|xi|+logt\max_{i=1}^{t}|x_{i}|+\log t.

Theorem 6 ([2]).

Assume that an \NP\NP-hard language LL cross-composes into a parameterized language QQ. Then QQ does not admit a polynomial kernel, unless \NP\coNP/\poly\NP\subseteq\coNP/\poly and the polynomial hierarchy collapses.

3 Parameterized aspects of restoring corrupted colorings

Junosza-Szaniawski et al. [20] focused on the rr-Fix problem, that is, the number of colors in the coloring is fixed to be rr. Among other results, they showed the problem is FPT parameterized by treewidth. In other words, the Fix problem (same as rr-Fix but rr is part of the input) is FPT for the combined parameter (r+t)(r+t), where tt is the treewidth of the input graph. In contrast, we observe the problem is \W[1]\W[1]-hard when the parameter is only treewidth.

In the Precoloring Extension problem (PrExt), we are given a graph G=(V,E)G=(V,E), a set WVW\subseteq V of precolored vertices, and a precoloring c:W[r]c:W\to[r] of the vertices in WW. The goal is to decide whether there is a proper rr-coloring cc^{\prime} of GG extending the coloring cc (i.e., c(v)=c(v)c^{\prime}(v)=c(v) for every vWv\in W). When rr is fixed, we call the problem rr-Precoloring Extension (rr-PrExt). Let us then proceed with the following observation.

Lemma 7.

There exists a polynomial time algorithm which given an instance I=(G,W,c,r)I=(G,W,c,r) of Precoloring Extension constructs an instance I=(G,r,c,k)I^{\prime}=(G^{\prime},r^{\prime},c^{\prime},k^{\prime}) of Fix, such that II is a YES-instance of Precoloring Extension iff II^{\prime} is a YES-instance of Fix.

Proof.

Let I=(G,W,c,r)I=(G,W,c,r) be an instance of Precoloring Extension. To obtain, in polynomial time, an instance I=(G,r,c,k)I^{\prime}=(G^{\prime},r^{\prime},c^{\prime},k^{\prime}) of Fix, we proceed as follows. First, let G=GG^{\prime}=G, r=rr^{\prime}=r, and set the number of recolorings k=|VW|k^{\prime}=|V\setminus W|. Then to each precolored vertex wWw\in W, we attach (r1)(k+1)(r^{\prime}-1)\cdot(k^{\prime}+1) pendant vertices, called PwP_{w}. Build cc^{\prime} from cc as follows. We color vertices in PwP_{w} such that there are precisely k+1k^{\prime}+1 vertices colored in every color c([r]{c(w)})c\in([r^{\prime}]\setminus\{c(w)\}). We retain the colors on the vertices in WW, and color each uncolored vertex with color 11. Observe that kk^{\prime} recolorings will not suffice to change the color of wWw\in W as it has k+1k^{\prime}+1 pendants colored in each color distinct from c(w)c(w). Thus, it is easy to see I=(G,W,c,r)I=(G,W,c,r) is a YES-instance of Precoloring Extension iff I=(G,r,c,k)I^{\prime}=(G^{\prime},r^{\prime},c^{\prime},k^{\prime}) is a YES-instance of Fix.

To make the result hold for Swap, we add rkr\cdot k^{\prime} isolated vertices and color them so that we provide a choice of one of the rr colors for each of the kk^{\prime} non-precolored vertices. Finally, it is well-known the addition of vertices of degree at most 1 does not increase the treewidth of a graph. As Precoloring Extension is \W[1]\W[1]-hard for treewidth [10], we obtain the following.

Corollary 8.

Both problems Fix and Swap are \W[1]\W[1]-hard parameterized by treewidth.

Because Precoloring Extension is \NP\NP-complete when restricted to distance-hereditary graphs [3] (and thus for e.g., chordal graphs), we immediately observe the following.

Corollary 9.

Both problems Fix and Swap are \NP\NP-complete when restricted to the class of distance-hereditary graphs.

The above also implies hardness for bounded cliquewidth graphs.

Junosza-Szaniawski et al. [20] proved that for every fixed rr, the problem rr-Fix is FPT parameterized by the number of recolorings. However, when the basic operation is a swap instead of a recoloring, the problem becomes hard. This is established by the following lemma. For the result, we give a parameterized reduction from the well-known Independent Set problem. In this problem are given a graph G=(V,E)G=(V,E), and an integer kk. The goal is to decide whether GG contains a set of kk pairwise non-adjacent vertices. The problem is well-known to be \W[1]\W[1]-hard parameterized by kk.

Lemma 10.

There exists a polynomial time algorithm which given an instance I=(G,k)I=(G,k) of Independent Set constructs an instance I=(G,r,c,k)I^{\prime}=(G^{\prime},r,c,k^{\prime}) of rr-Swap for r=3r=3 such that II is a YES-instance of Independent Set iff II^{\prime} is a YES-instance of rr-Swap.

Proof.

Let V(G)={u1,u2,,un}V(G)=\{u_{1},u_{2},\ldots,u_{n}\}. To construct the graph GG^{\prime}, begin with V(G)=V(G)V(G^{\prime})=V(G) and k=2kk^{\prime}=2k. Add kk disjoint triangles {a1,b1,c1},{ak,bk,ck}\{a_{1},b_{1},c_{1}\},\ldots\{a_{k},b_{k},c_{k}\}, and color them such that c(aj)=3c(a_{j})=3 and c(bj)=c(cj)=2c(b_{j})=c(c_{j})=2, for j[k]j\in[k]. For each i[n]i\in[n], add a disjoint triangle Ci={uai,ubi,uci}C_{i}=\{u^{i}_{a},u^{i}_{b},u^{i}_{c}\}. In each, color c(uai)=1c(u^{i}_{a})=1, c(ubi)=2c(u^{i}_{b})=2, and c(uci)=3c(u^{i}_{c})=3. Attach 2(k+1)2(k+1) pendant vertices to uaiu^{i}_{a} and color k+1k+1 of them with color 22, and k+1k+1 of them with color 33. For each ii, add the edge uiubiu_{i}u^{i}_{b}. For every i,j[n]i,j\in[n], if j>ij>i and uiujE(G)u_{i}u_{j}\in E(G), add the edge ujuciu_{j}u^{i}_{c}. Finally, for each i[n]i\in[n], add k+1k+1 disjoint triangles {ta,1i,tb,1i,tc,1i},,{ta,k+1i,tb,k+1i,tc,k+1i}\{t^{i}_{a,1},t^{i}_{b,1},t^{i}_{c,1}\},\ldots,\{t^{i}_{a,k+1},t^{i}_{b,k+1},t^{i}_{c,k+1}\}. These k+1k+1 disjoint triangles are colored such that c(ta,ji)=3c(t^{i}_{a,j})=3, c(tb,ji)=2c(t^{i}_{b,j})=2, and c(ta,jc)=1c(t^{c}_{a,j})=1, where j[k+1]j\in[k+1]. Add the edge uita,jiu_{i}t^{i}_{a,j}, for i[n]i\in[n] and j[k+1]j\in[k+1]. This completes the construction of GG^{\prime}. An example is shown in Figure 1. Let us then prove I=(G,k)I=(G,k) is a YES-instance of Independent Set iff I=(G,r,c,k)I^{\prime}=(G^{\prime},r,c,k^{\prime}) is a YES-instance of rr-Swap.

Refer to caption
Figure 1: An instance (G,k)(G,k) of Independent Set with k=2k=2 (highlighted in gray) transformed to an instance of rr-Swap. Thick edges at the bottom correspond to k+1k+1 pendant vertices. A gadget has been expanded for u1u_{1}: the three dots hide a similar gadget for each of u2u_{2}, u3u_{3}, and u4u_{4}. The colors are “ =1=1”, “ =2=2”, and “ =3=3”.

Let S={s1,,sk}V(G)S=\{s_{1},\ldots,s_{k}\}\subseteq V(G) be an independent set. By construction, there are exactly kk conflicts in GG^{\prime} between bjb_{j} and cjc_{j}, for j[k]j\in[k]. Swap cjc_{j} with uju_{j}, spending a total of kk swaps. By doing so, we fixed kk conflicts but also introduced kk new conflicts. In particular, the new conflicts are between uiu_{i} and ubiu^{i}_{b}, as they are both colored 22. We swap ubiu^{i}_{b} with uciu^{i}_{c} (colored 33), and claim GG^{\prime} is properly colored. By construction, uciu^{i}_{c} is adjacent to uV(G)u\in V(G) only if uu and uiu_{i} are adjacent in V(G)V(G). As SS is an independent set, each uV(G)u\in V(G) adjacent to uciu^{i}_{c} is colored 11. Thus, cc is a proper coloring for GG^{\prime}, and we are done.

For the other direction, suppose k=2kk^{\prime}=2k swaps suffice to obtain a proper vertex coloring from cc. Again, each of the kk conflicts between bjb_{j} and cjc_{j}, for j[k]j\in[k], must be fixed. To resolve the conflicts, we must swap either bjb_{j} or cjc_{j} with a vertex colored 11. Without loss, suppose we choose cjc_{j} over bjb_{j}. Observe that for every i[n]i\in[n], we cannot swap uaiu^{i}_{a} with any vertex as it has k+1k+1 pendant vertices colored 22, and k+1k+1 pendant vertices colored 33. Thus, there are two possibilities: either we swap cjc_{j} with uiu_{i}, or with ta,jit^{i}_{a,j}, for some i[n]i\in[n] and j[k+1]j\in[k+1]. If the swap occurs between cjc_{j} and ta,jit^{i}_{a,j}, we must then swap tb,jit^{i}_{b,j} with uiu_{i} for some i[n]i\in[n]. This introduces a conflict between the chosen uiu_{i} and its adjacent vertex ubiu^{i}_{b}. After we fix this conflict, we have used a total of 3 swaps, totaling 3k>k3k>k^{\prime} swaps if we followed this strategy for each cjc_{j}. Thus, as k=2kk^{\prime}=2k swaps suffice, and we are looking for an independent set of size exactly kk, we must swap each of the vertices cjc_{j} with some uiu_{i}. Clearly, two vertices ui,uu_{i},u_{\ell}, for i,[n]i,\ell\in[n], adjacent in GG cannot be used to fix the conflicts, for otherwise we would have a conflict between the vertices ubiu^{i}_{b} and ubu^{\ell}_{b} (both colored 22). We conclude that the vertices uiu_{i} a vertex cjc_{j} is swapped with form an independent set.

By adding a properly colored rr-clique to the constructed graph, we can extend the lemma to cover every fixed value of rr. Thus, we have the following.

Theorem 11.

For every r3r\geq 3, the problem rr-Swap is \W[1]\W[1]-hard parameterized by the number of swaps kk. Furthermore, there is no f(k)no(k)f(k)n^{o(k)}-time algorithm for the problem unless ETH fails, where ff is a computable function.

In addition, it is straightforward to extend the construction of Lemma 10 to show the promise variant, namely rr-Swap-Promise, is \W[1]\W[1]-hard parameterized by the number of swaps kk.

Corollary 12.

For every r3r\geq 3, the problem rr-Swap-Promise is \W[1]\W[1]-hard parameterized by the number of swaps kk. Furthermore, there is no f(k)no(k)f(k)n^{o(k)}-time algorithm for the problem unless ETH fails, where ff is a computable function.

Proof.

Assume the construction of an instance I=(G,r,c,k)I=(G^{\prime},r,c,k^{\prime}) of rr-Swap of Lemma 10. To prove the claim, it suffices to augment the construction to ensure the promise holds, i.e., that with a finite number of swaps we have that GG^{\prime} is properly rr-colored and χ(G)=r\chi(G^{\prime})=r.

A double star SnS^{\prime}_{n} is the complete bipartite graph K1,nK_{1,n} with each edge subdivided. Formally, Sn=({s}{q1,,qn}{q1,,qn},{(s,qi),(qi,qi)i[n]})S^{\prime}_{n}=(\{s\}\cup\{q_{1},...,q_{n}\}\cup\{q^{\prime}_{1},...,q^{\prime}_{n}\},\{(s,q_{i}),(q_{i},q^{\prime}_{i})\mid i\in[n]\}). To enforce the promise, add nn disjoint double stars Sk+1S^{\prime}_{k+1} to GG^{\prime}. Each double star is colored such that the central vertex ss receives color 1, vertices qiq_{i} adjacent to the central vertex color 2, and the remaining vertices qiq^{\prime}_{i} color 3. Observe that after swapping the central vertex ss (colored 1) of a Sk+1S_{k+1} with (say) b1b_{1} (colored 2), we require k+1k^{\prime}+1 more swaps to fix the conflicts residing at that particular Sk+1S^{\prime}_{k+1}. Nevertheless, given enough swaps, k(k+1)k^{\prime}\cdot(k^{\prime}+1) to be precise, we can properly rr-color GG^{\prime}. Finally, to guarantee χ(G)=r\chi(G^{\prime})=r, it suffices to add a disjoint properly rr-colored clique.

4 No polynomial kernel for rr-Fix

Junosza-Szaniawski et al. [20] showed that for any fixed rr, the problem rr-Fix is FPT parameterized by the number of recolorings kk. In particular, their result implies a kernel of exponential size for the problem. Thus, they asked whether or not there is a kernel of polynomial size. The question was answered in the negative in a full version of [20] by Garnero et al. [13]. Independently of their work, in what is to follow, we give an alternative proof of the theorem.

Lemma 13.

For r=3r=3, the problem rr-Fix parameterized by the number of recolorings kk does not admit a polynomial kernel unless \NP\coNP/\poly\NP\subseteq\coNP/\poly.

Proof.

We show that 33-SAT cross-composes into rr-Fix parameterized by the number of recolorings kk. By choosing an appropriate polynomial equivalence relation \mathcal{R}, we can assume we are given a sequence φ1,φ2,,φt\varphi_{1},\varphi_{2},\ldots,\varphi_{t} of 33-SAT instances with an equal number of variables, denoted by nn, and an equal number of clauses, denoted by mm.

Let us then proceed with an cross-composition algorithm that composes tt input instances φ1\varphi_{1},φ2\varphi_{2},,φt\ldots,\varphi_{t} which are equivalent under \mathcal{R} into a single instance of rr-Fix parameterized by the number of recolorings. Specifically, we construct an instance (G,k)(G,k) of rr-Fix, where GG is a vertex-colored graph, and kk the number of recolorings. Our plan is to convert each 33-SAT instance φ1,φ2,,φt\varphi_{1},\varphi_{2},\ldots,\varphi_{t} to an instance φ1,φ2,,φt\varphi^{\prime}_{1},\varphi^{\prime}_{2},\ldots,\varphi^{\prime}_{t} of 44-SAT. For each resulting instance of 44-SAT, we apply the standard reduction from 44-SAT to 33-Coloring (see e.g., [12]). Finally, the resulting graphs are connected by a spread gadget, which acts as an instance selector. Let us first describe the gadgets, and then the construction of the whole graph GG. At the same time, we describe a 3-coloring c:V(G)[3]c:V(G)\to[3]. We set k=2log2(t)+2n+9mk=2\log_{2}(t)+2n+9m. Our construction depends crucially on kk, and its choice will become apparent later on.

3-SAT to 4-SAT.  For each 33-SAT formula φh\varphi_{h}, where h[t]h\in[t], introduce a new variable uhu_{h}, and add it to each clause of φh\varphi_{h}. We call the resulting 44-SAT formula φh\varphi_{h}^{\prime}. Observe that by setting uhu_{h} to true we satisfy φh\varphi_{h}^{\prime}.

The variable vertices.  Let the nn variables of φh\varphi_{h}, where h[t]h\in[t], be x1,h,x2,h,,xn,hx_{1,h},x_{2,h},\ldots,x_{n,h}. We introduce nn disjoint 2-cliques labelled {x1,h,¬x1,h},,{xn,h,¬xn,h}\{x_{1,h},\neg x_{1,h}\},\ldots,\{x_{n,h},\neg x_{n,h}\}. Set c(xi,h)=2c(x_{i,h})=2 and c(¬xi,h)=1c(\neg x_{i,h})=1, for i[n]i\in[n] (i.e., initially we set each variable true). Add an isolated vertex uhu_{h}, and let c(uh)=1c(u_{h})=1. We refer to each of the 2n+12n+1 vertices as variable vertices.

The clause gadget.  Denote by Ch,jC_{h,j} the jjth clause of φh\varphi_{h}^{\prime}. For each clause Ch,jC_{h,j}, where h[t]h\in[t] and j[m]j\in[m], construct the following clause gadget Hh,jH_{h,j} (see Figure 2 (b)). Take three disjoint triangles {aj,bj,y1,j}\{a_{j},b_{j},y_{1,j}\}, {cj,dj,y2,j}\{c_{j},d_{j},y_{2,j}\}, {y3,j,y4,j,rj}\{y_{3,j},y_{4,j},r_{j}\}, and add the edges y1,jy4,jy_{1,j}y_{4,j}, y2,jy3,jy_{2,j}y_{3,j}, and y5,jrjy_{5,j}r_{j}. We add k+1k+1 pendant vertices adjacent to rjr_{j} and color them with color 11. This guarantees kk recolorings cannot give rjr_{j} color 11. Vertices aja_{j}, bjb_{j}, cjc_{j} and djd_{j} correspond to the 4 literals each clause has. Thus, we connect them to the corresponding variable vertices. That is, when u{aj,bj,cj,dj}u\in\{a_{j},b_{j},c_{j},d_{j}\} corresponds to the variable xi,hx_{i,h}, i[n]i\in[n], we add the edge uxi,hux_{i,h} (and similarly when its negated). The following properties hold for a clause gadget Hh,jH_{h,j}.

  1. (P1)(P_{1})

    If all four variable vertices of Hh,jH_{h,j} have color 1, then rjr_{j} must have color 1 (costing k+1k+1 recolorings to properly color the gadget).

  2. (P2)(P_{2})

    The gadget Hh,jH_{h,j} can be properly 3-colored if one of the attached variable vertices (including uhu_{h}) have color 2.

The spread gadget.  The spread gadget is constructed by starting from a complete binary tree on tt leaves 1,2,,t\ell_{1},\ell_{2},\ldots,\ell_{t} with the root rr. We replace each internal vertex with a triangle, and attach k+1k+1 pendant vertices to rr. Thus, the distance from rr to any leaf is 2log2(t)2\log_{2}(t). We color root rr, its pendant vertices, and each leaf 1,2,,t\ell_{1},\ell_{2},\ldots,\ell_{t} with color 11. In a triangle, the top vertex receives color 11, the right vertex color 22, and the left vertex color 33 (see Figure 2 (b)). This finishes the construction of the spread gadget.

Refer to caption
Refer to caption
Figure 2: (a) In the spread gadget, fixing the conflict at the root rr corresponds to choosing an instance h\ell_{h}, for h[t]h\in[t]. (b) The clause gadget with its initial vertex-coloring, where the white vertices are colored such that (P1)(P_{1}) and (P2)(P_{2}) are respected. In both figures, thick edges correspond to k+1k+1 pendant vertices. The colors are “ =1=1”, “ =2=2”, and “ =3=3”.

To obtain GG, we connect the described gadgets together as follows. For each φh\varphi_{h}^{\prime}, where h[t]h\in[t], we add a vertex whw_{h}. Make whw_{h} adjacent to each variable vertex, and set c(wh)=3c(w_{h})=3. We give whw_{h} altogether 2(k+1)2(k+1) pendant vertices, and color them so that k+1k+1 of them have color 11, and k+1k+1 of them have color 22. This enforces c(wh)=3c(w_{h})=3 if only kk recolorings are available. In the spread gadget, each leaf h\ell_{h} is made adjacent to both uhu_{h} and whw_{h}.

This completes the construction of the graph GG. Recall k=2log2(t)+2n+9mk=2\log_{2}(t)+2n+9m, and output the instance (G,k)(G,k) of rr-Fix. Let us then prove that (G,k)(G,k) is a YES-instance of rr-Fix iff one of φh\varphi_{h} is satisfiable for h[t]h\in[t].

Correctness.  Suppose (G,k)(G,k) is a YES-instance of rr-Fix. By construction, the root rr and its k+1k+1 pendant vertices are colored with color 11 in the spread gadget. As we only have a budget of kk recolorings, we must recolor rr. By doing so, we introduce a conflict into the triangle containing rr. When this conflict is fixed, we move it to one of the two succeeding triangles. Further continuing to fix the conflict, we propagate it down to one of the leaves s\ell_{s}, for some s[t]s\in[t]. Intuitively, the propagation to s\ell_{s} means we have chosen to solve the instance φs\varphi_{s}. By construction, s\ell_{s} forms a triangle with uhu_{h} (colored 22) and whw_{h} (colored 33). As whw_{h} has k+1k+1 pendants colored with 11 and k+1k+1 pendants colored with 22, we must move the conflict to uhu_{h}. By moving the conflict from rr to uhu_{h}, we used precisely 2log2(t)2\log_{2}(t) swaps. Now, uhu_{h} has color 11, as do all the vertices in D={djV(Cs,j)j[m]}D=\{d_{j}\in V(C_{s,j})\mid j\in[m]\}. As c(uh)=1c(u_{h})=1, we have set the truth value of uhu_{h} to false. Thus, the truth value of φs\varphi_{s} is not affected by the truth value of uhu_{h}. As |D|=m|D|=m, each vertex in DD can be recolored in mm recolorings. Moreover, 9m9m recolorings suffice to swap the color of each vertex in the three vertex-disjoint triangles a clause gadget has. By construction, the initial vertex-coloring corresponds to a truth assignment τ={z1,z2,,zn}{1}n\tau=\{z_{1},z_{2},\ldots,z_{n}\}\in\{1\}^{n} setting each variable to true. Clearly, 2n2n recolorings suffice to reverse τ\tau, i.e., change τ\tau to τ\tau^{\prime} such that the Hamming distance of τ\tau and τ\tau^{\prime} is nn. Therefore, by (P2)(P_{2}), if (G,k)(G,k) is a YES-instance of rr-Fix, then φs\varphi_{s} is satisfiable.

For the other direction, suppose φs\varphi_{s} is satisfiable for some s[t]s\in[t]. Again, the initial vertex-coloring corresponds to a truth assignment τ={z1,z2,,zn}{1}n\tau=\{z_{1},z_{2},\ldots,z_{n}\}\in\{1\}^{n} setting each variable to true. Using at most 2n+9m2n+9m recolorings, we turn the initial vertex-coloring to a vertex-coloring corresponding to τ={z1,z2,,zn}{0,1}n\tau^{\prime}=\{z^{\prime}_{1},z^{\prime}_{2},\ldots,z^{\prime}_{n}\}\in\{0,1\}^{n} such that φs\varphi_{s} is satisfied under τ\tau^{\prime}. Indeed, observe that as φs\varphi_{s} is satisfiable, (P1)(P_{1}) is not violated. Moreover, observe that τ\tau^{\prime} satisfies φs\varphi_{s} regardless of the truth value of usu_{s}. Thus, we can freely let c(us)=1c(u_{s})=1. But now we introduce a conflict between s\ell_{s} (colored 11) and its unique neighbor in the spread gadget. However, using precisely 2log2(t)2\log_{2}(t) recolorings, we propagate this conflict, and in particular the color 11, up to the root rr. At most k=2log2(t)+2n+9mk=2\log_{2}(t)+2n+9m recolorings have been used, and no conflicts remain in GG. Thus, if at least one of φ1,,φt\varphi_{1},\ldots,\varphi_{t} is a YES-instance of 33-SAT, then (G,k)(G,k) is a YES-instance of rr-Fix. This concludes the proof.

In order to extend the above result to hold for every r4r\geq 4, we attach (r3)(k+1)(r-3)\cdot(k+1) pendant vertices to each vertex of the construction. These pendant vertices are colored in the obvious way such that each “original” vertex must receive exactly one of the colors 1, 2, or 3.

Theorem 14 ([13]).

For every r3r\geq 3, the problem rr-Fix parameterized by the number of recolorings kk does not admit a polynomial kernel unless \NP\coNP/\poly\NP\subseteq\coNP/\poly.

Note that in the light of Theorem 11, the existence of a kernel of any size depending only on kk and rr for rr-Swap is highly unlikely.

5 Chromatic villainy: rr-Swap-Promise is hard

As the main result of this section, we prove that 33-Swap-Promise is \NP\NP-hard when restricted to the class of planar graphs. In other words, even with the additional information that some proper vertex-coloring is always obtainable after a finite number of swaps (and no other proper vertex-coloring with less than 3 colors exists), the problem remains hard.

Our reduction will be from the rr-PrExt problem, shown to be \NP\NP-complete for r=3r=3 when restricted to bipartite planar graphs by Kratochvíl [22]. In fact, although not explicitly stated, the following slightly stronger result is obtained from [22].

Theorem 15 ([22]).

The rr-PrExt problem is \NP\NP-complete for r=3r=3 when restricted to the class of bipartite planar graphs, and each precolored vertex has degree 1, that is, deg(w)=1\deg(w)=1 for every wWw\in W.

The reader should be aware that in the following, we use the color set {0,1,2}\{0,1,2\} instead of [3][3]. This will make it more convenient to describe the coloring through modular arithmetic. We are then ready to proceed with the main result of the section.

Theorem 16.

33-Swap-Promise is \NP\NP-hard when restricted to the class of planar graphs. Moreover, the same is true even when every swap must be between adjacent vertices.

Proof.

Let (G=(V,E),W,c)(G=(V,E),W,c) be an instance of rr-PrExt, where GG is an nn-vertex bipartite planar graph, WVW\subseteq V a set of precolored vertices, and c:W{0,1,2}c:W\to\{0,1,2\} a precoloring of the vertices in WW. By Theorem 15, we may assume without loss that each (precolored) vertex in WW has degree 1. Our construction crucially depends on this fact. Let r=3r=3 be a fixed color bound, and let h=|VW|h=|V\setminus W|. We will construct a graph HH along with its vertex-coloring cHc_{H} such that the precoloring cc can be extended to a valid rr-coloring of GG iff at most hh swaps are needed to transform cHc_{H} to an optimal proper vertex-coloring of HH, i.e., B(cH)hB(c_{H})\leq h. To enforce the promise of the problem, it shall hold for cHc_{H} that (i) it uses precisely χ(H)\chi(H) colors, and that (ii) by using a finite number of swaps cHc_{H} can be transformed into a proper coloring of HH.

Construction.  Let X=VWX=V\setminus W be the set of uncolored vertices, let AA and BB be the bipartition of GG, that is, V=ABV=A\cup B, and let us name the set of rr colors C={0,1,2}C=\{0,1,2\}. The graph HH and its vertex-coloring cHc_{H} are constructed from GG and its precoloring cc as follows.

  • We retain the coloring on the vertices of WW, that is, cH(w)=c(w)c_{H}(w)=c(w), for every wWw\in W.

  • If xXx\in X has one or more neighbors colored with color ii (observe it cannot have distinctly colored neighbors), we set cH(x)=ic_{H}(x)=i. If all neighbors of xx are uncolored, we set cH(x)=0c_{H}(x)=0 if xAx\in A. Otherwise, xBx\in B, so we set cH(x)=1c_{H}(x)=1. For each xx, we also add two vertices x1x_{1} and x2x_{2} along with the edges xx1xx_{1} and xx2xx_{2}. We color cH(x1)=(i+1)mod3c_{H}(x_{1})=(i+1)\bmod 3 and cH(x2)=(i+2)mod3c_{H}(x_{2})=(i+2)\bmod 3.

  • For each precolored vertex wWw\in W we add 2(h+1)2(h+1) new vertices sw,1,,sw,h+1s_{w,1},\ldots,s_{w,h+1} and tw,1,,tw,h+1t_{w,1},\ldots,t_{w,h+1}. These will be made pendant vertices of ww by adding the altogether 2(h+1)2(h+1) edges wsw,ws_{w,\ell} and wtw,wt_{w,\ell} where [h+1]\ell\in[h+1]. They receive a color as follows, where c(w)c(w) denotes the color of ww:

    • if wAc(w)0w\in A\wedge c(w)\neq 0, then cH(sw,)=0c_{H}(s_{w,\ell})=0 and cH(tw,)=fc_{H}(t_{w,\ell})=f, where fC{0,c(w)}f\in C\setminus\{0,c(w)\};

    • if wBc(w)1w\in B\wedge c(w)\neq 1, then cH(sw,)=1c_{H}(s_{w,\ell})=1 and cH(tw,)=gc_{H}(t_{w,\ell})=g, where gC{1,c(w)}g\in C\setminus\{1,c(w)\}; and

    • in all other cases cH(sw,)=(i+1)mod3c_{H}(s_{w,\ell})=(i+1)\bmod 3, and cH(tw,)=(i+2)mod3c_{H}(t_{w,\ell})=(i+2)\bmod 3.

  • For every precolored vertex wAc(w)0w\in A\wedge c(w)\neq 0, we add hh new vertices sw,1,,sw,hs^{\prime}_{w,1},\ldots,s^{\prime}_{w,h} with the edges sw,jsw,js_{w,j}s^{\prime}_{w,j}, and set cH(sw,j)=c(w)c_{H}(s^{\prime}_{w,j})=c(w), where j[h]j\in[h].

  • For every precolored vertex wBc(w)1w\in B\wedge c(w)\neq 1, we add hh new vertices sw,1,,sw,hs^{\prime}_{w,1},\ldots,s^{\prime}_{w,h} with the edges sw,jsw,js_{w,j}s^{\prime}_{w,j}, and set cH(sw,j)=c(w)c_{H}(s^{\prime}_{w,j})=c(w), where j[h]j\in[h].

  • Finally, consider an arbitrary precolored vertex wWw\in W, and its set of h+1h+1 pendant vertices tw,jt_{w,j}. We choose an arbitrary vertex among the tw,jt_{w,j} vertices, and call it vv. Then, we add two vertices rr and rr^{\prime} along with the edges vrvr, vrvr^{\prime}, and rrrr^{\prime}. These vertices are colored such that cH(r)=(cH(v)+1)mod3c_{H}(r)=(c_{H}(v)+1)\bmod 3 and cH(r)=(cH(v)+2)mod3c_{H}(r^{\prime})=(c_{H}(v)+2)\bmod 3.

Refer to caption
Refer to caption
Figure 3: (a) A partially precolored input graph GG of rr-PrExt. (b) To reduce clutter, the reduction of Theorem 16 expanded for only two vertices xXx\in X and wWw\in W. The colors are “ =0=0”, “ =1=1”, and “ =2=2”.

This finishes the construction of the graph HH along with its vertex-coloring cHc_{H}. It is straightforward to verify GG is planar, but not bipartite because of the triangle on the vertices vv, rr, and rr^{\prime}. An example is shown in Figure 3. We will then prove (G=(V,E),W,c)(G=(V,E),W,c) is YES-instance of PrExt iff B(cH)hB(c_{H})\leq h, that is, if hh swaps suffice to transform cHc_{H} into a proper coloring of HH.

Correctness.  Suppose cc can be extended to a proper vertex-coloring cc^{\prime} of GG. We will show hh swaps suffice to transform cHc_{H} into a proper coloring of HH. For each xXx\in X, we perform a swap between xx and either x1x_{1} or x2x_{2}. Then for every xx it holds that either cH(x)=c(x)c_{H}(x)=c^{\prime}(x) (and there is no need to swap it), or one of the two described swaps can change the color of xx to c(x)c^{\prime}(x). Now, let cH(x)c_{H}(x) be the color of xx before the swap, and cH(x)=c(x)c^{\prime}_{H}(x)=c^{\prime}(x) its color after the swap. Let u1,,umu_{1},\ldots,u_{m} be the neighbors of xx. If uiWu_{i}\in W was a precolored vertex, then cH(ui)=cH(x)cH(x)c_{H}(u_{i})=c_{H}(x)\neq c^{\prime}_{H}(x) by construction; if uiXu_{i}\in X was an uncolored vertex then the valid coloring cc^{\prime} guarantees that cH(x)cH(ui)c^{\prime}_{H}(x)\neq c^{\prime}_{H}(u_{i}). Thus, the claim follows.

For the other direction, suppose B(cH)hB(c_{H})\leq h. Consider a precolored vertex wWw\in W and let cH(w)=ic_{H}(w)=i. We claim that for any valid extension cc^{\prime} of cc, it holds that c(w)=cH(w)=c(w)c^{\prime}(w)=c_{H}(w)=c(w). More precisely, we will show that if the color of ww was changed, then it is impossible for cc^{\prime} to be an extension of cc. By construction, the vertex ww has h+1h+1 neighbors sw,s_{w,\ell} each colored pp, and h+1h+1 neighbors tw,t_{w,\ell} each colored qq with ipqi\neq p\neq q. Thus, if one swap was used to change the color on ww, then after h1h-1 swaps there would be at least one edge incident to ww with its endpoints having the same color. So we have that c(w)=cH(w)=c(w)c^{\prime}(w)=c_{H}(w)=c(w). Moreover, cc^{\prime} is completed to an extension of cc by picking the colors cH(x)c^{\prime}_{H}(x) assigned to the uncolored vertices xXx\in X after the hh swaps. This completes the proof of correctness for our reduction.

Promise.  Let us then show that the promise holds as well. That is, we show that cHc_{H} can be transformed into a proper vertex-coloring cH′′c^{\prime\prime}_{H} of HH with a finite number of swaps even if the original precoloring of GG cannot be extended to a proper coloring (but in this case, more than hh swaps are needed).

First, we show that a finite number of swaps gives us a 2-coloring for ABA\cup B such that every vertex in AA receives color 0, and every vertex in BB color 11. Afterwards, we will adjust the remaining pendant vertices sw,s_{w,\ell}, tw,t_{w,\ell}, and sw,js^{\prime}_{w,j} so that no color conflict remains.

If xXAcH(x)1x\in X\cap A\wedge c_{H}(x)\neq 1, then we swap it with one of its neighbors x1x_{1} or x2x_{2} and get cH′′(x)=0c^{\prime\prime}_{H}(x)=0. Similarly, if xXBcH(x)2x\in X\cap B\wedge c_{H}(x)\neq 2, a swap with either x1x_{1} or x2x_{2} gives us cH′′(x)=1c^{\prime\prime}_{H}(x)=1.

Let us then consider the precolored vertices. If wWAcH(w)0w\in W\cap A\wedge c_{H}(w)\neq 0, we swap ww with sw,h+1s_{w,h+1} which is colored 0. This causes a conflict cH′′(w)=cH(sw,j)=0c^{\prime\prime}_{H}(w)=c_{H}(s_{w,j})=0, which is fixed by swapping sw,js_{w,j} with sw,js^{\prime}_{w,j} that are colored cH(sw,j)=cH(w)0c_{H}(s^{\prime}_{w,j})=c_{H}(w)\neq 0. Similarly, if wWBcH(w)1w\in W\cap B\wedge c_{H}(w)\neq 1, we swap ww with sw,h+1s_{w,h+1} which is colored 11. This causes conflicts cH′′(w)=cH(sw,j)=1c^{\prime\prime}_{H}(w)=c_{H}(s_{w,j})=1, where j[h]j\in[h]. To fix them, we swap sw,js_{w,j} with sw,js^{\prime}_{w,j} that are colored cH(sw,j)=cH(w)1c_{H}(s^{\prime}_{w,j})=c_{H}(w)\neq 1. Thus, we have that all vertices in AA are colored 11, and all vertices in BB are colored 11. Moreover, for all wWw\in W we have cH′′(w)cH′′(sw,)cH′′(w)cH′′(tw,)c^{\prime\prime}_{H}(w)\neq c^{\prime\prime}_{H}(s_{w,\ell})\wedge c^{\prime\prime}_{H}(w)\neq c^{\prime\prime}_{H}(t_{w,\ell}), where [h+1]\ell\in[h+1]. Also, cH′′(sw,j)cH′′(sw,j)c^{\prime\prime}_{H}(s_{w,j})\neq c^{\prime\prime}_{H}(s_{w,j}), where j[h]j\in[h]. Thus, cH′′c^{\prime\prime}_{H} is a valid coloring of HH and the triangle v,r,rv,r,r^{\prime} guarantees that χ(H)=3\chi(H)=3. Thus, the claim follows.

By removing the promise condition, we can modify our reduction to obtain the following.

Corollary 17.

For every r3r\geq 3, the problem rr-Swap is \NP\NP-complete for bipartite planar graphs.

Another corollary follows by a chain of reductions. First, Lichtenstein [24] gives a reduction from 33-SAT to Planar 33-SAT showing Planar 33-SAT cannot be solved in time 2o(n+m)2^{o(\sqrt{n+m})}, unless ETH fails. Continuing to compose reductions, Mansfield [26] gives a linear reduction from Planar 33-SAT to Planar 11-in-33-SAT, which is then similarly reduced by Kratochvíl [22] to rr-PrExt (the result of Theorem 15). Finally, it can be verified the construction of Theorem 16 has linear size, giving us the following.

Corollary 18.

There is no algorithm which solves Planar 33-Swap-Promise in 2o(n)2^{o(\sqrt{n})} time unless ETH fails.

However, on a positive side, we claim that for any fixed rr, the problem Planar rr-Fix (and its promise variant) can be solved in 2O(n)2^{O(\sqrt{n})} time. To see this, we recall that Junosza-Szaniawski et al. [20] showed that for any fixed rr, the optimization variant of rr-Fix is solvable in O(nrt+2)O(nr^{t+2}) time on graphs of treewidth tt. To leverage this result, it is enough to recall the treewidth of a planar graph is O(n)O(\sqrt{n}). This implies a 2O(n)2^{O(\sqrt{n})}-time algorithm for Planar rr-Fix.

Finally, let us mention that by modifying the construction of Theorem 16 slightly, one can show a similar result for rr-Fix-Promise, and its non-promise variant as well.

Theorem 19.

33-Fix-Promise is \NP\NP-hard when restricted to the class of planar graphs.

Proof.

Consider the construction in Theorem 16. For each xXx\in X, remove the edges xx1xx_{1} and xx2xx_{2}, and add the edge x1x2x_{1}x_{2}.

Observe that it still holds that in hh recolorings, it is impossible to recolor a precolored vertex wWw\in W. Thus, the correctness of the reduction holds. To see that the promise is enforced, note that it is still true that χ(G)=3=r\chi^{\prime}(G)=3=r. For each xXx\in X, there is a corresponding 2-clique, from which a color distinct from c(x)c^{\prime}(x) can be swapped for xx. Thus, the promise is also enforced. We have a valid reduction, and thus conclude the proof.

By relaxing the requirement on the promise condition, we establish again the following. We also note that using different ideas, the same conclusion was reached in [13].

Corollary 20 ([13]).

For every r3r\geq 3, the problem rr-Fix is \NP\NP-complete for bipartite planar graphs.

As also remarked in [13], it is interesting to contrast the above with the results of [20] where it was shown that when r=2r=2, the problem rr-Fix is solvable in polynomial time. In other words, if we have a bipartite graph that is not colored optimally (i.e. more than two colors are used), fixing the coloring is hard.

6 Conclusions

We further investigated the complexity of restoring corrupted colorings, especially from a parameterized perspective. Interestingly, we showed that rr-Swap is \W[1]\W[1]-hard parameterized by the number of swaps, while rr-Fix is known to be FPT parameterized by the number of recolorings. We believe the problems behave similarly for treewidth. Indeed, we conjecture that rr-Swap is \W[1]\W[1]-hard parameterized by treewidth, for every r3r\geq 3. One could also consider other natural basic operations, such as swaps between adjacent vertices.

Finally, it might be interesting to perform a similar study for edge-colored graphs. In particular, how does the complexity of edge recoloring compare to vertex recoloring?

References

  • [1] A. Björklund, T. Husfeldt, and M. Koivisto. Set partitioning via inclusion-exclusion. SIAM Journal on Computing, 39(2):546–563, 2009.
  • [2] H. L. Bodlaender, B. M. P. Jansen, and S. Kratsch. Kernelization lower bounds by cross-composition. SIAM Journal of Discrete Mathematics, 28(1):277–305, 2014.
  • [3] F. Bonomo, G. Durán, and J. Marenco. Exploring the complexity boundary between coloring and list-coloring. Annals of Operations Research, 169(1):3–16, 2008.
  • [4] P. S. Bonsma, A. E. Mouawad, N. Nishimura, and V. Raman. The complexity of bounded length graph recoloring and CSP reconfiguration. In Proceedings of the 9th International Symposium on Parameterized and Exact Computation, IPEC 2014, Wroclaw, Poland, September 10-12, pages 110–121, 2014.
  • [5] S. A. Clark, J. E. Holliday, S. H. Holliday, P. Johnson, J. E. Trimm, R. R. Rubalcaba, and M. Walsh. Chromatic villainy in graphs. Congressus Numerantium, 182:171, 2006.
  • [6] M. Cygan, F. V. Fomin, Ł. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized Algorithms. Springer, 2015.
  • [7] M. de Berg, K. Buchin, B. M. P. Jansen, and G. J. Woeginger. Fine-grained complexity analysis of two classic TSP variants. In Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, Rome, Italy, July 11-15, pages 5:1–5:14, 2016.
  • [8] R. Diestel. Graph Theory. Springer-Verlag Heidelberg, 2010.
  • [9] S. Even, A. L. Selman, and Y. Yacobi. The complexity of promise problems with applications to public-key cryptography. Information and Control, 61(2):159–173, 1984.
  • [10] M. R. Fellows, F. V. Fomin, D. Lokshtanov, F. Rosamond, S. Saurabh, S. Szeider, and C. Thomassen. On the complexity of some colorful problems parameterized by treewidth. Information and Computation, 209(2):143–153, 2011.
  • [11] M. R. Fellows, F. V. Fomin, D. Lokshtanov, F. Rosamond, S. Saurabh, and Y. Villanger. Local search: Is brute-force avoidable? Journal of Computer and System Sciences, 78(3):707–719, 2012.
  • [12] M. R. Garey, D. S. Johnson, and L. Stockmeyer. Some simplified NP-complete graph problems. Theoretical Computer Science, 1(3):237–267, 1976.
  • [13] V. Garnero, K. Junosza-Szaniawski, M. Liedloff, P. Montealegre, and P. Rzążewski. Fixing improper colorings of graphs. CoRR, abs/1607.06911, 2016.
  • [14] O. Goldreich. On promise problems: A survey. In Theoretical Computer Science, volume 3895 of Lecture Notes in Computer Science, pages 254–290. Springer Berlin Heidelberg, 2006.
  • [15] O. Goldreich. Computational Complexity: A Conceptual Perspective. Cambridge University Press, 2008.
  • [16] R. Impagliazzo and R. Paturi. On the Complexity of kk-SAT. Journal of Computer and System Sciences, 62(2):367–375, 2001.
  • [17] T. R. Jensen and B. Toft. Graph coloring problems, volume 39. John Wiley & Sons, 2011.
  • [18] D. S. Johnson. The NP-completeness column: an ongoing guide. Journal of Algorithms, 6(3):434–451, 1985.
  • [19] M. Johnson, D. Kratsch, S. Kratsch, V. Patel, and D. Paulusma. Finding shortest paths between graph colourings. In Proceedings of the 9th International Symposium on Parameterized and Exact Computation, IPEC 2014, Wroclaw, Poland, September 10-12, pages 221–233, 2014.
  • [20] K. Junosza-Szaniawski, M. Liedloff, and P. Rzążewski. Fixing improper colorings of graphs. In SOFSEM 2015: Theory and Practice of Computer Science, pages 266–276. Springer, 2015.
  • [21] S. Khuller, R. Bhatia, and R. Pless. On local search and placement of meters in networks. SIAM Journal on Computing, 32(2):470–487, 2003.
  • [22] J. Kratochvíl. Precoloring extension with fixed color bound. Acta Math. Univ. Comen, 62:139–153, 1993.
  • [23] A. Krokhin and D. Marx. On the hardness of losing weight. ACM Transactions on Algorithms, 8(2):1–18, 2012.
  • [24] D. Lichtenstein. Planar formulae and their uses. SIAM Journal on Computing, 11(2):329–343, 1982.
  • [25] D. Lokshtanov, D. Marx, and S. Saurabh. Lower bounds based on the Exponential Time Hypothesis. Bulletin of the EATCS, (105):41–72, 2011.
  • [26] A. Mansfield. Determining the thickness of graphs is NP-hard. In Mathematical Proceedings of the Cambridge Philosophical Society, volume 93, pages 9–23. Cambridge University Press, 1983.
  • [27] D. Marx. Graph colouring problems and their applications in scheduling. Electrical Engineering, 48(1-2):11–16, 2004.
  • [28] P. R. Östergård. On a hypercube coloring problem. Journal of Combinatorial Theory, Series A, 108(2):199–204, 2004.
  • [29] S. Szeider. The parameterized complexity of kk-flip local search for SAT and MAX SAT. Discrete Optimization, 8(1):139–145, 2011.
  • [30] L. G. Valiant and V. V. Vazirani. NP is as easy as detecting unique solutions. Theoretical Computer Science, 47:85–93, 1986.
  • [31] D. West. Chromatic Villainy of Graphs. http://www.math.illinois.edu/~dwest/
    regs/chromvil.html, 2013 (accessed August 3, 2015).
  • [32] M. Wrochna. Reconfiguration in bounded bandwidth and treedepth. arXiv preprint arXiv:1405.0847, 2014.