Abstract
The fastest known classical algorithm deciding the k-colorability of n-vertex graph requires running time \(\varOmega (2^n)\) for \(k\ge 5\). In this work, we present an exponential-space quantum algorithm computing the chromatic number with running time \(O(1.9140^n)\) using quantum random access memory (QRAM). Our approach is based on Ambainis et al’s quantum dynamic programming with applications of Grover’s search to branching algorithms. We also present a polynomial-space quantum algorithm not using QRAM for the graph 20-coloring problem with running time \(O(1.9575^n)\). For the polynomial-space quantum algorithm, we essentially develop \((4-\epsilon )^n\)-time classical algorithms that can be improved quadratically by Grover’s search.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Exhaustive search is believed to be (almost) the fastest classical algorithm for many NP-complete problems including SAT, hitting set problem, etc [8]. Grover’s quantum search quadratically improves the running time of exhaustive search [15]. Hence, the best classical running time for many NP-complete problems can be quadratically improved by quantum algorithms. On the other hand, non-trivial faster classical algorithms are known for some NP-complete problems including the travelling salesman problem (TSP), the graph coloring problem, etc. For these problems, more complicated techniques, such as dynamic programming, arithmetic algorithm based on inclusion–exclusion principle, etc., are used in the fastest known classical algorithms. It is not obvious how to boost these classical algorithms by a quantum computer. Recently, Ambainis et al. showed a general idea of quantum dynamic programming using quantum random access memory (QRAM), and showed quantum speedup for many NP-complete and NP-hard problems including TSP, set cover, etc [1]. Ambainis et al.’s work gives a new general method for exact exponential-time quantum algorithms.
In this work, we present exact exponential-time quantum algorithms for the graph coloring problem. The fastest known classical algorithm computes the chromatic number of n-vertex graph with running time \(\mathrm {poly}(n)2^n\) on the random access memory (RAM) model. The main result of this work is the following theorem.
Theorem 1
There is an exponential-space bounded-error quantum algorithm using QRAM for the chromatic number problem with running timeFootnote 1\(O^*\bigl ((2^{37/35}3^{3/7}5^{-9/70}7^{-5/28})^n\bigr )=O(1.9140^n)\).
The quantum algorithm in Theorem 1 is based on Ambainis et al’s quantum dynamic programming for TSP with applications of Grover’s search to Byskov’s algorithm enumerating all maximal independent sets (MISs) of fixed size [7]. Byskov’s algorithm is not naive exhaustive search, but is a branching algorithm (also referred as Branch & Reduce), for which Grover’s search can be applied [12]. While RAM is a widely accepted model of classical computation, QRAM is sometimes criticized due to the difficulty of implementation.
In this paper, we also present quantum algorithms not using QRAM.
Theorem 2
For \(k\le 20\), there exists a constant \(\epsilon >0\) such that there are polynomial-space bounded-error quantum algorithms not using QRAM for the graph k-coloring problem with running time \(2^{(1-\epsilon )n}\).
Note that classical algorithms with running time \(2^{(1-\epsilon )n}\) are known only for \(k=3,4\) [2, 7]. Running times of the quantum algorithms in Theorem 2 are shown in Table 1. For proving Theorem 2, we essentially develop classical algorithms with running time \(4^{(1-\epsilon )n}\) that can be improved quadratically by Grover’s search. These classical algorithms are obtained by generalizing Byskov’s techniques for reducing the graph \(k(\ge 4)\)-coloring problem to the graph 3-coloring problem [7]. The proofs of Theorems 1 and 2 in this paper require numerical calculations. More precicely, the running time is represented by the maximum of some complicated function. The maximum is approximately computed by evaluating the function at many points.
1.1 Related Work
Since a graph is k-colorable if and only if the set of vertices can be partitioned into k independent sets, many algorithms for the graph k-coloring problem use enumeration algorithms of independent sets. There is a simple branching algorithm enumerating all MISs in time \(O^*(3^{n/3})=O(1.4423^n)\) [11]. Lawler showed that 3-colorability can be decided in time \(O^*(3^{n/3})\) by enumerating all MISs and checking the bipartiteness of the subgraph induced by the complement of each MIS [17]. Lawler also showed that the chromatic number can be computed in time \(O(2.4423^n)\) by a simple dynamic programming.
Beigel and Eppstein showed an efficient algorithm for the graph 3-coloring problem with running time \(O(1.3289^n)\) [2]. Byskov showed reduction algorithms from the graph \(k(\ge 4)\)-coloring problem to the graph 3-coloring problem [7]. By using Beigel and Eppstein’s graph 3-coloring algorithm, Byskov showed classical algorithms for the graph 4-, 5- and 6-coloring problems with running time \(O(1.7504^n)\), \(O(2.1592^n)\) and \(O(2.3289^n)\), respectively. Fomin et al. showed an algorithm for the graph 4-coloring problem with running time \(O(1.7272^n)\) by using the path decomposition [10].
In 2006, Björklund and Husfeldt, and Koivisto showed an exponential-space \(O^*(2^n)\)-time algorithm for the chromatic number problem in the RAM model [3, 16]. These algorithms are based on the inclusion–exclusion principle. They also showed that if there is a polynomial-space \(O^*(\alpha ^n)\)-time algorithm counting the number of independent sets, then there is a polynomial-space \(O^*((1+\alpha )^n)\)-time algorithm computing the chromatic number [3, 5]. Since the fastest known polynomial-space algorithm computes the number of independent sets with running time \(O(1.2356^n)\) [13], there is a polynomial-space \(O(2.2356^n)\)-time algorithm computing the chromatic number.
There is almost no previous theoretical work on quantum algorithms for the graph coloring problems. Fürer mentioned that Grover’s algorithm can be applied to branching algorithms, and hence, Beigel and Eppstein’s algorithm for the graph 3-coloring problem can be improved to running time \(O(\sqrt{1.3289}^n)=O(1.1528^n)\) [12]. The quantum algorithms for Theorem 2 are basically obtained by applying Grover’s search to generalized Byskov’s reduction algorithms on the basis of Fürer’s observation.
For general NP-hard problems, Ambainis et al. showed exponential-space exponential-time quantum algorithms using QRAM for many NP-hard problems [1]. The quantum algorithm for Theorem 1 is based on Ambainis et al’s algorithm for TSP with application of Grover’s search to Byskov’s algorithm enumerating MISs of fixed size on the basis of Fürer’s observation.
1.2 Overview of Quantum Algorithms
1.2.1 Quantum Algorithm for the Chromatic Number Problem
Similarly to Ambainis et al.’s quantum algorithm for TSP, the quantum algorithm for Theorem 1 is a simple divide-and-conquer algorithm with dynamic programming approach. The basic classical algorithm was shown in [4, Proposition 3]. The chromatic number of a graph G is equal to a sum of the chromatic numbers of G[S] and \(G[V\setminus S]\) for some non-empty \(S\subsetneq V\), unless G is one-colorable. If we can assume that S has size exactly \(\lfloor n/2\rfloor \) or \(\lceil n/2\rceil \), then we can consider a classical algorithm that recursively finds S of size \(\lfloor n/2\rfloor \) minimizing \(\chi (G[S])+\chi (G[V\setminus S])\). Let T(n) be the running time of this algorithm. Then, it follows \(T(n) = \left( {\begin{array}{c}n\\ \lfloor n/2\rfloor \end{array}}\right) (T(\lfloor n/2\rfloor )+T(\lceil n/2\rceil ))\), so that we can apply Ambainis et al’s quantum dynamic programming straightforwardly and obtain an \(O(1.7274^n)\)-time quantum algorithm [1]. However, the balanced partition S satisfying \(\chi (G)=\chi (G[S])+\chi (G[V\setminus S])\) does not necessarily exist. Hence, we use the following useful fact.
Fact 1
Let \(a_1,\dotsc ,a_k\) be positive integers, and \(n:=\sum _{i=1}^ka_i\). Assume that \(a_1\ge a_i\) for all \(i\in \{1,2,\dotsc ,k\}\). Then, for any \(m\in \{1,2,\dotsc ,n-1\}\), there exists \(S\subseteq \{2,3,\dotsc ,k\}\) such that \(\sum _{i\in S}a_i\le m\) and \(\sum _{i\in \{2,\dotsc ,k\}\setminus S} a_i\le n-m-1\).
Proof
Let \(t:=\max \bigl \{j\in \{2,\dotsc ,k\}\mid \sum _{i=2}^j\le m\bigr \}\). Let \(S:=\{2,3,\dotsc ,t\}\). Then, \(\sum _{i\in \{t+1,t+2,\dotsc ,k\}} a_i \le \sum _{i\in \{1,t+2,t+3,\dotsc ,k\}} a_i = n - \sum _{i\in \{2,3,\dotsc ,t+1\}} a_i \le n - m - 1\). \(\square \)
From Fact 1, we can consider the following quantum algorithm computing the chromatic number. First, the algorithm precomputes the chromatic number of all induced subgraphs with size at most \(\lfloor n/4\rfloor \). This precomputation is based on Lawler’s formula
where \(\mathrm {MIS}(G)\) denotes the set of all MISs of G [17]. There is a classical algorithm enumerating all MISs with running time \(O^*(3^{n/3})\). We will show in Sect. 3 that Grover’s search can be applied to this algorithm, and hence, the quantum algorithm can search for all MISs with running time \(O^*(3^{n/6})\). Here, computed chromatic numbers are stored to QRAM. Hence, we can apply Grover’s search for computing the minimum in (1). The precomputation requires the running time \(O^*\left( \sum _{i=1}^{\lfloor n/4\rfloor } \left( {\begin{array}{c}n\\ i\end{array}}\right) 3^{i/6}\right) =O(1.8370^n)\). Then, the main part of the algorithm computes the chromatic number of G by using the formula
for \(\chi (G)\ge 3\). This formula is justified by Fact 1 for \(m=\lfloor n/2\rfloor \). Grover’s search is used for finding S. For computing \(\chi (G[S])\) and \(\chi (G\setminus I\setminus S])\), the above formula is used again. Then, we need the chromatic numbers of subgraphs of G of size at most \(\lfloor n/4\rfloor \), which were precomputed and stored to QRAM. The running time of the main part of this quantum algorithm is
Quantum algorithm for Theorem 1 searches for all MISs of size t for each \(t\in \{1,2,\dotsc ,n\}\) separately. Therefore, the above estimate of the running time is larger than the actual running time since if MIS I of size t is chosen, the remaining graph \(G[V\setminus I]\) has only \(n-t\) vertices. Hence, the factor \(2^{n/2}\) in the above estimate can be replaced by \(2^{(n-t)/2}\). Then, precise analysis shows that the running time of the improved quantum algorithm is \(O(1.9140^n)\).
1.2.2 Quantum Algorithms for the Graph k-coloring Problem
We will derive classical algorithms that can be improved quadratically by Grover’s search. The ideas of the classical algorithms were obtained by Byskov [7]. In the classical algorithms, the graph \(k(\ge 4)\)-coloring problem is reduced to the graph \(k'\)-coloring problems for some \(k'<k\). A graph G is \(k(\ge 2)\)-colorable if and only if there exists a subset S of vertices such that G[S] is \(\lfloor k/2\rfloor \)-colorable and \(G[V\setminus S]\) is \(\lceil k/2\rceil \)-colorable. Let us consider a classical algorithm that simply searches for \(S\subseteq V\) satisfying the above condition. Let \(T_k(n)\) be the running time of this algorithm for the graph k-coloring problem. Then, \(T_k(n)\) satisfies
where polynomial factors in n are ignored. Then, we obtain \(T_4(n) = O^*(2^n)\), \(T_8(n)= O^*(3^n)\) and \(T_{16}(n)=O^*(4^n)\). Let us consider a quantum algorithm that uses Grover’s search for finding S. Let \(T_k^*(n)\) be the running time of the quantum algorithm. Then, it follows \(T_k^*(n) = \sum _{i=0}^n\sqrt{\left( {\begin{array}{c}n\\ i\end{array}}\right) }(T_{\lfloor k/2\rfloor }^*(i) + T_{\lceil k/2\rceil }^*(n-i))\), which implies \(T_k^*(n) = O^*(\sqrt{T_k(n)})\). Hence, we obtain \(T_4^*(n) = O(1.4143^n)\), \(T_8^*(n)=O(1.7321^n)\) and \(T_{16}^*(n)=O^*(2^n)\). This yields a weaker version of Theorem 2 that is valid for \(k\le 8\) rather than \(k\le 20\). Better reduction algorithms are used for Theorem 2.
1.3 Organization
In Sect. 2, notations and known classical and quantum algorithms are introduced. In Sect. 3, we present details of quantum algorithm for branching algorithms. In Sect. 4, we prove Theorem 1. In Sect. 5, we prove a weaker version of Theorem 2 that is valid for \(k\le 19\) rather than \(k\le 20\). Theorem 2 is obtained by improving the quantum algorithms in Sect. 5. The details of the proof of Theorem 2 are shown in Appendix B.
2 Preliminaries
2.1 Definitions and Notations
For a finite vertex set V, a set E of edges consists of subsets of V of size two. A pair (V, E) of finite vertex set V and a set E of edges is called an undirected simple graph. In this paper, we simply call a graph rather than an undirected simple graph. The number of vertices |V| is denoted by n. A mapping \(c:V \rightarrow \{1,2,\dotsc ,k\}\) is called k-coloring if \(c(v)\ne c(w)\) for all \(\{v,w\}\in E\). For a graph G, the smallest k such that there exists a k-coloring is called the chromatic number of G, and denoted by \(\chi (G)\). A subset \(I\subseteq V\) of vertices is called an independent set if \(\{v,w\}\notin E\) for all \(v, w\in I\). An independent set I is said to be maximal if there is no strict superset of I that is an independent set. A maximal independent set of size t is called t-MIS. For \(S\subseteq V\), G[S] denotes the induced subgraph \((S, \{\{v,w\}\in E\mid v, w\in S\})\) of G. Let \(h(\delta ) := -\delta \log \delta - (1-\delta )\log (1-\delta )\) for \(\delta \in [0,1]\) where \(0\log 0 = 0\). In this paper, the base of logarithm is 2. The notation \(g(n) = O^*(f(n))\) means that \(g(n) = O(n^cf(n))\) for some constant c. For \(O^*(\lambda ^n)\), we often round \(\lambda \) up to the fourth digit after the decimal point. In this case, we can use O() rather than \(O^*()\). For example, we often write \(g(n) = O(1.4143^n)\) rather than \(g(n) = O^*(2^{n/2})\). The notation \(g(n) = \widetilde{O}(f(n))\) means that \(g(n) = O((\log f(n))^c f(n))\) for some constant c.
2.2 Known Classical Algorithm for Enumerating all t-MISs
Byskov showed the following theorem.
Theorem 3
(Byskov [7]) The maximum number of t-MISs of n-vertex graphs is
Furthermore, there is a classical algorithm enumerating all t-MISs of an n-vertex graph in time \(O^*(I(n,t))\).
We can straightforwardly obtain the following lemma and corollary.
Lemma 1
For any constant \(\delta \in (0,1)\), \(I(n, \lfloor \delta n\rfloor )=O(2^{E(\delta )n})\) where
Here, \(E(\delta )\) is concave (and hence, continuous) and piecewise linear for \(\delta \in (0,1)\). The maximum of \(E(\delta )\) is given at \(\delta =1/3\).
Proof
It is easy to see that \(I(n, \lfloor \delta n\rfloor )=O(2^{E(\delta )n})\). If \(\lfloor \delta ^{-1}\rfloor \) in the definition of \(E(\delta )\) is replaced by \(\delta ^{-1}\), we obtain \(-\delta \log \delta \), which is obviously concave for \(\delta \in (0,1)\). Furthermore, \(E(\delta ) = -\delta \log \delta \) if \(\delta \) is an inverse integer. For \(\delta \in (1/(s+1), 1/s)\) where s is some positive integer, \(E(\delta )\) is a linear function since \(\lfloor \delta ^{-1}\rfloor \) is constant in this domain. Therefore, it is sufficient to show that \(E(\delta )\) is continuous at \(\delta =1/s\) for all \(s\in \mathbb {Z}_{\ge 1}\) for showing that \(E(\delta )\) is concave. Obviously, \(E(\delta )\) is left-continuous. At \(\delta =1/s\) for some positive integer s, \(E(\delta )\) is equal to \(-\delta \log \delta =(\log s) / s\) even if \(\lfloor \delta ^{-1}\rfloor =s\) is replaced by \(s-1\). This means that \(E(\delta )\) is right-continuous as well.
Finally, by comparing E(1/2), E(1/3) and E(1/4), it is shown that the maximum of \(E(\delta )\) is given at \(\delta =1/3\). \(\square \)
Corollary 1
For any \(a\in \mathbb {R}_{\ge 0}\) and \(t\in \mathbb {Z}_{\ge 3}\), the maximum of \(E(\delta ) - a \delta \) for \(\delta \in [1/t,1]\) is given at \(\delta =1/s\) for some \(s\in \{3,4,\dotsc ,t\}\).
2.3 Grover’s Search
Here, Grover’s search is briefly explained without introducing quantum circuit, unitary oracle, etc.
Theorem 4
(Grover [15], Boyer et al. [6]) Let \(A:\{1,2,\dotsc ,N\}\rightarrow \{0,1\}\) be a bounded-error quantum algorithm with running time T. Then, there is a bounded-error quantum algorithm computing \(\bigvee _{x\in \{1,\dotsc ,N\}} A(x)\) with running time \(\widetilde{O}(\sqrt{N}T)\). If it is guaranteed that either \(|A^{-1}(1)|\ge M\) or \(|A^{-1}(1)|=0\), then there is a bounded-error quantum algorithm with running time \(\widetilde{O}(\sqrt{N/M}T)\).
Theorem 5
(Dürr and Høyer [9]) Let \(A:\{1,2,\dotsc ,N\}\rightarrow \{1,2,\dotsc ,M\}\) be a bounded-error quantum algorithm with running time T. Then, there is a bounded-error quantum algorithm computing \(\min _{x\in \{1,\dotsc ,N\}} A(x)\) with running time \(\widetilde{O}(\sqrt{N}T)\).
2.4 QRAM
QRAM is the quantum analogue of RAM that can be accessed in a superposition [14]. QRAM has been used in many quantum algorithms [1]. RAM is the memory that can be accessed in constant or logarithmic time with respect to the memory size. For computing the minimum of some function f(x, W) for all \(x\in \{1,2,\dotsc ,N\}\) where W denotes a read-only RAM, we can replace RAM with QRAM and apply Grover’s search. Then, we obtain an \(\widetilde{O}(\sqrt{N}T)\)-time quantum algorithm computing \(\min _x f(x, W)\) where T denotes the running time for evaluating f.
3 Grover’s Search for Branching Algorithms
Fürer mentioned that Grover’s search can be applied to branching algorithms [12]. Since the details of the quantum algorithm were not explicitly described in [12], we will show the details in this section. A branching algorithm is an algorithm which recursively reduce a problem into some problems of smaller parameters. We now consider decision problems with \(\ell \) parameters \(n_1,n_2,\dotsc ,n_\ell \) that are non-negative integers. If the parameters are sufficiently small, we do not apply any branching rule and solve this problem in some way. For a problem P with parameters \(n_1,\dotsc ,n_\ell \) that are not sufficiently small, we choose a branching rule b(P) such that P is reduced to \(m_{b(P)}\) problems \(P_1,P_2\dotsc ,P_{m_{b(P)}}\) of the same class. Here, \(P_i\) has parameters \(f^{b(P),i}_1(n_1),\dotsc ,f^{b(P),i}_\ell (n_\ell )\) for some function \(f_j^{b(P),i}\) satisfying \(f_j^{b(P),i}(n_j)\le n_j\) for \(i=1,2,\dotsc ,m_{b(P)}\) and \(j=1,2,\dotsc ,\ell \). At least one of the parameters of \(P_i\) must be smaller than the same parameter of P for all \(i\in 1,2,\dotsc ,m_{b(P)}\). The solution of P is true if and only if at least one of the solutions of \(P_1,\dotsc ,P_{m_{b(P)}}\) is true. Hence, we will call this algorithm OR-branching algorithm. For a problem P of this class, we can consider a computation tree that represents the branchings of the reductions. The computation tree for P is a single node if P has sufficiently small parameters, so that no branching rule is performed, and is a rooted tree where children of the root node are the root nodes of the computation trees for \(P_1,P_2,\dotsc ,P_{m_{b(P)}}\) if some branching rule b(P) is applied to P. Let \(L(n_1,\dotsc ,n_\ell )\) be the maximum number of leaves of the computation tree for P with parameters \(n_1,\dotsc ,n_\ell \). Assume that the running time of the computation at a non-leaf node, including computations of b(P), \(P_i\), and \(f_j^{b(P),i}\), is polynomial with respect to \(n_1,\dotsc ,n_\ell \). Then, the total running time of the OR-branching algorithm is at most \(L(n_1,\dotsc ,n_\ell )(\mathrm {poly}(n_1,\dotsc ,n_\ell )+T)\) where T is the running time for the computation at a leaf node. We can apply Grover’s search to OR-branching algorithms if we have an upper bound of \(L(n_1,\dotsc ,n_\ell )\) with some properties, as shown in the following lemma.
Lemma 2
Let \(U(n_1,\dotsc ,n_\ell )\) be an upper bound of \(L(n_1,\dotsc ,n_\ell )\) that can be computed in polynomial time with respect to the parameters, and satisfies
for any branching rule b. Then, there is a bounded-error quantum algorithm with running time \(\sqrt{U(n_1,\dotsc ,n_\ell )}(\mathrm {poly}(n_1,\dotsc ,n_\ell )+T)\).
Proof
If we can assign an integer \(s\in \{1,2,\dotsc ,U(n_1,\dotsc ,n_\ell )\}\) to every leaf of the computation tree, and can compute the corresponding leaf from given s in polynomial time with respect to the parameters, then, we can apply Grover’s search for computing
where a(P) denotes the solution of a problem P and W(P) denotes the set of all problems corresponding to leaves of the computation tree for P. Then, we obtain a quantum algorithm with running time \(\sqrt{U(n_1,\dotsc ,n_\ell )}(\mathrm {poly}(n_1,\dotsc ,n_\ell )+T)\) as briefly mentioned in [12]. The algorithm computing the s-th leaf of a problem P is shown in Algorithm 1, which was omitted in [12]. We will show the validity of Algorithm 1.

