Skip to Content
  • Proceeding Paper
  • Open Access

12 October 2026

8 Pages

Feature Selection Method Utilizing Quantum Approximate Optimization Algorithm with Layerwise Grid Search Strategy †

and
1
Department of Computer Science and Information Engineering, Chang Jung Christian University, Tainan 711301, Taiwan
2
Department of Computer and Communication Engineering, National Kaohsiung University of Science and Technology, Kaohsiung 824005, Taiwan
*
Author to whom correspondence should be addressed.
†
Presented at the 6th International Conference on Electronic Communications, Internet of Things and Big Data (ICEIB 2026), New Taipei, Taiwan, 24–26 April 2026.

Abstract

Feature selection remains a challenge in high-dimensional data analysis. Identifying the optimal feature subset is a complex combinatorial problem often classified as nondeterministic polynomial-time-hard. Traditional classical heuristics frequently struggle to navigate the exponentially growing search space. In this paper, we propose a feature selection method utilizing the quantum approximate optimization algorithm (QAOA) integrated with a layerwise grid search (LGS) strategy. By formulating feature selection as a max-cut problem, we leverage QAOA to optimize the selection process. Unlike standard global optimization, the LGS approach sequentially optimizes parameters for each circuit layer. This systematic discretization of the parameter space ensures stable convergence and enhances overall performance. Experimental evaluations on the iris flower dataset demonstrate the effectiveness of the proposed method in addressing feature selection challenges.

1. Introduction

In machine learning research, feature selection is used for dimensionality reduction and involves identifying and retaining a subset of the most relevant attributes from a dataset while discarding redundant or noisy variables [1,2]. Feature selection is conducted in three frameworks [3]. The first is the filter methods, which utilize statistical correlation to rank features and select the important ones. The second is the wrapper methods, which iteratively search for the optimal subset by evaluating the performance of a specific model. The third is the embedded methods, which integrate the selection process directly into the training phase, as seen in least absolute shrinkage and selection operator (LASSO) regression or random forests. The second and third methods are most commonly used in the context of supervised learning where labels are required. Therefore, it is interesting to develop an unsupervised feature selection method that works without labels. This paper aims to extend the filter method, which does not require a threshold. That is, the entire feature set is divided into two highly correlated subsets by using the max-cut method, and one of the subsets is removed to reduce redundancy.
On the other hand, the quantum approximate optimization algorithm (QAOA) solves complex combinatorial optimization problems by combining the strengths of quantum and classical processing [4,5].
In the modern era of noisy quantum computers, QAOA is a major candidate for demonstrating a practical advantage because it operates with relatively shallow circuits that are less prone to errors. References [6,7] provide a detailed investigation into the fundamental principles, technical implementations, and practical applications of QAOA. A primary application of QAOA is solving the max-cut problem, a fundamental challenge in graph theory [8,9]. The objective is to partition a graph’s vertices into two sets that maximize the number of edges between them. Although max-cut is nondeterministic polynomial-time hard and computationally intensive for classical systems as graph sizes scale, QAOA provides a promising heuristic by mapping the problem onto a quantum framework. In this paper, we employ a QAOA-based max-cut method to divide a feature set into two highly correlated subsets, addressing the feature selection problem through quantum computation.
The remainder of this paper is organized as follows. Section 2 reviews the fundamentals of QAOA and defines the max-cut problem in graph theory. Section 3 details the development of a QAOA-based max-cut method designed to partition a feature set into two highly correlated subsets, enabling feature selection via quantum computation. Section 4 presents experimental results using the iris flower dataset to demonstrate the effectiveness of the proposed method. Section 5 concludes this research.

2. Preliminary

2.1. Fundamentals of QAOA

