Exponential Time Approximations for
Coloring 3-Colorable Graphs
Abstract
The problem of efficiently coloring -colorable graphs with few colors has received much attention on both the algorithmic and inapproximability fronts. We consider exponential time approximations, in which given a parameter , we aim to develop an -approximation algorithm with the best possible runtime, providing a tradeoff between runtime and approximation ratio. In this vein, an algorithm to -color a 3-colorable graphs in time is given in (Atserias and Dalmau, SODA 2022.)
We build on tools developed in (Bansal et al., Algorithmic, 2019) to obtain an algorithm to color -colorable graphs with colors in time, asymptotically improving upon the bound given by Atserias and Dalmau.
1 Introduction
Graph Coloring is a classic and fundamental problem in theoretical computer science with applications in scheduling, register allocation, and more. A graph is said to be -colorable if there is an assignment of colors to vertices such that no two adjacent vertices share the same color. The question of whether a given graph can be colored using colors for was one of Karp’s NP-complete problems [19]. For any graph , the minimum such that is -colorable is called the chromatic number of ; it is known that the chromatic number is hard to approximate to a factor [15, 23].
It is natural to ask if one can obtain a valid coloring of a graph with few colors if its chromatic number is known. The first polynomial time algorithm for this problem was given by Wigderson [25], who obtained an -coloring for -colorable graphs. In this paper we focus on the special case where is -colorable. There are several known polynomial time algorithms for this setting. Blum obtained a polynomial improvement over [25] to colors [7] when the input graph is -colorable. This was improved to using semi-definite programming methods by Karger, Motwani, and Sudan [18]. A long line of subsequent work culminated in the the development of an algorithm using colors [20], very recently improved to [21]. On the hardness of approximation side, it is known to be NP-hard to color a 3-colorable graph using 4 colors [22, 16, 10], and until recently, no better lower bound was known. Barto et al. recently showed that it is NP-hard to color an -colorable graph using colors; in particular, it is NP-hard to 5-color a 3-colorable graph [5]. Furthermore, there is some evidence based on variants of the Unique Games Conjecture that coloring an -colorable graph with colors is hard for any [13, 17].
The hardness of approximating graph coloring in polynomial time has motivated the design of algorithms that provide a more fine-grained trade-off between running time and approximation factors; see [8, 9, 12] for some such work in graph coloring, as well as the closely related Independent Set problem. As a simple example, one can obtain an -coloring of a 3-colorable graph in time as follows: partition into blocks of size each and use an exact 3-coloring exponential-time algorithm on each block. In general, this idea is surprisingly close to the best we can do: any -approximation to Graph Coloring requires at least time, assuming ETH [24].
Recently, Bansal et. al. [3] obtained an -approximation for
the Graph Coloring problem that runs in
time. As a subroutine in this algorithm, they use and develop an
-approximation for the Independent Set problem that runs in
time.
In this work we improve upon the approximation algorithms given by Bansal et. al.
[3] for the setting in which the input graph is known to be
3-colorable.
1.1 Promise Constraint Satisfaction Problems and Width-based Algorithms
Graph colorability is an example of a larger class of problems known as constraint satisfaction problems (CSPs). The input to a CSP is a set of variables over a domain , along with a set of constraints. Each constraint specifies, for some subset of variables, a relation that it must takes values in. The goal is to find a valid assignment of values from the domain to each variable that satisfies all constraints. Equivalently, one can model CSPs as a problem of finding homomorphism between relational structures [14]. That is, we can think of the input as two structures: , where , , where . The goal is to find a function such that for all . In the case of -graph colorability, the variables are the vertices of the graph, the sets are the edges, the domain is the set of colors , and the constraints are all tuples of two different colors.
Brakensiek and Guruswami [11], building on work in [2], recently proposed a generalization of this class of problems, known as promise constraint satisfaction problems (PCSPs); these are CSPs in which we are guaranteed that the input satisfies an even stronger set of constraints. Formally, we are given three relational structures where there exists a homomorphism from to . Given the promise that there exists some homomorphism from to , the goal is to find one from to . It is easy to see that the problem of -coloring a 3-colorable graph is an example of a promise CSP, with corresponding to -colorability and to 3-colorability.
Fixed-template CSPs are CSPs in which the structure is fixed and the input specifies . One of the few known techniques for solving fixed-template CSPs in polynomial time is local consistency checking. This technique considers -strategies, which are sets of partial solutions on subsets of variables of size at most . These sets must be closed under restrictions and all partial solutions of subsets of size less than must be extendable to all supersets up to size . Clearly, if there exists a homomorphism from to , then there exists a -strategy for all . A CSP is said to have width if the converse holds: a non-empty -strategy implies a homomorphism from to . For any fixed , this gives a simple polynomial time algorithm to solve the CSP: find all partial solutions on subsets of size at most and remove the ones that don’t satisfy the closure and extension properties until we either have a non-empty -strategy or an empty set.
One can define a similar notion in the context of PCSPs [5]. A PCSP has width if a non-empty -strategy on implies a homomorphism from to . Recently, Atserias and Dalmau [1] showed that given an input graph and parameter , the problem of distinguishing whether is 3-colorable from the case where is not -colorable has width between and . This gives an algorithm to color 3-colorable graphs with colors in time . Improving this runtime is posed as an open question in [1].
1.2 Definitions and Notation
For a given graph , we let denote its set of vertices, denote the set of edges, and . For any , we call the neighborhood of (denoted ) the set of all such that . We let denote the degree of . We write to suppress polynomial factors in , and to suppress factors (where is the approximation ratio). The analogous definitions hold for .
Maximum Independent Set: We say a set is independent if for all , . We let denote the size of the maximum cardinality independent set of .
Graph Coloring: We say that a function is a -coloring if . We say is -colorable if a valid -coloring of exists. We let denote the chromatic number of , i.e. the minimum integer such that is -colorable.
1.3 Our Result and Techniques
Our main contribution is an improved appoximation algorithm for coloring 3-colorable graphs.
Theorem 1.1.
Given a 3-colorable graph and a parameter , there exists an algorithm that, with high probability, outputs a valid coloring of using at most colors in time .
For any fixed real , setting to be , we obtain a coloring of using colors in time . This asymptotically improves upon the width-based algorithm given by Atserias and Dalmau [1]. Furthermore, up to polynomial factors in , this matches the width-based lower bound given in [1]. Whether our result can be captured by a width-based argument remains a direction for future research.
Techniques: We closely follow the algorithm given by Bansal et al. [3]. We first consider the independent set problem. The approach in [3] is to branch on high degree vertices. For each such vertex, the algorithm chooses to include it with some small probability, in which case all of its neighbors are removed, else it removes the high degree vertex and recurses on the remaining graph. The probability of choosing each vertex is chosen in a way to ensure the number of leaves of the branching process remains bounded. Once the maximum degree of the graph is small, the algorithm terminates by applying a known approximation for for graphs with bounded degree [4]. We follow from a similar algorithm, replacing the base case with an -approximation for Independent Set on 3-colorable graphs. To then color the graph , the algorithm in [3] repeatedly finds large independent sets and colors each independent set with its own color. Once the number of remaining vertices is small enough, they use a brute force inclusion-exclusion based algorithm for coloring the remaining vertices in time [6]. We follow the same approach, using our improved approximation for Independent Set.
2 Improved Approximation for Coloring 3-Colorable Graphs
2.1 Independent Set
In this section, we prove the following lemma providing an approximation algorithm for finding an independent set in a 3-colorable graph:
Lemma 2.1.
Given a 3-colorable graph and a parameter , there exists an algorithm that, with probability at least , outputs an independent set of size at least in time .
We use the following lemma from [3].
Lemma 2.2 ([3]).
Let be an approximation algorithm that outputs an independent set of of size . Suppose runs in time (where ) when has maximum degree , where . Then, there is an algorithm that given any graph , outputs an independent set of of expected size in expected time .
We note that the algorithm of [3] only calls on graphs obtained by deleting vertices and edges from . Therefore, if is 3-colorable, we can assume is as well. The seminal work of Karger, Motwani, and Sudan [18] provides a polynomial time algorithm to color 3-colorable graphs using colors, where is the maximum degree of the input graph. We will use the following lemma from their analysis:
Lemma 2.3 ([18]).
Given a -colorable graph , there exists a polynomial time algorithm to find an independent set of size , where is the maximum degree of the input graph.
Combining these two results, we obtain the following corollary:
Corollary 2.4.
Given a -colorable graph , there exists a polynomial time algorithm that outputs an independent set of expected size in expected time .
Proof.
We refer to the algorithm given by Lemma 2.3 as . By Lemma 2.3, for any -colorable graph with maximum degree , outputs an independent set of size
Note that since is -colorable, . Thus we can choose so that outputs an independent set of size in polynomial time (recall here that suppresses factors).
We then apply Lemma 2.2 on the input with as defined above to obtain an independent set of expected size in expected time
∎
To complete the proof of Lemma 2.1, note that Corollary 2.4 gives the desired runtime and approximation ratio in expectation. Thus it suffices to run multiple iterations of this algorithm to obtain our desired probability of failure.
Proof of Lemma 2.1.
Let be a given 3-colorable graph. Let denote the algorithm given by Corollary 2.4, and let denote the expected runtime of . We run times and output the maximum independent set given. If the total runtime exceeds , we terminate the algorithm.
By construction, this algorithm runs in time . By Markov’s inequality, the probability that the total runtime exceeds is at most . Thus it remains to bound the error probability given that we successfully complete iterations of .
Fix a single run of , and let be the resulting independent set. To bound the probability that is small, note that . Since , we can apply Markov’s inequality to obtain
Thus the probability that none of the runs of give an independent set of size at least is at most . Combining with the runtime error, we get a total probability of failure of at most . ∎
2.2 Graph Coloring
In this section, we refer to the algorithm given by Lemma 2.1 as for consistency with the notation used in [3]. To prove Theorem 1.1, we follow the same general approach outlined by Bansal et. al. in [3] with as a subroutine. For completeness, we describe the full algorithm and analysis below. Let , .
Claim 2.5.
For a fixed iteration of Algorithm 1, with probability at least .
Proof.
Claim 2.6.
Algorithm 1 gives a valid coloring of using at most colors with high probability.
Proof.
Validity of the coloring follows is clear by construction, since we choose a new color for each independent set. It remains to bound the number of colors used.
Note that at all times, since reduces by at least one at each iteration. Thus by Claim 2.5, reduces by a factor of at every iteration with probability at least . After iterations,
Therefore, when , , so Algorithm 1 runs for at most iterations. Since is 3-colorable, the final optimum coloring of the remaining vertices on line 10 uses at most 3 colors. Thus the total number of colors used is at most . ∎
Claim 2.7.
Algorithm 1 runs in time .
Proof.
We first bound the runtime of the while loop in lines 2-9. By Lemma 2.1, runs in time . By the analysis in the proof of Claim 2.6, the total number of iterations is at most , and in each iteration we run times. This the loop runs in time
Using a naive brute force algorithm, the final step in line 10 runs in time , giving us our desired time bound. ∎
References
- [1] Albert Atserias and Víctor Dalmau. Promise constraint satisfaction and width. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1129–1153. SIAM, 2022.
- [2] Per Austrin, Venkatesan Guruswami, and Johan Håstad. ()-SAT is NP-hard. SIAM Journal on Computing, 46(5):1554–1573, 2017. arXiv:https://doi.org/10.1137/15M1006507, doi:10.1137/15M1006507.
- [3] Nikhil Bansal, Parinya Chalermsook, Bundit Laekhanukit, Danupon Nanongkai, and Jesper Nederlof. New tools and connections for exponential-time approximation. Algorithmica, 81(10):3993–4009, 2019.
- [4] Nikhil Bansal, Anupam Gupta, and Guru Guruganesh. On the Lovász Theta function for independent sets in sparse graphs. In Proceedings of the Forty-Seventh Annual ACM Symposium on Theory of Computing, STOC ’15, page 193–200, New York, NY, USA, 2015. Association for Computing Machinery. doi:10.1145/2746539.2746607.
- [5] Libor Barto, Jakub Bulín, Andrei Krokhin, and Jakub Opršal. Algebraic approach to promise constraint satisfaction. J. ACM, 68(4), jul 2021. doi:10.1145/3457606.
- [6] Andreas Björklund, Thore Husfeldt, and Mikko Koivisto. Set partitioning via inclusion-exclusion. SIAM J. Comput., 39(2):546–563, jul 2009. doi:10.1137/070683933.
- [7] Avrim Blum. New approximation algorithms for graph coloring. J. ACM, 41(3):470–516, may 1994. doi:10.1145/176584.176586.
- [8] Édouard Bonnet and Vangelis Th Paschos. Sparsification and subexponential approximation. Acta Informatica, 55:1–15, 2018.
- [9] Nicolas Bourgeois, Bruno Escoffier, and Vangelis Th Paschos. Approximation of max independent set, min vertex cover and related problems by moderately exponential algorithms. Discrete Applied Mathematics, 159(17):1954–1970, 2011.
- [10] Joshua Brakensiek and Venkatesan Guruswami. New Hardness Results for Graph and Hypergraph Colorings. In Ran Raz, editor, 31st Conference on Computational Complexity (CCC 2016), volume 50 of Leibniz International Proceedings in Informatics (LIPIcs), pages 14:1–14:27, Dagstuhl, Germany, 2016. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. URL: https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CCC.2016.14, doi:10.4230/LIPIcs.CCC.2016.14.
- [11] Joshua Brakensiek and Venkatesan Guruswami. Promise constraint satisfaction: Algebraic structure and a symmetric Boolean dichotomy. SIAM Journal on Computing, 50(6):1663–1700, 2021. arXiv:https://doi.org/10.1137/19M128212X, doi:10.1137/19M128212X.
- [12] Marek Cygan, Lukasz Kowalik, Marcin Pilipczuk, and Mateusz Wykurz. Exponential-time approximation of hard problems, 2008. arXiv:0810.4934.
- [13] Irit Dinur, Elchanan Mossel, and Oded Regev. Conditional hardness for approximate coloring. SIAM Journal on Computing, 39(3):843–873, 2009. arXiv:https://doi.org/10.1137/07068062X, doi:10.1137/07068062X.
- [14] Tomás Feder and Moshe Y. Vardi. The computational structure of monotone monadic snp and constraint satisfaction: A study through datalog and group theory. SIAM Journal on Computing, 28(1):57–104, 1998. arXiv:https://doi.org/10.1137/S0097539794266766, doi:10.1137/S0097539794266766.
- [15] Uriel Feige and Joe Kilian. Zero knowledge and the chromatic number. Journal of Computer and System Sciences, 57(2):187–199, 1998. URL: https://www.sciencedirect.com/science/article/pii/S0022000098915872, doi:https://doi.org/10.1006/jcss.1998.1587.
- [16] Venkatesan Guruswami and Sanjeev Khanna. On the hardness of 4-coloring a 3-colorable graph. volume 18, pages 30–40, 2004. doi:10.1137/S0895480100376794.
- [17] Venkatesan Guruswami and Sai Sandeep. -to-1 hardness of coloring 3-colorable graphs with colors. In Artur Czumaj, Anuj Dawar, and Emanuela Merelli, editors, 47th International Colloquium on Automata, Languages, and Programming (ICALP), volume 168 of LIPIcs, pages 62:1–62:12. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. URL: https://doi.org/10.4230/LIPIcs.ICALP.2020.62, doi:10.4230/LIPICS.ICALP.2020.62.
- [18] David R. Karger, Rajeev Motwani, and Madhu Sudan. Approximate graph coloring by semidefinite programming. J. ACM, 45(2):246–265, 1998. doi:10.1145/274787.274791.
- [19] Richard M. Karp. Reducibility among Combinatorial Problems, pages 85–103. Springer US, Boston, MA, 1972. doi:10.1007/978-1-4684-2001-2_9.
- [20] Ken-Ichi Kawarabayashi and Mikkel Thorup. Coloring 3-colorable graphs with less than colors. J. ACM, 64(1), mar 2017. doi:10.1145/3001582.
- [21] Ken-ichi Kawarabayashi, Mikkel Thorup, and Hirotaka Yoneda. Better coloring of 3-colorable graphs. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, page 331–339, New York, NY, USA, 2024. Association for Computing Machinery. doi:10.1145/3618260.3649768.
- [22] Sanjeev Khanna, Nathan Linial, and Shmuel Safra. On the hardness of approximating the chromatic number. Combinatorica, 20(3):393–415, March 2000. doi:10.1007/s004930070013.
- [23] S. Khot. Improved inapproximability results for maxclique, chromatic number and approximate graph coloring. In Proceedings 42nd IEEE Symposium on Foundations of Computer Science, pages 600–609, 2001. doi:10.1109/SFCS.2001.959936.
- [24] Bundit Laekhanukit. Inapproximability of combinatorial problems in subexponential-time. Phd thesis, McGill University, 2014.
- [25] Avi Wigderson. Improving the performance guarantee for approximate graph coloring. J. ACM, 30(4):729–735, oct 1983. doi:10.1145/2157.2158.