Quantum Search Algorithm for Weighted Solutions

This paper presents a quantum search algorithm (QSA) for weighted solutions. In a QSA, the final quantum state has an equal probability of solutions. However, solutions should have different probabilities in specific problems, such as dynamic spectrum management (DSM). We propose a method to make differences with probability in accordance with rewards for each solution, and present an application to DSM. The proposed algorithm has some error terms for the final quantum state, and we provide the error terms in accordance with the number of iterations. In addition, we present the simulation results of the proposed algorithm compared with a classical exact algorithm and QSA. The proposed algorithm has a lower complexity and relative difference than the classical exact algorithm. Furthermore, the proposed algorithm has a higher performance than the QSA in specific cases.


I. INTRODUCTION
Quantum computation has the advantage of having a lower complexity than classical computation in many algorithms [1]- [6]. In particular, Grover's quantum search algorithm (QSA) solves a data-searching problem with quadratic speed-up [5]. Given a search space with a size of N , the QSA finds the desired data with complexity O( √ N ), which is much less than that of the classical random search O(N ). After Grover had suggested the QSA, many improved quantum search algorithms have been proposed. Boyer-Brassard-Høyer-Tapp presented a tight bound of QSA and a method that solve the problem having unknown number of solutions [7]. Dürr and Høyer proposed a quantum minimum search algorithm [8]. Dürr-Høyer algorithm can find a minimum value through higher complexity rather than QSA. Hogg presented a heuristic algorithm for quantum method [9]. The quantum heuristic algorithm can solve a satisfiability problem with lower complexity than QSA. Fabrikant and Hogg presented the quantum heuristic algorithm for a graph coloring problem (GCP) [10]. In practice, QSA can be applied to a resource assignment problem such as the GCP [11].
The associate editor coordinating the review of this manuscript and approving it for publication was Ding Xu .
A GCP is a coloring vertex that is connected by an edge with different colors in a graph where multiple vertices are drawn (called ''interference condition''). We can describe the problem mathematically using graph theory, and find all possible color assignments that satisfy the given conditions using a search algorithm. Therefore, several studies have been conducted to address the resource assignment problem in communication systems where interference conditions exist by converting the assignment problem to GCP [12]- [14]. If two objects interfere with each other, these objects are denoted by two vertices connected by an edge. We can also find an assignment combination that maximizes the communication gain by adding rewards for each resource usage. Once we describe the system in graph theory, we can use a search algorithm in the same manner as GCP. This paper proposes a QSA that considers the sum of rewards of each solution, such that it can be used in GCPs with rewards.
The method of applying QSA to GCP and the implementation of corresponding gate-level circuits have been proposed in various ways. Since [11] reported that QSA is a faster solution for NP-complete problems such as GCP, [15] and [16] expressed vertices and available colors as qubits in the ternary domain, and they proposed a method of synthesizing the oracle, which marks states that satisfy interference conditions, as well as an amplification operator. In addition, [17] VOLUME 10,2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ addressed qubits in the binary domain and its oracle, while analyzing the cost of fault tolerance of the oracle. In prior studies, if the number of solutions is greater than one, all solution states have the same probability. Thus, when we consider the sum of the rewards of each solution, the QSA does not reflect rewards. However, we introduce the conditioned oracle and phase inversion in Section III to increase the probability according to the sum of rewards. In addition, we propose procedures ranging from receiving the reward matrix (whose elements can be a real value) to entering values into the conditioned oracle. To maximize the probabilities of solutions, the upper and lower bounds on the number of iterations i of the process from the conditioned oracle to phase inversion are derived mathematically. Let N v be the number of vertices and N c be the number of colors; then, we reduce the complexity of the proposed algorithm from O( where N = N c N v using the W-state in [18]. Therefore, we propose a QSA that solves GCP by considering rewards (called ''Reward-GCP''). The simulation results also demonstrate the performance of the proposed algorithm. When comparing the proposed algorithm with the classical algorithm, we calculated the complexity to find the solution with the maximum reward from the result. It can be seen that the proposed algorithm has a lower complexity than the classical exact algorithm. In addition, when setting the classical exact algorithm and the proposed algorithm to the same complexity √ N , the expected reward of the proposed algorithm is much higher. Furthermore, we compared the relative difference of the proposed algorithm and QSA.

II. PRELIMINARIES
In this section, we review dynamic spectrum management (DSM) using graph coloring problem (GCP) and quantum search algorithm (QSA) and present a method for the application of QSA to GCP.

A. DYNAMIC SPECTRUM MANAGEMENT (DSM)
In addition to 5G, there is the need for a technology that increases the data rate and manages a large number of users in a 6G network. Thus, a method for efficiently sharing idle resources of cognitive radio (CR) networks while preventing interference between adjacent users is being considered [19], [20]. In addition, the application of spectrum sharing to achieve the efficient utilization of limited spectrum resources has been consistently mentioned [21].
The CR network is an intelligent multi-user spectrum sharing technique that assigns an idle spectrum to a cognitive user (CU, or a secondary user). However, a primary user (PU), who is an original user who owns the spectrum in the primary network, is assigned to use a particular spectrum band by a communication service provider, while having priority over the CU. In this case, a spectrum hole refers to a spectrum band that is assigned to the PU, but which is not being utilized by its owner temporally or geographically. The CU shares the spectrum with the PU while detecting the spectrum hole The DSM technique proposes a spectrum assignment scheme that considers the reward in a CR network. First, spectrum holes are activated and rewards that CR links can obtain from each spectrum are obtained. Then, the spectrum holes are dynamically assigned to CR links in an efficient manner to maximize the reward of the CR network. Therefore, the purpose of DSM is to find the optimal solution that satisfies interference conditions while considering the reward, and many previous studies have focused on developing a method to find the optimal solution quickly and accurately. This paper describes the status of CR networks in graph theory and solving the resource assignment problem using GCP. DSM is converted to GCP, and a search algorithm is used to find solutions. GCP is a problem of painting vertices in some colors, but adjacent vertices connected by edges must be painted in different colors. In this problem, the number of available colors can be determined in advance and it can be extended to a problem in which rewards vary depending on the color assigned to each vertex. Each component of the DSM and its corresponding component of the GCP are shown in Table 2, and the solutions of the DSM will be color-assigned combinations of GCP [13]. Fig. 1 shows an example of converting DSM to GCP in an arbitrary CR network. Details of the GCP and search algorithms are described in the next section.

B. GRAPH-COLORING PROBLEM (GCP)
Graph G consists of sets of N v vertices, V, and N e edges, E, which describe a graph using the notation G = (V, E). In this paper, we define GCP as a problem coloring all vertices with N c colors so that two vertices connected by one edge(called the ''adjacent vertices'') are assigned different colors(called ''interference condition''). We can also define a solution for the graph. Let S t (v i ) be a set of v i 's colors in the t-th solution. Then, the graph is expressed as where i, j = 1, . . . , N v . In addition, t = 1, . . . , m and m is the number of solutions. The t-th solution, S t , of graph G consists of N v sets, that is, The problem of assigning one color to one vertex is called a single coloring problem (SCP) where S t satisfies the following equation.
If any vertex should be assigned more than one color, we call this problem a multi-coloring problem (MCP). When we define a weight W(v i ) as the number of colors to assign a vertex v i ∈ V, SCP is the case where W(v i ) = 1, ∀v i ∈ V. However, the problem of assigning several colors to one vertex is called MCP where W(v i ) ∈ {1, 2, . . .} ∀v i ∈ V. In addition, there should be no colors in common at adjacent vertices. Thus, S t in the MCP satisfies (1) and (3).
Let a clique be a subset of G in which all vertices are mutually adjacent. Any MCP can be converted into SCP by replacing a vertex with W(v i ) > 1 with a clique of size W(v i ) [22].
Meanwhile, it is possible to establish lower bounds on N c using a theorem such as Hoffman's bound (1970). In this case, the minimum number of colors required to color graph G is denoted by N chr , and is called a chromatic number. In other cases, N c is already determined to be a condition of the problem. A basic assumption in this study is that N c is fixed as a condition of the GCP. Thus, we will discuss the GCP with the interference condition and a fixed value, N c .
Using graph theory described in this paper, the following example is available: Fig. 2 shows an example of a 3-coloring problem with three vertices that are fully connected and that use only three colors. Using (1), Fig. 2 can be expressed as We can intuitively find a set of solution for this simple graph.   However, it is difficult to obtain a solution intuitively in more complex graphs with more vertices and edges. Thus, various search algorithms have been proposed to find solutions of the GCP that satisfy interference conditions with a fixed N c . An exact algorithm always returns the best solutions(or optimal solutions) in the problem of finding feasible combinations. The best solutions are all color-assigned combinations that satisfy all edge conditions and use the minimum number of colors, N chr . Although N c is not equal to N chr and may be greater than N chr , exact algorithms can always find solutions. Therefore, the running time for exact algorithms increases as the number of vertices or colors increases. Some exact algorithms for finding the best solutions are described as follows: Exhaustive search(brute-force search): An exhaustive search is an enumeration method for GCP. It considers N c N v assignments (candidate solutions) on N v vertices and checks whether each assignment is legitimate. The algorithm then returns the best solutions using the fewest colors. A simple algorithm for Fig. 2 is shown in Fig. 3.
Backtracking algorithm: The backtracking algorithm gradually generates feasible solutions by checking the relevant edge conditions at each step. In the forward step, the algorithm assigns colors to vertices in a predefined order until a vertex cannot be colored with one of N c colors. In the backward step, the algorithm searches backward and identifies a colored vertex that can be colored with different colors. Then, the forward step resumes at this point, and the algorithm repeats these steps until we return to the root vertex v 1 in a backward step or reach a user-defined time limit. A simple algorithm for Fig. 2 is shown in Fig. 4.
So far, we have described GCP, where the number of available colors is predetermined, and the interference condition in (1) is satisfied. In this case, all solutions from the exact algorithm are equally significant. However, we can extend the GCP to a problem that considers a reward for each color of a vertex. The reward represents the gain obtained when a vertex is assigned a specific color, and has a non-negative value. Each solution has a different significance with respect to the reward.
Let r be a reward matrix and r ij be an element of r where i = 1, . . . , N v and j = 1, . . . , N c . The element r ij represents the gain obtained when color j is assigned to vertex v i , that is, The reward of the entire system can be defined as follows: where S t (v i ) = c j . We can find a specific solution based on the reward value among the solution set, S t . Thus, when we consider colors as active resources and vertices as objects to be assigned, many resource assignment problems can be converted to GCP, and the reward is defined as the gain from each resource. Therefore, it is possible to define Reward-GCP that finds a solution that maximizes the sum of rewards while satisfying the following conditions.
Condition 2: The number of available colors, N c is predetermined.
Condition 3: The non-negative reward, r ij , is the gain obtained when the vertex v i is assigned to the color c j , associated with (6).
The reward-GCP model is commonly used to solve the resource assignment problem of communication because clear factors are used as gains in the communication environment. Specific situations of the application of the reward-GCP to the communication system are described in Section IV. Table 3 summarizes parameters that are used to describe GCP in this paper.

C. QUANTUM SEARCH ALGORITHM (QSA) 1) GROVER's QUANTUM SEARCH ALGORITHM
Given a Boolean function f : X → {0, 1}, we can find x ∈ X such that f (x) = 1 using a QSA. Let S f be a conditional phase inversion operator defined by Assume that the space of X is N = 2 n . There are m solutions in X . The index j ∈ X can be described in the range 0 to N − 1.
QSA can be summarized in five steps: initialization, oracle, amplitude amplification, iteration, and measurement. During initialization, we can transform |0 to |ψ using the Hadamard gate: where |α and |β are defined as a non-solution and solution quantum state, respectively, and sin θ = √ m/N . We use the Hadamard gate for convenience, but any unitary transformation can be used [23].
In the oracle, S f is applied to |ψ . It transforms |ψ into ψ as follows: Subsequently, we use −HS 0 H † to amplify the probability of the solution quantum state in amplitude amplification. Operator S 0 is also expressed as S 0 = I − 2|0 0|. Now we can define Grover's operator as a unitary transformation Hereafter, we focus on changes in |α and |β . First, we consider Q |α .
This can be summarized by (14).
Finally, we obtain the result of implementing Grover's operator.
Consequently, the Q operator rotates |α and |β about 2θ to positive side. When we apply Q to |ψ i times, we get The QSA process is described in Fig. 5. If we know the value of m, we can compute the appropriate number of i. The value of i can be computed using the equation such that the probability of the solutions is close to 1.
With the property of the sinusoid, θ approximates sin θ = √ m/N on a large scale of N . That is, Finally, the state |ψ i is measured and yields a specific index χ. If the index χ satisfies f (χ) = 1, the algorithm succeeds. When the outcome of a measurement is not the solution, we restart QSA. In this case, the complexity of QSA is O( √ N /m), as obtained by (19).