The overview block diagram of QAOA is shown in Figure 1. Given the cost Hamiltonian HC and mixer Hamiltonian HB, the output state of p-layer ansatz circuit is given as follows.
| ϕ ( γ , β ) ⟩ = ( Π k = 1 p e − i β k H B e − i γ k H C ) H ⊗ n | 0 ⟩ ⊗ n
where n is the number of quantum bits (qubits), p is the number of layers, |0⟩ is zero state, ⊗ is the tensor product, H is the single-qubit Hadamard gate, and two parameter vectors γ = [γ1,γ2,…,γp]T and β = [β1,β2,…,βp]T are parameters of the ansatz circuit.
Figure 1. The block diagram of QAOA.
From the state |ϕ(γ,β)⟩, the expectation value F(γ,β) is then defined as
F(γ,β) = ⟨ϕ(γ,β)|HC|ϕ(γ,β)⟩
To solve the optimization problem by QAOA, F(γ,β) must be maximized with respect to parameters γ and β. This is accomplished by a classical optimizer such as constrained optimization by linear approximation (COBYLA) and Powell and Nelder-Mead methods. Because the cost function F(γ,β) is nonlinear, these methods become stuck in local extreme values. A layerwise grid search (LGS) method is used to find a good solution and to reduce search time [10]. We use QAOA with the LGS method to solve the feature selection problem. Once optimal parameters γ* and β* are obtained by the iterative loop in Figure 1, they can be used to run the quantum computer to get the state |ϕ(γ*,β*)⟩. This final state is measured, and the resulting bit string whose counts in the histogram is the final solution obtained by QAOA.

2.2. Optimization Problem of Max-Cut

Let G = (V,E,A) be an undirected weighted graph, where V = {0,1,…,n − 1} is the vertex set, E is the edge set, and A is the adjacency matrix whose elements wℓ,m are equal to edge weights if vertex ℓ connects with vertex m, otherwise, wℓ,m = 0. The max-cut problem is to divide the vertex set V into two disjoint subsets V1 and V2 such that the sum of weights of edges with one endpoint in V1 and the other in V2 is maximized. Many methods are used to solve the combinational problem [8,9]. If we assign each vertex k a binary variable xk ∈ {0,1}, the contribution of a single edge (ℓ,m) to cut weight is given by
w ℓ , m ( x ℓ − x m ) 2 = w ℓ , m ( x ℓ 2 − 2 x ℓ x m + x m 2 ) = w ℓ , m ( x ℓ + x m − 2 x ℓ x m )
The equalities x ℓ 2 = x ℓ and x m 2 = x m are used in Equation (3). The max-cut problem is used to find the binary variables xn−1xn−2 … x1x0 to maximize the following cost function:
J ( x 0 , x 1 , … , x n − 1 ) = ∑ ( l , m ) ∈ E w ℓ , m ( x ℓ + x m − 2 x ℓ x m )
Let a new variable be zk = 2xk − 1; then, we have a bipolar binary variable zk ∈ {−1,1}. Therefore, the cost function in Equation (4) reduces to
J ( z 0 , z 1 , … , z n − 1 ) = ∑ ( ℓ , m ) ∈ E w ℓ , m ( z ℓ + 1 2 + z m + 1 2 − 2 z ℓ + 1 2 z m + 1 2 ) = 1 2 ∑ ( ℓ , m ) ∈ E w ℓ , m ( 1 − z ℓ z m ) = − 1 2 ∑ ( ℓ , m ) ∈ E w l , m z ℓ z m + c
where constant c is given by c = 1 2 ∑ ( ℓ , m ) ∈ E w ℓ , m . Replacing variables zℓ, zm by Pauli-Z operators σ ℓ z , σ m z and neglecting the constant c and factor 1 2 , the cost Hamiltonian HC of the max-cut problem is given by
H C = − ∑ ( ℓ , m ) ∈ E w ℓ , m σ ℓ z σ m z
The mixer Hamiltonian HB is often chosen as the sum of Pauli-X operators σx on each qubit below:
H B = ∑ k = 0 n − 1 σ k x
Once HC and HB are obtained using Equations (6) and (7), QAOA in Figure 1 can be applied to solve the max-cut problem. In this study, the feature selection problem is transformed into a max-cut problem of an undirected weighted graph. Then, the optimal solution of the max-cut problem is found by using QAOA. Finally, the wanted features are selected from the given features according to the solution of the max-cut of the graph.

3. Feature Selection Using Max-Cut

In this section, the feature selection problem is solved by using the graph max-cut method whose optimal solution is found by QAOA. Given the feature data set S = {f0,f1,…,fn−1}, where n is the number of features. The best subset of the set of features contains the least number of features that most contribute to the accuracy of classification Because each feature can be selected or not selected, the total number of combinations of selection is equal to 2n which exponentially grows with respect to n. Therefore, this problem is difficult to solve. One of the conventional unsupervised methods to solve this problem is the filter method based on the feature-to-feature correlation. That is, if the correlation between two features is higher than a prescribed threshold, one of them can be filtered out and removed. A three-step procedure to implement the filter method is as follows.
  • Step 1: Calculate the correlation matrix of features;
  • Step 2: Set a threshold that defines how much redundancy we are willing to tolerate;
  • Step 3: Identify pairs of features whose correlation is higher than the threshold and remove one of them.
