Algorithms and Almost Tight Results for 3-Colorability of Small Diameter Graphs

In spite of the extensive studies of the 3-coloring problem with respect to several basic parameters, the complexity status of the 3-coloring problem on graphs with small diameter, i.e. with diameter 2 or 3, has been a longstanding and challenging open question. For graphs with diameter 2 we provide the first subexponential algorithm with complexity $2^{O(\sqrt{n\log n})}$, which is asymptotically the same as the currently best known time complexity for the graph isomorphism (GI) problem. Moreover, we prove that the graph isomorphism problem on 3-colorable graphs with diameter 2 is GI-complete. Furthermore we present a subclass of graphs with diameter 2 that admits a polynomial algorithm for 3-coloring. For graphs with diameter 3 we establish the complexity of 3-coloring by proving that for every $\varepsilon \in [0,1)$, 3-coloring is NP-complete on triangle-free graphs of diameter 3 and radius 2 with $n$ vertices and minimum degree $\delta=\Theta(n^{\varepsilon})$. Moreover, assuming ETH, we provide three different amplifications of our hardness results to obtain for every $\varepsilon \in [0,1)$ subexponential lower bounds for the complexity of 3-coloring on triangle-free graphs with diameter 3 and minimum degree $\delta=\Theta(n^{\varepsilon})$. Finally, we provide a 3-coloring algorithm with running time $2^{O(\min\{\delta\Delta,\frac{n}{\delta}\log\delta\})}$ for graphs with diameter 3, where $\delta$ (resp. $\Delta $) is the minimum (resp. maximum) degree of the input graph. To the best of our knowledge, this algorithm is the first subexponential algorithm for graphs with $\delta=\omega(1)$ and for graphs with $\delta=O(1)$ and $\Delta=o(n)$. Due to the above lower bounds of the complexity of 3-coloring, the running time of this algorithm is asymptotically almost tight when the minimum degree if the input graph is $\delta=\Theta(n^{\varepsilon})$, where $\varepsilon \in [1/2,1)$.


Introduction
A proper k-coloring (or k-coloring) of a graph G is an assignment of k different colors to the vertices of G, such that no two adjacent vertices receive the same color.That is, a k-coloring is a partition of the vertices of G into k independent sets.The corresponding k-coloring problem is the problem of deciding whether a given graph G admits a k-coloring of its vertices, and to compute one if it exists.Furthermore, the minimum number k of colors for which there exists a k-coloring is denoted by χ(G) and is termed the chromatic number of G.The minimum coloring problem is to compute the chromatic number of a given graph G, and to compute a χ(G)-coloring of G if one exists.
One of the most well known complexity results is that the k-coloring problem is NP-complete for every k ≥ 3, while it can be solved in polynomial time for k = 2 [11].Therefore, since graph coloring has numerous applications besides its theoretical interest, there has been considerable interest in studying how several graph parameters affect the tractability of the k-coloring problem, where k ≥ 3.In view of this, the complexity status of the coloring problem has been established for many graph classes.It has been proved that 3-coloring remains NP-complete even when the input graph is restricted to be a line graph [14], a triangle-free graph with maximum degree 4 [19], or a planar graph with maximum degree 4 [11].
On the positive side, one of the most famous result in this context has been that the minimum coloring problem can be solved in polynomial time for perfect graphs using the ellipsoid method [12].Furthermore, polynomial algorithms for 3-coloring have been also presented for classes of nonperfect graphs, such as AT-free graphs [24] and P 6 -free graphs [22] (i.e.graphs that do not contain any path on 6 vertices as an induced subgraph).Furthermore, although the minimum coloring problem is NP-complete on P 5 -free graphs, the k-coloring problem is polynomial on these graphs for every fixed k [13].Courcelle's celebrated theorem states that every problem definable in Monadic Second-Order logic (MSO) can me solved in linear time on graphs with bounded treewidth [8], and thus also the coloring problem can be solved in linear time on such graphs.
For the cases where 3-coloring is NP-complete, considerable attention has been given to devise exact algorithms that are faster than the brute-force algorithm (see e.g. the recent book [10]).In this context, asymptotic lower bounds of the time complexity have been provided for the main NP-complete problems, based on the Exponential Time Hypothesis (ETH) [15,16].ETH states that there exists no deterministic algorithm that solves the 3-CNF-SAT problem in time 2 o(n) , given a boolean formula with n variables.In particular, assuming ETH, 3-coloring can not be solved in time 2 o(n) on graphs with n vertices, even when the input is restricted to graphs with diameter 4 and radius 2 (see [18,21]).Therefore, since it is assumed that no subexponential 2 o(n) time algorithms exist for 3-coloring, most attention has been given to decrease the multiplicative factor of n in the exponent of the running time of exact exponential algorithms, see e.g.[4,10,20].
A very famous computational problem that has been neither proved to be polynomially solvable nor to be NP-complete, is that of the graph isomorphism (GI) problem [11].That is, the problem of deciding whether two given graphs are isomorphic.The currently best known complexity of an algorithm for the graph isomorphism problem is subexponential, namely 2 O( √ n log n) [3].Due to the importance of this problem, the complexity class GI has been defined, which contains all problems with a polynomial time reduction to the graph isomorphism problem.As it is common for complexity classes, a problem is GI-hard if there is a polynomial time reduction from any problem in the class GI that problem.Furthermore, a problem is GI-complete if it is GI-hard and it also belongs to the class GI.
One of the most central notions in a graph is the distance between two vertices, which is the basis of the definition of other important parameters, such as the diameter, the eccentricity, and the radius of a graph.For these graph parameters, it is known that 3-coloring is NP-complete on graphs with diameter at most 4 (see e.g. the standard proof of [21]).Furthermore, it is straightforward to check that k-coloring is NP-complete for graphs with diameter at most 2, for every k ≥ 4: we can reduce 3-coloring on arbitrary graphs to 4-coloring on graphs with diameter 2, just by introducing to an arbitrary graph a new vertex that is adjacent to all others.
In contrast, in spite of the extensive studies of the 3-coloring problem with respect to several basic parameters, the complexity status of this problem on graphs with small diameter, i.e. with diameter at most 2 or at most 3, has been a longstanding and challenging open question, see e.g.[5,7,17].The complexity status of 3-coloring is open also for triangle-free graphs of diameter 2 and of diameter 3. It is worth mentioning here that a graph is triangle-free and of diameter 2 if and only if it is a maximal triangle free graph.Remarkably, it is known that 3-coloring is NP-complete for triangle-free graphs [19], however it is not known whether this reduction can be extended to maximal triangle free graphs.Another interesting result is that almost all graphs have diameter 2 [6]; however, this result can not be used in order to establish the complexity of 3-coloring for graphs with diameter 2.
Our contribution.In this paper we provide subexponential algorithms and hardness results for the 3-coloring problem on graphs with low diameter, i.e. with diameter 2 and 3.As a preprocessing step, we first present two reduction rules that we apply to an arbitrary graph G, such that the resulting graph G is 3-colorable if and only G is 3-colorable.We call the resulting graph irreducible with respect to these two reduction rules.We use these reduction rules to reduce the size of the given graph and to simplify the algorithms that we present.
For graphs with diameter at most 2, we first provide a subexponential algorithm for 3-coloring with running time 2 O(min{δ, n δ log δ}) , where n is the number of vertices and δ is the minimum degree of the input graph.Therefore, this algorithm is simple and has worst-case running time 2 O( √ n log n) , which is asymptotically the same as the currently best known time complexity of the graph isomorphism problem [3].To the best of our knowledge, this algorithm is the first subexponential algorithm for graphs with diameter 2. We demonstrate that this is indeed the worst-case of our algorithm by providing, for every n ≥ 1, a 3-colorable graph G n = (V n , E n ) with Θ(n) vertices, such that G n has diameter 2, the size of a minimum dominating set of G n is Θ( √ n), and deg(v) = Θ( √ n) for every v ∈ V n .In addition, this graph is triangle-free and irreducible with respect to the above two reduction rules.Furthermore we prove that the graph isomorphism problem on 3-colorable graphs with diameter 2 is GI-complete, i.e. it is as hard as on general graphs.Finally, we present a subclass of graphs with diameter 2, which admits a polynomial algorithm for 3-coloring.In particular, we prove that whenever an irreducible graph G with diameter 2 has at least one vertex v such that G − N (v) − {v} is disconnected, then 3-coloring on G can be decided in polynomial time.
For graphs with diameter at most 3, we establish the complexity of deciding 3-coloring.Namely we prove that 3-coloring is NP-complete on irreducible graphs with diameter 3 and radius 2, by providing a reduction from 1-in-3 SAT.In addition, we provide a 3-coloring algorithm with running time 2 O(min{δ∆, n δ log δ}) for arbitrary graphs with diameter 3, where n is the number of vertices and δ (resp.∆) is the minimum (resp.maximum) degree of the input graph.To the best of our knowledge, this algorithm is the first subexponential algorithm for graphs with δ = ω(1) and for graphs with δ = O(1) and ∆ = o(n).Furthermore we improve the above NP-completeness reduction to triangle-free graphs.In particular, we prove in Section 4.4 that 3-coloring remains NP-complete also on triangle-free graphs with diameter 3 and radius 2, by providing a reduction from 3SAT.Table 1 summarizes the current state of the art of the complexity of k-coloring, as well as our algorithmic and NP-completeness results.Furthermore, we provide three different amplification techniques that extend our hardness results for graphs with diameter 3.In particular, we first show that 3-coloring is NP-complete on irreducible graphs G of diameter 3 and radius 2 with n vertices and minimum degree δ(G) = Θ(n ε ), for every ε ∈ [ 1 2 , 1) and that, for such graphs, there exists no algorithm for 3-coloring with running time 2 o( n δ ) = 2 o(n 1−ε ) , assuming ETH.This lower bound is asymptotically almost tight, due to our above algorithm with running time 2 O( n δ log δ) , which is subexponential when δ(G) = Θ(n ε ) for some ε ∈ [ 1 2 , 1).With our second amplification technique, we show that 3-coloring remains NPcomplete also on irreducible graphs G of diameter 3 and radius 2 with n vertices and minimum degree δ(G) = Θ(n ε ), for every ε ∈ [0, 1 2 ).Moreover, we prove that for ε ∈ [0, 1 3 ) there exists no algorithm for 3-coloring with running time 2 o( ) , assuming ETH.Finally, with our third amplification technique, we prove that for ε ∈ [ 1 3 , 1 2 ) there exists no algorithm for 3-coloring with running time 2 o(δ) = 2 o(n ε ) , assuming ETH.Furthermore all these hardness results, as well as the lower time complexity bounds, can be carried over also to the case of triangle-free graphs, cf.Section 4.4.Table 2 summarizes our lower time complexity bounds for 3-coloring on graphs with diameter 3 and radius 2, parameterized by their minimum degree δ.
Organization of the paper.We provide in Section 2 the necessary notation and terminology, as well as our two reduction rules and the notion of an irreducible graph.In Sections 3 and 4 we present our results for graphs with diameter 2 and 3, respectively.Finally, we discuss the presented results and further research in Section 5.