2) BOYER-BRASSARD-Høyer-TAPP QUANTUM SEARCH ALGORITHM
In QSA, to succeed with certainty, we should know the value of m for the computation of the exact value of i. If the exact value of i is unknown, QSA has a probability of failure. When m is unknown, we iterate the algorithm using a method presented by Boyer et al. [7]. First, initialize j = 1 and set λ = 8/7, which is any value strictly between 1 and 4/3. Then, an integer i is chosen randomly such that 0 ≤ i < j, and apply i iteration times are applied in QSA. Finally, if a solution is not obtained, we set j to min(λj, √ N ) and return to the step choosing i.

3) Dürr-Høyer QUANTUM SEARCH ALGORITHM
When we find a minimum value among T [0, · · · , N − 1], we can use Dürr-Høyer quantum search algorithm [8]. First, we choose a threshold index y uniformly random such that Afterward, we use the method in Section II-C2, and earn a measurement outcome y . If T [y ] < T [y], we set the threshold index y to y and return to the step setting x. Finally, when the total running time is more than 22.5 √ N , the algorithm ends.

D. QUANTUM METHOD FOR GCP
The quantum method employed to solve GCP is derived from an exact algorithm, for example, an exhaustive search. The exact algorithm can find an optimal solution with the maximum system reward among all possible combinations. The purpose of this study is to devise a QSA to solve the GCP satisfying Conditions ( (1) and (6)). Based on prior studies, we describe how to solve the GCP satisfying Condition 1 and Condition 2 ((1)), and we analyze its limitation when Condition 3 ( (6)) is added. In the five phases of QSA, the VOLUME 10, 2022 initialization and the oracle present specific requirements for searching for solutions of GCP, and the rest remain the same.
When solving GCP using QSA, first, an input state of QSA uses qubits that can contain all the colors of all vertices. Thus, there are N v pairs of N c bits representing the number of available colors for each vertex, and the total N v × N c qubits are allocated to the input state. q ij is a qubit that indicates whether the jth color has been assigned to the ith node, and it has a value of 1 when it is assigned. Equation (21) shows an input state where N v = 3 and N c = 3 (G 1 in Fig. 2). |q 11 q 12 q 13 q 21 q 22 q 23 q 31 q 32 q 33 .
The input state of the QSA is a bare candidate that does not consider interference conditions(Condition 1). Candidates can represent all possible strings in a data space such as |000 000 000 , |000 000 001 , . . . , |111 111 111 , (22) where the number of candidates is equal to the size of the data space, N = 2 N v N c . Instead of using all possible strings, we use the W state to generate an input state, as described in [18]. This method is based on the fact that only one color can be assigned to a vertex, and only one qubit has a value of 1. For G 1 , only one of q 11 , q 12 and q 13 has a value of 1. Therefore, we can reduce the number of candidates to N v N c , and an input state can be a superposition of these states: |001 001 001 , |001 001 010 , . . . , |100 100 100 .
The initialization step generates a superposition of N = N v N c input states. Then, oracle S f , marks states that satisfy all interference conditions among the superpositioned input states. The oracle can be implemented using a controlled unitary gate or in various ways [15]- [17]. Afterward, the probability of the solution states marked by the oracle is maximally amplified through the amplitude amplification and iteration phases. The measurement result(index, N chr ) is converted to classical information (bit), and can be used similar to the solution from the classical search algorithm. Using the procedure described so far, QSA can be applied to the GCP. GCP is interpreted as a problem of finding a solution that satisfies the given conditions in a space with a size of N = N v N c . In addition, QSA can find a solution with a complexity of O( N v N c ), whereas classical counterparts can find one with O(N v N c ). Meanwhile, the solution state of the GCP can be a multiple rather than one. It is possible to amplify the probabilities of all solutions, and when performing measurements, all solutions are detected with equal probability. Because each solution has the same probability without considering rewards, QSA cannot be an optimal algorithm if Condition 3 is included.
However, the proposed algorithm can find an optimal solution of GCP satisfying Condition 3 while maintaining the complexity gain of QSA. In Section III, we present the mathematical development of the proposed algorithm and the manner in which the algorithm works. We also provide simulation results for the classical exact algorithm, QSA, and the proposed algorithm.