Although this filter method can be applied to select the wanted features, it is not easy to choose the threshold value at step 2. In this study, a graph max-cut method is presented to solve the feature selection problem by feature-to-feature correlations without requiring a threshold. Three steps involved in the proposed method are as follows.
  • Step 1: Use the given dataset S to construct an undirected weighted complete graph. Each vertex corresponds to each feature, so the number of vertices is equal to the number of features. The weight wℓ,m of the graph edge (ℓ,m) is computed by the absolute value of the following Pearson’s correlation coefficients
    w ℓ , m = | E ( ( f ℓ − μ ℓ ) ( f m − μ m ) ) E ( ( f ℓ − μ ℓ ) 2 ) E ( ( f m − μ m ) 2 ) |
    where operation E(⋅) denotes the expected value, and μℓ, μm are the mean values of features fℓ and fm. wℓ,m is in the interval [0, 1] using the Cauchy-Schwarz inequality. The more wℓ,m approaches unity, the higher correlation features fℓ and fm have. As an example, a complete graph G = (V,E,A) in the case of three features (n = 3) is shown in Figure 2a. There are three vertices and three edges in this graph.
Figure 2. Example in three-feature case: (a) graphical representation with n = 3; (b) The quantum circuit to implement operator e − i β k H B e − i γ k H C at the k-th layer of the ansatz circuit. This circuit is composed of Rzz gate and Rx gate.
  • Step 2: Use edge weights in (8), the cost Hamiltonian HC in (6) can be computed. Once HC and HB are known, the quantum circuit to implement the operator e − i β k H B e − i γ k H C at the k-th layer of the ansatz circuit in Figure 1 can be designed. As an example, the circuit to realize e − i β k H B e − i γ k H C in the three-feature case (n = 3) is shown in Figure 2b. Clearly, this circuit is composed of three Rzz gates and three Rx gates. After the architecture of the ansatz circuit in QAOA is obtained, the remaining problem is how to determine the parameters γ = [γ1,γ2,…,γp]T and β = [β1,β2,…,βp]T to maximize the cost function F(γ,β) in (2). In this paper, the layerwise grid search (LGS) method in [10] is used to achieve the purpose. The LGS breaks down the optimization problem into a series of smaller sub-problems, and it determines the parameters (γk,βk) layer by layer for (k = 1,2,…,p). In the initial step, the grid search method is performed to find the optimal parameter ( γ 1 * , β 1 * ) for the ansatz circuit with p = 1. Then, another grid search is performed to find the optimal parameter ( γ 2 * , β 2 * ) for the ansatz circuit with p = 2, while keeping the first layer’s parameter fixed at ( γ 1 * , β 1 * ) obtained in the initial step. This process is repeated for each subsequent layer, with the new layer’s parameters being determined on top of the already determined layers [10].
  • Step 3: Let the optimal binary bit string obtained from QAOA in step 2 be denoted by xn−1xn−2 … x1x0 where xk ∈ {0,1}, then feature data set S = {f0,f1,…,fn−1} can be divided into two subsets S1 and S2:
S 1 = { f k   |   i f   x k = 0 } ,   S 2 = { f k   |   i f   x k = 1 }
If the size of subset S1 is |S1| = n1 and the size of subset S2 is |S2| = n2, n1 + n2 = n. Because graph edge weights are the correlations between features and max-cut is used in the graph partition, feature subset S1 is strongly correlated with subset S2. This means that feature data is divided into two highly correlated parts of data. Therefore, the remaining problem is how to determine the selected feature subset from S1 and S2. This problem is solved by considering the following two cases:
  • Case 1: The case n1 ≠ n2 is considered here. Because a smaller-size feature subset has lower computational load in the classification task. Therefore, the smaller-size feature subset is the selected feature data in the proposed method, and the other larger-size feature subset is removed and pruned. For example, if n2 > n1 holds, then S1 is the selected feature subset;
  • Case 2: The case n1 = n2 is considered here. If a feature has zero or low variance, it provides no or little information for training a classifier. Therefore, the feature with larger variance is preferred. So, the total sum of variances in feature subsets S1 and S2 are computed, then the subset with a larger sum of variances is chosen as the selected feature subset.

4. Results