Proposition 1
For any problem Q that corresponds to a leaf node of the computation tree of a problem P with parameters \(n_1,\dotsc ,n_\ell \), there exists \(s\in \{1,2,\dotsc ,U(n_1,\dotsc ,n_\ell )\}\) such that \(\textsc {Leaf}(P,s)=Q\).
Proof
The proof is an induction on the depth of the computation tree for P. If the computation tree for P consists of a single node, then Algorithm 1 returns P for any s. Since \(U(n_1,\dotsc ,n_\ell )\) is an upper bound of \(L(n_1,\dotsc ,n_\ell )\), it follows \(U(n_1,\dotsc ,n_\ell )\ge 1\), and hence, \(\{1,2,\dotsc ,U(n_1,\dotsc ,n_\ell )\}\) is non-empty. Assume that the proposition holds for any P with the computation tree of depth at most d. We will consider a problem P with computation tree of depth \(d+1\). Let i be the index of the branching at P that achieves Q. From the induction hypothesis, there exists \(s'\in \{1,\dotsc ,U(f_1^{b,i}(n_1),\dotsc ,f_\ell ^{b,i}(n_\ell ))\}\) such that \(\textsc {Leaf}(P_i, s')=Q\). Let \(s:=s'+\sum _{j=1}^{i-1} U(f_1^{b,j}(n_1),\dotsc ,f_\ell ^{b,j}(n_\ell ))\). Then, \(\textsc {Leaf}(P,s)=Q\). Here, \(s\le \sum _{j=1}^{m_{b}}U(f_1^{b,j}(n_1),\dotsc ,f_\ell ^{b,j}(n_\ell )) \le U(n_1,\dotsc ,n_\ell )\). \(\square \)
From Proposition 1 and a fact that \(\textsc {Leaf}(P,s)\) always returns a problem corresponding to one of the leaf nodes for P, we obtain
Since the depth of the computation tree for P is at most \(\sum _{j=1}^\ell n_j\), the running time of \(\textsc {Leaf}(P,s)\) is polynomial with respect to the parameters. We have assumed that there is a quantum algorithm computing a(Q) with running time T for \(Q\in W(P)\). Hence, there is a quantum algorithm computing \(a(\textsc {Leaf}(P, s))\) for given \(s\in \{1,\dotsc ,U(n_1,\dotsc ,n_\ell )\}\) with running time \(\mathrm {poly}(n_1,\dotsc ,n_\ell )+T\). By using the quantum algorithm computing \(a(\textsc {Leaf}(P, s))\) as the oracle, Grover’s search computes a(P) with running time \(\sqrt{U(n_1,\dotsc ,n_\ell )}(\mathrm {poly}(n_1,\dotsc ,n_\ell )+T)\). \(\square \)
For a problem P whose solution is an integer, we can also consider a branching algorithm satisfying \(a(P) = \min _{i=1}^{m_{b(P)}} a(P_i)\) for children \(P_1,\dotsc ,P_{m_{b(p)}}\) of P. In this case, we will call this algorithm MIN-branching algorithm. Similarly to OR-branching algorithm, we can apply Grover’s search to MIN-branching algorithm from Theorem 5.
In this paper, we apply Lemma 2 to Byskov’s algorithm in Theorem 3. Byskov showed the upper bound I(n, t) satisfying the conditions in Lemma 2 for the branching algorithm with two parameters n and t [7, Theorem 2]. Hence, we can apply Grover’s search to Byskov’s algorithm in Theorem 3. For example, since \(\sum _{t=1}^n I(n,t) = O^*(3^{n/3})\), there is a bounded-error quantum algorithm searching for all MISs in time \(O^*(3^{n/6})\).
4 Quantum Algorithms for the Chromatic Number Problem
The overview of the quantum algorithm was described in Sect. 1.2.1. The quantum algorithm for Theorem 1 is shown in Algorithm 2.

For computing the chromatic number of G[S], when MIS I of size t is chosen, we have to chose \(T\subseteq S\setminus I\) satisfying \(|T|\le |S|/2\) and \(|S\setminus I\setminus T|\le |S|/2\) as mentioned in Sect. 1.2.1. This implies the condition \(|S|/2 - t \le |T|\le |S|/2\). Hence, Algorithm 2 computes the chromatic number correctly. By analyzing the running time of Algorithm 2, we obtain the following theorem.
Theorem 6
Algorithm 2 computes the chromatic number of an n-vertex graph with running time \(O^*\left( (2^{37/35}3^{3/7}5^{-9/70}7^{-5/28})^n\right) =O(1.9140^n)\) with bounded error probability.
Proof
The running time of the precomputation is \(O^*\left( \sum _{i=1}^{\lfloor n/4\rfloor } \left( {\begin{array}{c}n\\ i\end{array}}\right) 3^{i/6}\right) =O^*\bigl (2^{h(1/4)n}3^{n/24}\bigr ) =O(1.8370^n)\). Let \(T_1(n)\) be the running time of \(\textsc {CHR1}(V)\) and \(T_2(m)\) be the running time of \(\textsc {CHR2}(S)\) for \(S\subseteq V\) of size m. Then, we obtain
by ignoring polynomial factors in n. Here, \(T_2(m) \le \sum _{t=1}^m\sqrt{I(m,t)}2^{\frac{m-t}{2}}\) whose exponent is equal to \(\max _{\delta \in [0,1]} \left\{ (E(\delta ) + (1-\delta ))/2\right\} \). From Corollary 1, it is sufficient to take maximum among \(\delta \) being an inverse integer. Numerical calculation shows that the maximum is given at \(\delta =1/5\) and hence \(T_2(m) = O^*(80^{m/10})=O(1.5500^m)\). Hence, the exponent of \(T_1(n)\) is equal to
Here, we only consider maximum for \(t\le n/3\) since I(n, t) is decreasing with respect to t for \(t\ge n/3\), and the other part \(\sum _s \sqrt{\left( {\begin{array}{c}n-t\\ s\end{array}}\right) }T_2(s)\) in (3) is also decreasing with respect to t. Numerical calculation shows that the maximum is given at \(\delta =1/7, \lambda =1/2\). Hence, we obtain
\(\square \)
Careful readers may notice that the running times of the precomputation and the main computation are not balanced. If the quantum algorithm precomputes the chromatic numbers of induced subgraphs with size at most \((1/4+\epsilon )n\) for some \(\epsilon >0\), the precomputation and the main computation require more and less running time, respectively (we can use Fact 1 for unbalanced m). At first glance, it might be possible to improve the running time by optimizing \(\epsilon \) such that the both running time are balanced. Indeed, this idea improved the running time of the quantum algorithm for TSP [1], but does not improve the running time of Algorithm 2. Equation (2) is dominated by \(t=m/5\) and \(s=(2/5)m\). Equation (3) is dominated by \(t=n/7\) and \(s=n/2\). In order to exclude \(s=(2/5)n\) in the summation in (2), the chromatic number of induced subgraph with size at most (3/10)n must be precomputed. However, the running time of the precomputation in this case is \(\sum _{i=1}^{(3/10)n}\left( {\begin{array}{c}n\\ i\end{array}}\right) 3^{i/6}=\varOmega (1.9460^n)\). Hence, the running time of quantum algorithm is not improved.
5 Quantum Algorithms Not Using QRAM
5.1 Known Classical Algorithms for k-coloring Problem
Beigel and Eppstein showed the fastest known classical algorithm for the graph 3-coloring problem.
Theorem 7
(Beigel and Eppstein [2]) There is a classical algorithm for the graph 3-coloring problem with running time \(O^*((2^{3/49}3^{4/49}\varLambda ^{24/49})^n)=O(1.3289^n)\) where \(\varLambda \) denotes the unique real positive root of \(x^5-2x-2\).
For larger k, Byskov showed reduction algorithms from the graph k-coloring problem to the graph 3-coloring problem [7]. Since a graph G is k-colorable if and only if there exists an MIS I of size at least \(\lceil n/k\rceil \) such that \(G[V\setminus I]\) is \((k-1)\)-colorable, we obtain the following reduction algorithm.
Reduction algorithm 1
(Byskov [7], Lawler [17]) For each \(t\in \{\lceil n/k\rceil , \lceil n/k\rceil +1,\dotsc , n\}\), enumerate all t-MISs. For each t-MIS I, the algorithm for the graph \((k-1)\)-coloring is performed to \(G[V\setminus I]\).
Let \(T_k^{(1)}(n)\) be the running time of an algorithm for the graph k-coloring problem using Reduction Algorithm 1. Then, it satisfies
for \(k\ge 4\) by ignoring a polynomial factor. By using Reduction Algorithm 1 and Theorem 7, Byskov obtained algorithms for the graph 4- and 5-coloring problems with running time \(O(1.7504^n)\) and \(O(2.1592^n)\), respectively. Byskov also introduced another reduction algorithm. Here, we introduce it in a general form. Since a graph G is k-colorable if and only if there exists a subset S of vertices of size at least \(\lceil n k' / k\rceil \) such that G[S] is \(k'\)-colorable and \(G[V\setminus S]\) is \((k-k')\)-colorable for arbitrary \(k'< k\), we obtain the following reduction algorithm.
Reduction algorithm 2
(Byskov [7], Lawler [17]) Fix \(k'\in \{2,3,\dotsc ,\lfloor k/2\rfloor \}\). For each \(t\in \{\lceil nk'/k\rceil , \lceil nk'/k\rceil + 1, \dotsc ,n\}\), enumerate all subsets of vertices of size t. For each subset S of vertices of size t, the algorithms for the graph \(k'\)- and \((k-k')\)-coloring problems are performed to G[S] and \(G[V\setminus S]\), respectively.
Let \(T_k^{(2)}(n)\) be the running time of an algorithm for the graph k-coloring problem using Reduction Algorithm 2. Then, it satisfies
for \(k\ge 4\) by ignoring a polynomial factor. Reduction Algorithm 2 is a simple generalization of a reduction algorithm in [7]. For \(k=6\), Reduction Algorithm 2 with \(k'=3\) gives \(T_6^{(2)}(n)=O(2.3289^n)\) while \(T_6^{(1)}(n)=O(2.5602^n)\) [7]. Byskov did not consider classical algorithms for the graph \(k(\ge 7)\)-coloring problem since the classical algorithms obtained by Reduction Algorithms 1 and 2 are slower than the fastest classical algorithm computing the chromatic number at that time with running time \(O(2.4023^n)\) [7].
5.2 Quantum Algorithms Not Using QRAM
In this section, we present quantum algorithms not using QRAM, and prove a weaker version of Theorem 2 that is valid for \(k\le 19\) rather than \(k\le 20\). Theorem 2 is obtained by improving quantum algorithms presented in this section. The improved quantum algorithm and the proof of Theorem 2 are shown in Appendix B.
Fürer mentioned that Grover’s search can be applied to Beigel and Eppstein’s algorithm.
Lemma 3
(Fürer [12]) There is a bounded-error quantum algorithm not using QRAM for the graph 3-coloring problem with running time \(O^*((2^{3/49}3^{4/49}\varLambda ^{24/49})^{n/2})=O(1.1528^n)\) where \(\varLambda \) denotes the unique real positive root of \(x^5-2x-2\).
The quantum algorithm in Lemma 3 is obtained by application of Lemma 2 to classical Beigel and Eppstein’s algorithm in Theorem 7. On the other hand, Beigel and Eppstein also showed a very simple randomized algorithm for the graph 3-coloring problem with running time \(O^*(2^{n/2})\) [2, Corollary 1]. This randomized algorithm searches for one of the \(2^{n/2}\) solutions from \(2^n\) leaves in a quaternary computation tree of depth n/2. From Theorem 4, we can apply Grover’s search to the randomized algorithm and obtain a quantum algorithm with running time \(O^*(2^{n/4})\). The quantum algorithms for Theorem 2 reduce the graph k-coloring problems to the graph 3-coloring problem. Theorem 2 can be obtained even if this simpler quantum 3-coloring algorithm is used in place of the involved quantum 3-coloring algorithm in Lemma 3 although the exponents increase. By applying Reduction Algorithms 1 and 2 boosted by Grover’s search, the following Theorem is obtained.
Theorem 8
Assume that there is a polynomial-space bounded-error quantum algorithm not using QRAM for the graph 3-coloring problem with running time \(O^*(2^{f^*_3 n})\) for some \(f_3^*\). Then, there is a polynomial-space bounded-error quantum algorithm not using QRAM for the graph k-coloring problem with running time \(O^*(2^{f^*_k n})\) where
for \(k\ge 4\).
Proof
We consider a quantum algorithm using Reduction Algorithms 1 and 2 with Grover’s search. Since we can apply Lemma 2 to Byskov’s enumeration algorithm of t-MIS in Reduction Algorithm 1, we obtain
For Reduction Algorithm 2, we can simply apply Grover’s search, and obtain
for any \(k'\in \{2,\dotsc ,\lfloor k/2\rfloor \}\). Hence, by choosing the best reduction algorithm, we obtain quantum algorithms with running time \(O^*(2^{F^*_k n})\) where \(F^*_3=f^*_3\) and
for \(k\ge 4\). Since \(E(\delta )\) is decreasing for \(\delta \ge 1/3\), we can assume that \(\delta \le 1/3\). From Corollary 1, it is sufficient to take maximum among \(\delta =1/s\) for \(s\in \{3,4,\dotsc ,k\}\). This proves \(F^*_k = f^*_k\). \(\square \)
By using Theorem 8 with \(f^*_3 = (3 + 4\log 3 + 24 \log \varLambda )/98\le 0.2051\) or \(f^*_3 = 1/4\), we obtain Theorem 2 for \(k\le 19\). In Table 2 in Appendix A, the values of \(f^*_k\) and best choices of \(k'\) are shown for \(f^*_3 = (3 + 4\log 3 + 24 \log \varLambda )/98\). Here, we summarize the quantum algorithm.

It is easy to calculate the exponents \(f^*_k\) efficiently and precisely. The details are explained in Appendix A. Note that if Grover’s search is not used in Algorithm 3, we obtain classical algorithms with running time \(O^*(4^{f^*_kn})\). We will obtain Theorem 2 by improving Algorithm 3. When Reduction Algorithm 2 is applied, we can assume that \(k-k'\) independent sets in \(G[V\setminus S]\) are smaller than \(k'\) independent sets in G[S]. Hence, we can use the average size \(|S|/k'\) of \(k'\) independent sets in G[S] as an upper bound on the size of independent sets in \(G[V\setminus S]\). This idea reduces the running time of Algorithm 3 and gives Theorem 2. The details are shown in Appendix B.
Notes
In this paper, \(O^*(f(n))\) means \(O(\mathrm {poly}(n)f(n))\).
References
Ambainis, A., Balodis, K., Iraids, J., Kokainis, M., Prūsis, K., Vihrovs, J.: Quantum speedups for exponential-time dynamic programming algorithms. In: Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’19), pp. 1783–1793. SIAM (2019)
Beigel, R., Eppstein, D.: 3-coloring in time \(O(1.3289^n)\). J. Algorithms 54(2), 168–204 (2005)
Björklund, A., Husfeldt, T.: Inclusion-exclusion algorithms for counting set partitions. In: Proceedings of the Forty-Seventh Annual IEEE Symposium on Foundations of Computer Science (FOCS’06), pp. 575–582. IEEE (2006)
Björklund, A., Husfeldt, T.: Exact algorithms for exact satisfiability and number of perfect matchings. Algorithmica 52(2), 226–249 (2008)
Björklund, A., Husfeldt, T., Koivisto, M.: Set partitioning via inclusion-exclusion. SIAM J. Comput. 39(2), 546–563 (2009)
Boyer, M., Brassard, G., Høyer, P., Tapp, A.: Tight bounds on quantum searching. Fortschritte der Physik: Prog. Phys. 46(4–5), 493–505 (1998)
Byskov, J.M.: Enumerating maximal independent sets with applications to graph colouring. Oper. Res. Lett. 32(6), 547–556 (2004)
Cygan, M., Dell, H., Lokshtanov, D., Marx, D., Nederlof, J., Okamoto, Y., Paturi, R., Saurabh, S., Wahlström, M.: On problems as hard as CNF-SAT. ACM Trans. Algorithms 12(3), 41 (2016)
Dürr, C., Høyer, P.: A quantum algorithm for finding the minimum. arXiv preprint arXiv:quant-ph/9607014 (1996)
Fomin, F.V., Gaspers, S., Saurabh, S.: Improved exact algorithms for counting 3-and 4-colorings. In: Proceedings of the Thirteenth Annual International Computing and Combinatorics Conference (COCOON’07), pp. 65–74. Springer (2007)
Fomin, F.V., Kratsch, D.: Exact Exponential Algorithms. Springer, Berlin (2010)
Fürer, M.: Solving NP-complete problems with quantum search. In: Latin American Symposium on Theoretical Informatics (LATIN’08), pp. 784–792. Springer (2008)
Gaspers, S., Lee, E.J.: Faster graph coloring in polynomial space. In: Proceedings of the Twenty-third Annual International Computing and Combinatorics Conference (COCOON’17), pp. 371–383. Springer (2017)
Giovannetti, V., Lloyd, S., Maccone, L.: Quantum random access memory. Phys. Rev. Lett. 100(16), 160501 (2008)
Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the Twenty-eighth Annual ACM Symposium on Theory of Computing (STOC’96), pp. 212–219. ACM (1996)
Koivisto, M.: An \(O^*(2^{n})\) algorithm for graph coloring and other partitioning problems via inclusion–exclusion. In: Proceedings of the Forty-seventh Annual IEEE Symposium on Foundations of Computer Science (FOCS’06), pp. 583–590. IEEE (2006)
Lawler, E.L.: A note on the complexity of the chromatic number problem. Inf. Proc. Lett. 5, 66–67 (1976)
Acknowledgements
This work was supported by JST PRESTO Grant Number JPMJPR1867 and JSPS KAKENHI Grant Numbers JP17K17711, JP18H04090, JP20H04138 and JP20H05966. The authors thank François Le Gall for the insightful comments.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Calculations of the Exponents \(f^*_k\)
Here, we consider calculations of the exponents \(f^*_k\). The details of the numerical calculations were not written in [1]. Fortunately, the calculation of \(f^*_k\) is not difficult. The non-trivial part is the calculation of
In general, the sum of the binary entropy function and a linear function is a concave function. Hence, it is sufficient to find a stationary point \(\delta ^*\). For maximizing \(h(\delta )/2+\delta f^*_{k'}\), we need to find \(\delta ^*\in [0, 1]\) such that
Since the left-hand side is monotonically decreasing, \(\delta ^*\) can be approximated efficiently by the binary search. If \(\delta ^*< k'/k\), then \(\delta =k'/k\) gives the maximum. The precise values of \(f^*_k\) computed by the above algorithm and chosen \(k'\) are shown in Table 2. Here, \(k'=1\) means that Reduction Algorithm 1 is chosen.
Improved Quantum Algorithm for k-coloring Problems Not Using QRAM
Theorem 9
Assume that there is a polynomial-space bounded-error quantum algorithm not using QRAM for the graph 3-coloring problem with running time \(O^*(2^{f^*_3 n})\) for some \(f_3^*\). Then, there is a polynomial-space bounded-error quantum algorithm not using QRAM for the graph k-coloring problem with running time \(O^*(2^{d^*_k(1) n})\) where \(d^*_3(\mu ):=f_3^*\) for all \(\mu \in [1/3,1]\) and
for \(k\ge 4\) and \(\mu \in [1/k,1]\).
Proof
The quantum algorithms are almost the same as those in Theorem 8. When we apply Reduction Algorithm 2, we check for all subsets S of vertices of size t whether G[S] is \(k'\)-colorable and \(G[V\setminus S]\) is \((k-k')\)-colorable. Since we assume that S consists of \(k'\) largest independent sets in a coloring, we can safely assume that \(|S|\ge \lceil nk'/k\rceil \). At the same time, we can assume that \(k-k'\) independent sets in a coloring of \(G[V\setminus S]\) have size at most \(\lfloor |S|/k'\rfloor \), which is the average size of independent sets in a coloring of G[S]. This knowledge can be used for reducing the running time of quantum algorithms. We can consider a partial function that outputs true if the given graph can be partitioned into k independent sets of size at most u, outputs false if the given graph is not k-colorable, and outputs either of true or false for other cases. For computing this partial function, we can restrict the size of S in Reduction Algorithm 2. Since we only have to consider independent sets of size at most u, we can assume that |S| is at most \(uk'\) and at least \(n-u(k-k')\). We can assume that u is at least \(\lceil n/k\rceil \) since otherwise there is no solution. Then, \(\lceil nk'/k\rceil \ge n-u(k-k')\). Hence, we can assume that |S| is at least \(\lceil nk'/k\rceil \) and at most \(\min \{n,uk'\}\). Let \(T_k^*(n, u)\) denote the running time of the quantum algorithm. Then, we obtain
for any \(k'\in \{2,3,\dotsc ,k\}\). Note that in Reduction Algorithm 1, we cannot assume that enumerated MIS has size at most u since the size of MIS is not restricted. On the other hand, \(T_{k-1}^*(n-t,n-t)\) in the first inequality can be replaced by \(T_{k-1}^*(n-t, \min \{t,u\})\). However, we do not apply this improvement since numerical calculation show that this does not improve the exponents of running time for \(k\in \{3,4,\dotsc ,21\}\setminus \{13\}\). By choosing the best reduction algorithms, we obtain \(T^*_k(n,\lfloor \mu n\rfloor )=O^*(2^{d^*_k(\mu )n})\). \(\square \)
By using Theorem 9 with \(f^*_3 = (3 + 4\log 3 + 24 \log \varLambda )/98 \text { or } 1/4\), we obtain Theorem 2. Table 1 shows the values of \(d^*_k(1)\). Here, \(k'\) may depend on u. However, even if \(k'\) is determined only by k, the same exponents are obtained. Chosen \(k'\)s are the same as those in Table 2 except for \(k'=7\) for \(k=17\). Here, we summarize the quantum algorithm.

The details of numerical calculation of \(d^*_k(1)\) and their precise values are shown in Appendix C. Finally, we introduce our ideas that failed to improve the running time. Similarly to Theorem 9, we can assume that in Reduction Algorithm 2, the size of independent sets in a coloring of G[S] is lower bounded by \((n-t)/(k-k')\), which is the average size of independent sets in \(G[V\setminus S]\). However, this idea could not improve the exponents in our numerical calculations. We also tried to use hybrid algorithms of Reduction Algorithms 1 and 2. We introduce a threshold s of size of independent sets. Then, Reduction Algorithms 1 and 2 are both applied on the assumptions that the size of the largest independent set in a coloring is at least \(s+1\) and at most s, respectively. The threshold s is optimized so that the running time of Reduction algorithms are balanced. This algorithm failed to improve the running time as well.
Calculations of the Exponents \(d^*_k(\mu )\)
It is much more difficult to calculate \(d^*_k(1)\) than \(f^*_k\). The non-trivial part is the calculations of
In the numerical calculations, the maximum for \(\delta \) is taken for all \(\delta \in \{1/2^{16}, 2/2^{16},\dotsc , 2^{16}/2^{16}\}\). Computed \(d^*_k(\mu )\) is cached and reused. Then, we obtain \(d^*_k(1)\) in Table 1.
As another heuristic way, we assume that for each \(k'\), the functions \(h(\delta )/2 + \delta d^*_{k'}(\min \{1,\,\mu /\delta \})\) and \(h(\delta )/2 + (1-\delta )d^*_{k-k'}(\min \{1,\,\delta /(k'(1-\delta ))\})\) are unimodal, i.e., functions with a single maximal. On this assumption, we can apply the golden-section search for finding the maximum efficiently. Obtained approximations of \(d^*_k(1)\) are very close to those calculated by the first method. Hence, we believe that the golden-section search gives very precise approximations of \(d^*_k(1)\), which are shown in Table 3.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Shimizu, K., Mori, R. Exponential-Time Quantum Algorithms for Graph Coloring Problems. Algorithmica 84, 3603–3621 (2022). https://doi.org/10.1007/s00453-022-00976-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-022-00976-2