III. PROPOSED ALGORITHM
In this section, we present a QSA for weighted solutions with a reward value. First, we provide a simple case of the proposed algorithm with three parameters. We then consider the general case of the proposed algorithm. In addition, we state the algorithm in the case of the reward-GCP for DSM. Finally, we analyze the complexity of the classical and quantum methods, and we compare the performance of the proposed algorithm with that of QSA and the classical exact algorithm.

A. THE SIMPLE CASE OF THE PROPOSED ALGORITHM
Let us consider a problem when there are m different values of j such that f (j) = 1. We assume that β and γ are the high/ low-weight solutions, respectively. In addition, α represents a set of non-solutions. The space of the data in the problem is N .
We can also prepare the quantum state for the initialization of QSA. (24) where sin θ = √ m/N and sin 2 φ is the ratio of β in the solutions. We also assume another conditional phase inversion operator, S g and S h , which are different from S f .
First, we execute Grover's operator with i iterations. Before the measurement, we have Here, we explain the process of increasing the probability of |β by reducing that of |γ . First, we define the iteration operator of the proposed algorithm.
When we apply K to |ψ i k times, we can obtain where ε α,k , ε β,k , and ε γ ,k are the error terms of |α , |β , and |γ , respectively. The details of the error terms in simple case are mentioned in Appendix A.
To increase the probability of solutions, the probability of |α should decrease. Whereas ε α,k can be disregarded in small k, ε α,k increases the probability of |α in large k. Therefore, we should have a suitable value of i and k according to the probability of |α . Because ε β,k and ε γ ,k are much smaller than ε α,k depending on k, we can ignore ε β,k and ε γ ,k in the low probability of |α . There were two conditions for k iterations. First, the angle of |α is not allowed, which is larger than π/2. Second, the angle of |γ is not allowed, which is lower than zero. Therefore, these two conditions can be combined. Then, we get When we know the number of solutions(m), we can estimate the value of θ. In other words, we can choose a suitable value of i and k with a high probability of the solutions. This means that the angle of |α is close to π/2. However, a high value of k increases the probability of |α according to (64) in Appendix A. Consequently, we have to choose an appropriate value of i and k where the non-solutions have a low probability. Now we can summarize the proposed algorithm of simple case to Algorithm 1. In the case of an unknown number of solutions, we can use the method of [7].