Preliminaries and notation
In this section we provide some notation and terminology, as well as two reduction (or "cleaning") rules that can be applied to an arbitrary graph G. Throughout the article, we assume that any given graph G of low diameter is irreducible with respect to these two reduction rules, i.e. that these reduction rules have been iteratively applied to G until they can not be applied any more.Note that the iterative application of these reduction rules on a graph with n vertices can be done in time polynomial in n.
Notation.We consider in this article simple undirected graphs with no loops or multiple edges.In an undirected graph G, the edge between vertices u and v is denoted by uv, and in this case u and v are said to be adjacent in G. Otherwise u and v are called non-adjacent or independent.Given a graph G = (V, E) and a vertex u ∈ V , denote by N (u) = {v ∈ V : uv ∈ E} the set of neighbors (or the open neighborhood ) of u and by N [u] = N (u) ∪ {u} the closed neighborhood of u.Whenever the graph G is not clear from the context, we will write N G (u) and N G [u], respectively.Denote by deg(u) = |N (u)| the degree of u in G and by δ(G) = min{deg(u) : u ∈ V } the minimum degree of G. Let u and v be two non-adjacent vertices of G.Then, u and v are called (false) twins if they have the same set of neighbors, i.e. if N (u) = N (v).Furthermore, we call the vertices u and v siblings if N (u) ⊆ N (v) or N (v) ⊆ N (u); note that two twins are always siblings.
Given a graph G = (V, E) and two vertices u, v ∈ V , we denote by d(u, v) the distance of u and v, i.e. the length of a shortest path between u and v in G. Furthermore, we denote by 2 possible edges among its vertices, then G[S] is a clique.A clique with t vertices is denoted by K t .A graph G that contains no K t as an induced subgraph is called K t -free.Furthermore, a subset D ⊆ V is a dominating set of G if every vertex of V \D has at least one neighbor in D. For simplicity, we refer in the remainder of the article to a proper k-coloring of a graph G just as a k-coloring of G. Throughout the article we perform several times the merging operation of two (or more) independent vertices, which is defined as follows: we merge the independent vertices u 1 , u 2 , . . ., u t when we replace them by a new vertex u 0 with N (u 0 ) = ∪ k i=1 N (u i ).In addition to the well known big-O notation for asymptotic complexity, some times we use the O * notation that suppresses polynomially bounded factors.For instance, for functions f and g, we write f Observe that, whenever a graph G contains a clique K 4 with four vertices as an induced subgraph, then G is not 3-colorable.Furthermore, we can check easily in polynomial time (e.g. with brute-force) whether a given graph G contains a K 4 .Therefore we assume in the following that all given graphs are K 4 -free.In order to present our two reduction rules of an arbitrary K 4 -free graph G, recall first that the diamond graph is a graph with 4 vertices and 5 edges, i.e. it consists of a K 4 without one edge.The diamond graph is illustrated in Figure 1(a).Suppose that four vertices u 1 , u 2 , u 3 , u 4 of a given graph G = (V, E) induce a diamond graph, and assume without loss of generality that u 1 u 2 / ∈ E.Then, it is easy to see that in any 3-coloring of G (if such exists), u 1 and u 2 obtain necessarily the same color.Therefore we can merge u 1 and u 2 into one vertex, as the next reduction rule states, and the resulting graph is 3-colorable if and only if G is 3-colorable.
Reduction Rule 1 (diamond elimination) Let G = (V, E) be a K 4 -free graph.If the quadruple {u 1 , u 2 , u 3 , u 4 } of vertices in G induces a diamond graph, where u 1 u 2 / ∈ E, then merge vertices u 1 and u 2 .
Note that, after performing a diamond elimination in a K 4 -free graph G, we may introduce a new K 4 in the resulting graph.An example of such a graph G is illustrated in Figure 1(b).In this example, the graph on the left hand side has no K 4 but it has two diamonds, namely on the quadruples {u 1 , u 2 , u 3 , u 4 } and {u 4 , u 5 , u 6 , u 7 } of vertices.However, after eliminating the first diamond by merging u 1 and u 4 , we create a new K 4 on the quadruple {u 1 , u 5 , u 6 , u 7 } of vertices, cf. the graph of the right hand side of Figure 1  Suppose now that a graph G has a pair of siblings u and v and assume without loss of generality that N (u) ⊆ N (v).Then, we can extend any proper 3-coloring of G − {u} (if such exists) to a proper 3-coloring of G by assigning to u the same color as v. Therefore, we can remove vertex u from G, as the next reduction rule states, and the resulting graph G − {u} is 3-colorable if and only if G is 3-colorable.
Reduction Rule 2 (siblings elimination) Let G = (V, E) be a K 4 -free graph and u, v ∈ V , such that N (u) ⊆ N (v).Then remove u from G.
Definition 1.Let G = (V, E) be a K 4 -free graph.If neither Reduction Rule 1 nor Reduction Rule 2 can be applied to G, then G is irreducible.
Due to Definition 1, a K 4 -free graph is irreducible if and only if it is diamond-free and siblingsfree.Given a K 4 -free graph G with n vertices, clearly we can iteratively execute Reduction Rules 1 and 2 in time polynomial on n, until we either find a K 4 or none of the Reduction Rules 1 and 2 can be further applied.If we find a K 4 , then clearly the initial graph G is not 3-colorable.Otherwise, we transform G in polynomial time into an irreducible (K 4 -free) graph G of smaller or equal size, such that G is 3-colorable if and only if G is 3-colorable.
Observe that during the application of these reduction rules to a graph G, neither the diameter nor the radius of G increase.Moreover, note that in the irreducible graph G , the neighborhood N G (u) of every vertex u in G induces a graph with maximum degree at most 1, since otherwise G would have a K 4 or a diamond as an induced subgraph.That is, the subgraph of G induced by N G (u) contains only isolated vertices and isolated edges.Furthermore, the minimum degree of G is δ(G ) ≥ 2, since G is siblings-free.All these facts are summarized in the next observation.In the remainder of the article, we assume that any given graph G is irreducible.
Observation 1 Let G = (V, E) be a K 4 -free graph and G = (V , E ) be the irreducible graph obtained from G. Then δ(G ) ≥ 2, diam(G ) ≤ diam(G), rad(G ) ≤ rad(G), and G is 3-colorable if and only if G is 3-colorable.Moreover, for every u ∈ V , N G (u) induces in G a graph with maximum degree 1.
3 Algorithms for 3-coloring on graphs with diameter 2 In this section we present our results on graphs with diameter 2. In particular, we provide in Section 3.1 our subexponential algorithm for 3-coloring on such graphs.Moreover, we prove that the graph isomorphism (GI) problem on the class of 3-colorable graphs of diameter 2 is GI-complete, i.e. it is as hard as on general graphs.We then provide, for every n, an example of an irreducible and triangle-free graph G n with Θ(n) vertices and diameter 2, which is 3-colorable, has minimum dominating set of size Θ( √ n), and all its vertices have degree Θ( √ n).Furthermore, we provide in Section 3.2 our polynomial algorithm for irreducible graphs G with diameter 2, which have at least one vertex v, such that G − N [v] is disconnected.

