Manuscript Offprint
arXiv:2611.03115Faster Exact Algorithms for 3- and 4-Coloring: Deterministic Improvements and Further Randomized Speedups
Abstract
We study exact exponential-time algorithms for 3- and 4-coloring. For 3-coloring, the best previously published running-time bound is , due to Eppstein (SODA 2001). We improve this bound to deterministically and using randomization. For 4-coloring, the best previously known running-time bound is , due to Wu, Gu, Jiang, Shao, and Xu (ESA 2024). We improve this bound to deterministically and using randomization.
Our algorithms for both problems combine constraint satisfaction algorithms with dynamic programming over tree and path decompositions, exploiting their complementary strengths on different graph structures. For 6-coloring, the best published randomized running-time bound is exponentially smaller than the best published deterministic bound. For 3- and 4-coloring, however, no such improvement through randomization was previously known. To the best of our knowledge, our results provide the first randomized running-time bounds for these two problems that exponentially improve upon the best previously published deterministic bounds. This raises the question of whether randomization offers an inherent exponential advantage for 3- and 4-coloring.
*Department of Computer Science, Graduate School of Information Science and Technology, The University of Tokyo, Japan. ryoyamano15@g.ecc.u-tokyo.ac.jp. †Division of Medical Data Informatics, Human Genome Center, Institute of Medical Science, The University of Tokyo, Japan. tshibuya@hgc.jp. Supported by KAKENHI Grant Number 23K28035.
Contents
1 Introduction 1
2 Preliminaries 2
3 CSP Algorithms and Decomposition-Based DP 3
4 Algorithms for 3-Coloring 5
4.1 Overview of the 3-Coloring Algorithm 5
4.2 Preprocessing the Graph 5
4.3 Algorithms via CSP 7
4.4 Algorithms via Decomposition-Based DP 8
4.5 Running-Time Analysis via Linear Programming 9
5 Algorithms for 4-Coloring 9
5.1 Overview of the 4-Coloring Algorithm 9
5.2 Preprocessing the Terminal Instances 10
5.3 Terminal Algorithms via 3-Coloring 11
5.4 Terminal Algorithms via CSP 11
5.5 Terminal Algorithms via Tree Decomposition DP 13
5.6 Terminal Algorithms via Path Decomposition DP 13
5.7 From Terminal Bounds to the Overall Running Time 14
A Decision-to-Search Reduction 20
B Deferred Proofs 20
B.1 Proof of Lemma 3.7 20
B.2 Proof of Lemma 4.2 21
C Linear Programs and Dual Certificates for 3-Coloring 21
D Branching Constraints for 4-Coloring 23
E Convex Programs and Dual Certificates for 4-Coloring 24
F On the Linear Program in Meijer's Preprint 26
The -coloring problem asks if a graph admits a -coloring and is NP-hard for every fixed [Lov73]. Graph coloring has been widely studied through exact [Bro72, C.96, FM02, BH08, BHKK11, GL23] and heuristic algorithms [Bré79, HPZ08, MMT08]; see [MT10, MMN20] for surveys. We focus on exact algorithms. On -vertex graphs, -coloring can be solved in time [BH06]. For every fixed , this is the best formally published running-time bound. Interestingly, for , algorithms exponentially faster than are known.
For , Zamir broke the barrier by giving -time algorithms for some constant , deterministic for and randomized for [Zam21]. For , successive improvements have yielded faster algorithms.
For 3-coloring, the running-time bound improved from [Law76] to [Sch94], [BE95], and [Epp01]. The last bound, obtained in 2001, remains the most recent formally published improvement. For 4-coloring, the running-time bound improved from [Epp01] to [Bys04], [FGS07], and [WGJ+24]. All of these algorithms for 3- and 4-coloring are deterministic.
We improve the bound for 3-coloring from [Epp01] to deterministically (Theorem 1.1) and using randomization (Theorem 1.2). For 4-coloring, we improve the bound from [WGJ+24] to deterministically (Theorem 1.3) and using randomization (Theorem 1.4). Our deterministic algorithms yield exponential improvements over previous bounds, and randomization yields further exponential improvements.
Theorem 1.1. There is a deterministic algorithm for 3-Coloring on arbitrary -vertex graphs running in time.
Theorem 1.2. There is a randomized algorithm for 3-Coloring on arbitrary -vertex graphs running in time.
Theorem 1.3. There is a deterministic algorithm for 4-Coloring on arbitrary -vertex graphs running in time.
Theorem 1.4. There is a randomized algorithm for 4-Coloring on arbitrary -vertex graphs running in time.
Beyond improving running-time bounds, our results highlight the role of randomization in exact exponential-time graph coloring. Whether randomization provides an inherent computational advantage is a fundamental question in complexity theory [NW94, IW97, KI03, Vad12]. For exact
The notation suppresses polynomial factors.
Preprints by Zamir and Pratt give randomized -time algorithms for every fixed , with [Zam26, Pra26]. Very recently, OpenAI and Anthropic released manuscripts claiming subexponential-time satisfiability algorithms [Ope26, Cla26]. The claims by OpenAI and Anthropic remain unverified and are currently under examination, but, if correct, would imply subexponential-time algorithms for -coloring for every fixed .
In a preprint, Meijer reports an -time algorithm for 3-coloring [Mei23]. However, we were unable to reproduce this bound from the linear program presented in the preprint; see Appendix F for details.
exponential-time algorithms, this question takes a quantitative form: can randomization achieve an exponential base unattainable by deterministic algorithms? For 6-coloring, the best known randomized running-time bound is exponentially smaller than the best known deterministic bound. For 3- and 4-coloring, by contrast, the previous best bounds were achieved deterministically, and no improvement over them through randomization was known. To the best of our knowledge, our results provide the first such improvements for these two problems.
Our randomized bounds are exponentially smaller even than the deterministic bounds established in this paper. This raises a natural question: can the randomized bounds in Theorems 1.2 and 1.4 also be achieved deterministically? More broadly, does randomization offer an inherent exponential advantage for either problem? Our results establish a gap between known upper bounds, leaving open whether it reflects a fundamental distinction or an opportunity for further deterministic improvements.
Our main techniques Our algorithms for 3- and 4-coloring combine reductions to constraint satisfaction problems (CSPs) with dynamic programming (DP) over tree and path decompositions, choosing the best running-time bound. These tools are summarized in Section 3. For 4-coloring, we also use a reduction to 3-coloring. Before applying these approaches, we process high-degree structure by selecting a bushy forest for 3-coloring (Section 4.2) and vertex-disjoint packings for 4-coloring (Section 5.2), leaving residual graphs of bounded degree.
These approaches exploit complementary structural features. CSP algorithms have running times exponential in the number of variables regardless of constraint density, making them useful for dense residual graphs. Fixing colors on selected high-degree vertices further reduces the CSP cost by restricting the available colors of their neighbors. In contrast, decomposition-based DP benefits from small treewidth or pathwidth, whose upper bounds depend on the degree structure of the residual graph and favor sparse instances. Our analyses exploit this complementarity by identifying structural parameters that control the costs of the different approaches.
For 3-coloring, after selecting the bushy forest, we track the total number of degree-three vertices and the maximum number in any residual component. A component with many degree-three vertices lets us apply a stronger packing bound to more vertices, improving the CSP bound. Conversely, if every component contains few such vertices, each has small pathwidth and can be solved efficiently by DP after coloring the forest. Thus, the maximum number per component captures the trade-off between the CSP and DP bounds.
For 4-coloring, we strengthen the CSP approach using a multiple-cover construction for triangles. We construct nine list assignments such that every triangle coloring is compatible with at least two of them (Theorem 5.3), yielding an amortized factor of 9/2 per triangle instead of the factor of 4.837 used in [WGJ 24]. We combine this improvement with structural parameters tracking the numbers of residual cliques and the distribution of star centers among them. These parameters capture the trade-off between coloring the selected stars and the resulting savings in the CSP and decomposition-based DP algorithms. Together with the reduction to 3-coloring, these approaches provide complementary running-time bounds that yield our improved bounds for 4-coloring.
2 Preliminaries
We use the notation and write for the natural logarithm of . The notation suppresses factors polynomial in , where denotes the number of vertices of the input graph. Unless stated otherwise, all algorithms are deterministic. Our randomized algorithms are one-sided Monte Carlo algorithms: they always reject no-instances and accept yes-instances with probability at least a fixed positive constant. Independent repetition amplifies the success probability to with only polynomial overhead, which is absorbed into the notation. Whenever an algorithm makes multiple randomized calls, we amplify each call sufficiently to bound the overall failure probability by a union bound.
All graphs are undirected and simple; that is, they contain neither self-loops nor multiple edges. For a graph , we denote its vertex and edge sets by and , respectively. For a vertex , we denote its degree by and its neighborhood by . We denote the maximum and minimum degrees of by and , respectively. For two vertices , let denote the minimum number of edges in a path between and in , with if no such path exists. For , we denote by the subgraph of induced by , that is, and . We write for and define . For disjoint vertex sets , we define .
A tree decomposition of a graph consists of a tree and a family of bags , where for every and , satisfying the following conditions:
-
For every , there exists a node such that .
-
If , then for every node on the unique path in between and .
The width of a tree decomposition is the size of its largest bag minus one. A path decomposition is a tree decomposition in which is a path, with the same notion of width.
For a nonnegative integer , let , with . A coloring of a graph is a function such that for every edge . The -coloring problem asks whether admits a coloring . Throughout this paper, we consider the decision version of -coloring. The corresponding search version, which asks to output such a coloring if one exists, can be solved within the same running time by a standard self-reduction; see Appendix A.
A list -coloring instance consists of a graph and a list for each vertex . The list -coloring problem asks whether admits a coloring such that for every . List -coloring arises naturally when extending a partial -coloring: each uncolored vertex is assigned the list of colors in that are not used by its already colored neighbors.
For a positive integer , we denote by the complete graph on vertices. For positive integers and , we denote by the complete bipartite graph with bipartition , where , , and .
To analyze branching algorithms, we use the measure-and-conquer method [FGK09]. A measure is a nonnegative real-valued function on instances. Suppose that a branching rule applied to an instance produces subinstances such that for every . The work factor of the branching rule, denoted by , is the unique positive real number satisfying . If every branching rule has work factor at most , then for each branching rule. Consequently, the overall running time is , provided that each terminal instance can be solved in time. For the 3-coloring preprocessing, we use the number of remaining vertices as the measure, whereas our 4-coloring analysis uses a weighted measure and directly applies the branching inequalities of [WGJ+24].
3 CSP Algorithms and Decomposition-Based DP
We first introduce the constraint satisfaction problem (CSP).
Definition 3.1 ((A, B)-CSP). An -CSP instance consists of a set of variables, each with at most possible colors, and a set of constraints. Each constraint specifies at most variable-color pairs and forbids the assignment in which every specified variable is assigned its corresponding color. The task is to find an assignment of colors to the variables that satisfies all constraints.
The -CSP problem generalizes -coloring. For the algorithm of Beigel and Eppstein [BE05], we define
Lemma 3.2 ([BE05, Theorem 1]). A (3,2)-CSP instance with n variables can be solved in time.
We also use the following local reduction for variables with only two available colors.
Lemma 3.3 ([BE05, Lemma 2]). A variable with at most two available colors in an -CSP instance can be eliminated in polynomial time while preserving satisfiability. The reduction introduces constraints only among variables that shared a constraint with the eliminated variable, leaving all other original constraints unchanged.
Hence, by repeatedly applying this reduction, we may assume that every remaining variable in a -CSP instance has three possible colors.
We next discuss dynamic programming (DP) over graph decompositions. Given a tree decomposition of width tw, k-coloring can be solved in time [TP97]. The algorithm extends immediately to list k-coloring by forbidding disallowed colors in each bag state.
Lemma 3.4 ([TP97]). Given a graph and a tree decomposition of width tw, list -coloring can be solved in time.
Jansen and Nederlof obtained the following randomized algorithm. Although their theorem is stated for ordinary k-coloring, they explicitly observe that it extends directly to list k-coloring by assigning sufficiently large weights to forbidden vertex-color pairs; see [JN19, Section 3].
Lemma 3.5 ([JN19]). Given a graph and a path decomposition of width pw, there is a randomized algorithm that solves list -coloring in time.
We use a polynomial-time algorithm to construct path decompositions of bounded width. Although the bound in [FGSS09, Lemma 1] is stated for , where depends only on , it extends to all graphs with an additive term for every fixed , since graphs with admit trivial path decompositions of width at most .
Lemma 3.6 ([FGSS09, Lemma 1]). For every fixed and every graph on vertices, a path decomposition of of width at most
can be constructed in polynomial time. Here, denotes the number of vertices of degree in for , and denotes the number of vertices of degree at least 7.
For a simpler analysis, we derive a coarser upper bound in terms of the degree excess.
Lemma 3.7. For every fixed and every graph on vertices, a path decomposition of of width at most
can be constructed in polynomial time.
Proof. See Appendix B.1.
4 Algorithms for 3-Coloring
4.1 Overview of the 3-Coloring Algorithm
An overview of our 3-coloring algorithm is given in Fig. 1. In Section 4.2, we describe the preprocessing and the construction of a maximal bushy forest. In Sections 4.3 and 4.4, we derive running-time bounds for the CSP and width-based DP algorithms, respectively. Finally, in Section 4.5, we explain that, since the logarithmic running-time bounds are linear in the parameters, their worst-case minimum can be analyzed using linear programming, and state the resulting upper bounds. The explicit formulations and dual certificates are given in Appendix C.
- Apply the preprocessing in Section 4.2 to obtain a maximal bushy forest .
- Enumerate and fix the colors of the non-leaf vertices of .
- To color the leaves of and the residual graph , use the structural parameters to select the algorithm with the smallest running-time bound among the reduction to -CSP (Theorem 4.7), the tree decomposition DP (Theorems 4.8 and 4.9), and the randomized path decomposition DP (Theorem 4.8).
Figure 1: Overview of the 3-coloring algorithm.
4.2 Preprocessing the Graph
We apply the preprocessing steps in Fig. 2. Steps 1–3 are also used in the preprocessing of the -time 3-coloring algorithm of [BE05]. Step 1 is immediate, since any 3-coloring of extends to when . Thus, we may assume . Step 2 follows from Theorem 4.1.
Lemma 4.1 ([BE05, Lemma 21]). Let be a graph containing a cycle whose vertices all have degree three. Then the 3-coloring problem on can be reduced to smaller instances with work factor at most .
Since this work factor is smaller than the running-time bases in Theorems 1.1 and 1.2, the branching does not increase the running-time bounds. Consequently, we may assume that the vertices of degree three induce a forest. This property is used to derive constraints in Theorem 4.4.
For Step 3, we extract a maximal bushy forest from , following the idea introduced by Beigel and Eppstein in [BE05, Section 6.2]. A bushy forest is an unrooted forest contained in the given graph in which every internal vertex, that is, every non-leaf vertex, has degree at least four in the forest, and every tree contains at least one internal vertex. A bushy forest is maximal if no internal vertex has a neighbor outside the forest, no leaf has three or more neighbors outside the forest, and no vertex outside the forest has four or more neighbors outside the forest. A maximal bushy forest
- Repeatedly remove vertices of degree at most two, so that .
- If the graph contains a cycle of degree-three vertices, split the problem into smaller instances according to Theorem 4.1, and recursively apply Steps 1 and 2 to each resulting instance.
- Greedily construct a maximal bushy forest .
- Modify in polynomial time so that it remains a maximal bushy forest and every tree containing a leaf adjacent to a vertex with is a .
Figure 2: Overview of the preprocessing steps.