B. CASE OF MULTIPLE WEIGHTED SOLUTIONS
In this section, we present the proposed algorithm in t different weight solution sets. In addition, we assume that there are m different solutions in N space of the problem. When all solutions have different weights, t = m. Now, we redefine the initialization state |ψ given by where b 2 w is the ratio of β w to the total solution such that (λ can be any value between 1 and 4/3) 3: Choose an integer i uniformly random such that k ≤ i ≤ j. 4: Apply K k Q i to the initial state |ψ . 5: Measure the state K k Q i |ψ and let ϕ be the outcome. 6: If f (ϕ) = 1, the algorithm is over. 7: Otherwise, reset j to min λj, π 4θ − k and return to step 3.
denoted as |β w , and |α represents the state of the incorrect answer. We also assume that the l-th conditional phase inversion operator S w,l is defined as where R l is the l-th conditional weight solution set. That can be changed in each iteration. For example, if we want to increase the probability of |β 1 , |β 2 , · · · , β p in the l-th iteration, R l consists of R l = {β 1 , β 2 , · · · , β p }. Specifically, when R l consists of all different weight solutions, S w,l equals S f in QSA. The function f in (31) is identical to the f function represented in (8).
The inversion operator of S w,l is defined by This operator is not described in QSA. If we set R l as a portion of the solution, we obtain the unintended results after amplitude amplification; the relative phase of others in R l will have a negative phase. To solve this problem, we must apply an additional phase inversion operator to the solution set not included in R l . This operator can be considered as the generalized operator of S h in (25). We also define the l-th iteration operator K l as follows: where K l is equal to Q when R l = {β 1 , β 2 , · · · , β t }. Similar to K in (27), it rotates the states at approximately 2θ with some errors.
In this algorithm, Q should be applied i times because the low-weight solutions may have a negative phase. The appropriate value of i can be determined from the value of k, where k represents the number of iterations operating K l , not Q. After applying Q i and 1 l=k K l to |ψ , we obtain the final state ψ i,k .
where k β w denotes the number of β w included in R l for l = 1, 2, · · · , k. Note that k = max w k β w . For example, let us include β p in R l where l = 1, 2, · · · , p. Then, we can compute the angle of β p to be {2(i+p)+1}θ. In addition, ε α,k and ε β w ,k are the k-th error terms of |α and |β w , respectively. The details of coefficients are mentioned in Appendix B.
The entire process of the algorithm is illustrated in Fig. 6. In this paper, we denote the l-th conditioned oracle as S w,l and the l-th phase inversion as S w † ,l . Because of the definitions of the conditioned oracle and the phase inversion, S w † ,l S w,l is equal to S f . The details of r → r transformation are presented in Section III-C.
Similar to Section III-A, there are two conditions for k iterations. First, the angle of |α must be smaller than π/2. Second, the minimum angle of |β w must be greater than zero. The first condition is represented by where the angle of |α is induced from (i + k)-th iteration states. Equation (35) can be represented by The second condition is represented by where the minimum angle of |β w is also induced from the (i + k)-th iteration states. Equation (37) can be easily represented by We can obtain the bound of the i value from (36) and (38) as follows: If the left side of (39) has a negative value, the minimum value of i is zero. The maximum value of i is related to the complexity of the algorithm. If i has a maximum value, the complexity of this algorithm is equal to that of QSA, that is, O( √ N /m). When we know the number of solutions m, we can estimate the value of θ. If we have an unknown value of m, we use the method in [7]. The entire algorithm is summarized in Algorithm 2.