An 2 O(
√ n log n) -time algorithm for any graph with diameter 2 We first provide in the next lemma a well known algorithm that decides the 3-coloring problem on an arbitrary graph G, using a dominating set (DS) of G.We also provide its proof for completeness.
Lemma 1 (the DS-approach).Let G = (V, E) be a graph and D ⊆ V be a dominating set of G.Then, the 3-coloring problem can be decided in O * (3 |D| ) time on G.
Proof.We iterate for all possible proper 3-colorings of D. There are at most 3 |D| such colorings; note that, if there is no proper 3-coloring of D, then clearly G is not 3-colorable.Once such a coloring is fixed, every vertex of G − D can be colored by at most two different colors in any 3-coloring of G, since D is a dominating set of G. Therefore, the question of whether this 3-coloring of D can be extended to a 3-coloring of G is a list 2-coloring problem, which can be solved in polynomial time as it can be formulated as a 2SAT instance (a similar approach has been first used in [9], in the context of coloring problems on dense graphs).Therefore, by considering in worst case all possible 3-colorings of the dominating set D, we can decide 3-coloring on G in time O * (3 |D| ).
In the next theorem we use Lemma 1 to provide an improved 3-coloring algorithm for the case of graphs with diameter 2. The time complexity of this algorithm is parameterized on the minimum degree δ of the given graph G, as well as on the fraction n δ .
Theorem 1.Let G = (V, E) be an irreducible graph with n vertices.Let diam(G) = 2 and δ be the minimum degree of G.Then, the 3-coloring problem can be decided in 2 O(min{δ, n δ log δ}) time on G.
Proof.In an arbitrary graph G with n vertices and minimum degree δ, it is well known how to construct in polynomial time a dominating set D with cardinality |D| ≤ n 1+ln(δ+1) δ+1 [2] (see also [1]).).Note by Observation 1 that δ ≥ 2, since G is irreducible by assumption.Therefore the latter running time is 2 O( n δ log δ) .The DS-approach of Lemma 1 applies to any graph G.However, since G has diameter 2 by assumption, we can design a second algorithm for 3-coloring of G as follows.Consider a vertex u ∈ V with minimum degree, i.e. deg(u) = δ.Since diam(G) = 2, it follows that for every other vertex u ∈ V , either d(u, v) = 1 or d(u, v) = 2. Therefore N (u) is a dominating set of G with cardinality δ.Furthermore, in any possible 3-coloring of G, every vertex of N (u) can be colored by one of two possible colors, since all vertices of N (u) are adjacent with u.We iterate now for all possible proper 2-colorings of N (u) (instead of all 3-colorings of the dominating set in the proof of Lemma 1).There are at most 2 δ such colorings; note that, if there is no proper 2-coloring of N (u), then clearly G is not 3-colorable.Similarly to the algorithm of Lemma 1, for every such 2-coloring of N (u) we solve in polynomial time the corresponding list 2-coloring of G − N [u].Thus, considering at most all possible 2-colorings of N (u), we can decide the 3-coloring problem on Summarizing, we can combine these two 3-coloring algorithms for G, obtaining an algorithm with time complexity 2 O(min{δ, n δ log δ}) .
The next corollary provides the first subexponential algorithm for the 3-coloring problem on graphs with diameter 2. Its correctness follows now by Theorem 1.
Corollary 1.Let G = (V, E) be an irreducible graph with n vertices and let diam(G) = 2.Then, the 3-coloring problem can be decided in time on G by Theorem 1.
The time complexity of Corollary 1 is asymptotically the same as the currently best known complexity for the graph isomorphism (GI) problem [3].Thus, as the 3-coloring problem on graphs with diameter 2 has been neither proved to be polynomially solvable nor to be NP-complete, it would be worth to investigate whether this problem is polynomially reducible to/from the GI problem.Remarkably, the GI problem on the class of 3-colorable graphs of diameter 2 is GI-complete, i.e. it is as hard as on general graphs, as we prove in the next theorem.
Theorem 2. The graph isomorphism problem on the class of 3-colorable graphs of diameter 2 is GI-complete.
Proof.First note that the graph isomorphism problem on 3-colorable graphs of diameter 2 clearly belongs to the class GI.Recall now that the graph isomorphism problem on bipartite graphs is GIcomplete [25].In order to prove that the graph isomorphism problem on 3-colorable graphs of diameter 2 is GI-hard, it suffices to provide a polynomial time reduction from the graph isomorphism problem on bipartite graphs.Consider two bipartite graphs G 1 and G 2 on n vertices each.Add to G 1 (resp.to G 2 ) a new vertex v 1 (resp.to v 2 ) that is adjacent to all vertices of G 1 (resp.to G 2 ) and denote the new graph by G 1 (resp.G 2 ).Note that both G 1 and G 2 are graphs of diameter 2. Furthermore, since both G 1 and G 2 are bipartite graphs, i.e. 2-colorable, it follows that both G 1 and G 2 are 3-colorable.Moreover, G 1 is isomorphic to G 2 if and only if G 1 is isomorphic to G 2 , since v 1 and v 2 are the only vertices with degree n in G 1 and G 2 , respectively.Therefore, since G 1 and G 2 can be clearly constructed in polynomial time from G 1 and G 2 , respectively, it follows that the graph isomorphism problem on 3-colorable graphs of diameter 2 is GI-hard.This completes the proof of the theorem.
Given the statements of Lemma 1 and Theorem 1, a question that arises naturally is whether the worst case complexity of the algorithm of Theorem 1 is indeed 2 O( √ n log n) (as given in Corollary 1).That is, do there exist 3-colorable irreducible graphs G with n vertices and diam(G) = 2, such that both δ(G) and the size of the minimum dominating set of G are Θ( √ n log n), or close to this value?We answer this question to the affirmative, thus proving that, in the case of 3-coloring of graphs with diameter 2, our analysis of the DS-approach (cf.Lemma 1 and Theorem 1) is asymptotically almost tight.In particular, we provide in the next theorem for every n an example of an irreducible 3-colorable graph G n with Θ(n) vertices and diam(G n ) = 2, such that both δ(G n ) and the size of the minimum dominating set of G are Θ( √ n).In addition, each of these graphs G n is triangle-free, as the next theorem states.
Theorem 3. Let n ≥ 1.Then there exists an irreducible and triangle-free 3-colorable graph Proof.We assume without loss of generality that n = 4k 2 for some integer k ≥ 1 and we construct a graph We arrange the n vertices of G n in a matrix of size 2k × 2k.For simplicity of notation, we enumerate the vertices of G n in the usual fashion, i.e. vertex v i,j is the vertex in the intersection of row i and column j, where 1 ≤ i, j ≤ 2k.We assign the 3 colors red, blue, green to the vertices of G n as follows.The vertices {v i,j : 1 ≤ i ≤ k, 1 ≤ j ≤ k} are colored blue, the vertices {v i,j : k + 1 ≤ i ≤ 2k, 1 ≤ j ≤ k} are colored green, and the vertices We add edges among vertices of V n as follows.The vertices of jth column {v 1,j , v 2,j , . . ., v 2k,j } and the vertices of the (2k − j)th column {v 1,2k−j , v 2,2k−j , . . ., v 2k,2k−j } build a complete bipartite graph, without the edges {v i,j v i,2k−j : 1 ≤ i ≤ 2k}, i.e. without the edges between vertices of the same row.Furthermore, the vertices of ith row {v i,1 , v i,2 , . . ., v i,2k } and the vertices of the (2k − i)th column {v 2k−i,1 , v 2k−i,2 , . . ., v 2k−i,2k } build a complete bipartite graph, without the edges {v i,j v 2k−i,j : 1 ≤ j ≤ k} ∪ {v i,j v 2k−i, : k + 1 ≤ j, ≤ 2k}.That is, there are no edges between vertices of the same column and no edges between vertices colored red in the above 3-coloring of G n .Note also that there are no edges between vertices colored blue (resp.green), and thus this coloring is a proper 3-coloring of G n .The 2k × 2k matrix arrangement of the vertices of G n is illustrated in Figure 2(a).In this figure, the three color classes are illustrated by different shades of gray.Furthermore, the edges of G n between different rows and between different columns in this matrix arrangement are illustrated in Figures 2(b) and 2(c), respectively.
It is easy to see by the construction of is adjacent to all vertices of the (2k − i)th row of the matrix.Suppose now that there exists a dominating set are adjacent to at least one vertex of D. Thus D is not a dominating set, which is a contradiction.Therefore the size of a minimum dominating set of G n is Θ( √ n).Now we will prove that diam(G n ) = 2. Consider two arbitrary vertices v i,j and v p,q , where (i, j) = (p, q).We will prove that d(v i,j , v p,q ) ≤ 2. If p = i, then v i,j and v p,q lie both in the ith row of the matrix.Therefore v i,j and v p,q have all vertices of {v 2k−i,1 , v 2k−i,2 , . . ., v 2k−i,k }\{v 2k−i,j , v 2k−i,q } as their common neighbors, and thus d(v i,j , v p,q ) = 2.If q = j, then v i,j and v p,q lie both in the jth column of the matrix.Therefore v i,j and v p,q have all vertices of {v 1,2k−j , v 2,2k−j , . . ., v 2k,2k−j } \ {v i,2k−j , v p,2k−j } as their common neighbors, and thus d(v i,j , v p,q ) = 2. Suppose that p = i and q = j.If p = 2k − i or q = 2k − j, then v i,j v p,q ∈ E n by the construction of G n , and thus d(v i,j , v p,q ) = 1.Suppose now that also p = 2k − i and q = 2k − j.If j ≤ k (i.e.v i,j is colored blue or green in the above 3-coloring of G n ), then there exists the path (v i,j , v 2k−i,2k−q , v p,q ) in G n , and thus d(v i,j , v p,q ) = 2. Otherwise, if j ≥ k + 1 (i.e.v i,j is colored red in the above 3-coloring of G n ), then there exists the path (v i,j , v 2k−p,2k−j , v p,q ) in G n , and thus d(v i,j , v p,q ) = 2. Summarizing, d(v i,j , v p,q ) ≤ 2 for every pair of vertices v i,j and v p,q , and thus diam(G n ) = 2. Now we will prove that G n is a triangle-free graph.Suppose otherwise that the vertices v i,j , v p,q , v r,s induce a triangle in G n .Since the above coloring of the vertices of V n is a proper 3-coloring of G n , we may assume without loss of generality that v i,j is colored blue, v p,q is colored green, and v r,s is colored red in the above coloring of G n .That is, i, j ∈ {1, 2, . . ., k}, p ∈ {k + 1, k + 2, . . ., 2k}, q ∈ {1, 2, . . ., k}, r ∈ {1, 2, . . ., 2k}, and s ∈ {k + 1, k + 2, . . ., 2k}.Thus, since v i,j v p,q ∈ E n , it follows by the construction of G n that p = 2k − i.Furthermore, since v p,q v r,s ∈ E n , it follows that p = 2k − r or q = 2k − s.If p = 2k − r, then r = i (since also p = 2k − i).Therefore v i,j and v r,s lie both in the ith row of the matrix, which is a contradiction, since we assumed that v i,j v r,s ∈ E n .Therefore q = 2k − s.Finally, since v i,j v r,s ∈ E n , it follows that r = 2k − i or s = 2k − j.If r = 2k − i, then r = p (since also p = 2k − i).Therefore v p,q and v r,s lie both in the pth row of the matrix, which is a contradiction, since we assumed that v p,q v r,s ∈ E n .Therefore s = 2k − j.Thus, since also q = 2k − s, it follows that q = j, i.e. v i,j and v p,q lie both in the jth column of the matrix.This is again a contradiction, since we assumed that v i,j v p,q ∈ E n .Therefore, no three vertices of G n induce a triangle, i.e.G n is triangle-free.
Note now that G n is diamond-free, since it is also triangle-free, and thus the Reduction Rule 1 does not apply on G n .Furthermore, it is easy to check that there exist no pair v i,j and v p,q of vertices such that N (v i,j ) ⊆ N (v p,q ), i.e.G n is also siblings-free, and thus also the Reduction Rule 2 does not apply on G n .Therefore G n is irreducible.This completes the proof of the theorem.

A tractable subclass of graphs with diameter 2
In this section we present a subclass of graphs with diameter 2, which admits an efficient algorithm for 3-coloring.In particular, given an irreducible graph G with diam(G) = 2, such that G − N [v 0 ] is disconnected for some vertex v 0 of G, Algorithm 1 decides 3-coloring on G in polynomial time, as we prove in Theorem 4. Note here that there exist instances of K 4 -free graphs G with diameter 2, for which G − N [v] is connected for every vertex v of G, but in the irreducible graph G obtained by G (by iteratively applying the Reduction Rules 1 and 2), G − N G [v 0 ] becomes disconnected for some vertex v 0 of G .Therefore, if we provide as input to Algorithm 1 the irreducible graph G instead of G, this algorithm decides in polynomial time the 3-coloring problem on G (and thus also on G).
if Ci is bipartite then 5: merge the two color classes of Ci into two vertices ui and vi, respectively {ui and vi are adjacent} 6: else 7: return "G is not 3-colorable" return "G is not 3-colorable" Let N1 = {z1, z2, . . ., z2q}, where z2i−1z2i ∈ E for every i = 1, 2, . . ., q Compute a 2-coloring of N G (v0) with colors blue and green {this 2-coloring, together with the red color of v0 (cf.line 1) constitutes a 3-coloring of G } Color all vertices of N G (v0) green 25: Color all vertices u i blue and all vertices v i red, for every i = 1, 2, . . ., k