Figure 3: Illustration of the parameters associated with a maximal bushy forest .
can be constructed greedily by repeatedly applying the following operations: if an internal vertex has a neighbor outside the forest, we add that neighbor to its tree as a new leaf; if a leaf has at least three neighbors outside the forest, we add all of these neighbors to its tree; and if a vertex outside the forest has at least four neighbors outside the forest, we add that vertex and all of its neighbors outside the forest as a new tree. This construction runs in polynomial time.
For Step 4, we use a weaker variant of the preprocessing described in the preprint [Mei23, Lemma 3.1] and provide a self-contained proof of this variant in Appendix B.2.
Lemma 4.2 ([Mei23]). Given a maximal bushy forest , we can modify in polynomial time so that it remains a maximal bushy forest and every tree containing a leaf adjacent to a vertex with is a .
We partition the vertices of according to a maximal bushy forest . For each tree of , we arbitrarily choose an internal vertex as its root. Let , and denote the numbers of roots, non-root internal vertices, and leaves, respectively. We denote the set of leaves by , so that . Let be the residual graph, and define and , with and . The parameters follow the notation of [BE05, Section 6.5]. We further define and . The parameters are illustrated in Fig. 3.
Lemma 4.3. The graph is subcubic, that is, , and its degree-three vertices are exactly the vertices in . In particular, has exactly vertices of degree three. Moreover, every vertex satisfies .
Proof. By the maximality of the bushy forest , every vertex satisfies . Moreover, a vertex is not adjacent to any leaf of by the definition of , and it is not adjacent to any internal vertex of by the maximality of . Hence, has no neighbor in , and therefore . By Step 1 of Fig. 2, we have , and thus for every . By the definition of , the degree-three vertices in are exactly the vertices in . Therefore, the degree-three vertices of are exactly those in , and their number is .
The parameters defined above satisfy the following constraints.
Lemma 4.4. The parameters are nonnegative and satisfy
Proof. All six parameters are cardinalities and hence nonnegative. The sets counted by partition , while and partition , giving . gives .
By the definition of a bushy forest, each tree has at least four leaves, and each additional internal vertex contributes at least two more leaves. Thus, . Moreover, by maximality, each leaf has at most two neighbors outside , giving .
To show , let . By Step 4 of Fig. 2, every tree containing a vertex of is a . Hence . Since every vertex in is adjacent to a vertex of , and each vertex of has at most two neighbors outside , we obtain .
Finally, by Step 2 of Fig. 2 and Theorem 4.3, is a forest, so . Since every vertex in has degree three in , we have . On the other hand, vertices in have degree at most two in , while those in have degree three, giving . Therefore, .
We first enumerate the colorings of the internal vertices of . Each root has at most three choices, and each non-root internal vertex has at most two choices once its parent is colored. Thus, the number of such colorings is at most
For each such coloring, every leaf in has at most two available colors. In the following sections, we focus on coloring the remaining leaves and the residual graph .
4.3 Algorithms via CSP
After coloring the internal vertices of , it remains to color the leaves and the residual graph . A simple approach is to formulate the remaining problem as a (3,2)-CSP instance. Since each leaf has at most two available colors, the corresponding variables can be eliminated in polynomial time by Theorem 3.3, leaving at most three-valued variables. By Theorem 3.2, the resulting instance can be solved in time, yielding a total running time of .
To improve this bound, we process stars centered at degree-three vertices of . For each star, branching on the color of its center requires at most three choices and reduces the domains of its three leaves to size at most two. By Theorem 3.3, these leaves can then be eliminated. Thus, all four vertices of the are processed at a cost of at most three choices, compared with when applying (3,2)-CSP directly. The relative cost is therefore .
A -packing in a graph is a set such that for all distinct . To obtain vertex-disjoint copies of , we seek a 2-packing consisting of degree-three vertices of . Since , each vertex has at most vertices within distance two. Thus, a greedy algorithm finds a 2-packing containing at least degree-three vertices of . A stronger bound for connected cubic graphs was obtained using a refined greedy algorithm [GH24].
Lemma 4.5 ([GH24]). For every connected cubic graph on vertices, a 2-packing of size at least can be constructed in polynomial time.
We extend their 2-packing algorithm to connected subcubic graphs.
Lemma 4.6. Suppose that, for some constant , every connected cubic graph on vertices admits a 2-packing of size at least that can be constructed in polynomial time. Then every connected subcubic graph admits a 2-packing of size at least consisting entirely of degree-three vertices of , where denotes the number of such vertices. This packing can be constructed in polynomial time.
Proof. If , the empty packing suffices. Hence, assume . We construct an auxiliary graph on the degree-three vertices of , joining two distinct vertices if a path in connects them using only degree-two internal vertices. Since is connected, so is . Moreover, for all . Thus, every 2-packing in is also a 2-packing in .
Since is subcubic but not necessarily cubic, we augment it to a cubic graph as follows. We take two copies of the current graph and join each pair of corresponding vertices whose degrees are less than three by an edge. This increases the degree of each vertex from to . We repeat this operation until the graph becomes cubic. Since at most three iterations are needed, the resulting cubic graph contains copies of . By assumption, we can construct a 2-packing in of size at least . By the pigeonhole principle, some copy of contains at least vertices of . These vertices form a 2-packing in , since distances within a copy of cannot be smaller than those in . Moreover, every 2-packing in is also a 2-packing in . Since , we obtain a 2-packing in consisting of degree-three vertices of size at least .
Thus, components containing many degree-three vertices allow us to exploit the stronger packing bound, whereas those containing few degree-three vertices yield smaller pathwidth in the width-based algorithm described later. To exploit this trade-off, let denote the maximum number of degree-three vertices in any component of . By definition, we have
We apply Theorems 4.5 and 4.6 to a component of containing the most degree-three vertices, and use the simple greedy algorithm with a 1/10 guarantee for the others. Combining these 2-packings yields a 2-packing of degree-three vertices of size at least
Applying the branching with relative cost to each 2-packing vertex yields the following bound.
Lemma 4.7. For a graph G after preprocessing, 3-coloring can be solved in time
4.4 Algorithms via Decomposition-Based DP
We take a maximal matching of and let . By definition, we have
After coloring the internal vertices of , each leaf has at most two available colors. Since these colors belong to the common color set [3], the endpoints of each edge in admit at most three colorings. Thus, the endpoints of all edges in can be colored in at most ways.
Let be the set of unmatched leaves. After coloring the internal vertices of and the endpoints of , it remains to color and . We consider two approaches: coloring first or processing it together with .
Coloring first. We first color in at most ways, since each leaf has at most two available colors. For each coloring of , we assign to each vertex the list of colors in [3] not used by its colored neighbors. We then solve list 3-coloring on each connected component of independently. Recall that is the maximum number of degree-three vertices in a component of , and that by Theorem 4.3. By Theorem 3.6, each component admits a path decomposition of width at most . Thus, all components can be solved in deterministic time by Theorem 3.4, or in randomized time by Theorem 3.5.
Lemma 4.8. Let be an upper bound on the number of colorings of for each coloring of the internal vertices of . For every fixed , a graph after preprocessing can be 3-colored in deterministic time or randomized time .
Processing together with . We consider coloring . Since need not be subcubic, we can no longer exploit the subcubic bound in Theorem 3.5, but Theorem 3.4 remains useful. Since distinct components of may be connected through , we use rather than to bound the width of a tree decomposition of using Theorem 3.7. By the maximality of , each vertex has at most two neighbors outside . The maximality of also implies that is independent. Hence, for every . Thus, vertices in contribute no degree excess above two, and each edge between and increases this excess by at most one. Hence,
Therefore, the width of the tree decomposition of is at most . Combining the colorings of the endpoints of with the list 3-coloring algorithm of Theorem 3.4 on yields the following bound.
Lemma 4.9. For every fixed , 3-coloring on a graph after preprocessing can be solved in time
4.5 Running-Time Analysis via Linear Programming
We use the fastest of the algorithms in Theorems 4.7 to 4.9. The logarithm of each running-time bound, ignoring polynomial factors, is linear in the nonnegative parameters . Normalizing these parameters through division by , we formulate a linear program based on the constraints in (2), (4), and (5) to determine in the worst-case running-time bound .
Since only the bound in Theorem 4.8 is randomized, we exclude it from the deterministic analysis and include it in the randomized analysis. We fix and let and denote the optimal values of the deterministic and randomized linear programs, respectively. The detailed LP formulations and dual certificates for the resulting bounds are given in Appendix C. Here we state the results: and , which yield the following theorems.
Theorem 1.1. There is a deterministic algorithm for 3-Coloring on arbitrary n-vertex graphs running in time.
Theorem 1.2. There is a randomized algorithm for 3-Coloring on arbitrary n-vertex graphs running in time.
5 Algorithms for 4-Coloring
5.1 Overview of the 4-Coloring Algorithm
An overview of our 4-coloring algorithm is given in Fig. 4. Following the idea of [WGJ 24], we consider an instance , where I and S are disjoint subsets of , I is an independent
- Apply the branching reductions of [WGJ 24] to reduce the initial instance to terminal instances.
- For each terminal instance, construct the two -packings described in Section 5.2.
- Based on the structural parameters of each terminal instance, select the algorithm with the smallest running-time bound among the reduction to 3-coloring (Theorem 5.2), the (3,2)-CSP algorithm (Theorem 5.4), the tree decomposition DP (Theorem 5.5), and the randomized path decomposition DP (Theorem 5.6). Accept if any terminal instance admits a coloring.
Figure 4: Overview of the 4-coloring algorithm.
set, and . The vertices in are assigned color 4, those in use colors from [3], and those in may use any color in [4]. Thus, it suffices to color subject to these color restrictions. An instance is terminal if every component of is or . Starting from , the branching reductions of [WGJ 24] replace nonterminal instances with smaller instances until all resulting instances are terminal. We apply their branching reductions unchanged.
Our main technical contribution for 4-coloring is to improve the running time for solving terminal instances. In Section 5.7, we describe the measure-and-conquer framework of [WGJ 24] and the convex optimization used to translate terminal running-time bounds into an overall bound for 4-coloring. For an instance , let and denote the numbers of -components and -components of , respectively.
5.2 Preprocessing the Terminal Instances
For a graph , an -packing in is a family of pairwise vertex-disjoint subgraphs of , each isomorphic to . We use maximal -packings as a common preprocessing step.
Two maximal -packings We first greedily construct a maximal family of vertex-disjoint copies of in . Let be the union of their vertex sets. We then construct another maximal family of vertex-disjoint copies of with centers in and leaves in . Let and be its sets of centers and leaves, respectively, and set . Write , , and , so that and . The maximality of the packings implies the following.
Lemma 5.1. We have and for every .
Proof. Otherwise, a vertex with three neighbors in could form an additional , contradicting maximality of the first -packing. Similarly, a vertex with three neighbors in would extend the second -packing.
Classification of clique components We classify the clique components of according to the number of their vertices in . Let denote the number of -components containing exactly vertices of for . Similarly, let denote the number of such -components for . Then
5.3 Terminal Algorithms via 3-Coloring
We give a simple reduction to 3-coloring.
Lemma 5.2. Suppose that 3-coloring on n-vertex graphs can be solved in time. Then a terminal instance of 4-coloring can be solved in time .
Proof. Recall that the vertices of are assigned color 4, whereas those of are restricted to colors in [3]. Since , there are no edges between and . We may therefore assume that each of the disjoint clique components of contains exactly one vertex of color 4: if a component does not use color 4, we may recolor any one of its vertices with 4. We enumerate the vertex assigned color 4 in each component of . Since consists of copies of and copies of , there are choices. For each choice, the remaining vertices of and all vertices of must be colored from [3]. Thus, we can apply the assumed 3-coloring algorithm to the graph induced by these vertices, yielding the claimed running time.
5.4 Terminal Algorithms via CSP
To reduce a terminal instance to -CSP, we restrict each vertex in to at most three colors. We branch into list assignments while preserving satisfiability. For each triangle with , we restrict its vertices to two-element lists. Each list belongs to . For comparison, processing triangles incurs a factor of in , whereas our construction reduces this factor to .
Lemma 5.3. Let be pairwise vertex-disjoint triangles, and let . There is a deterministic algorithm that constructs a family of list assignments such that every coloring satisfying for all is compatible with some , meaning that for every . Moreover, and the family can be enumerated in time.
Proof. As in the proof of Theorem 5.2, we consider only colorings that use color 4 on every triangle. For a single triangle , each and each define a list assignment
There are nine such list assignments. Every coloring of using color 4 is compatible with exactly two. Indeed, let receive colors , respectively, and let . These two assignments are
There are no others: x cannot be , and either remaining choice of x uniquely determines c.
For triangles, the local choices give list assignments, each coloring being compatible with exactly . Thus, a uniform sample preserves any fixed coloring with probability , and independent samples preserve it with constant probability.
We derandomize this step by constructing list assignments such that every coloring is compatible with at least one of them. Consider a block of triangles. Taking products of the nine local choices gives candidate list assignments. The block has colorings, each compatible with exactly candidates.
We select candidates greedily. Suppose colorings are not yet compatible with any selected candidate. Each is compatible with exactly of the candidates. By the pigeonhole principle, some candidate is compatible with at least of these colorings. Selecting it leaves at most colorings. Initially there are colorings. Thus, after selections, at most
colorings remain. Consequently, every coloring is compatible with a selected candidate after at most selections, where .
Set and partition the triangles into blocks of sizes , where . For each block, select at most candidates as above, and let be the Cartesian product of the selected families. Every coloring is compatible with some member of , because its restriction to each block is compatible with a selected candidate. Moreover,
Since , the colorings and candidates of each block can be enumerated in polynomial time. We can therefore make each greedy selection in polynomial time and enumerate in polynomial time per member, giving the claimed enumeration time.
We are now ready to bound the running time.
Lemma 5.4. There is an -time algorithm for solving a terminal instance of 4-coloring, where, for ,
Proof. For each clique of , we form a block consisting of and the leaves of each second star centered in . We partition into the first stars , the cliques with their associated star leaves, and the remaining vertices . We process these parts as follows.
For each first star, we choose one of the three colors in [3] for its center, since . Its three leaves then have lists of size at most two and can be eliminated by Theorem 3.3. As there are first stars, this contributes a factor of to the overall running time.
For each clique of , let and . We show below that processing together with its associated star leaves incurs a total branch cost of at most , where each branch has cost and is the number of three-valued variables left by this part. By the definitions of and , the cliques together with their associated star leaves contribute a factor of at most to the overall running time. The additional factor comes from the size bound in Theorem 5.3.
We leave the vertices of unchanged, without branching on their colors or restricting their lists. Since , each has at most three available colors. Thus, they contribute a factor of at most to the overall running time. Multiplying the factors for the three types of vertices gives the claimed running-time bound.
Proof of the bounds on . First consider . For , Theorem 5.3 gives 9/2 list assignments per triangle, up to an factor. Every vertex then has a two-element list, so the triangle adds no three-valued variables to the remaining (3,2)-CSP instance. Hence . For , choose two vertices of the to receive the list and give the other two the list . There are choices, and every coloring of the is compatible with exactly one of them. No three-valued variables remain in the clique, so . The same six-way restriction of is used in [WGJ+24, Section 3.1].
Next, suppose , and let . We fix the color of . If receives color 4, each of its three second-star leaves retains a three-element list, while the other vertices of have lists of size at most three. This branch costs at most . If receives a color in [3], its leaves have lists of size at most two. There are three such choices, each costing at most for the remaining vertices of . Hence .
Finally, suppose . We fix the colors of all vertices in , assigning them distinct colors. If none receives color 4, there are assignments when , and none when . In either case, the number of assignments is . The leaves of these centers then have lists of size at most two, so each assignment costs 1. If one center receives color 4, there are assignments. Its three leaves retain three colors, while the other centers' leaves have lists of size at most two. Each assignment therefore costs . In either case, the remaining vertices of have lists of size at most two. Thus, .
5.5 Terminal Algorithms via Tree Decomposition DP
We enumerate the colors of all vertices in . Each first star has at most colorings. Each -component of has 18 colorings that use color 4, while each -component has 24 colorings. Thus, we enumerate at most colorings, discarding any that violate an edge between precolored vertices. For each remaining choice, we obtain a list 3-coloring instance on by giving each vertex the list of colors in [3] not used by its precolored neighbors. By Theorem 5.1, . Hence this graph is a disjoint union of paths, cycles, and isolated vertices, and has treewidth at most two. The list instance can therefore be solved in polynomial time by Theorem 3.4. Therefore, we obtain the following bound.
Lemma 5.5. A terminal instance of 4-coloring can be solved in time.
5.6 Terminal Algorithms via Path Decomposition DP
We first enumerate the colors of all vertices in the two star packings. The first stars have at most colorings. For a clique containing centers of the second star packing, we assign distinct colors to these centers. Let denote an upper bound on the number of colorings of the centers in and their leaves. The centers must receive distinct colors. If none receives color 4, their leaves have at most colorings; if one receives color 4, their leaves have at most colorings. Thus, for ,
We also set . Thus, the vertices in have at most colorings, where
Let . We enumerate the colors of in at most ways. This leaves a list 4-coloring instance on , with lists obtained from [3] for vertices in and [4] for those in , by removing colors used by precolored neighbors. By Theorem 5.1, , and every vertex of has at most two neighbors in . Hence, , and we apply Theorem 3.5 to solve this instance.
We bound the width of a path decomposition of using Theorem 3.7. For each clique of , let . For , let and denote the numbers of edges from to vertices in , summed over cliques with and , respectively. Since and , with exactly vertices of degree three in the latter graph, we have . The coefficient of can be reduced from 2 to because each vertex in a remaining clique of size at most two has internal degree at most one. If it has neighbors in , its contribution is at most . Thus, Theorem 3.7 gives a path decomposition of of width at most , where
Since , Theorem 3.5 solves list coloring of in randomized time.
Since each has at least four neighbors in , we have . Moreover, by Theorem 5.1, each has at most two neighbors in . Hence
where denotes the sum over all cliques of with , and is defined analogously. The last equality uses and . Combining the at most colorings of , the at most colorings of , and the -time list-coloring algorithm for , we obtain the following bound.
Lemma 5.6. Let Q be defined as in (7). For every fixed , there is a randomized algorithm that solves a terminal instance of 4-coloring in time
5.7 From Terminal Bounds to the Overall Running Time
We describe how the branching reductions of can be used to derive an overall running-time bound from the running times for terminal instances. Recall that for an instance , and denote the numbers of -components and -components of , respectively. Let denote the set of all other components of . Following the Equation (2) of , we define the measure
where and for are nonnegative weights, with and for all .
The constraints on the weights in [WGJ 24, Equation (3)] ensure that the measure does not increase under the reduction rules. The branching rules for nonterminal instances are described in [WGJ 24, Section 3.2], and the additional constraints in [WGJ 24, Equations (6)–(21)] ensure that, for a target running-time base r > 1, the total running-time budget of the resulting subinstances does not exceed that of the original instance.
Lemma 5.7 ([WGJ 24]). Suppose that r > 1 and the measure weights satisfy the constraints in Appendix D, taken from Equations (3) and (6)–(21) of [WGJ 24]. For every nonterminal instance , the branching reductions in Section 3.2 of [WGJ 24] produce subinstances for such that . Moreover, P admits a valid 4-coloring if and only if at least one of the subinstances does, and holds for every , where . These subinstances can be generated with polynomial overhead per subinstance.
We next use a linear programming duality argument to combine multiple algorithms for terminal instances with the branching reductions. Our formulation expresses , , and as linear functions of finer structural parameters. This leads to a convex optimization formulation for the overall running-time bound.
Lemma 5.8. Fix a constant . Let and suppose that and the measure weights satisfy the constraints in Appendix D. Let and be the numbers of parameters and terminal algorithms, respectively. Suppose every terminal instance has a polynomial-time computable parameter vector satisfying
for a fixed matrix . For each row of a fixed matrix , suppose an algorithm solves every terminal instance in time, where is the number of vertices of the original input. If a nonnegative vector satisfies
then 4-coloring can be solved in time.
Proof. For a terminal instance with parameter vector , we have
The first inequality follows from and , and the second follows from (9) and . The equality holds because every component of in a terminal instance is or . Thus, choosing the terminal algorithm with the smallest bound yields a running time of .
For nonterminal instances, we apply Theorem 5.7. Let be the initial instance, and let denote the multiset of terminal instances at the leaves of the resulting branching tree. By repeatedly applying the inequality in Theorem 5.7, we obtain
Consequently, the total time spent solving terminal instances is
Since strictly decreases in every reduction, the depth of the branching tree is at most . Moreover, the inequality in Theorem 5.7 and the nonnegativity of imply that the number of nodes at each depth is at most . Thus, the polynomial overhead of the reductions is absorbed into the notation.
Finally, the constraints in (10), together with , imply , , and , yielding . Therefore, the overall running time is .
Following the rescaling approach in [WGJ 24, Appendix A], we introduce and scaled weights . Under this substitution, the constraint in (9) becomes linear, while the branching constraints (11) become convex, as they take the form for affine functions .
The terminal algorithm described in [WGJ 24, Section 3.1] runs in time. Thus, their overall bound for 4-coloring can be recovered using Theorem 5.8 by setting
where denotes the identity matrix, , and . Hence, their convex optimization is a special case of our formulation using , , and directly as parameters, with a single terminal algorithm.
We now apply this formulation to our terminal algorithms. We use the following 11 parameters:
From (6), the corresponding matrix is
Each terminal algorithm gives one row of by expressing its leading exponent as a linear function of . We fix and . Then the factor in Theorem 5.6 equals , and the factor in Theorem 5.4 is at most for sufficiently large . Thus, each terminal running-time bound in Theorems 5.2 and 5.4 to 5.6 has the form required by Theorem 5.8. Here, we use the 3-coloring algorithms in Theorems 1.1 and 1.2 when applying Theorem 5.2 in the deterministic and randomized analyses, respectively.
The explicit matrices for the deterministic and randomized algorithms, together with dual certificates for the resulting bounds, are given in Appendix E. Here we state the results. Let and denote the optimal values of in the deterministic and randomized cases, respectively. We obtain and , which yield the following theorems.
Theorem 1.3. There is a deterministic algorithm for 4-Coloring on arbitrary n-vertex graphs running in time.
Theorem 1.4. There is a randomized algorithm for 4-Coloring on arbitrary n-vertex graphs running in time.
AI methodology
We used ChatGPT to assist in generating code for finding feasible solutions, computing upper bounds on the optimal values of the linear and convex programs, and obtaining corresponding dual certificates. This assistance materially affected Appendices C, E and F. The authors verified the correctness and originality of all content.
References
[BE95] R. Beigel and D. Eppstein. 3-coloring in time : a no-MIS algorithm. In Proceedings of IEEE 36th Annual Foundations of Computer Science (FOCS), pages 444–452, 1995. doi:10.1109/SFCS.1995.492575.
[BE05] Richard Beigel and David Eppstein. 3-coloring in time . Journal of Algorithms, 54(2):168–204, 2005. doi:10.1016/j.jalgor.2004.06.008.
[BH06] Andreas Bjorklund and Thore Husfeldt. Inclusion–exclusion algorithms for counting set partitions. In 2006 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS'06), pages 575–582, 2006. doi:10.1109/FOCS.2006.41.
[BH08] Andreas Björklund and Thore Husfeldt. Exact algorithms for exact satisfiability and number of perfect matchings. Algorithmica, 52(2):226–249, 2008. doi:10.1007/s00453-007-9149-8.
[BHKK11] Andreas Björklund, Thore Husfeldt, Petteri Kaski, and Mikko Koivisto. Covering and packing in linear space. Information Processing Letters, 111(21):1033–1036, 2011. doi:10.1016/j.ipl.2011.08.002.
[Bré79] Daniel Brélaz. New methods to color the vertices of a graph. Commun. ACM, 22(4):251–256, April 1979. doi:10.1145/359094.359101.
[Bro72] J. Randall Brown. Chromatic scheduling and the chromatic number problem. Management Science, 19(4-part-1):456–463, 1972. doi:10.1287/mnsc.19.4.456.
[Bys04] Jesper Makholm Byskov. Enumerating maximal independent sets with applications to graph colouring. Operations Research Letters, 32(6):547–556, 2004. doi:10.1016/j.orl.2004.03.002.
[C.96] SEWELL E. C. An improved algorithm for exact graph coloring. DIMACS Series in Computer Mathematics and Theoretical Computer Science, 26:359–373, 1996. URL: https://cir.nii.ac.jp/crid/1573387450796867840.
[Cla26] Claude (Anthropic). A time algorithm for 3-SAT. Manuscript, 2026. Accessed October 30, 2026. URL: https://github.com/anthropics/formal-math/tree/main/eth.
[Epp01] David Eppstein. Improved algorithms for 3-coloring, 3-edge-coloring, and constraint satisfaction. In Proceedings of the Twelfth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), page 329–337, USA, 2001. Society for Industrial and Applied Mathematics.
[FGK09] Fedor V. Fomin, Fabrizio Grandoni, and Dieter Kratsch. A measure & conquer approach for the analysis of exact algorithms. J. ACM, 56(5), August 2009. doi:10.1145/1552285.1552286.
[FGS07] Fedor V. Fomin, Serge Gaspers, and Saket Saurabh. Improved exact algorithms for counting 3- and 4-colorings. In Guohui Lin, editor, Computing and Combinatorics, pages 65–74, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. doi:10.1007/978-3-540-73545-8_9.
[FGSS09] Fedor V. Fomin, Serge Gaspers, Saket Saurabh, and Alexey A. Stepanov. On two techniques of combining branching and treewidth. Algorithmica, 54(2):181–207, 2009. doi:10.1007/s00453-007-9133-3.
[FM02] Tomás Feder and Rajeev Motwani. Worst-case time bounds for coloring and satisfiability problems. Journal of Algorithms, 45(2):192–201, 2002. doi:10.1016/S0196-6774(02)00224-9.
[GH24] Wayne Goddard and Michael A. Henning. The packing number of cubic graphs. Discrete Optimization, 53:100850, 2024. doi:10.1016/j.disopt.2024.100850.
[GL23] Serge Gaspers and Edward J Lee. Faster graph coloring in polynomial space. Algorithmica, 85(2):584–609, 2023. doi:10.1007/s00453-022-01034-7.
[Hal93] Magnús M. Halldórsson. A still better performance guarantee for approximate graph coloring. Information Processing Letters, 45(1):19–23, 1993. doi:10.1016/0020-0190(93)90246-6.
[HPZ08] Alain Hertz, Matthieu Plumettaz, and Nicolas Zufferey. Variable space search for graph coloring. Discrete Applied Mathematics, 156(13):2551–2560, 2008. Fifth International Conference on Graphs and Optimization. doi:10.1016/j.dam.2008.03.022.
[Hus15] Thore Husfeldt. Graph colouring algorithms, page 277–303. Encyclopedia of Mathematics and its Applications. Cambridge University Press, 2015. doi:10.1017/CB09781139519793.016.
[IW97] Russell Impagliazzo and Avi Wigderson. P = bpp if e requires exponential circuits: derandomizing the xor lemma. In Proceedings of the Twenty-Ninth Annual ACM Symposium on Theory of Computing, STOC '97, page 220–229, New York, NY, USA, 1997. Association for Computing Machinery. doi:10.1145/258533.258590.
[JN19] Bart M.P. Jansen and Jesper Nederlof. Computing the chromatic number using graph decompositions via matrix rank. Theoretical Computer Science, 795:520–539, 2019. doi:10.1016/j.tcs.2019.08.006.
[Kar72] Richard M. Karp. Reducibility among Combinatorial Problems, pages 85–103. Springer US, Boston, MA, 1972. doi:10.1007/978-1-4684-2001-2_9.
[KI03] Valentine Kabanets and Russell Impagliazzo. Derandomizing polynomial identity tests means proving circuit lower bounds. In Proceedings of the Thirty-Fifth Annual ACM Symposium on Theory of Computing, STOC '03, page 355–364, New York, NY, USA, 2003. Association for Computing Machinery. doi:10.1145/780542.780595.
[Law76] E.L. Lawler. A note on the complexity of the chromatic number problem. Information Processing Letters, 5(3):66–67, 1976. doi:10.1016/0020-0190(76)90065-X.
[Lov73] László Lovász. Coverings and colorings of hypergraphs. In Proc. 4th South-eastern Conference of Combinatorics, Graph Theory, and Computing, pages 3–12. Utilitas Mathematica Publishing, 1973. URL: https://cir.nii.ac.jp/crid/1572261549354589440.
[Mei23] Lucas Meijer. 3-coloring in time , 2023. arXiv:2302.13644v1.
[MMN20] Taha Mostafaie, Farzin Modarres Khiyabani, and Nima Jafari Navimipour. A systematic study on meta-heuristic approaches for solving the graph coloring problem. Computers & Operations Research, 120:104850, 2020. doi:10.1016/j.cor.2019.104850.
[MMT08] Enrico Malaguti, Michele Monaci, and Paolo Toth. A metaheuristic approach for the vertex coloring problem. INFORMS Journal on Computing, 20(2):302–316, 2008. doi: 10.1287/ijoc.1070.0245.
[MT10] Enrico Malaguti and Paolo Toth. A survey on vertex coloring problems. International Transactions in Operational Research, 17(1):1–34, 2010. doi:10.1111/j.1475-3995.2009.00696.x.
[NW94] Noam Nisan and Avi Wigderson. Hardness vs randomness. Journal of Computer and System Sciences, 49(2):149–167, 1994. doi:10.1016/S0022-0000(05)80043-1.
[Ope26] OpenAI. The Exponential Time Hypothesis is False. OpenAI Math Release preprint OAI:The-Exponential-Time-Hypothesis-is-False-October-25-2026, 2026.
[Pra26] Kevin Pratt. Breaking the barrier for graph k-coloring, 2026. URL: https://arxiv.org/abs/2607.27159, arXiv:2607.27159.
[Sch94] Ingo Schiermeyer. Deciding 3-colourability in less than steps. In Jan van Leeuwen, editor, Graph-Theoretic Concepts in Computer Science, pages 177–188, Berlin, Heidelberg, 1994. Springer Berlin Heidelberg.
[TP97] Jan Arne Telle and Andrzej Proskurowski. Algorithms for vertex partitioning problems on partial k-trees. SIAM Journal on Discrete Mathematics, 10(4):529–550, 1997. doi: 10.1137/S0895480194275825.
[Vad12] Salil P. Vadhan. Pseudorandomness. Found. Trends Theor. Comput. Sci., 7(1-3):1–336, December 2012. doi:10.1561/0400000010.
[WGJ+24] Pu Wu, Huanyu Gu, Huiqin Jiang, Zehui Shao, and Jin Xu. A Faster Algorithm for the 4-Coloring Problem. In Timothy Chan, Johannes Fischer, John Iacono, and Grzegorz Herman, editors, 32nd Annual European Symposium on Algorithms (ESA 2024), volume 308 of Leibniz International Proceedings in Informatics (LIPIcs), pages 103:1–103:18, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi: 10.4230/LIPIcs.ESA.2024.103.
[Zam21] Or Zamir. Breaking the Barrier for 5-Coloring and 6-Coloring. In Nikhil Bansal, Emanuela Merelli, and James Worrell, editors, 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021), volume 198 of Leibniz International Proceedings in Informatics (LIPIcs), pages 113:1–113:20, Dagstuhl, Germany, 2021. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2021.113.
[Zam26] Or Zamir. k-coloring is faster than computing the chromatic number, 2026. URL: https://arxiv.org/abs/2607.25973, arXiv:2607.25973.
[Zuc06] David Zuckerman. Linear degree extractors and the inapproximability of max clique and chromatic number. In Proceedings of the Thirty-Eighth Annual ACM Symposium on Theory of Computing, STOC '06, page 681–690, New York, NY, USA, 2006. Association for Computing Machinery. doi:10.1145/1132516.1132612.
A Decision-to-Search Reduction
A standard self-reduction allows us to construct a k-coloring using a decision algorithm with only polynomial overhead. This reduction also appears in the survey [Hus15].
Lemma A.1. Suppose that the existence of a k-coloring of an n-vertex graph can be decided in time. Then a k-coloring of can be constructed, if one exists, in time.
Proof. We first use the decision algorithm to check whether admits a k-coloring. If not, we report that no such coloring exists. Otherwise, we repeatedly consider nonadjacent vertices and test whether adding preserves k-colorability. If so, we add to . We stop when no further edge can be added.
A graph is complete multipartite if its vertex set can be partitioned into independent sets such that every two vertices in different parts are adjacent. The resulting graph is complete multipartite with at most parts, since otherwise some nonadjacent vertices could receive different colors in a k-coloring, allowing another edge to be added. Thus, its complement is a disjoint union of at most cliques, which yield a k-coloring of the original graph. Since decision calls are needed, the total running time is .
B Deferred Proofs
B.1 Proof of Lemma 3.7
Here, we restate Theorem 3.6 for convenience.
Lemma B.1 ([FGSS09, Lemma 1]). For every fixed and every graph on vertices, a path decomposition of of width at most
can be constructed in polynomial time. Here, denotes the number of vertices of degree in for , and denotes the number of vertices of degree at least 7.
Lemma B.2. For every fixed and every graph on vertices, a path decomposition of of width at most
can be constructed in polynomial time.
Proof. Let be obtained from by replacing each degree-7 vertex with two adjacent vertices and of degrees 4 and 5, respectively. This is done by assigning three neighbors of to and the remaining four to .
Apply Theorem 3.6 to with . For every degree , the coefficient in Theorem 3.6 is at most . This follows directly for , and for from . For each split degree-7 vertex, the two new vertices contribute
Hence, the degree-weighted part of the pathwidth bound for is at most . Since , the remaining terms satisfy . Together with the bound on the degree-weighted part, this gives the desired pathwidth bound for .
Finally, contracting each edge recovers . The nodes whose bags contain and , respectively, induce subpaths of . Since is an edge, these subpaths intersect, and hence their union is also a subpath. Thus, replacing and by in every bag preserves the path-decomposition properties without increasing any bag size. The resulting path decomposition of satisfies the claimed bound and can be constructed in polynomial time.
B.2 Proof of Lemma 4.2
Lemma B.3 ([Mei23]). Given a maximal bushy forest , we can modify in polynomial time so that it remains a maximal bushy forest and every tree containing a leaf adjacent to a vertex with is a .
Proof. Suppose that there exists a vertex with that is adjacent to a leaf of a tree in , where is not a . Let denote the three neighbors of in . We distinguish two cases according to the number of internal vertices of and show how to modify to eliminate this violating configuration.
Case 1: has at least two internal vertices. Since has at least two internal vertices, there exists an internal vertex of that is not adjacent to in . We remove from and add a new tree consisting of and all of its neighbors in , with as its only internal vertex. Since , this tree satisfies the bushy-forest condition. We also add a new centered at with leaves .
Case 2: has exactly one internal vertex. Since is not a , its internal vertex has at least five leaves. We remove from ; the remaining tree still satisfies the bushy-forest condition, since its internal vertex has at least four leaves. We then add to a new centered at with leaves .
In either case, the resulting forest is still a bushy forest, the chosen violating configuration is eliminated, and the number of trees in the forest increases by one. The resulting forest may no longer be maximal, so we greedily extend it. This extension preserves the bushy-forest condition and never decreases the number of trees.
We repeat this modification and extension as long as a violating configuration exists. Each modification strictly increases the number of trees in , while the greedy extension never decreases it. Since the number of trees in the forest is bounded above by , at most modifications are performed. Each modification and greedy extension can be carried out in polynomial time. Hence, the entire procedure runs in polynomial time and terminates with a maximal bushy forest satisfying the desired property.
C Linear Programs and Dual Certificates for 3-Coloring
We formulate the linear programs used to derive the running-time bounds in Theorems 1.1 and 1.2. Throughout this section, we use for the corresponding parameters divided by , and fix . We set for the deterministic analysis and for the randomized analysis. The normalized logarithms of the running-time bounds in Theorems 4.7 to 4.9 are
The structural constraints are
For each , the primal linear program maximizes subject to these structural constraints and
In the randomized analysis, we omit the deterministic bound since it is dominated by .
Dual linear programs. Let . We express the structural constraints as and , where and are given by
We express the three normalized logarithmic running-time bounds as , where and are given by
and
The rows of correspond to the algorithms via CSP, treewidth-DP, and pathwidth-DP, respectively, while its columns correspond to .
Let denote the all-ones vector. For each , the primal linear program is
Its dual is
Here, and correspond to the running-time constraints and structural inequalities, respectively, while z corresponds to the equality .
By weak duality, any feasible primal and dual solutions satisfy
Feasible dual certificates. We give feasible dual solutions for and in the following table. All displayed decimal values are treated as exact rational numbers.
| 0.277893717 | 0.274458566 | |
| 0.872081561 | 0.881461989 | |
| 0.108128455 | 0.052151678 | |
| 0.019789984 | 0.066386333 | |
| 0.006293660 | 0.000000010 | |
| 0.207626932 | 0.209344508 | |
| 0 | 0 | |
| 0.001223624 | 0.001110933 | |
| 0.000305899 | 0.000277726 | |
| 0.000000010 | 0.004006697 | |
| 0.016951940 | 0.000000010 |
For both values of , these solutions satisfy , , and . They also satisfy the componentwise inequalities
The corresponding dual objective values satisfy
For numerical verification, we used rational interval bounds for to verify both the componentwise inequalities and the objective bounds. These checks establish the feasibility of the displayed dual solutions and the stated objective bounds independently of the accuracy of the numerical optimizer. By weak duality, the certificates establish the claimed deterministic and randomized running-time bounds.
D Branching Constraints for 4-Coloring
We restate [WGJ24, Equation (3)] as follows:
For [WGJ24, Equations (6)–(21)], each row of Table 1 specifies a multiset of pairs , representing the constraint
| [WGJ+24] Eq. | Pairs ( ) in |
|---|---|
| (6) | |
| (7a) | for |
| (7b) | |
| (8a) | |
| (8b) | |
| (8c) | |
| (8d) | |
| (9) | |
| (10) | |
| (11) | |
| (12) | |
| (13), (14) | |
| (15) | |
| (16) | |
| (17a), (18b) | |
| (17b) | |
| (18a) | |
| (18c) | |
| (19) | |
| (20) | |
| (21) |
Table 1: Branching constraints from [WGJ+24, Equations (6)–(21)].
We write and , where denotes the family of all maximal independent sets of the cycle , and .
E Convex Programs and Dual Certificates for 4-Coloring
We give the terminal coefficient matrices and feasible solutions certifying our running-time bounds. The parameter order is
The corresponding matrix mapping these parameters to , , and is
Terminal coefficient matrices. For and , define
where is defined in the analysis of Theorem 5.6, and
The parameter denotes the running-time base of the chosen 3-coloring algorithm.
The rows , , , and are obtained from the running-time bounds in Theorem 5.2, Theorem 5.4, Theorem 5.5, and Theorem 5.6, respectively. They are
Here, is defined in Theorem 5.4. Thus, the deterministic and randomized coefficient matrices are
We use the deterministic and randomized 3-coloring running-time bounds from Theorems 1.1 and 1.2, respectively. We fix and . The additional factor in Theorem 5.6 equals , and the factor in Theorem 5.4 is at most for sufficiently large n. Consequently, every terminal algorithm satisfies the bound required by Theorem 5.8.
Convex formulation. We introduce the rescaled variables
In particular, , since . The terminal coefficient inequalities become
We combine these with the branching constraints in Appendix D, expressed in the rescaled variables. The constraints in (10) remain linear, while each branching inequality of (11) becomes a sum of exponentials of affine functions bounded by one. Thus, minimizing z subject to these constraints is a convex optimization problem.
We use and for the deterministic and randomized cases, respectively. The vector certifies that the minimum terminal exponent is bounded by the terminal measure, as shown in Theorem 5.8.
Feasible solutions and verification. The following table specifies feasible solutions. All displayed finite decimals are interpreted as exact rational numbers. The original variables are recovered by and , with for .
| Deterministic | Randomized | |
|---|---|---|
| 0.5291126816180365 | 0.5266716867458051 | |
| 0.4944314348773351 | 0.4928717407360532 | |
| 0.5291126816180365 | 0.5266716867458051 | |
| 0.2957156198800068 | 0.2925962315974430 | |
| 1.5714124563519097 | 1.5621902025983386 | |
| 1.8810074111165460 | 1.9480191762881393 | |
| 0.0788417191536246 | 0.2043107963374502 | |
| 0.8811402533346064 | 0.7611219494728269 | |
| 0.0400180275117690 | 0.0069512075211995 | |
| - | 0.0276160466685234 |
The entries of sum to exactly one in both cases.
For numerical verification, we used rational interval bounds for exp and ln to verify all constraints in (10) and (11), and all terminal coefficient inequalities in (12). These checks establish the feasibility of the displayed solutions independently of the accuracy of the numerical optimizer.
Let and denote the values of z in the displayed deterministic and randomized feasible solutions, respectively. The resulting running-time bases satisfy
Thus, these certificates establish the claimed deterministic and randomized running-time bounds.
F On the Linear Program in Meijer's Preprint
Meijer [Mei23] reports an -time algorithm for 3-coloring. However, the linear program presented in the preprint admits a feasible solution with an objective value exceeding . We restate the linear program below and give an explicit feasible solution.
We retain the notation of the preprint, but throughout this section all cardinalities are normalized by ; thus, for example, denotes the original cardinality divided by . Using natural logarithms, the linear program in Section 5.2 of the preprint is
all variables are nonnegative.
These are the constraints in [Mei23, Equations (1)–(4) and (6)–(12)], after normalization. Consider the assignment
with all other variables equal to zero. All equality constraints hold. Moreover, each inequality constraint holds with equality:
Thus, this assignment is feasible. Its objective value is
whose exponential is
Consequently, the optimum of the displayed maximization problem exceeds , so this linear program does not establish the reported running-time bound. However, this feasible solution does not necessarily imply a lower bound on the algorithm's running time, since it need not correspond to a realizable graph. Additional structural constraints might exclude this solution, and a different analysis might establish the reported bound.