Improved method for optimizing K-means clustering problem through quantum artificial bee colony algorithm

Through the improved quantum artificial bee colony algorithm, combined with adaptive revolving doors and Levy flight strategies, the problem of K-means being sensitive to initial clustering centers is solved, the stability and accuracy of clustering are improved, and faster convergence is achieved Speed ​​and better clustering effects.

CN119249184APending Publication Date: 2025-01-03NORTH CHINA UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411294593.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The K-means clustering algorithm is sensitive to the initial clustering center, resulting in unstable clustering effect and low accuracy. The search efficiency of traditional group intelligence algorithms is low, low accuracy, and easy to fall into local optimality.

Method used

The improved quantum artificial bee colony algorithm is adopted to dynamically adjust the solution search method by introducing adaptive rotation angle quantum revolving doors, symmetric functions and Levy flight-based mobile development strategies, and adopting linear population reduction strategies to improve the algorithm mining ability and Convergence speed.

Benefits of technology

The stability, accuracy and convergence speed of clustering are effectively improved, and the clustering effect is significantly improved. The experimental results show that the performance on different data sets is better than other algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249184A_ABST
    Figure CN119249184A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quantum, in particular to a method for optimizing a K-means clustering problem through an improved quantum artificial bee colony algorithm, and the method comprises the steps: S1, initializing the parameters of the improved quantum artificial bee colony algorithm and a K-means algorithm; s2, generating a nectar source population based on quantum coding; s3, performing solution space transformation on the initial population and calculating a fitness value; s4, a solution searching stage of employed bees; s5, the observation bees select employed bees according to the probability to further seek solutions; s6, a new nectar source generation stage of the reconnaissance bees; s7, linearly reducing the population, jumping out of iteration after the maximum number of iterations of the improved quantum artificial bee colony algorithm is achieved, and taking an obtained optimization result as an initial clustering center of K-means; s8, executing K-means, dividing the data into clusters, and updating a clustering center in each cluster; and S9, when a K-means termination condition is reached, outputting a final clustering result. Through the improved quantum artificial bee colony algorithm, the defect that K-means is sensitive to an initial clustering center is overcome, and the clustering effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of quantum technology, and in particular to a method for optimizing K-means clustering problems using an improved quantum artificial bee colony algorithm. Background Art

[0002] Clustering is the process of dividing data samples (or data points) into clusters consisting of similar samples while maximizing the similarities between samples within a cluster and the differences between clusters. Clustering belongs to unsupervised learning in machine learning and is widely used in image retrieval, data mining, customer classification, object recognition, and data analysis. Clustering algorithms can be divided into partition-based, layer-based methods and grid-based, density-based methods. K-means is currently the main partition clustering method and is popular because of its simple calculation. However, K-means is sensitive to the initial cluster center, which leads to unstable clustering effect and low accuracy, which is the disadvantage of the algorithm.

[0003] Currently, most K-means optimizations use traditional swarm intelligence algorithms, such as artificial bee colony algorithm, particle swarm optimization algorithm, and ant lion optimization algorithm. However, these traditional swarm intelligence algorithms still have problems such as low search efficiency, low accuracy, and easy to fall into local optimality. Summary of the invention

[0004] The purpose of the present invention is to provide an improved quantum artificial bee colony algorithm to optimize the K-means clustering problem method, so as to solve the disadvantage that K-means is sensitive to the initial clustering center, and can effectively enhance the stability, accuracy and convergence speed during clustering.

[0005] In order to achieve the purpose of the above invention, the following technical solution is adopted:

[0006] An improved quantum artificial bee colony algorithm is used to optimize the K-means clustering problem, including the following steps:

[0007] S1. Initialize the parameters of the improved quantum artificial bee colony algorithm and K-means algorithm;

[0008] S2, generating honey source population based on quantum coding;

[0009] S3, transform the solution space of the initial population and calculate the fitness value;

[0010] S4, hired bee solution-seeking stage;

[0011] S5, the observation bees select the employed bees according to probability to further find the solution;

[0012] S6, the stage where scout bees generate new nectar sources;

[0013] S7, reduce the population linearly, and exit the iteration when the maximum number of iterations of the improved quantum artificial bee colony algorithm is reached, and the obtained optimization result is used as the initial clustering center of K-means;

[0014] S8, execute K-means, divide the data into clusters, and update the cluster center in each cluster;