C. METHOD OF APPLYING THE PROPOSED ALGORITHM TO REWARD-GCP
We now present a method for applying the proposed algorithm to a reward-GCP. Assume that the reward of vertices is represented as a matrix r. Reward matrix r consists of an N v × N c matrix. In Section II, we prepare N v · N c qubits. If the (p · q)-th qubit has a value of one, the color c q is assigned to vertex v p . At this time, r pq is the reward obtained when vertex Algorithm 2 Quantum Search Algorithm for Multiple-Weighted Solutions 1: Initialize an integer k and k β w from problem settings such as a reward matrix in GCP. 2: If k ≥ 2 · min w k β w , set q = k − 2 · min w k β w , otherwise q = 0. 3: Set j = q and λ = 8/7.
(λ can be any value between 1 and 4/3) 4: Choose an integer i uniformly random such that q ≤ i ≤ j. 5: Apply 1 l=k K l · Q i to the initial state |ψ . 6: Measure the state K k · · · K 1 Q i |ψ and let ϕ be the outcome. 7: If f (ϕ) = 1, the algorithm is over. v p is colored in color c q . That is, in the propose algorithm, we can substitute the element of the reward matrix as an element of R l . However, if r pq is not included in the integer, we need a transformation to make integer r pq .
Assume that the quantization level of r pq is decided for L in advance. In addition, a quantization reward value is decided for fr (j), where j = 1, · · · , L. Now, we define anr matrix using fr as follows: Then, we compose an r matrix from anr matrix. The element of r pq is decided as an index ofr pq . In other words, r pq = j−1, wherer pq = fr (j). Finally, we operate the quantum state with R l in accordance with the value of the row in r . Because the iteration is conducted serially through matrix r , the angle of the maximum reward state may be different from that of |α . For example, we consider matrix r such that This example is for a fully connected graph of three vertices. In addition, we have a quantum state with no probability, such as |100 100 100 , |100 100 010 , · · · , |001 001 001 . Subsequently, we first operate (42) with R l in accordance with r 1q , where Because the quantum states containing the first vertex (v 1 ) colored with the first color (c 1 ) should be included in R 1 once, when r 11 = 1, (45) is decided. Using the same method, we obtain R 2 and R 3 .