The quantum information software kit (Qiskit SDK V2.3) developed by IBM (Armonk, NY, USA) was used to conduct the experiments of the proposed feature selection method. The iris flower dataset was employed to illustrate the implementation details. This dataset is remarkably simple and balanced, consisting of 150 samples. Three species of iris flower data are Setosa (class 0), Versicolor (class 1), and Virginica (class 2). In total, 50 samples were selected from each species. The number of features is n = 4 and the feature set is S = {f0,f1,f2,f3}, where f0 is sepal length, f1 is sepal width, f2 is petal length, and f3 is petal width. All measurements of features are in centimeters (cm). Let mean values be denoted by μk = E(fk), we have μ0 = 5.8433, μ1 = 3.0573, μ2 = 3.7580 and μ3 = 1.1993. If the variances of features are defined by vark = E((fk − μk)2), then var0 = 0.6811, var1 = 0.1887, var2 = 3.0955 and var3 = 0.5771. Using Equation (8), the Pearson’s correlation matrix of the iris flower dataset is given as
W = [ 1 0.1176 0.8718 0.8179 0.1176 1 0.4284 0.3661 0.8718 0.4284 1 0.9629 0.8179 0.3661 0.9629 1 ]
where the element at the ℓ-th row and m-th column is the Pearson correlation coefficient wℓ,m between features fℓ and fm. Based on matrix W, the correlation graph of the iris flower dataset is shown in Figure 3a. The optimal max-cut of this complete graph is also shown in Figure 3b, and its cut value can be computed by (4) with x3x2x1x0 = 1100 or 0011. That is, we have the maximum cut value.
J(x0,x1,x2,x3) = 0.8179 + 0.8718 + 0.3661 + 0.4284 = 2.4842
Figure 3. Correlation graph obtained by the iris flower dataset: (a) Complete graphical representation with four vertices and six edges; (b) the max-cut of this complete graph.
If p = 3 is chosen, the ansatz circuit of QAOA to solve the feature selection problem of the iris flower dataset is shown in Figure 4. Each qubit corresponds to each vertex or each feature, and each ZZ gate corresponds to each edge. When this QAOA circuit with p = 3 is applied to find the max-cut of the correlation graph, the values of six parameters ( γ 1 * , β 1 * ) , ( γ 2 * , β 2 * ) and ( γ 3 * , β 3 * ) can be determined by the LGS method.
Figure 4. The ansatz circuit with p = 3 when QAOA is used to solve the max-cut problem of compete graph in Figure 3.
After the parameters are obtained, the quantum circuit is performed 1024 times. The resultant histogram of QAOA with the LGS method is shown in Figure 5a. The bit strings 0011 and 1100 have the highest counts in the histogram, so the QAOA with the LGS method can find the optimal max-cut shown in Figure 3b. Based on the bit strings x3x2x1x0 = 1100 or 0011, the feature set S = {f0,f1,f2,f3} can be divided into two subsets S1 = {f0,f1} and S2 = {f2,f3}. Because each subset has two features, which lead that n1 = n2 = 2, the total sum of variances is calculated to determine which subset is selected by us. For subset S1, the total sum of variances of features is given by T1 = var0 + var1 = 0.6811 + 0.1887 = 0.8698. For subset S2, the total sum of variances of features is given by T2 = var2 + var3 = 3.0955 + 0.5771 = 3.6726. Variance T2 of subset S2 is larger than T1 of subset S1, so S2 = {f2,f3} is the final selected features. That is, petal length f2 and petal width f3 are our selected features. Finally, some discussions are made as follows.
Figure 5. The histogram of the measurement results of the QAOA method when the quantum circuit is performed 1024 times: (a) The histogram obtained by LGS method; (b) the histogram obtained by the COBYLA method.
When conventional optimizer COBYLA method is applied to determine the six parameters ( γ 1 * , β 1 * ) , ( γ 2 * , β 2 * ) and ( γ 3 * , β 3 * ) of the ansatz circuit in Figure 4, and the obtained circuit is performed 1024 times, Figure 5b shows the resultant histogram of this method. The bit strings x3x2x1x0 = 0010 or 1101 have the highest counts. The cut value corresponding to these two strings is given as
J(x0,x1,x2,x3) = 0.9629 + 0.8718 + 0.4284 = 2.2631
The cut value 2.2631 is smaller than 2.4842 in (11), so the COBYLA method does not show the optimal max-cut in Figure 3b. Therefore, the LGS method provides a better solution than the conventional COBYLA method.
If classifiers K-nearest neighbor (KNN), support vector machine (SVM), and decision tree (DT) are used to recognize the iris flower dataset, the accuracies for the entire feature set S = {f0,f1,f2,f3} were 96% (KNN), 96% (SVM), and 95% (DT). Moreover, the accuracies for the selected feature set S2 = {f2,f3} were 96% (KNN), 95% (SVM), and 96% (DT). Although two features f0 and f1 are removed, the accuracy in the case of selected features S2 is almost the same as the accuracy in the entire feature set S. Therefore, the proposed feature selection method has good performance. Scikit-learn is a popular and widely used open-source machine learning library to solve the feature selection problem of the iris flower dataset, the filter method, wrapper method, and embedded method all provide the selected feature subset as petal length and petal width, that is, {f2,f3} are selected for all three methods. Therefore, conventional methods give the same results as the proposed method for the iris flower dataset.