[0015] S9. Reach the termination condition of K-means and output the final clustering result.

[0016] In summary, the present invention provides an improved quantum artificial bee colony algorithm for optimizing the K-means clustering problem, which overcomes the shortcoming of K-means being sensitive to the initial cluster center. By introducing two quantum revolving gates with adaptive rotation angles, the population is guided to evolve toward a better solution. The mining ability of the algorithm is improved by introducing two mobile development strategies based on symmetric functions and Levy flight. In order to further improve the quality of new solutions, the solution-finding method is dynamically adjusted during the reconnaissance bee stage. At the same time, by introducing a linear population reduction strategy, the quality of the population space is improved and computing resources are reduced. Experimental results show that the use of these methods in clustering problems effectively improves the effect of clustering. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of the method for optimizing K-means clustering problem using the improved quantum artificial bee colony algorithm of the present invention;

[0018] Figure 2 The experimental test results of the improved quantum artificial bee colony algorithm (IQABC) and other algorithms on the Iris dataset;

[0019] Figure 3 Experimental test results of IQABC and other algorithms on the Cancer dataset;

[0020] Figure 4 Experimental test results of IQABC and other algorithms on the Seeds dataset;

[0021] Figure 5 Experimental test results of IQABC and other algorithms on the Wine dataset;

[0022] Figure 6 Experimental test results of IQABC and other algorithms on the Survival dataset;

[0023] Figure 7 Experimental test results of IQABC and other algorithms on the Glass dataset. DETAILED DESCRIPTION

[0024] The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present invention, but are not intended to limit the present invention. Each step of the improved quantum artificial bee colony algorithm for optimizing the K-means clustering problem provided by the present invention will be described in detail below. Figure 1 As shown, the steps are as follows:

[0025] Step S1, initializing the parameters of the improved quantum artificial bee colony algorithm and the K-means algorithm.

[0026] Specifically, the maximum number of iterations T of the improved quantum artificial bee colony algorithm is set max , iteration number t=1, number of nectar sources n, number of employed bees P1, number of observation bees P2, number of scout bees P3, limit number of nectar source stop updating L, input data set D, maximum number of iterations Maxcycle of K-means algorithm, number of clusters k.

[0027] Step S2: Population initialization based on quantum coding.

[0028] Specifically, in quantum computing, the smallest unit of information is represented by a quantum bit, and the state of a quantum bit is:

[0029] |φ>=α|0>+β|1>

[0030] In the formula, α and β are two complex numbers, |α| 2 and |β| 2 are two probability amplitudes, and α and β satisfy |α| 2 +|β| 2 =1; let α = cos(θ), β = sin(θ), and express the above formula in matrix form:

[0031]

[0032] The randomized honey source is expressed as:

[0033] P i t ={φ1(t),φ2(t),K,φ m (t)}

[0034] Where i = {1, 2..., n}, m is the attribute dimension of the solution vector;

[0035] The size of the honey source population is n, where the attribute dimension of each individual is m. The state of the quantum bit is constructed using the angle matrix, which is represented by the probability amplitude. When the population is initialized, an n*m matrix with an angle range from 0 to 2π is constructed;

[0036] θ ij=rand(0,1)·2π, i={1,2...,n}, j={1,2...,m}.

[0037]

[0038] P represents a matrix with n nectar sources. Each nectar source occupies two positions in the search space, and each position corresponds to a possible solution to the problem. The nectar source population is represented as:

[0039]

[0040] Step S3: transform the solution space of the initial nectar source population and calculate the fitness value.

[0041] The quality level of each nectar source is evaluated by considering its fitness value, which requires transforming the solution space of the nectar source location. Assuming that the solution space of the problem is defined as Ω = [xMin, xMax], the transformation formula is:

[0042]

[0043] The fitness value of the nectar source is calculated according to the objective function. The objective function used in the present invention is the sum of squared errors, which is expressed as follows:

[0044]

[0045] In the formula, G i represents the i-th cluster, d(x i ,C j ) represents the data point x i To the center C of the cluster j The Euclidean distance.

[0046] Step S4: Hired bees search for solutions.