26:
else {N1 = ∅} 27: φ ← ∅; Define boolean variables xi and yj, where 1 return "G is not 3-colorable" 32: else 33: Compute a truth assignment τ that satisfies the formula φ 34: for i = 1 to k do 35: if xi = 1 in τ then color u i red and v i blue else color u i blue and v i red 36: for j = 1 to q do 37: if yi = 1 in τ then color z2j−1 green and z2j blue else color z2j−1 blue and z2j green In order to compute a proper 3-coloring of G, the algorithm assigns without loss of generality the color red to vertex v 0 (cf.line 2).Suppose that at least one component Suppose now that G is 3-colorable, and let χ be a proper 3-coloring of G. Assume without loss of generality that χ uses the colors red, blue, and green (recall that v 0 is already colored red in line 2 of the algorithm).Let C i , C j be an arbitrary pair of connected components of G − N [v 0 ]; such a pair always exists, as G − N [v 0 ] is assumed to be disconnected.Let u and v be two arbitrary vertices of C i and of C j , respectively, such that both u and v are not colored red in χ; such vertices u and v always exist, as we observed above.Then, since diam(G) = 2, there exists at least one common neighbor a of u and v, where a ∈ N (v 0 ).That is, a ∈ N (v 0 ) ∩ N (u) ∩ N (v).Therefore, since v 0 is colored red in χ and u, v are not colored red in χ, it follows that both u and v are colored by the same color in χ.Assume without loss of generality that both u and v are colored blue in χ.Thus, since u and v have been chosen arbitrarily under the single assumption that they are not colored red in χ, it follows that for every vertex are bipartite, Algorithm 1 merges for every i ∈ {1, 2, . . ., k} the vertices of each of the two color-classes of C i into one vertex (cf.lines 3-5).That is, for every i ∈ {1, 2, . . ., k}, the component C i is replaced by exactly two adjacent vertices {u i , v i }, where the one color class of C i is merged into u i and the other one is merged into v i (cf.line 5).Then Algorithm 1 iteratively applies the Reduction Rules 1 and 2, until none of them can be further applied, or until it detects an induced K 4 .Denote the resulting graph by G = (V , E ), cf.lines 8-10 of the algorithm.If G contains an induced K 4 , then G is clearly not 3-colorable, and thus the initial graph G is also not 3-colorable.Therefore, in this case, Algorithm 1 correctly returns in line 12 that G is not 3-colorable.Otherwise, if G does not contain any induced K 4 , then G is irreducible by Definition 1.Note that diam(G ) = 2 and that G is 3-colorable, since diam(G) = 2 and G is assumed to be 3-colorable as well.Denote by χ the 3-coloring of G that is induced by the 3-coloring χ of G.Then, similarly to χ, every vertex of G − N G [v 0 ] is either colored red or blue in χ .
Note by Observation 1 that N G (v 0 ) induces in G a graph with maximum degree 1, since G is irreducible.That is, the vertices of N G (v 0 ) can be partitioned into the sets N 0 and N 1 that include the vertices of G [N G (v 0 )] with degree 0 and with degree 1, respectively (cf.line 13 of Algorithm 1).That is, N 0 contains the isolated vertices of G [N G (v 0 )] and N 1 contains the vertices of N G (v 0 ) that are paired in edges in G [N G (v 0 )].Let N 0 = {w 1 , w 2 , . . ., w p } and N 1 = {z 1 , z 2 , . . ., z 2q }, where z 2i−1 z 2i ∈ E for every i = 1, 2, . . ., q (cf.lines 14-17 of the algorithm).Furthermore, note that N G (v 0 ) is bipartite.
After the execution of the latter applications of the Reduction Rules 1 and 2 to G (cf. lines 9-10 of the algorithm), some of the vertices of adjacent to all other vertices of G .Therefore, since N G (v 0 ) is bipartite, Algorithm 1 correctly computes a 2-coloring of N G (v 0 ) with colors blue and green (cf.line 19).This 2-coloring of N G (v 0 ), together with the red color of v 0 , constitutes a 3-coloring of Suppose that N 1 = ∅, i.e. if q = 0, and thus N G (v 0 ) = N 0 .Then we can construct a proper 3coloring of G as follows.We first color all vertices of N G (v 0 ) green.Then, for every i = 1, 2, . . ., k , we color u i blue and v i red (cf.lines [23][24][25].Note that this coloring is a proper 3-coloring of G .Suppose now that N 1 = ∅, i.e. q = 0 (cf.line 26).We prove that |N G (u i ) ∩ {z 2j−1 , z 2j }| = |N G (v i ) ∩ {z 2j−1 , z 2j }| = 1 for every i ∈ {1, 2, . . ., k } and every j ∈ {1, 2, . . ., q}.Consider a vertex , where 1 ≤ i ≤ k .Suppose that there exists an index j ∈ {1, 2, . . ., q} such that both z 2j−1 , z 2j ∈ N G (u i ).Then the vertices {u i , v 0 , z 2j−1 , z 2j } induce a diamond graph in G (with u i v 0 / ∈ E ).This is a contradiction, since G is irreducible.Therefore |N G (u i ) ∩ {z 2j−1 , z 2j }| ≤ 1 for every j ∈ {1, 2, . . ., q}.Similarly we can prove that also |N G (v i ) ∩ {z 2j−1 , z 2j }| ≤ 1 for every j ∈ {1, 2, . . ., q}.Suppose now that there exists an index j ∈ {1, 2, . . ., q} such that both z 2j−1 , z 2j / ∈ N G (u i ).Then, since diam(G ) = 2, there must exist paths (u i , a, z 2j−1 ) and (u i , a , z 2j ) in G , each of length two.Recall that v i is the only neighbor of u i in G − N G [v 0 ].Furthermore recall that z 2j−1 is the only neighbor of z 2j and z 2j is the only neighbor of We construct a 2SAT formula φ, i.e. a boolean formula φ in conjunctive normal form with two literals in every clause (2-CNF), such that φ is satisfiable if and only if G is 3-colorable.We first define one boolean variable x i for every connected component where 1 ≤ i ≤ k (cf.line 27).If x i = 1, then u i is colored red and v i is colored blue.Otherwise, if x i = 0, then u i is colored blue and v i is colored red.Furthermore, we define one boolean variable y j for every pair {z 2j−1 , z 2j } of N 1 , where 1 ≤ j ≤ q (cf.line 27).If y j = 1, then z 2j−1 is colored green and z 2j is colored blue.Otherwise, if y j = 0, then z 2j−1 is colored blue and z 2j is colored green.Now, for every j ∈ {1, 2, . . ., q} and every vertex , where i ∈ {1, 2, . . ., k }, we add one clause to formula φ as follows.If u i z 2j−1 ∈ E , we add the clause (x i ∨ y j ).Otherwise, if u i z 2j ∈ E , we add the clause (x i ∨ y j ), cf.line 28 of Algorithm 1. Furthermore, for every j ∈ {1, 2, . . ., q} and every vertex , where i ∈ {1, 2, . . ., k }, we add one more clause to formula φ as follows.If v i z 2j−1 ∈ E , we add the clause (x i ∨ y j ).Otherwise, if v i z 2j ∈ E , we add the clause (x i ∨ y j ), cf.line 29 of Algorithm 1.
By the above correspondence between truth values of the variables x i , y j and the colors of the vertices u i , v i , z 2j−1 , x 2j , it is now easy to check that an arbitrary clause of the formula φ is not satisfiable if and only if the corresponding edge between one vertex of {u i , v i } and one vertex of {z 2j−1 , z 2j } is monochromatic, i.e. both its endpoints are colored blue.Therefore, φ is satisfiable if and only if G is 3-colorable.Thus, if φ is not satisfiable, Algorithm 1 correctly returns in line 31 that G is not 3-colorable.Otherwise, if φ is satisfiable, Algorithm 1 correctly computes a 3-coloring of the vertices of G from a satisfying truth assignment of φ (cf.lines 33-37 of the algorithm).
Summarizing, if the input graph G is not 3-colorable, Algorithm 1 correctly returns a negative answer during its execution (cf.lines 7, 12, and 31).Otherwise, Algorithm 1 computes a proper 3-coloring χ of the irreducible graph G .Given such a coloring of G , it is now straightforward to extend it to a proper 3-coloring of the input graph G (cf. line 38 of the algorithm).Namely, we have to iteratively undo all applications of the Reduction Rules 1 and 2 that have previously transformed G into G during the execution of lines 9-10, respectively.For every application of the Reduction Rule 1, we color each of the original vertices with the color of the merged vertex in χ .For every application of the Reduction Rule 2, we color the removed vertex with the color of its sibling in χ .Therefore, Algorithm 1 correctly returns in line 39 the proper 3-coloring of G that it has computed in line 38.
Regarding the time complexity of the algorithm, first recall that the size of the formula φ is linear to the size of G (and thus also of G) and that the 2SAT problem can be solved in polynomial time.Furthermore, recall that the Reduction Rules 1 and 2 can be applied (as well as they can be undone) in polynomial time; the same holds for the execution of all other lines of Algorithm 1.Therefore, Algorithm 1 runs in polynomial time.This completes the proof of the theorem.
A question that arises now naturally by Theorem 4 is whether there exist any irreducible 3colorable graph G = (V, E) with diam(G) = 2, for which G − N [v] is connected for every v ∈ V .
A negative answer to this question would imply that we can decide the 3-coloring problem on any graph with diameter 2 in polynomial time using Algorithm 1.However, the answer to that question is positive: for every n ≥ 1, the graph G n = (V n , E n ) that has been presented in Theorem 3 is irreducible, 3-colorable, has diameter 2, and G n − N [v] is connected for every v ∈ V n .Therefore, Algorithm 1 can not be used in a trivial way to decide in polynomial time the 3-coloring problem for an arbitrary graph of diameter 2. We leave the tractability of the 3-coloring problem of arbitrary diameter-2 graphs as an open problem.

Almost tight results for graphs with diameter 3
In this section we present our results on graphs with diameter 3.In particular, we first provide in Section 4.1 our algorithm for 3-coloring on graphs with diameter 3 that has running time 2 O(min{δ∆, n δ log δ}) , where n is the number of vertices and δ (resp.∆) is the minimum (resp.maximum) degree of the input graph.Then we prove in Section 4.2 that 3-coloring is NP-complete on irreducible graphs with diameter 3 and radius 2 by providing a reduction from a variant of the 1in-3 SAT (or 3-XSAT ) problem that is NP-complete.Furthermore, we provide in Section 4.3 our three different amplification techniques that extend our hardness results of Section 4.2.In particular, we provide in Theorems 8 and 9 our NP-completeness amplifications, and in Theorems 12, 13, and 14 our lower bounds for the time complexity of 3-coloring, assuming ETH.Finally, we extend in Section 4.4 all our results of Sections 4.2 and 4.3 to the case of triangle-free graphs.
4.1 An 2 O(min{δ∆, n δ log δ}) -time algorithm for any graph with diameter 3 In the next theorem we use the DS-approach of Lemma 1 to provide an improved 3-coloring algorithm for the case of graphs with diameter 3. The time complexity of this algorithm is parameterized on the minimum degree δ of the given graph G, as well as on the fraction n δ .Theorem 5. Let G = (V, E) be an irreducible graph with n vertices and diam(G) = 3.Let δ and ∆ be the minimum and the maximum degree of G, respectively.Then, the 3-coloring problem can be decided in 2 O(min{δ∆, n δ log δ}) time on G.
Proof.First recall that, in an arbitrary graph G with n vertices and minimum degree δ, we can construct in polynomial time a dominating set D with cardinality |D| ≤ n 1+ln(δ+1) δ+1 [2].Therefore, similarly to the proof of Theorem 1, we can use the DS-approach of Lemma 1 to obtain an algorithm that decides 3-coloring on G in 2 O( n δ log δ) time.The DS-approach of Lemma 1 applies to any graph G.However, since G has diameter 3 by assumption, we can design a second algorithm for 3-coloring of G as follows.Consider a vertex u ∈ V with minimum degree, i.e. deg(u) = δ.Since diam(G) = 3, we can partition the vertices of Furthermore, the set A ∪ {u} is a dominating set of G with cardinality at most δ∆ + 1.Thus we can decide 3-coloring on G by considering in worst case all possible 3-colorings of A ∪ {u} in O * (3 δ∆+1 ) = 2 O(δ∆) time by using the DS-approach of Lemma 1.
Summarizing, we can combine these two 3-coloring algorithms for G, obtaining an algorithm with time complexity 2 O(min{δ∆, n δ log δ}) .
To the best of our knowledge, the algorithm of Theorem 5 is the first subexponential algorithm for graphs with diameter 3, whenever δ = ω(1), as well as whenever δ = O(1) and ∆ = o(n).As we will later prove in Section 4.3, the running time provided in Theorem 5 is asymptotically almost tight whenever δ = Θ(n ε ), for any ε ∈ [ 1 2 , 1).Note now that for any graph G with n vertices and diam(G) = 3, the maximum degree ∆ of G is ∆ = Ω(n Then, there are at most ∆ vertices in G at distance 1 from u, at most ∆ 2 vertices at distance 2 from u, and at most ∆ 3 vertices at distance 3 from u.That is, all vertices of G are at most 1 + ∆ + ∆ 2 + ∆ 3 = o(n), since we assumed that ∆ = o(n 1 3 ), which is a contradiction.Therefore ∆ = Ω(n 1 3 ).Furthermore note that, whenever δ = Ω(n 1 3

The 3-coloring problem is NP-complete on graphs with diameter 3 and radius 2
In this section we provide a reduction from the monotone 1-in-3 SAT problem to the 3-coloring problem of graphs with diameter 3 and radius 2. A boolean formula φ is called monotone if no variable in φ is negated.Given a monotone boolean formula φ in conjunctive normal form with three literals in each clause (3-CNF), φ is 1-in-3-satisfiable (or X-satisfiable) if there exists a truth assignment τ of the variables of φ such that every clause of φ contains exactly one true literal and two false literals.In this case, the truth assignment τ of φ is called an X-satisfying truth assignment of φ.The monotone 1-in-3 SAT problem (or the monotone 3-XSAT problem) is the problem of deciding whether a given monotone 3-CNF formula φ is X-satisfiable.This problem is known to be NP-complete [23].
Let φ be a monotone 3-CNF formula with n variables x 1 , x 2 , . . ., x n and m clauses α 1 , α 2 , . . ., α m .We can assume in the following without loss of generality that each clause has three distinct literals, i.e. variables.We now construct a graph H φ = (V φ , E φ ) with diameter 3 and radius 2, such that φ is X-satisfiable if and only if H φ is 3-colorable.Before we construct H φ , we first construct an auxiliary graph G n,m that depends only on the number n of the variables and the number m of the clauses in φ, rather than on φ itself.
We construct the graph G n,m = (V n,m , E n,m ) as follows.Let v 0 be a vertex with 3m neighbors v 1 , v 2 , . . ., v 3m , which induce an independent set.Consider also the sets U = {u i,j : 1 ≤ i ≤ n, 1 ≤ j ≤ 3m} and W = {w i,j : 1 ≤ i ≤ n, 1 ≤ j ≤ 3m} of vertices.Each of these sets has 3nm vertices.The set V n,m of vertices of G n,m is defined as The set E n,m of the edges of G n,m is defined as follows.Define first the subsets U j = {u 1,j , u 2,j , . . ., u n,j } and W j = {w 1,j , w 2,j , . . ., w n,j } of U and W , respectively.Then define N (v j ) = {v 0 } ∪ U j ∪ W j for every j ∈ {1, 2, . . ., 3m}, where N (v j ) denotes the set of neighbors of vertex v j in G n,m .For simplicity of the presentation, we arrange the vertices of U ∪ W on a rectangle matrix of size 2n × 3m, cf. Figure 3(a).In this matrix arrangement, the (i, j)th element is vertex u i,j if i ≤ n, and vertex w i−n,j if i ≥ n + 1.In particular, for every j ∈ {1, 2, . . ., 3m}, the jth column of this matrix contains exactly the vertices of U j ∪ W j , cf. Figure 3(a).Note that, for every j ∈ {1, 2, . . ., 3m}, vertex v j is adjacent to all vertices of the jth column of this matrix.Denote now by i = {u i,1 , u i,2 , . . ., u i,3m } (resp.i = {w i,1 , w i,2 , . . ., w i,3m }) the ith (resp.the (n + i)th) row of this matrix, cf. Figure 3(a).For every i ∈ {1, 2, . . ., n}, the vertices of i and of i induce two independent sets in G n,m .We add between the vertices of i and the vertices of i all possible 9m 2 edges, such that they induce a complete bipartite graph in G n,m , cf. Figure 3(b).Note by the construction of G n,m that both U and W are independent sets in G n,m .Furthermore, since m = Ω(n), note that the minimum degree in G n,m is δ(G n,m ) = Θ(n) and the maximum degree in G n,m is ∆(G n,m ) = Θ(m).The construction of the graph G n,m is illustrated in Figure 3.
Observation 2 For every n, m ≥ 1, the graph G n,m is irreducible.Lemma 2. For every n, m ≥ 1, the graph G n,m has diameter 3 and radius 2. Proof.First note that an arbitrary vertex u i,j (resp.w i,j ) is adjacent to v j .Therefore, since v j ∈ N (v 0 ) for every j ∈ {1, 2, . . ., 3m}, it follows that d(v 0 , u) ≤ 2 for every u ∈ V n,m \ {v 0 }, and thus G n,m has radius 2. Furthermore note that d(v j , v k ) ≤ 2 for every 1 ≤ j < k ≤ 3m, since v j , v k ∈ N (v 0 ).Consider now an arbitrary vertex u i,j (resp.w i,j ) and an arbitrary vertex v k .If j = k, then d(v k , u i,j ) = 1 (resp.d(v k , w i,j ) = 1).Otherwise, if j = k, then there exists the path (v k , v 0 , v j , u i,j ) (resp.(v k , v 0 , v j , w i,j )) of length 3 between v k and u i,j (resp.w i,j ).Therefore also d(v k , u) ≤ 3 for every k = 1, 2, . . ., 3m and every u ∈ V n,m \ {v k }.
We will now prove that d(u i,j , u p,q ) ≤ 3 for every (i, j) = (p, q).If p = i and q = j, then there exists the path (u i,j , v j , w p,j , u p,q ) of length 3 between u i,j and u p,q .If q = j, then d(u i,j , u p,q ) = 2, as u i,j , u p,q ∈ N (v j ).Finally, if p = i, then there exists the path (u i,j , v j , w i,j , u p,q ) of length 3 between u i,j and u p,q .Therefore d(u i,j , u p,q ) ≤ 3 for every (i, j) = (p, q).Similarly it follows that d(w i,j , w p,q ) ≤ 3 for every (i, j) = (p, q).It remains to prove that d(u i,j , w p,q ) ≤ 3 for every (i, j) and every (p, q).If p = i and q = j, then there exists the path (u i,j , v j , u p,j , w p,q ) of length 3 between u i,j and w p,q .If p = i then w p,q = w i,q , and thus u i,j w p,q ∈ E φ .If p = i and q = j, then d(u i,j , w p,q ) = 2, since u i,j , w p,q ∈ N (v j ).Therefore d(u ij , w pq ) ≤ 3 for every (i, j) = (p, q), and thus G n,m has diameter 3.
We now construct the graph H φ = (V φ , E φ ) from φ by adding 3m edges to G n,m as follows.For each clause ≤ n, we add to G n,m the triangle with vertices a, b, c, where a = u i k,1 ,3k−2 , b = u i k,2 ,3k−1 , and c = u i k,3 ,3k .Note that the graphs H φ and G n,m have the same vertex set, i.e.V φ = V n,m , and that E n,m ⊂ E φ .Therefore diam(H φ ) = 3 and rad(H φ ) = 2, since diam(G n,m ) = 3 and rad(G n,m ) = 2 by Lemma 2.Moreover, note that H φ is irreducible as G n,m .Observe now that, by the construction of H φ from G n,m , every literal of φ is assigned to one vertex of U .In particular, each of the 3m literals of φ corresponds by this construction to a different column in the matrix arrangement of the vertices of U .Furthermore, if a literal of φ is the variable x i , where 1 ≤ i ≤ n, then the vertex of U that corresponds to this literal lies in the ith row i of the matrix.We are now ready to state the main theorem of this section.Theorem 6.The formula φ is X-satisfiable if and only if H φ is 3-colorable.
Proof.We will first prove that G n,m is 3-colorable.Recall that both U and W are independent sets, and that the only edges among the vertices of U ∪ W in G n,m are all possible edges between the rows i (that contains only vertices of U ) and i (that contains only vertices of W ). Consider three colors, say red, green, and blue.We assign to vertex v 0 the color red and to each of its neighbors v j , 1 ≤ j ≤ 3m, the color blue.Given these colors of the vertices of v 0 and its neighbors, we can construct 2 n different proper 3-colorings of G n,m as follows.For every i = 1, 2, . . ., n, we have two possibilities of coloring the vertices of i and of i : either color all vertices of i green and all vertices of i red, or color all vertices of i red and all vertices of i green.All these different colorings of U ∪ W provide a different 3-coloring of G n,m .Therefore, there are at least 2 n different proper 3-colorings of G n,m , in which all vertices of N (v 0 ) = {v 1 , v 2 , . . ., v 3m } obtain the same color (i.e.blue).
(⇒) Suppose first that φ is X-satisfiable, and let τ be a satisfying truth assignment of φ.We will construct a proper 3-coloring χ φ of H φ .Before we construct χ φ , we first construct an auxiliary (non-proper) coloring χ 0 of the vertices of H φ , as follows.First assign to v 0 the color red in χ 0 .Consider an arbitrary variable x i in φ, where 1 ≤ i ≤ n.If x i = 1 in τ , then assign to all vertices of the row i the color red.Otherwise, we assign to all vertices of the row i the color red.Therefore, for every i = 1, 2, . . ., n, either all vertices of i or all vertices of i are red in χ 0 .For the purposes of the proof, we define for every i = 1, 2, . . ., n the red line of x i as the vertices of the row i if x i = 1 in τ , and as the vertices of the row i if x i = 0 in τ .Similarly, we define for every i = 1, 2, . . ., n the white line of x i as the vertices of the row i if x i = 1 in τ , and as the vertices of the row i if x i = 0 in τ .We complete now the (non-proper) 3-coloring χ 0 of H φ as follows.For every variable x i , we assign to all vertices of the white line of x i the color green in χ 0 , and to all vertices of N (v 0 ) = {v 1 , v 2 , . . ., v 3m } the color blue in χ 0 .As we described in the first paragraph of the proof, χ 0 is a proper 3-coloring of G n,m .However, in this coloring χ 0 , the vertices of U ∪ W are colored either green or red.Therefore χ 0 is not a proper coloring of the graph H φ , since H φ has several triangles on the vertices of U ∪ W (in particular, H φ has m triangles on these vertices, one triangle for each clause of φ).
Consider an arbitrary clause α k = (x i k,1 ∨x i k,2 ∨x i k,3 ) of φ.Since τ is an X-satisfying assignment of φ, it follows that exactly one of the variables x i k,1 , x i k,2 , and x i k,3 is true in τ and the other two are false in τ .Therefore, by the above construction of the (non-proper) 3-coloring χ 0 of H φ , there exist appropriate indices p k , p k , and p k , where {p k , p k , p k } = {1, 2, 3}, such that all vertices of the row i k,p k are colored red in χ 0 , while all vertices of the rows i k,p k and i k,p k are colored green in χ 0 .We now construct the proper 3-coloring χ φ of H φ by modifying coloring χ 0 , as follows.For every k ∈ {1, 2, . . ., 3m}, we assign to vertex v p k the color green (instead of blue in χ 0 ).Furthermore, for every vertex u ∈ U p k ∪ W p k (i.e. for every vertex u of the p k th column in the matrix), if u is colored green in χ 0 , then we assign to u the color blue in χ φ .Since by the construction of H φ every column of the matrix has exactly one vertex of a triangle, it follows that every triangle of H φ is trichromatic in χ φ .Furthermore, it can be easily verified that the resulting coloring χ φ remains a proper 3-coloring of G n,m .Therefore χ φ is a proper 3-coloring of H φ .
(⇐) Suppose now that H φ is 3-colorable and let χ φ be a proper 3-coloring of H φ .Assume without loss of generality that vertex v 0 is colored red in χ φ .We will construct an X-satisfying assignment τ of φ.Consider an index i ∈ {1, 2, . . ., n} and the rows i and i of the matrix.Suppose that i (resp. of i ) has at least one vertex that is colored red and at least one vertex that is colored blue in χ φ .Then clearly all vertices of i (resp. of i ) are colored green in χ φ , since the vertices of i and of i induce a complete bipartite graph in G n,m .Therefore, since every vertex of i (resp. of i ) has a distinct neighbor in N (v 0 ) = {v 1 , v 2 , . . ., v 3m }, it follows that all vertices v 1 , v 2 , . . ., v 3m are colored blue in χ φ .Thus, in turn, all vertices of U ∪ W are colored either green or red in χ φ .This is a contradiction, since we assumed that some vertices of i (resp. of i ) are colored blue in χ φ .Thus, there exists no row i or i , such that at least one of its vertices is colored red and at least one other is colored blue in χ φ .Similarly, there exists no row i or i , such that at least one of its vertices is colored red and at least one other is colored green in χ φ .That is, if at least one vertex of a row i (resp.i ) is colored red in χ φ , then all vertices of i (resp.i ) are colored red in χ φ .
We will now prove that for any i ∈ {1, 2, . . ., n}, at least one vertex of i or at least one vertex of i is red in χ φ .Suppose otherwise that every vertex of the rows i and i is colored either green or blue in χ φ .Then, since the vertices of i and of i induce a complete bipartite graph, it follows that all vertices of i are colored green and all vertices of i are colored blue, or vice versa.Thus, in particular, for every j = 1, 2, . . ., 3m, vertex v j is adjacent to one blue and to one green vertex (one from i and the other from i ).Thus, since χ φ is a proper 3-coloring of H φ , it follows that v j is colored red in χ φ .This is a contradiction, since v 0 ∈ N (v j ) and v 0 is colored red in χ φ by assumption.Therefore, for any i ∈ {1, 2, . . ., n}, at least one vertex of i or at least one vertex of i is colored red in χ φ .
Summarizing, for every i ∈ {1, 2, . . ., n}, either all vertices of the row i or all vertices of the row i are colored red in χ φ .We define now the truth assignment τ of φ as follows.For every i ∈ {1, 2, . . ., n}, we set x i = 1 in τ if all vertices of i are colored red in χ φ ; otherwise, if all vertices of i are colored red in χ φ , then we set x i = 0 in τ .We will prove that τ is an X-satisfying assignment of φ.Consider a clause By the construction of the graph G φ , this clause corresponds to a triangle in G φ .Thus, since χ φ is a proper 3-coloring of G φ , the vertices of this triangle are trichromatic, i.e. exactly one of them is colored red in χ φ and the other two are colored blue and green in χ φ .Therefore the vertices of exactly one of the rows i k,1 , i k,2 , and i k,3 are colored red and the vertices of the other two rows are colored by the other two colors.Thus, by definition of the truth assignment τ , exactly one of the variables x i k,1 , x i k,2 , and x i k,3 is true in τ .Therefore, τ is an X-satisfying truth assignment of φ.This completes the proof of the theorem.
The next theorem follows by Lemma 2 and Theorem 6.
Theorem 7. The 3-coloring problem is NP-complete on irreducible graphs with diameter 3 and radius 2.

Lower time complexity bounds and general NP-completeness results
In this section we present our three different amplification techniques of the reduction of Theorem 6.In particular, using these three amplifications we extend the result of Theorem 7 (by providing both NP-completeness and lower time complexity bounds) to irreducible graphs with diameter 3 and radius 2 and minimum degree δ = Θ(n ε ), for every ε ∈ [0, 1).We use our first amplification technique in Theorems 8 and 12, our second one in Theorems 9 and 14, and our third one in Theorem 13.Theorem 8. Let G = (V, E) be an irreducible graph with diameter 3 and radius 2.
Proof.Let φ be a monotone boolean formula with n variables and m clauses.Using the reduction of Section 4.2, we construct from the formula φ the irreducible graph H φ = (V φ , E φ ), such that H φ has diameter 3 and radius 2. Furthermore |V φ | = Θ(nm) by the construction of H φ .Then, φ is X-satisfiable if and only if H φ is 3-colorable by Theorem 6. Let ) by assumption, it follows that ε 0 ≥ 1.We construct now from the graph H φ the irreducible graph H 1 (φ, ε) with diameter 3 and radius 2, as follows.For every vertex v j in H φ , where j ∈ {1, 2, . . ., 3m}, remove v j and introduce the 2k 0 new vertices A j = {v j,1 , v j,2 , . . ., v j,k 0 } and B j = {v j,1 , v j,2 , . . ., v j,k 0 }.The vertices of A j and of B j induce two independent sets in H 1 (φ, ε).We then add between the vertices of A j and of B j all possible edges, except those of {v j,p v j,p : 1 ≤ p ≤ k 0 }.That is,we add k 2 0 − k 0 edges between the vertices of A j and B j , such that they induce a complete bipartite graph without a perfect matching between A j and B j .This replacement of vertex v j by the vertex sets A j and B j in H 1 (φ, ε) is illustrated in Figure 4. Furthermore, we add all 2k 0 edges between v 0 and the vertices of A j ∪ B j .Finally, we add all 2n • k 0 edges between the 2n vertices of U j ∪ W j (i.e. the jth column of the matrix arrangement of the vertices of U ∪ V ) and the k 0 vertices of A j .Denote the resulting graph by H 1 (φ, ε).Observe that, by this construction, for every j ∈ {1, 2, . . ., 3m}, all neighbors of vertex v j in the graph H φ are included in the neighborhood of every vertex v j,p of A j in the graph H 1 (φ, ε), where 1 ≤ p ≤ k 0 .In particular, H φ is an induced subgraph of H 1 (φ, ε): if we remove from H 1 (φ, ε) the vertices of B j ∪ A j \ {v j,1 }, for every j ∈ {1, 2, . . ., 3m}, we obtain a graph isomorphic to H φ , where v j,1 of H 1 (φ, ε) corresponds to vertex v j of H φ , for every j ∈ {1, 2, . . ., 3m}.
Note that, similarly to H φ , the graph H 1 (φ, ε) has radius 2, since d(v 0 , u) ≤ 2 in H 1 (φ, ε) for every vertex u of H 1 (φ, ε)−{v 0 }.We now prove that H 1 (φ, ε) has also diameter 3. First note that the distance between any two vertices of ∪ 3m j=1 A j ∪ 3m j=1 B j is at most 2, since they all have v 0 as common neighbor.Consider now an arbitrary vertex z ∈ ∪ 3m j=1 A j ∪ 3m j=1 B j and an arbitrary vertex u i,j ∈ U (resp.w i,j ∈ W ). If z and u i,j are not adjacent in H 1 (φ, ε), there exists the path (z, v 0 , v j,1 , u i,j ) (resp. the path (z, v 0 , v j,1 , w i,j )) of length 3 between z and u i,j (resp.w i,j ).Therefore d(z, u) ≤ 3 in H 1 (φ, ε), for every vertex z ∈ ∪ 3m j=1 A j ∪ 3m j=1 B j and every vertex u = z of H 1 (φ, ε).Moreover, since H φ is an induced subgraph of H 1 (φ, ε), it follows by Lemma 2 that also d(u, u ) ≤ 3 in H 1 (φ, ε), for every pair of vertices u, u / ∈ ∪ 3m j=1 A j ∪ 3m j=1 B j of H 1 (φ, ε).Thus H 1 (φ, ε) has diameter 3. Recall now that for every j ∈ {1, 2, . . ., 3m}, vertex v j of H φ has been replaced by the vertices of A j ∪ B j in H 1 (φ, ε).Furthermore, recall that the vertices of A j ∪ B j induce in H 1 (φ, ε) a complete bipartite graph without a perfect matching between A j and B j .Therefore there exists no pair of sibling vertices in A j ∪ B j , for every j ∈ {1, 2, . . ., 3m}.Thus, since H φ is irreducible, it follows that H 1 (φ, ε) is irreducible as well.
We now prove that H 1 (φ, ε) is 3-colorable if and only if H φ is 3-colorable.Suppose first that H 1 (φ, ε) is 3-colorable.Then, since H φ is an induced subgraph of H 1 (φ, ε), it follows immediately that H φ is also 3-colorable.Suppose first that H φ is 3-colorable, and let χ be a proper 3-coloring of H φ .Assume without loss of generality that v 0 is colored red in χ.We will extend χ into a proper 3-coloring of H 1 (φ, ε) as follows.Consider the vertex v j of H φ , where 1 ≤ j ≤ 3m.Since v 0 is colored red in χ, it follows that v j is colored either blue or green in χ.If v j is colored green in χ, then we color in H 1 (φ, ε) all vertices of A j green and all vertices of B j blue.Otherwise, if v j is colored blue in χ, then we color in H 1 (φ, ε) all vertices of A j blue and all vertices of B j green.It is now straightforward to check that the resulting 3-coloring of H 1 (φ, ε) is proper, i.e. that H 1 (φ, ε) is 3-colorable.That is, H 1 (φ, ε) is 3-colorable if and only if H φ is 3-colorable.Therefore Theorem 6 implies that the formula φ is X-satisfiable if and only if H 1 (φ, ε) is 3-colorable.
In the next theorem we provide an amplification of the reduction of Theorem 8 to the case of graphs with minimum degree δ = Θ(|V | ε ), where ε ∈ [0, 1 2 ).
Theorem 9. Let G = (V, E) be an irreducible graph with diameter 3 and radius 2.
) be an arbitrary irreducible graph diameter 3 and radius 2, such that G 1 has n vertices and minimum degree δ(G 1 ) = Θ( √ n).Note that such a graph G 1 exists by the construction of Theorem 8.For simplicity, we arbitrarily enumerate the vertices of by assumption, it follows that ε 0 ∈ [0, 1).We now construct from the graph G 1 the irreducible graph G 2 (ε) with diameter 3 and radius 2 as follows.For every i ∈ {1, 2, . . ., n}, we add the 2k 0 new vertices A i = {v i,1 , v i,2 , . . ., v i,k 0 } and B i = {v i,1 , v i,2 , . . ., v i,k 0 }.The vertices of A i and of B i induce two independent sets in G 2 (ε).We then add between the vertices of A i and of B i all possible edges, except those of {v i, v i, : 1 ≤ ≤ k 0 }.That is,we add k 2 0 − k 0 edges between the vertices of A i and B i , such that they induce a complete bipartite graph without a perfect matching between A i and B i .Furthermore, for every i ∈ {1, 2, . . ., n}, we add all possible k 0 edges between v i and the vertices of A i .Finally, we introduce a new vertex v 0 and we add all n • 2k 0 possible edges between v 0 and the vertices of ∪ n i=1 A i ∪ n i=1 B i .Denote the resulting graph by G 2 (ε).Note that, by construction, G 1 is an induced subgraph of G 2 (ε).Furthermore, G 2 (ε) has N = n + n • 2k 0 + 1 vertices, and thus N = Θ(n 1+ε 0 ).Therefore n = Θ(N 1 1+ε 0 ), where N is the number of vertices in G 2 (ε).Furthermore, the degree of Note that the graph G 2 (ε) has radius 2, since d(v 0 , u) ≤ 2 in G 2 (ε) for every vertex u of G 2 (ε) − {v 0 }.We now prove that G 2 (ε) has also diameter 3. First note that the distance between any two vertices of ∪ n i=1 A i ∪ n i=1 B i is at most 2, since they all have v 0 as common neighbor.Consider now an arbitrary vertex z ∈ ∪ n i=1 A i ∪ n i=1 B i and an arbitrary vertex v i ∈ V 1 , where 1 ≤ i ≤ n.If z and v i are not adjacent in G 2 (ε), there exists the path (z, v 0 , v j,1 , v i ) of length 3 between z and v i .Therefore d(z, u) ≤ 3 in G 2 (ε), for every vertex z ∈ ∪ n i=1 A i ∪ n i=1 B i and every vertex u of G 2 (ε) − {z}.Moreover, since diam(G 1 ) = 3 by assumption and G 1 is an induced subgraph of G 2 (ε), it follows that also d(v i , v j ) ≤ 3 in G 2 (ε) for every pair of vertices v i , v j ∈ V 1 .Therefore G 2 (ε) has diameter 3.
Recall that for every i ∈ {1, 2, . . ., n} the vertices of A i ∪B i induce in G 2 (ε) a complete bipartite graph without a perfect matching between A i and B i .Therefore there exists no pair of sibling vertices in A i ∪ B i , for every i ∈ {1, 2, . . ., n}.Thus, since G 1 is irreducible by assumption, it follows that G 2 (ε) is irreducible as well.
We now prove that G 2 (ε) is 3-colorable if and only if G 1 is 3-colorable.If G 2 (ε) is 3-colorable, then clearly G 1 is also 3-colorable, since G 1 is an induced subgraph of G 2 (ε).Suppose first that G 1 is 3-colorable, and let χ be a proper 3-coloring of G 1 that uses the colors red, blue, and green.We will extend χ into a proper 3-coloring χ of G 2 (ε) as follows.Consider the vertex v i ∈ V 1 , where 1 ≤ i ≤ n.If v i is colored red or blue in χ, then we color all vertices of A i green and all vertices of B i blue in χ .Otherwise, if v i is colored green in χ, then we color all vertices of A i blue and all vertices of B i green in χ .Finally, we color v 0 red in χ .It is now straightforward to check that the resulting 3-coloring Summarizing, for every irreducible graph G 1 with diameter 3 and radius 2, such that G 1 has n vertices and minimum degree δ(G 1 ) = Θ( √ n), we can construct in polynomial time a graph G 2 (ε) with N = Θ(n 1+ε 0 ) (i.e.N = Θ(n 1 1−ε )) vertices and minimum degree δ = Θ(N ε ), such that G 2 (ε) is 3-colorable if and only if G 1 is 3-colorable.Moreover, the constructed graph G 2 (ε) is irreducible and has diameter 3 and radius 2. This completes the proof of the theorem, since it is NP-complete to decide whether G 1 is 3-colorable by Theorem 8. Therefore, Theorems 8 and 9 imply that the 3-coloring problem remains NP-complete for graphs G = (V, E) with diameter 3 and radius 2, where the minimum degree δ(G) can be Θ(|V | ε ), for every ε ∈ [0, 1).However, Theorems 8 and 9 do not provide any information about how efficiently (although not polynomially, assuming P =NP) we can decide 3-coloring on such graphs.In the context of providing lower bounds for the time complexity of solving NP-complete problems, Impagliazzo, Paturi, and Zane formulated the Exponential Time Hypothesis (ETH) [16], which seems to be very reasonable with the current state of art: Exponential Time Hypothesis (ETH) [16]: There exists no algorithm solving 3-CNF-SAT in time 2 o(n) , where n is the number of variables in the input CNF formula.Furthermore, they proved the celebrated Sparsification Lemma [16], which has the following theorem as a direct consequence.This result is quite useful for providing lower bounds assuming ETH, as it parameterizes the running time with the size of the input CNF formula, rather than only the number of its variables.
Theorem 10 ( [15]).3-CNF-SAT can be solved in time 2 o(n) if and only if it can be solved in time 2 o(m) , where n is the number of variables and m is the number of clauses in the input CNF formula.
The following very well known theorem about the 3-coloring problem is based on the fact that there exists a standard polynomial-time reduction from Not-All-Equal-3-SAT to 3-coloring * [21], in which the constructed graph has diameter 4 and radius 2, and its number of vertices is linear in the size of the input formula (see also [18]).
We provide in the next three theorems subexponential lower bounds for the time complexity of 3-coloring on graphs with diameter 3 and radius 2.Moreover, the lower bounds provided in Theorem 12 are asymptotically almost tight, due to the algorithm of Theorem 5.The correctness of Theorems 12 and 13 is based on the fact that there exists a reduction from 3-CNF-SAT to monotone 3-XSAT, such that the size of the output monotone formula is linear to the size of the input 3-CNF formula [23].
Suppose now that there exists an algorithm A that, given an arbitrary graph G with N vertices, diameter 3, radius 2, and minimum degree δ = Θ(N ε ) for some m) .However, since the formula φ is X-satisfiable if and only if H 1 (φ, ε) is 3-colorable, algorithm A can be used to decide the monotone 3-XSAT problem in time 2 o(m) , where m is the number of clauses in the given monotone boolean formula φ.Thus, since there is a reduction from 3-CNF-SAT to monotone 3-XSAT that preserves the size of the formulas (up to a linear factor) [23], this implies that A can decide 3-CNF-SAT in time 2 o(m) .This is a contradiction by Theorem 10, assuming ETH.This completes the proof of the theorem.
Similarly to the construction of the graph H 1 (φ, 1 2 ) from H φ (cf. the proof of Theorem 8), we add for every j ∈ {3m + 1, 3m + 2, . . ., m 1+ε 0 } the two sets of new vertices A j = {v j,1 , v j,2 , . . ., v j,m } and B j = {v j,1 , v j,2 , . . ., v j,m } (recall that here k 0 = m).Each of the vertex sets A j and B j is an independent set.We then add between the vertices of A j and of B j all possible edges, except those of {v j,p v j,p : 1 ≤ p ≤ m}.That is,we add m 2 − m edges between the vertices of A j and B j , such that they induce a complete bipartite graph without a perfect matching between A j and B j .Proof.First observe that, by construction, G n,m has no pair of sibling vertices, and thus the Reduction Rule 2 does not apply to G n,m .Thus, in order to prove that G n,m is irreducible, it suffices to prove that G n,m is triangle-free, and thus also diamond-free, i.e. also the Reduction Rule 1 does not apply to G n,m .Suppose otherwise that G n,m has a triangle with vertices a, b, c.Note that vertex v 0 does not belong to any triangle in G n,m , since its neighbors N (v 0 ) = {v 1 , v 2 , . . ., v 8m } induce an independent set in G n,m .Furthermore, note that also vertex v j , where 1 ≤ j ≤ 8m, does not belong to any triangle in G n,m .Indeed, by construction of G n,m , its neighbors N (v j ) = {v 0 } ∪ U j ∪ W j induce an independent set in G n,m .Therefore all the vertices a, b, c of the assumed triangle of G n,m belong to U ∪ W .Therefore, at least two vertices among a, b, c belong to U , or at least two of them belong to W .This is a contradiction, since by the construction of G n,m the sets U and W induce two independent sets.Therefore G n,m is triangle-free.Thus G n,m is also diamond-free, i.e. the Reduction Rule 1 does not apply to G n,m .Summarizing, G n,m is irreducible and triangle-free.
Note that, by construction, the graphs H φ and G n,m have the same vertex set, i.e.V φ = V n,m , and that E n,m ⊂ E φ .Therefore diam(H φ ) = 3 and rad(H φ ) = 2, since diam(G n,m ) = 3 and rad(G n,m ) = 2 by Lemma 3. Observe now that every positive literal of φ is associated to a vertex of U , while every negative literal of φ is associated to a vertex of W .In particular, each of the 3m literals of φ corresponds by this construction to a different column in the matrix arrangement of the vertices of U ∪ W .If a literal of φ is the variable x i (resp.the negated variable x i ), where 1 ≤ i ≤ n, then the vertex of U (resp.W ) that is associated to this literal lies in the ith row i (resp. in the (n + 5m + i)th row i ) of the matrix.Moreover, note by the above construction that each of the 8m vertices {q k,1 , q k,2 , . . ., q k,8 } m k=1 corresponds to a different column in the matrix of the vertices of U ∪ W . Finally, each of the 5m vertices {q k,4 , q k,5 , q k,6 , q k,7 , q k,8 } m k=1 corresponds to a different row in the matrix of the vertices of U .
Observation 3 The gadget of Figure 5(c) has no proper 2-coloring, as it contains an induced cycle of length 5.
Observation 4 Consider the gadget of Figure 5(c).If we assign to vertices g k,1 , g k,2 , g k,3 the same color, we can not extend this coloring to a proper 3-coloring of the gadget.Furthermore, if we assign to vertices g k,1 , g k,2 , g k,3 in total two or three colors, then we can extend this coloring to a proper 3-coloring of the gadget.
The next observation follows by the construction of H φ and by our initial assumption that each clause of φ has three distinct literals.
Observation 5 For every i ∈ {1, 2, . . ., n + 5m}, there exists no pair of adjacent vertices in the same row i or i in H φ .Lemma 5.For every formula φ, the graph H φ is irreducible and triangle-free.
Proof.First observe that, similarly to G n,m , the graph H φ has no pair of sibling vertices, and thus the Reduction Rule 2 does not apply to H φ .We will now prove that H φ is triangle-free.Suppose otherwise that H φ has a triangle with vertices a, b, c.Similarly to G n,m , note that the neighbors of v 0 in H φ induce an independent set, and thus vertex v 0 does not belong to any triangle in H φ .Furthermore, note by the construction of H φ that we do not add any edge between vertices u i,j and w i,j , where 1 ≤ i ≤ n+5m and 1 ≤ j ≤ 8m.Therefore, similarly to G n,m , the neighbors of v j induce an independent set in H φ , where j ∈ {1, 2, . . ., 8m}, and thus v j does not belong to any triangle in H φ .Therefore all the vertices a, b, c of the assumed triangle of H φ belong to U ∪ W . Since G n,m is triangle-free by Lemma 4, it follows that at least one edge in this triangle belongs to E φ \ E n,m , i.e. to at least one of the copies of the gadget in Figure 5(c).Note that not all vertices a, b, c belong to the same copy of this gadget, since the gadget is triangle-free, cf. Figure 5(c).Assume without loss of generality that vertices a and b (and thus also the edge ab) of the assumed triangle of H φ belong to the copy of the gadget that corresponds to clause α k , where 1 ≤ k ≤ m.Then, since vertex c does not belong to this gadget, the edges ac and bc of the assumed triangle belong also to the graph G n,m .Therefore, since a, b, c ∈ U ∪ W , it follows by the construction of G n,m that a and b belong to some row i and c belongs to the row i , or a and b belong to some row i and c belongs to the row i .This is a contradiction, since no pair of adjacent vertices (such as a and b) belong to the same row i or i in H φ by Observation 5. Therefore H φ is triangle-free, and thus also diamond-free, i.e. the Reduction Rule 2 does not apply to H φ .Summarizing, H φ is irreducible and triangle-free.
We are now ready to state the main theorem of this section.
Theorem 15.The formula φ is satisfiable if and only if H φ is 3-colorable.isomorphism problem on 3-colorable graphs with diameter 2 is GI-complete, i.e. it is as hard as on general graphs.Furthermore we presented a subclass of graphs with diameter 2 that admits a polynomial algorithm for 3-coloring.An interesting open problem for further research is to establish the time complexity of 3-coloring on arbitrary graphs with diameter 2.Moreover, the complexity of 3-coloring remains open also for triangle-free graphs of diameter 2, or equivalently, on maximal triangle-free graphs.As these problems (in the general case) have been until now neither proved to be polynomially solvable nor to be NP-complete, it would be worth to investigate whether they are polynomially reducible to/from the graph isomorphism problem.
For graphs with diameter at most 3, we established the complexity of 3-coloring, even for triangle-free graphs, which has been a longstanding open problem.Namely we proved that for every ε ∈ [0, 1), 3-coloring is NP-complete on triangle-free graphs of diameter 3 and radius 2 with n vertices and minimum degree δ = Θ(n ε ).Moreover, assuming the Exponential Time Hyporthesis (ETH), we provided three different amplification techniques of our hardness results, in order to obtain for every ε ∈ [0, 1) subexponential asymptotic lower bounds for the complexity of 3-coloring on triangle-free graphs with diameter 3, radius 2, and minimum degree δ = Θ(n ε ).Finally, we provided a 3-coloring algorithm with running time 2 O(min{δ∆, n δ log δ}) for arbitrary graphs with diameter 3, where n is the number of vertices and δ (resp.∆) is the minimum (resp.maximum) degree of the input graph.Due to our lower bounds, the running time of this algorithm is asymptotically almost tight, when the minimum degree if the input graph is δ = Θ(n ε ), where ε ∈ [ 1 2 , 1).An interesting problem for further research is to find asymptotically matching lower bounds for the complexity of 3-coloring on graphs with diameter 3, for all values of minimum degree δ. (b).