D. THE COMPLEXITY
Prior to quantum methods including QSA and the proposed algorithm, we can consider the complexity of classical methods. The classical methods such as the exhaustive search (brute-force search) or the backtracking algorithm have the complexity of O(N c N v ) when we solve the GCP. On the other hand, in quantum sides, the complexity of QSA [5] is O( N c N v ). Boyer-Brassard-Høyer-Tapp (BBHT) algorithm [7] and Dürr-Høyer (DH) algorithm [8] have the same complexity of QSA. However, the quantum heuristic algorithm [9] has lower complexity than QSA. The proposed algorithm with oracles which can be implemented at gate-level circuits has the complexity of O( N c N v ). The comparison of the complexity according to each method is presented in Table 5.

IV. EXPERIMENTAL RESULTS
In this section, we compare the performance of the proposed algorithm with that of QSA and the classical exact algorithm in terms of finding the optimal solution quickly and accurately.
The simulation was conducted in MATLAB, and we used benchmark instances of GCP on the computational symposium website [24]. Because it is necessary to obtain all possible color combinations using the classical exact algorithm, we used GEOM20b and queen5_5 models, which have 20 and 25 vertices (3 20 and 5 25 candidates), respectively, as well as two additional graph models with the density of edges changed. Table 6 describes the properties of the models, and the minimum number of colors in [25] was used.