[0047] Specifically, the number of employed bees matches the nectar source. Each employed bee searches for a new nectar source around the current position through a quantum revolving door with an adaptive rotation angle based on the number of iterations, and defines a variable num to record the number of explorations of the nectar source under the same nectar source. If the fitness value of the explored new nectar source is better than the current nectar source, the nectar source is updated and num=0 is set, otherwise num is increased by 1. The expression of the adaptive rotation angle is:

[0048]

[0049] In the formula, r is a constant greater than 1, which is used to control the adjustment rate of the rotation angle, and r is proportional to η. According to the formula, it can be found that the t value is small at the beginning of the algorithm, while the angle value is large. At this time, the search range is large, which improves the convergence speed of the algorithm. During the iteration process of the algorithm, the t value gradually increases, while the angle value gradually decreases, so the algorithm reduces the search range and achieves accurate search.

[0050] The expression for quantum revolving door to update honey source is:

[0051]

[0052] Δθ=Sign(α i ×β i )·η

[0053] In the formula, the sign function Sign(α i ×β i ) indicates the direction of the rotation angle.

[0054] Step S5: The observation bees select employed bees according to probability to further search for solutions.

[0055] Specifically, the observation bee selects one of the employed bees for further exploration based on the fitness value of the nectar source corresponding to the employed bee through a probability-based roulette method, and uses a greedy selection mechanism to retain the better nectar source based on the fitness value, and finally updates num. The implementation process is:

[0056] S51. The observation bees use the roulette method to select employed bees. The expression of the roulette method is:

[0057]

[0058] In the formula, fit i represents the fitness of the ith nectar source (or the ith employed bee). The probability of the ith nectar source being selected is R i It is derived from the fitness of the nectar source. The better the fitness, the higher the probability of being selected.

[0059] S52. Observation bees use two mobile development strategies to explore new honey sources. The expression of the first mobile development strategy is:

[0060]

[0061] Where P i represents the location of the i-th nectar source, P best represents the global optimal honey source location, and C represents the average centroid location. r1, r2, and r3 are scalar values ​​randomly distributed in the range [0,1]. r1 specifies the influence of the current location on the next location. r2 and r3 are used to determine the optimal location in P. best and Expand the search space around u. 1(t) and u 2(t) is a scalar parameter, f u1(t) and f u2(t) is a symmetric function, expressed as:

[0062]

[0063] Based on f u1(t) and f u2(t) , "Drift Control" 1(t) and u 2(t) The parameters are calculated using the following expressions:

[0064]

[0065] Where v1, v2, v3, and v4 are random scalar numbers in the range [0,1]. According to the randomness of these parameters and the two symmetric function numbers f u1(t) and f u2(t) ,u 1(t) and u 2(t) The value of can be negative or positive in any iteration.

[0066] This trend is not only to use the global optimal P best and the average centroid position In addition to the high-quality search space, an extended search space can also be obtained, which is composed of two proposed parameters u 1(t) and u 2(t) control. Therefore, in the first few iterations, the search space will be generated in a different way to increase the chances of escaping the local optimum problem and finding a better search space. In the last few iterations, the accuracy level will be improved due to the reduction of the search space.

[0067] The second mobile development strategy is expressed as:

[0068]

[0069] In the formula, Levy(λ) is the concept of Levy flight introduced, which is a random walk whose step length follows the Levy distribution. The step length value depends on the exponential distribution γ between 1 and 2. The expression of Levy distribution is:

[0070]

[0071] In the formula, U and V are two normally distributed variables, and the standard deviation is σ 2and 1. γ is a parameter that controls the size of the step size. If γ is a small scalar number, the step size λ achieves a long move, vice versa, if γ is a large scalar number, the step size λ achieves a short move. And as the parameter γ gradually increases, the distribution of the step size λ tends to gradually decrease.

[0072] U~N(0,σ 2 )

[0073] V~N(0,1)

[0074]

[0075] Where Γ is the gamma function, expressed as:

[0076]

[0077] This trend explores the search space from the global optimal P best Initially, ignoring the individual position P of the nectar source i The position of the Lévy flight is used to generate a random step size, which establishes a deeper and wider search space. This trend movement tends to improve the convergence speed and accuracy level.

[0078] Step S6: The scout bees generate new nectar sources.

[0079] Specifically, if the nectar source is not updated after the maximum search limit L, it indicates that the nectar source is trapped in the local optimum and the nectar source will be discarded. The employed bees corresponding to the nectar source will be transformed into scout bees. The scout bees use the global guidance strategy to generate new nectar sources to replace the original nectar sources, record the best nectar source, and set num = 0. If the limit L is not reached, the current iteration ends and the next iteration of this stage is performed. The implementation process is:

[0080] S61. Randomly generate a nectar source according to the nectar source population matrix using the following formula:

[0081] P i =P min +τ(P max -P min )

[0082] Where τ is a random number uniformly distributed in the interval [0,1], P min and P max Represent the minimum and maximum values ​​in the nectar source population respectively.

[0083] S62. Update the randomly generated honey source using a quantum revolving door with a rotation angle based on the fitness value. The expression is:

[0084] P i '=U(Δθ)·Pi

[0085]

[0086] Where u is a random number in the interval [0,1], fit max and fit min are the optimal fitness value and the worst fitness value of the population, respectively. i is the current individual fitness value, θ max and θ min are the maximum and minimum angles in the angle matrix respectively;

[0087] S63, the honey source P updated by the quantum revolving door i ' and the global optimal solution P best Combined, if the solution generated by the first half is less than the global optimal solution, the expression is:

[0088] P i =P i '+(1-τ)(P i '-P best )

[0089] If the randomly generated solution in the first half is greater than the global optimal solution, the expression is:

[0090] P i =P i '-(1-τ)(P i '-P best )

[0091] The reason for the two situations here is that the new solution is too far away from the global optimal solution, which will affect the convergence speed of the algorithm, and finally the new nectar source will replace the original nectar source.

[0092] S7, reduce the population linearly, when the maximum number of iterations T of the improved quantum artificial bee colony algorithm is reached max Then the iteration is exited and the optimization result is used as the initial clustering center of K-means.

[0093] Specifically, the quality of the nectar source in the population space can be described based on the fitness value. In order to increase the chance of finding a better location and achieve a fast convergence speed, consider improving the quality of the population space, and the remaining population spaces with poor quality will be ignored. Each round of iteration uses the method of linear population reduction until the number of iterations reaches T max Finally, the optimal honey source is input into the K-means algorithm. The implementation process is:

[0094] S71, linear population reduction, nectar source populations are arranged in ascending order according to their fitness values, the expression is:

[0095]

[0096] Where, Fitness1≤Fitness2≤L≤Fitness 2n

[0097] After calculating the sorted nectar source population P', the population size will decrease linearly as the number of iterations increases, and the expression is:

[0098]

[0099] Where t is the current iteration, T max is the maximum number of iterations. The population size of the first iteration (t = 1) is n, and the population size of the last iteration (t = T max ) is n c ;

[0100] S72, when the number of iterations reaches T max When the improved quantum artificial bee colony algorithm is used, the honey source is obtained. After the solution space transformation of the nectar source, it is input into the K-means algorithm as the initial clustering center.

[0101] S8. Execute K-means to divide the data into clusters and update the cluster center in each cluster.

[0102] Specifically, all data are divided into a cluster with the greatest similarity according to similarity. Similarity is measured by Euclidean distance. Here, the maximum similarity means the minimum Euclidean distance, which is expressed as:

[0103]

[0104] Where d(x,y) is the Euclidean distance between two data points x and y with m attributes;

[0105] Calculate the average value of all data in each cluster to update each cluster center. The expression is:

[0106]

[0107] Where j = {1, 2, ..., k}, k is the number of clusters, n j is the number of data points in the jth cluster.

[0108] S9. Reach the termination condition of K-means and output the final clustering result.

[0109] Specifically, the cluster centers before and after the update are compared. If the objective function converges or the number of updates reaches the set maximum number of iterations Maxcycle, the clustering result is output; otherwise, go to step S8.

[0110] Figure 2-7 These are the experimental test results of the IQABC algorithm and other algorithms on different data sets. Figure 2 It can be seen that IQABC has the fastest convergence speed and converges to the optimal value in 14 generations, which is significantly faster than the other three algorithms. The convergence curve of IQABC on the Cancer dataset is shown in Figure 2. Figure 3 As shown in the figure, although it is not as fast as ABC in the first 6 iterations, its convergence speed is the fastest among all algorithms in the later period. And at the 17th iteration, the sum of squared errors of IQABC is significantly different from those of QABC and PSO. Figure 4 The convergence curve on the Seeds dataset is shown. It can be seen that the convergence speed of IQABC decreases faster than other algorithms and reaches the optimal value in 17 generations. For the other three datasets, such as Figure 5 , Figure 6 and Figure 7 As shown, it can also be observed that IQABC has the advantages of fast convergence speed and good accuracy.