Fig. 1 .
Fig. 1.(a) The diamond graph and (b) an example of a diamond elimination of a K4-free graph, which creates a new K4 on the vertices {u1, u5, u6, u7} in the resulting graph.

Fig. 2 .
Fig. 2. (a) The 2k × 2k matrix arrangement of the vertices of Gn, where n = 4k 2 , (b) the edges of Gn between the ith and the (2k − i)th rows, and (c) the edges of Gn between the jth and the (2k − j)th columns of this matrix arrangement.The three color classes are illustrated by different shades of gray.
38: From the computed 3-coloring of G , compute a 3-coloring χ of G by iteratively undoing Reduction Rules 1 and 2 39: return the proper 3-coloring χ of G Theorem 4. Let G = (V, E) be an irreducible graph with n vertices and diam line 21).Due to the above merging operations to the connected componentsC 1 , C 2 , . . ., C k of G − N [v 0 ], every connected component C i of G − N G [v 0 ]has exactly two vertices, where 1 ≤ i ≤ k .Denote the vertices of C i by {u i , v i }, where 1 ≤ i ≤ k (cf.line 22).

the running time of the algorithm of Theorem 5 becomes 2 3 √
O( n δ log δ) = 2 O(n 2 log n) .

Fig. 3 .
Fig. 3. (a) The 2n × 3m-matrix arrangement of the vertices U ∪ W of Gn,m and their connections with the vertices {v0, v1, v2, . . ., v3m}, and (b) the edges between the vertices of the ith row i and the (n + i)th row i in this matrix.