A. COMPARISON WITH CLASSICAL METHODS AND QUANTUM ALGORITHMS
First, we measured the complexity of the actual GCP using simulations. In the simulation settings, we generated a random matrix having values with 0 to 20 for GEOM20b and GEOM20b_d5. A random matrix having values with less than 50 was used for queen5_5_d3 and queen5_5. A random matrix was used as the reward matrix r in Section III-C. Based on the solution with the maximum reward, which is the most interesting solution, we calculated the number of iterations required in the quantum algorithms as where p m is the probability of the solution with the maximum reward. The maximum reward solution can be multiple.
In this case, we calculated p m as the product of the number of solutions and p m . We compared it with the complexity of finding the solution using the classical algorithm. The results are presented in Table 7 and Fig. 7. As a result of conducting simulations 10 times while changing the combination of the reward matrix, the complexity of QSA and the proposed algorithm were found to be much lower as the number of vertices increased or the density increased. Therefore, the complexity of QSA and the proposed algorithm is lower than VOLUME 10, 2022  that of the classical exact algorithm. The complexity of the QSA is similar to that of the proposed algorithm because the values of the elements on the reward matrix are small. Meanwhile, we can calculate the expected reward when the classical exact algorithm, QSA, and the proposed algorithm are applied with the same complexity as √ N . As we assumed that selecting the input data in the classical exact algorithm follows a uniform distribution, the probability of finding each solution is m/N . Let p u be the probability of the solution in the QSA. All solutions have the same probability p u . In addition, let p t be the probability of the t-th solution in the proposed algorithm. The expected reward of the classical exact algorithm is and that of QSA is In addition, the expected reward of the proposed algorithm is Table 8 presents the expected rewards of the algorithms. As the number of vertices or density increases, the expected reward increases. In all cases, quantum methods have a higher expected reward. Now, we present the relative difference of the algorithms in Table 9 and Fig. 8. If the average expected reward is T and the maximum reward value is T opt , then the relative difference is 1 − T /T opt [14]. The relative difference is another performance parameter in the graph coloring approach. This means the difference of system utility given by the algorithms and the global optimum. Overall, the performance of the quantum algorithms is higher than that of the classical algorithm for the same complexity.

B. COMPARISON WITH QUANTUM ALGORITHMS (RANDOM CASE)
Previously, we compared quantum algorithms and the classical algorithm in terms of their complexity and relative difference. However, for a small reward value under 50, the proposed algorithm is similar to QSA because the problem space is much larger than the reward value. A brief example for queen5_5 is denoted by Fig. 9. To determine the effect of the reward value, we applied the proposed algorithm and QSA to the same graph model(queen5_5) with multiple reward matrices from ×1 to ×800. The comparisons of complexity and relative difference are presented in Tables 10 and 11, respectively. In random reward matrix cases, the proposed algorithm has almost the same performance as QSA.   Table 7.

C. COMPARISON WITH QUANTUM ALGORITHMS (SPECIFIC CASE)
To increase the gain of the proposed algorithm, we simulated queen5_5 with a reward matrix having a specific value in the case of Section III-A. First, we divided the possible cases of the specific reward matrix into 4 instances. In these cases, the first row of the specific reward matrix has r b 0 0 0 0 , r b r b 0 0 0 , r b r b r b 0 0 , or r b r b r b r b 0 . Specifically, we can explain the specific case of r b r b 0 0 0 using Fig. 10. In a practical system applied to graph queen5_5, we can consider a specific user with a high reward for spectrum 1 and 2. We can also consider that only user 1 has a gain for a specific resource, and that  Table 9.
the remaining users have an equal gain regardless of the resources that they use. For example, user 1 must use a specific frequency because of the poor status of the channel (e.g., shadow area, inside buildings), but other users having a good status can use any frequency. Otherwise, user 1 is given priority over the desired frequency because user 1 has paid a lot of money. In these cases, we can quantize the reward of a specific user to r b and other rewards to 0. That is, the value of r 11 and r 12 is r b , and others in the reward matrix are 0. Now, we introduce a specific scenario employing the reward matrices of Fig. 10. This scenario is considered in the mobile communication engineering scenario [26], [27]. To explain the scenario, we suppose a few assumptions. First,    a base station (BS) intends to allocate a spectrum to multiple users with no interference. Second, each user sends a ''channel report information'' to BS periodically. The ''channel  report information'' means channel qualities of a communication link. In Fig. 10, the ''channel report information'' is employed to reward matrix values. Third, only one user can report the ''channel report information'' at a time, and other users send nothing. In Fig. 10, since only user 1 sends the ''channel report information'', user 1 has reward value r b and other users have a zero value. The third assumption can be considered in the case that the user 1 has a priority of spectrum assignment. Finally, BS assigns the spectrum for each user in consideration of the interference and ''channel report information''. In Fig. 10, we set the reward matrix value of the user u 1 to r b r b 0 0 0 . The other users have the reward matrix value of [0 0 0 0 0]. Consequently, the user u 1 has a high weight about the spectrum s 1 and s 2 .
In Fig. 11, we compare the complexity of the QSA and the proposed algorithm. We calculated the complexity using (47). The main difference with the previous simulation (in Section IV-B) is that p m is related to the number of solutions with the maximum reward value. In most of the previous simulations, the number of maximum reward solutions was mostly 1. Therefore, the number of solutions having the maximum reward value has an effect on the complexity, as shown in Fig. 11. The proposed algorithm decreases the complexity up to 43.6% compared to QSA in the 1:4 case. In addition, in all the cases, the proposed algorithm reduces the complexity by at least 14.7%. Consequently, we can see that the proposed algorithm has a higher gain in complexity than QSA in accordance with a higher reward value.
In Fig. 12, we compare QSA and the proposed algorithm with the relative difference. As opposed to Fig. 11, the proposed algorithm has a better performance in 4:1 rather than 1:4. The proposed algorithm has a lower relative difference up to 69% in comparison with QSA. As a result, we observed a low relative difference of the proposed algorithm compared to QSA in accordance with a higher reward value. Practical system is applied to the graph queen5_5. Only user 1 has a reward value for spectrum 1 and 2. The reward value is r b . Considering the communication system with a high-priority(paying more) user or a user with better channel conditions, we can compose a graph G.
FIGURE 11. The graph shows the complexity for queen5_5 in 4 cases. The reward value in the graph is used as the value of r b . In addition, we progressively simulated the ratio of r b to 0 in the first row of the reward matrix, i.e., 1:4(Proposed) indicate the number of r b : 0 in the reward matrix by applying the proposed algorithm. We also simulated queen5_5 with a reward matrix that has a specific value in the case of Section III-B. Each element of the reward matrices has one of r b , r c , 0, where r b = 5 × 10 6 FIGURE 13. A communication system that is applied to the type 1 of queen5_5.