5. Conclusions

In this paper, a feature selection method is developed using utilizing QAOA with the LGS method. However, the unsupervised feature selection method does not consider the correlation between features and targets. In the future, the mutual information between features and targets can be added to the graph construction of the dataset to further improve the performance of feature selection.

Author Contributions

Conceptualization, S.-L.L. and C.-C.T.; methodology, S.-L.L. and C.-C.T.; software, S.-L.L. and C.-C.T.; validation, S.-L.L. and C.-C.T.; formal analysis, S.-L.L. and C.-C.T.; investigation, S.-L.L. and C.-C.T.; resources, S.-L.L. and C.-C.T.; data curation, S.-L.L. and C.-C.T.; writing—original draft preparation, S.-L.L. and C.-C.T.; writing—review and editing, S.-L.L. and C.-C.T.; visualization, S.-L.L.; supervision, C.-C.T.; project administration, S.-L.L.; funding acquisition, S.-L.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Science and Technology Council of Taiwan under the grant number NSTC 114-2221-E-309-001.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Guyon, I.; Gunn, S.; Nikravesh, M.; Zadeh, L. Feature Extraction: Foundations and Applications; Springer: Heidelberg, Germany, 2006. [Google Scholar]
  2. Alpaydin, E. Introduction to Machine Learning, 3rd ed.; The MIT Press: London, UK, 2014. [Google Scholar]
  3. Venkatesh, B.; Anuradha, J. A review of feature selection and its methods. Cybern. Inf. Technoloies 2019, 19, 3–26. [Google Scholar] [CrossRef] [Scilit]
  4. Farhi, E.; Goldstone, J.; Gutmann, S. A quantum approximate optimization algorithm. arXiv 2014, arXiv:1411.4028. [Google Scholar] [CrossRef] [Scilit]
  5. Lee, X.; Yan, X.; Xie, N.; Cai, D.; Saito, Y.; Asai, N. Iterative layerwise training for quantum approximate optimization algorithm. Phys. Rev. A. 2024, 109, 052406. [Google Scholar] [CrossRef] [Scilit]
  6. Blekos, K.; Brand, D.; Ceschini, A.; Chou, C.H.; Li, R.H.; Pandya, K.; Summer, A. A review on quantum approximate optimization algorithm and its variants. Phys. Rep. 2023, 1068, 1–66. [Google Scholar] [CrossRef] [Scilit]
  7. Combarro, E.F.; Gonzalez-Castillo, S. A Practical Guide to Quantum Machine Learning and Quantum Optimization: Hands-on Approach to Modern Quantum Algorithms; Packt Publishing: Birmingham, UK, 2023. [Google Scholar]
  8. Majumdar, R.; Bhoumik, D.; Madan, D.; Vinayagamurthy, D.; Raghunathan, S.; Sur-Kolay, S. Depth optimized ansatz circuit in QAOA for max-cut. arXiv 2021, arXiv:2110.04637. [Google Scholar] [CrossRef] [Scilit]
  9. Bae, E.; Lee, S. Recursive QAOA outperforms the original QAOA for the MAX-CUT problem on complete graphs. Quantum Inf. Process 2024, 23, 7. [Google Scholar] [CrossRef] [Scilit]
  10. Lee, S.L.; Tseng, C.C. Parameters determination of quantum approximate optimization algorithm using layerwise grid search method. In Proceedings of the 7th Eurasia Conference on IoT, Communication and Engineering (ECICE), Yunlin, Taiwan, 14–16 November 2025; pp. 1–14. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.