[0111] The following will explain the method of optimizing the K-means clustering problem by the improved quantum artificial bee colony algorithm through a specific embodiment. Clustering belongs to unsupervised learning in machine learning and is widely used in image retrieval, data mining, customer classification, object recognition and data analysis. Therefore, the embodiment of the present application can cluster the target data set. For example, the target data set is an image data set. Before clustering, the image data set is first preprocessed. The specific steps include converting the color image into a grayscale image to reduce the data dimension, and then normalizing the image data so that the value of each pixel is in the same range, thereby avoiding clustering deviations caused by inconsistent pixel value ranges. Then, the image is feature extracted, and the extracted features may include color histograms, texture features, etc. These image feature vectors are used as the solution space of the problem, and then the improved quantum artificial bee colony algorithm process is executed. The optimal clustering center output by the improved quantum artificial bee colony algorithm is used as the initial clustering center of K-means. K-means repeatedly calculates the distance from the feature vector to the clustering center and updates the clustering center until the convergence condition is reached, and finally completes the clustering of the image data.

[0112] In summary, the present invention provides an improved quantum artificial bee colony algorithm to optimize the K-means clustering problem method, which combines the artificial bee colony algorithm with quantum computing, and improves the algorithm by introducing quantum revolving gates based on the number of iterations and two adaptive rotation angles based on the fitness value, as well as two mobile development strategies based on symmetric functions and Levy flight, thereby effectively solving the defect that K-means is sensitive to the initial clustering center. The linear population size reduction strategy introduced can reduce computing resources and improve the quality of the search space. The improved algorithm is greatly improved in terms of convergence speed, stability and accuracy, and the experimental results compared with other swarm intelligence algorithms show that the improved algorithm has a better clustering effect.

[0113] Of course, the above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above-mentioned embodiments. It should be pointed out that any equivalent substitution or obvious deformation made by any person skilled in the art after reading this specification belongs to the substantive scope of this specification and should be protected by the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An improved quantum artificial bee colony algorithm to optimize the K-means clustering problem method, characterized in that: The following steps are involved: S1. Initialize the parameters of the improved quantum artificial bee colony algorithm and K-means algorithm; S2, generating honey source population based on quantum coding; S3, transform the solution space of the initial population and calculate the fitness value; S4, hired bee solution-seeking stage; S5, the observation bees select the employed bees according to probability to further find the solution; S6, the stage where scout bees generate new nectar sources; S7, reduce the population linearly, and exit the iteration when the maximum number of iterations of the improved quantum artificial bee colony algorithm is reached, and the obtained optimization result is used as the initial clustering center of K-means; S8, execute K-means, divide the data into clusters, and update the cluster center in each cluster; S9. Reach the termination condition of K-means and output the final clustering result.

2. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S1, the maximum number of iterations T of the improved quantum artificial bee colony algorithm is set max , iteration number t=1, number of nectar sources n, number of employed bees P1, number of observation bees P2, number of scout bees P3, limit number of nectar source stop updating L, input data set D, maximum number of iterations Maxcycle of K-means algorithm, number of clusters k.

3. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S2, the state of a quantum bit is: |φ>=α|0>+β|1> In the formula, α and β are two complex numbers, |α 2 and |β 2 are two probability amplitudes, and α and β satisfy |α 2 +|β 2 =1; let α = cos(θ), β = sin(θ), and express the above formula in matrix form: The randomized honey source is expressed as: P i t ={φ1(t),φ2(t),K,φ m (t)} Where i = {1, 2..., n}, m is the attribute dimension of the solution vector; When the population is initialized, an n*m matrix with angles ranging from 0 to 2π is constructed; i ij =rand(0,1);2π,i={1,2...,n},j={1,2...,m}, The nectar source population is expressed as:

4. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S3, assuming that the solution space of the problem is defined as Ω=[xMin, xMax], the conversion formula of the solution space is: The fitness value of each nectar source is calculated according to the objective function, and the expression is: In the formula, G i represents the i-th cluster, d(x i ,C j ) represents the data point x i To the center C of the cluster j The Euclidean distance.

5. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S4, the employed bees use a quantum revolving door with an adaptive rotation angle based on the number of iterations to search for new nectar sources. The expression of the adaptive rotation angle is: Where r is a constant greater than 1, which is used to control the adjustment rate of the rotation angle, and r is proportional to η; The expression for quantum revolving door to update honey source is: Δθ=Sign(α i ×b i )·or In the formula, the sign function Sign|(α i ×β i ) indicates the direction of the rotation angle.

6. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: The step S5 specifically includes the following steps: S51. The observation bees use the roulette method to select employed bees. The expression of the roulette method is: In the formula, fit i Represents the fitness value of the i-th nectar source or the i-th employed bee; S52. The observation bee uses two mobile development strategies to search for new nectar sources. The expression of the first mobile development strategy is: Where P i represents the location of the i-th nectar source, P best represents the global optimal nectar source location, Represents the average centroid position. r1, r2, and r3 are scalar values ​​randomly distributed in the range [0,1]. r1 specifies the influence of the current position on the next position. r2 and r3 are used to calculate the influence of the current position on the next position. best and Expand the search space around u 1(t) and u 2(t) is a scalar parameter, and is a symmetric function, expressed as: based on and u 1(t) and u 2(t) The parameters are calculated using the following expressions: Where v1, v2, v3, and v4 are random scalar numbers in the range [0,1]. According to the randomness of these parameters and two symmetric functions and u 1(t) and u 2(t) The value of can be negative or positive in any iteration; The second mobile development strategy is expressed as: In the formula, Levy(λ) is the concept of Levy flight introduced, which is a random walk whose step size follows Levy distribution, and the expression is: In the formula, U and V are two normally distributed variables, and the standard deviation is σ 2 and 1, γ is a parameter that controls the step size; U~N(0,σ 2 ) V~N(0,1) Where Γ is the gamma function, expressed as:

7. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: The step S6 specifically includes the following steps: S61. Randomly generate a nectar source according to the nectar source population matrix using the following formula: P i =P min +τ(P max -P min ) Where τ is a random number uniformly distributed in the interval [0,1], P min and P max Respectively represent the minimum and maximum values ​​in the nectar source population; S62, the randomly generated honey source is updated using a quantum revolving door with a rotation angle based on the fitness value, and the expression is: P i '=U(Δθ)·P i Where u is a random number in the interval [0,1], fit max and fit min are the optimal fitness value and the worst fitness value of the population, respectively. i is the current individual fitness value, θ max and θ min are the maximum and minimum angles in the angle matrix respectively; S63, the honey source P updated by the quantum revolving door i 'With the global optimal solution P best Combined, if the solution generated by the first half is less than the global optimal solution, the expression is: P i ”=P i '+(1-τ)(P i '-P best ) If the randomly generated solution in the first half is greater than the global optimal solution, the expression is: P i ”=P i '-(1-τ)(P i '-P best )。 8. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: The step S7 specifically includes the following steps: S71, linear population reduction, nectar source populations are arranged in ascending order according to their fitness values, the expression is: Where, Fitness1≤Fitness2≤L≤Fitness 2n After calculating the sorted nectar source population P', the population size will decrease linearly as the number of iterations increases, and the expression is: Where t is the current iteration, T max is the maximum number of iterations, the population size at the first iteration, t = 1, is n, and the last iteration, t = T max n c ; S72, when the number of iterations reaches T max When the improved quantum artificial bee colony algorithm is used, the honey source is obtained. After the solution space transformation of the nectar source, it is input into the K-means algorithm as the initial clustering center.

9. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S8, all data are divided into a cluster with the greatest similarity according to similarity. The similarity is measured by Euclidean distance, which is expressed as: Where d(x,y) is the Euclidean distance between two data points x and y with m attributes; Calculate the average value of all data in each cluster to update each cluster center. The expression is: Where j = {1, 2, ..., k}, k is the number of clusters, n j is the number of data points in the jth cluster.

10. The improved quantum artificial bee colony algorithm for optimizing K-means clustering problem as claimed in claim 1, characterized in that: In step S9, the cluster centers before and after the update are compared, and if the objective function converges or the number of updates reaches the set maximum number of iterations Maxcycle, the clustering result is output; Otherwise, go to step S8.

Citation Information

Cited By

  • Water pollution diffusion monitoring method based on quantum optimization bee colony algorithm

    CN120373051A