Fig. 5 .
Fig. 5. (a) The 2(n + 5m) × 8m-matrix arrangement of the vertices U ∪ W of Gn,m and their connections with the vertices {v0, v1, v2, . . ., v8m}, (b) the edges between the vertices of the ith row i and the (n + 5m + i)th row i in this matrix, and (c) the gadget with 8 vertices and 10 edges that we associate in H φ to the clause α k of φ, where 1 ≤ k ≤ m.

Table 1 .
Current O(min{δ, n δ log δ}) -time minimum degree δ = Θ(n ε ), state of the art and our algorithmic and NP-completeness results for k-coloring on graphs with diameter diam(G).Our results are indicated by an asterisk ( * ).

Table 2 .
Summary of the results of Theorems 12, 13, and 14: Lower time complexity bounds for deciding 3-coloring on irreducible and triangle-free graphs G with n vertices, diameter 3, radius 2, and minimum degree δ(G) = Θ(n ε ), where ε ∈ [0, 1), assuming ETH.The lower bound for ε ∈ [ 1 2 , 1) is asymptotically almost tight, as there exists an algorithm for arbitrary graphs with diameter 3 with running time 2 This is a contradiction, since G is an irreducible graph.Therefore, every connected component C i of G − N [v 0 ] is non-trivial, i.e. it contains at least one edge.Thus, in any proper 3coloring of G (if such exists), there exists at least one vertex of every connected component C i of G − N [v 0 ] that is colored not red, i.e. with a different color than v 0 .
.e. u and v 0 are siblings in G.