FIGURE 14.
The graph shows the complexity for each model in Table 12. and r c = 5 × 10 3 . At the same time, the values of the reward matrix are arranged such that the set of solutions is divided VOLUME 10, 2022 FIGURE 15. The graph of the relative difference for each model in Table 13.
into multiple groups. Type 1 describes the system in Fig. 13 and divides the set of solutions into three groups based on the sum of rewards for each solution S t . The first group is a set of solutions in which the sum of rewards is r b ; for the second and third groups, the sums of rewards are r c and 0, respectively. The first row of the reward matrix for type 1 has r b r b r b r c 0 . Thus, the size of each group (the number of solutions in each group) corresponded to a ratio of 3:1:1. In type 2, the first row of the reward matrix has r b r c 0 0 0 , and the ratio of the size is 1:1:3. Tables 12 and 13 shows the results obtained. We can see the advantages of the proposed algorithm compared to multiple cases in Tables 10 and 11.

V. CONCLUSION
In this paper, we presented a QSA that can make the weighted solution states. The proposed algorithm has the same complexity as the QSA, BBHT-QSA, and DH-QSA. In addition, we proposed a method that solves the reward-GCP using the proposed algorithm. Then, we compared the classical exact algorithm and quantum algorithms in terms of the complexity and relative difference. Consequently, quantum algorithms have lower complexity and relative difference than the classical exact algorithm. In addition, we compared the QSA and the proposed algorithm in terms of the complexity and relative difference. In Tables 10-13 and Figs. 11, 12, 14, 15, we also compared QSA and the proposed algorithm with diverse cases. Based on the results, we demonstrated that the proposed algorithm has a higher expected reward than QSA in some cases.

APPENDIX A THE ERROR TERMS IN SIMPLE CASE OF THE PROPOSED ALGORITHM
In this section, we focus on the error terms of |α , |β , and |γ in simple case of the proposed algorithm. First, we considered K |α , K |α = −S h HS 0 H † S g |α = cos 2θ |α + sin 2θ sin φ |β − sin 2θ cos φ |γ .
From the results of implementing operator K to the basis states, we obtain ψ i,1 by applying K to |ψ i once.
Then, we consider |β n , which is not the element of R i+1 .
where p + 1 ≤ n ≤ t. These computations are used when calculating the coefficient of the states. When we apply K i+1 to Q i |ψ , the coefficients of |α and |β w are denoted as follows: where β m ∈ R i+1 and β n / ∈ R i+1 . Here, we assume the unintended terms of coefficients as error terms such that ε α,i+1 , ε β m ,i+1 , and ε β n ,i+1 . The error terms are represented as follows: where m = 1, · · · , p and n = p + 1, · · · , t.
Using the same method as in Appendix A, ε α,k in (34) can be denoted by ε α,k sin 2θ k l=1 sin {2(i + (l − 1)) + 1}θ where θ β w ,l is the l-th angle, |β w . The error term ε β w ,k is also ignored with a low probability of |α because ε β w ,k is much smaller than ε α,k .