Classification processing method and device, computer storage medium and terminal
By determining the association matrix and performing multi-view correction optimization of sub-objective functions, the problem of heuristic method dependence in the existing technology is solved, the quality of variable classification is improved, and more efficient variable classification is achieved.
Patent Information
- Application Number
- CN202411267460.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The existing methods to solve the QUBO problem of large-scale variables rely on heuristic methods. How to reduce the dependence of heuristic methods and improve the quality of variable classification has become a problem to be solved.
By determining the association matrix, splitting it into sub-association matrix, calculating the feature matrix, constructing the multi-view correction function of the Laplace matrix and the sub-objective function, the optimized association matrix is obtained through alternating optimization, used for variable classification, and reducing the dependence of heuristic methods. .
Variable classification based on feature vectors is implemented, which improves the quality of variable classification and reduces dependence on heuristic methods.
Smart Images

Figure CN119128595A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to combinatorial optimization technology, and more particularly to a classification processing method, device, computer storage medium and terminal. Background Art
[0002] Combinatorial optimization problems refer to solving how to take values of variables for an objective function composed of many variables so that the objective function can obtain the optimal value. At the same time, this type of problem may involve different constraints and common problems. Among them, the quadratic unconstrained binary optimization problem (QUBO) is the most basic problem in combinatorial optimization problems. It is also a non-deterministic polynomial (NP-hard) problem that is difficult for classical computers to solve in polynomial time. The algorithms for related problems are widely used in finance, economics, machine learning and other fields.
[0003] In recent years, quantum computing technology has been effectively improved, and quantum computing methods have been proven to be effective in solving some of them; the development of quantum computing provides a new way and method to solve this type of NP-hard problem; among them, the quantum approximate optimization algorithm (QAOA) is a powerful hybrid method for solving these complex optimization problems. By converting the QUBO objective function into a cost Hamiltonian, QAOA can solve the QUBO problem using the number of variables corresponding to the number of available bits on a universal quantum computer. However, due to the limited connectivity of bits on current quantum computers, the number of available quantum bits is much smaller than the scale of the problem to be solved. In order to overcome this limitation, researchers have developed a sub-QUBO algorithm framework; this method is based on problem decomposition and splitting, and takes advantage of the excellent ability of QAOA to solve optimization problems, enabling the algorithm to escape from local minima and solve the global minimum with a greater probability. In this way, the sub-QUBO problem can handle complex combinatorial optimization problems with many variables.
[0004] The core idea of the sub-QUBO algorithm in related technologies is to solve the problem by divide-and-conquer and iterate. The iterative process is as follows: first, the QUBO objective function problem (a total of N variables) is divided into multiple sub-problems, each of which consists of a certain number of independent variables (N 1It is composed of <N); since the number of variables in each sub-problem is small, QAOA or some simple methods can be used to solve the small-scale sub-problems simply and accurately, and then the solutions of all sub-problems are combined into a new candidate solution; then the current candidate solution is refined and optimized using classical tabu search or other classical algorithms to form a current optimal solution for the global problem (which cannot be proven to be the global optimal solution in the strict mathematical sense). Therefore, various methods including random selection are proposed for variable grouping; the variables are sorted according to the impact or certainty of each variable on the objective function, and the most uncertain variables are extracted from the pool (set) of previously obtained solution schemes; then the problems composed of these variables are solved. Generally speaking, sub-QUBO is an idea of divide and conquer. However, the existing methods for solving QUBO problems with a large number of variables largely rely on heuristic methods and make strong assumptions about the interactions between variables that affect the objective function. How to reduce the dependence on heuristic methods and improve the quality of variable classification has become a problem to be solved. Summary of the Invention
[0005] An embodiment of the present application provides a classification processing method applied to combinatorial mathematics optimization problems, including: determining an association matrix according to the increased values of the objective function when two or more variables in the independent variable matrix are independently reversed and simultaneously reversed, where the association matrix is used to describe the correlation between two or more variables and the change of the objective function when the variables change;
[0006] The determined association matrix is split into two or more first sub-association matrices according to the values of the matrix elements;
[0007] Calculate each of the first sub-association matrices obtained by splitting to obtain the corresponding eigenmatrix of each sub-association matrix;
[0008] Select a preset number of first eigenvectors from the obtained eigenmatrices respectively to construct a second sub-association matrix;
[0009] Construct the Laplacian matrix corresponding to each first sub-association matrix;
[0010] According to a pre-determined distance function, sub-objective function, and the constructed Laplacian matrix, construct a sub-objective function multi-view correction function, where the distance function represents the distance between the subspaces constructed by the eigenmatrices corresponding to the second sub-association matrix, the sub-objective function is the objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplacian matrix, and the sub-objective function multi-view correction function is used to solve for the solution when the value of the distance function is the largest and the sub-objective function is the smallest;
[0011] By solving the sub-objective function multi-view correction function, all second sub-correlation matrices contained in the distance function are alternately optimized until the sub-objective function multi-view correction function converges to obtain a third sub-correlation matrix, and the third sub-correlation matrix is any one of the optimized second sub-correlation matrices;
[0012] The row vector of each row of the third sub-association matrix is used as the second eigenvector, and the second eigenvectors are clustered into a preset number of clusters to obtain a preset number of variable classification groups.
[0013] On the other hand, an embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned classification processing method is implemented.
[0014] On the other hand, an embodiment of the present application further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; wherein:
[0015] The processor is configured to execute the computer program in the memory;
[0016] When the computer program is executed by the processor, the classification processing method as described above is implemented.
[0017] In another aspect, the embodiment of the present application further provides a classification processing device, which is applied to combinatorial mathematical optimization problems, including: determining an association unit, a splitting unit, a calculation unit, a first construction unit, a second construction unit, a third construction unit, an optimization processing unit and a classification unit; wherein,
[0018] Determine the association unit setting as follows: determine the association matrix according to the increase value of the objective function when two or more variables in the independent variable matrix are independently reversed and simultaneously reversed, wherein the association matrix is used to describe the correlation between the two or more variables and the change of the objective function caused by the change of the variables;
[0019] The splitting unit is set to: split the determined correlation matrix into more than two first sub-correlation matrices according to the values of the matrix elements;
[0020] The calculation unit is set to: calculate each first sub-correlation matrix obtained by splitting, and obtain a corresponding feature matrix of each sub-correlation matrix;
[0021] The first construction unit is configured to: select a preset number of first eigenvectors from the obtained eigenmatrix respectively to construct a second sub-association matrix;
[0022] The second construction unit is configured to: construct a Laplace matrix corresponding to each first sub-incidence matrix;
[0023] The third construction unit is configured to: construct a sub-objective function multi-view correction function according to a predetermined distance function, a sub-objective function, and a constructed Laplace matrix, wherein the distance function represents the distance between subspaces constructed by the feature matrix corresponding to the second sub-association matrix, the sub-objective function is an objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplace matrix, and the sub-objective function multi-view correction function is used to solve a solution in which the distance function has a maximum value and the sub-objective function is minimized;
[0024] The optimization processing unit is set to: by solving the sub-objective function multi-view correction function, all second sub-association matrices contained in the distance function are alternately optimized until the third sub-association matrix is obtained when the sub-objective function multi-view correction function converges, and the third sub-association matrix is any one of the optimized second sub-association matrices;
[0025] The classification unit is set as follows: taking the row vector of each row of the third sub-association matrix as the second eigenvector, clustering the second eigenvectors into a preset number of clusters, and obtaining a preset number of variable classification groups.
[0026] The disclosed embodiment determines an association matrix, splits the association matrix into two or more parts, obtains a feature matrix by calculating each first sub-association matrix, selects a first eigenvector from the feature matrix, constructs a second sub-association matrix, and after constructing the Laplace matrix of the first sub-association matrix, further constructs a sub-objective function multi-view correction function according to the distance function, the sub-objective function and the Laplace matrix, obtains a second eigenvector for variable classification by solving the sub-objective function multi-view correction function, realizes variable classification based on the second eigenvector, reduces the dependence of the variable classification process on the heuristic method, and improves the quality of variable classification.
[0027] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0029] Figure 1 A flowchart of a classification processing method according to an embodiment of the present disclosure;
[0030] FIG2( a ) is a comparison diagram of the solution quality of a mathematical combinatorial optimization problem in a first embodiment of the present disclosure;
[0031] FIG2( b ) is a comparison diagram of solution quality of another mathematical combinatorial optimization problem according to an embodiment of the present disclosure;
[0032] FIG2( c ) is a comparison diagram of solution quality of another mathematical combinatorial optimization problem according to an embodiment of the present disclosure;
[0033] FIG2( d ) is a comparison diagram of solution quality of another mathematical combinatorial optimization problem according to an embodiment of the present disclosure;
[0034] FIG3( a ) is a comparison diagram of solution quality after changing the number of quantum bits used in solving sub-problems in Example 1 of the present disclosure;
[0035] FIG3( b ) is a comparison diagram of solution quality after changing the number of quantum bits used in solving sub-problems in another embodiment of the present disclosure;
[0036] Figure 4 The present invention is a structural block diagram of a device for classification processing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0038] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0039] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0040] To facilitate understanding of the embodiments of the present disclosure, the following briefly describes the relevant technologies: Combinatorial mathematical optimization problem is to solve the value of N variables contained in a set of independent variable matrix X, so that the objective function takes the minimum value, and the expression is minX T QX; where matrix Q is the objective function matrix; generally speaking, the value in X can be any real number. If it is necessary to be compatible with quantum computing and quantum bit characteristics, it needs to be mapped to a binary variable, b i,t ∈{0,1}, the mapping method is not limited, the method in the related art is In this way, we can set an upper limit of A xi A real variable is converted into a variable group consisting of G {0, 1} binary variables. In order to solve the problem that there are many variables in the problem to be solved and quantum computing or some classical algorithms cannot be used to effectively solve the combinatorial optimization problem, the relevant technology adopts the idea of sub-QUBO to solve it. The processing flow includes: initializing a current solution, updating the current optimal solution to the initialized solution, and then entering the iterative loop; in each iteration, the variables are grouped, and the sub-problems composed of each group of variables will form a small-scale QUBO problem, and quantum computing or some classical algorithms are used to solve the sub-problems. During the iterative loop, if the function value of the solution given at a certain time is the historical optimal solution, the historical optimal solution can be updated. After the iteration is completed, the final solution output is the optimal solution given by the algorithm. The variables are grouped based on their influence. For a given QUBO matrix Q and the current solution, the i-th variable x in the independent variable matrix i The impact is defined as the inversion variable (x iIf it was originally 1, it is reversed to 0). This increase is always positive if the current solution is a local minimum. After calculating the impact of the variables on the objective function, sort the variables in the independent variable matrix according to their impact; then, classify the N variables into R groups, that is, the variables in each group have roughly equal impact; ensure that the number of variables in each group is approximately [N / R], and ensure that the number of variables in a single subproblem is within the range allowed by quantum computers, or within the range of the number of variables that can be efficiently solved by classical solvers.
[0041] Figure 1 The flowchart of the classification processing method of the embodiment of the present disclosure is applied to combinatorial mathematical optimization problems, such as Figure 1 As shown, including:
[0042] Step 101, determining a correlation matrix according to the increase in the objective function when two or more variables in the independent variable matrix are inverted independently and simultaneously, wherein the correlation matrix is used to describe the correlation between the two or more variables and the change of the objective function caused by the change of the variables;
[0043] Step 102: split the determined correlation matrix into more than two first sub-correlation matrices according to the values of the matrix elements;
[0044] Step 103, calculating each first sub-correlation matrix obtained by splitting, and obtaining a feature matrix corresponding to each sub-correlation matrix;
[0045] Step 104: Select a preset number of first eigenvectors from the obtained feature matrix to construct a second sub-association matrix;
[0046] Step 105, constructing a Laplacian matrix corresponding to each first sub-incidence matrix;
[0047] Step 106: construct a sub-objective function multi-view correction function according to a predetermined distance function, a sub-objective function, and a constructed Laplace matrix, wherein the distance function represents the distance between subspaces constructed by the characteristic matrix corresponding to the second sub-association matrix, the sub-objective function is an objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplace matrix, and the sub-objective function multi-view correction function is used to solve a solution in which the distance function takes the maximum value and the sub-objective function is the minimum value;
[0048] Step 107, by solving the sub-objective function multi-view correction function, all the second sub-correlation matrices included in the distance function are alternately optimized until the sub-objective function multi-view correction function converges to obtain a third sub-correlation matrix, and the third sub-correlation matrix is any one of the optimized second sub-correlation matrices;
[0049] Step 108: cluster the second eigenvectors into a preset number of clusters using the row vector of each row of the third sub-association matrix as the second eigenvector, and obtain a preset number of variable classification groups. Here, the row vector of each row of the third sub-association matrix of the embodiment of the present disclosure is used as the second eigenvector, and the third sub-association matrix contains N rows of row vectors, so all the second eigenvectors can construct a second eigenvector group.
[0050] The disclosed embodiment determines an association matrix, splits the association matrix into two or more parts, obtains a feature matrix by calculating each first sub-association matrix, selects a first eigenvector from the feature matrix, constructs a second sub-association matrix, and after constructing the Laplace matrix of the first sub-association matrix, further constructs a sub-objective function multi-view correction function according to the distance function, the sub-objective function and the Laplace matrix, obtains a second eigenvector for variable classification by solving the sub-objective function multi-view correction function, realizes variable classification based on the second eigenvector, reduces the dependence of the variable classification process on the heuristic method, and improves the quality of variable classification.
[0051] In an exemplary embodiment, when the two or more variables in the embodiment of the present disclosure are variable i and variable j, the expression of the association matrix is:
[0052] Σ ij (x,Q)=Δf ij (x;Q)-Δf i (x;Q)-Δf j (x; Q);
[0053] Where Δf ij (X;Q) is the inversion variable x i and variable x j When the objective function is increased, the expression of Δf ij (X;Q) = f(x 1 ,x 2 ,…,x i ⊕1,…,x j ⊕1,…,x N ;Q)-f(X;Q);Δf i (X;Q) means inverting variable x i When the objective function is increased, the expression of Δf i (X;Q) = f(x 1 ,x 2 ,…,x i ⊕1,…,x N ;Q)-f(X;Q);Δf j (X;Q) means inverting variable x j When the objective function is increased, the expression of Δf j (X;Q) = f(x1 ,x 2 ,…,x j ⊕1,…,x N ; Q)-f(X; Q), f(X; Q) is the optimization objective function x when the independent variable takes the value x T The function value of Qx.
[0054] In the disclosed embodiment, when flipping variables i and j at the same time will lead to worse results, the correlation matrix element is positive; therefore, it is not recommended to flip variables i and j at the same time, as they are like mutually repelling forces. Similarly, negative correlation is like an attraction between two variables; therefore, this indicator can better describe the role of many variables in the overall objective function optimization problem (compared to impact).
[0055] The disclosed embodiment calculates the increased value of the objective function value of each variable of the inverted independent variable matrix for each set of solutions to the combinatorial mathematical optimization problem (including the initial solution or any set of solutions in the iteration) based on the current solution and the objective function matrix, and uses the increased value of the objective function when each of the N variables contained in the independent variable matrix is inverted as the matrix element to obtain an N*1 vector matrix.
[0056] In an exemplary embodiment, when the variables that are simultaneously inverted in the embodiment of the present disclosure include variable i, variable j, and variable k, the expression of the increase value of the objective function is:
[0057] Δf ijk (X;Q) = f(x 1 ,x 2 ,…,x i ⊕1,…,x j ⊕1,…,x k ⊕1,…,x N ;Q)-f(X;Q).
[0058] The association matrix can be obtained by subtracting the increase in the objective function of each variable from the increase in the objective function of the variables that are inverted simultaneously.
[0059] In an exemplary embodiment, when the embodiment of the present disclosure simultaneously inverts the variable i, the variable j, and the variable k, the expression of the association matrix is:
[0060] Σ ijk (x,Q)=Δf ijk (x;Q)-Δf i (x;Q)-Δf j (x;Q)-Δf k (x;Q).
[0061] The embodiment of the present disclosure can determine the relationship between variables through the association matrix. The association matrix is used to measure the influence and association of variables in combinatorial mathematical optimization problems, providing better classification indicators for subsequent classification solutions.
[0062] In an exemplary embodiment, the method of the present disclosure further includes:
[0063] The correlation matrix is weighted by a pre-set weighting matrix W = Σ, which is the direct use of the correlation matrix; weighting can specifically amplify the correlation between some independent variables, such as amplifying the correlation between two independent variables 2 and 3, W ij =Σ ij (i,j≠2,3or 3,2),W 23 =c·Σ 23 ,W 32 =c·Σ 32 , used to assume that the correlation between variables 2 and 3 is extremely high, then c is set to a very large coefficient; or more concerned with optimizing the correlation in the correlation matrix, that is, more concerned with Σ ij <0, W ij =Σ ij (Σ ij ≥0); W ij =c·Σ ij (Σ ij <0), set c to a very large coefficient. In this way, the weights are adjusted according to the pre-defined rules, and the correlation matrix is processed to convert Σ into W.
[0064] In an exemplary embodiment, the embodiment of the present disclosure splits the determined incidence matrix into more than two first sub-incidence matrices according to the values of the matrix elements, including:
[0065] Determine the value range of the matrix elements contained in the incidence matrix;
[0066] The value range is equally divided into two or more intervals, and the correlation matrix is split into two or more first sub-correlation matrices according to the two or more equally divided intervals.
[0067] In an exemplary embodiment, assuming that the obtained correlation matrix is Σ, assuming that according to the positive and negative (greater than and less than 0) of the matrix elements, Σ is divided into positive Σ 1 and negative Σ 2 The two first sub-association matrices describe "repulsion" and "attraction" respectively. Then, the characteristic matrices of the two first sub-association matrices are calculated. For the preset number (K) of first eigenvectors of the characteristic matrix, they are u 1 ,u 2 ,…,u K ; The corresponding second sub-incidence matrix U can be constructed1 (dimension is N*K) and U 2 .
[0068] In an exemplary embodiment, the embodiment of the present disclosure constructs a Laplacian matrix corresponding to each first sub-incidence matrix, including:
[0069] Calculate a non-normalized Laplacian matrix based on the first sub-incidence matrix;
[0070] Among them, the Laplace matrix is L, L = VW, W represents the first sub-incidence matrix, V is the diagonal matrix V ii =Σ j W ij , each diagonal element of the matrix V is an element on the diagonal of the matrix, which is the element of the i-th row and i-th column of Vii. It is calculated by taking W i1 , W i2 ,…W in Add together.
[0071] The Laplacian matrix L of the disclosed embodiment is a semi-positive definite matrix, and its smaller eigenvalues correspond to some important features; for example, the eigenvalue 0 corresponds to the feature space spanned by the indicator vectors of the connected components of the graph. Therefore, the characteristics between variables can be obtained through the L matrix; using the characteristics between variables, the first preset number of eigenvectors of the Laplacian matrix L can be determined, which are u 1 ,u 2 ,…,u K These eigenvectors are used to form a matrix for variable classification; when the preset number is K, the dimension of the matrix used for variable classification is N*K.
[0072] In an exemplary embodiment, the distance function of the embodiment of the present disclosure is D:
[0073] The number of the first sub-incidence matrix is U 1 and U 2 When there are two, the expression of D is: D(U 1 ,U 2 )=tr((U 1 ) T (U 2 )(U 2 ) T (U 1 ));
[0074] The number of the first sub-incidence matrix is greater than two, which is U 1 ,U 2 ,…,U M hour,
[0075] In an exemplary embodiment, the Laplacian matrix of the first sub-incidence matrix of the embodiment of the present disclosure is L i , the second sub-incidence matrix of the i-th is U i , the corresponding sub-objective function is (U i ) T L i U i , the expression of the sub-objective function multi-view correction function is:
[0076]
[0077] Where M represents the number of the first sub-incidence matrix. For each U i Yes (U i ) T U i =I.
[0078] In an exemplary embodiment, the embodiment of the present disclosure clusters the second feature vector into a preset number of clusters, including:
[0079] The second eigenvector is clustered into a preset number of clusters using a k-means clustering method to obtain a preset number of groups.
[0080] The k-means clustering in the embodiment of the present disclosure is only an example, and clustering methods including K-Medoids clustering, hierarchical clustering, density-based clustering method, grid-based clustering method, etc. may also be used, and the embodiment of the present disclosure does not limit this.
[0081] The second sub-incidence matrix includes U 1 and U 2 For example, for U 1 and U 2 Alternate optimization is performed until the sub-objective function multi-view correction function is optimal; the embodiment of the present disclosure can select the optimized U 1 and U 2 As one of U best .U best The row vector of the i-th row is used as the second eigenvector {yi} (dimension 1*K), and these N vectors together constitute the second eigenvector group.
[0082] In an illustrative example, the value of the preset number in the embodiment of the present disclosure is determined according to the ability of a quantum computer to solve a sub-problem.
[0083] In an exemplary embodiment, the number of variables included in the independent variable matrix of the embodiment of the present disclosure is N, the preset number is R, and the clusters generated by clustering the second eigenvectors are C 1 ,C 2 ,…,C R, obtain the grouping of the preset number of variable classifications as A 1 ,A 2 ,…,A R Among them, A i ={j|y j ∈C i}. The disclosed embodiment processes N variables ({x i}) are classified into R clusters, achieving grouping.
[0084] In an exemplary embodiment, after clustering the obtained second feature vector into a preset number of clusters and obtaining a preset number of variable classification groups, the method of the embodiment of the present disclosure further includes:
[0085] Based on the obtained grouping of variable classifications, the solution of the combinatorial mathematical optimization problem is performed.
[0086] The independent variable matrix of the disclosed embodiment has a total of N variables, which is too many to be solved at one time, so it is divided into a preset number (R) of groups, and the subproblem solver needs to solve subproblems consisting of at most ([N / R]+1) variables at one time, that is, the group with the largest number of variables is also less than ([N / R]+1); therefore, m usually needs to be at least greater than or equal to [N / the number of independent variables allowed by the subproblem], that is, a positive integer of N / the number of quantum bits.
[0087] After obtaining the second feature vector group in the embodiment of the present disclosure, assuming that the second feature vector group is {yi} (size 1*K, K is a preset number of values, a total of N, N is the number of variables), the second feature vector is clustered into R clusters (classes) using the k-means clustering method, and the generated cluster C 1 ,C 2 ,…,C R The final output clustering is that there are R clusters, namely A 1 ,A 2 ,…,A R , where A i ={j|y j ∈C i}, at this time, the N variables in the independent variable matrix are classified into R clusters, achieving grouping.
[0088] When solving the sub-problem in the embodiment of the present disclosure, N independent variables x 1 ~x N Classified as A 1 ~A R These R groups are included. For example: Assume A 1 The cluster contains {1, 3, 4}, so the vector x {134} ={x 1 ,x 3,x 4 The sub-optimization problem of From the original question (minX T QX). Then we can use quantum QAOA or quantum annealing or other classical methods to solve it. Get the current best {x 1 ,x 3 ,x 4}; Next, solve the subproblems in the other R-1 clusters, and finally piece together the current solutions to form an overall solution consisting of N independent variables; where, It is a sub-problem defined in the sub-QUBO framework, and is also a sub-problem that is usually better handled by quantum computing algorithms such as QAOA and quantum annealing.
[0089] The disclosed embodiment constructs an association matrix that captures the impact of variables on the objective function; this association matrix represents the degree of association derived from the QUBO matrix and the current solution, and is used to describe the correlation between two or more variables and the change in the objective function caused by the change in the variable. By mapping the association matrix to the Laplace matrix, the variables are grouped by clustering, and each group constitutes a sub-problem; after determining the classification of the variables according to the clustering results, the sub-problems are solved, thereby improving the ability to solve the global optimal solution; the disclosed embodiment refers to the relevant technology, and QAOA (or other effective methods for solving sub-problems) can be applied to each sub-problem to obtain a better solution, and finally iterate to form the optimal solution to the problem.
[0090] The disclosed embodiment uses a randomly generated regular graph and Numerical simulations are performed on the MAXCUT problem of the Rényi graph using the method of the present invention, which proves that the method of the present invention is superior to related technologies in terms of solution quality. Figure 2(a) to Figure 2(d)This is a comparison diagram of the solution quality of the mathematical combinatorial optimization problem of the embodiment of the present disclosure. In the figure, curve 2-1-1 and data bar 2-1-2 correspond to the results obtained by sorting and grouping the independent variables and then applying sub-QUBO when the calculation of the indicator in the sub-QUBO problem in the related technology is the impact; curve 2-2-1 and data bar 2-2-2 correspond to the results obtained by sorting and grouping the independent variables and then applying sub-QUBO when the calculation of the indicator in the sub-QUBO problem in the related technology is the certainty; curve 2-3-1 and data bar 2-3-2 correspond to the results obtained by classifying the independent variables using the method of the embodiment of the present disclosure and then applying them to sub-QUBO; the sub-problems of the above methods are solved using the QAOA algorithm; the problem to be solved here is a MAXCUT problem with 100 random independent variables and 100 side lengths, wherein the side lengths in the MAXCUT problem are randomly generated, and then the problem to be solved is solved by the above three methods respectively to obtain the final result. The horizontal axis in Figure 2(a) is the final solution (x end ) corresponds to the objective function value Then the vertical axis is the frequency of occurrence (how many times in 100 problems). It can be seen from the figure that the cluster method we proposed can give a better solution, because the overall solved objective function value is lower (better); the horizontal axis of Figure 2 (b) is the average number of times the quantum computer is used to solve the sub-problems in one iteration; the horizontal axis of Figure 2 (c) is the number of sub-problems called by the quantum computer in the whole problem; the horizontal axis of Figure 2 (d) is the computing time used to solve the whole problem. Through analysis, it can be determined that the algorithm of the disclosed embodiment can achieve better results. With the improvement of quantum computer performance in the future, the speed of the algorithm of the disclosed embodiment will be further improved. Figure 3(a) to Figure 3(b) This is a comparison diagram of the solution quality when the number of quantum bits used in solving sub-problems is changed in the embodiment of the present disclosure. In the figure, the X-axis is the number of sub-problem variables, curve 3-1 corresponds to the result when the calculation of the indicator in the sub-QUBO problem in the related art is the impact; curve 3-2 corresponds to the result when the calculation of the indicator in the sub-QUBO problem in the related art is the certainty; curve 3-3 is the result obtained by classifying the independent variables using the Laplace matrix clustering method of the embodiment of the present disclosure; the y-axis coordinate of Figure 3(a) gives the objective function value. By comparison, it can be found that no matter how the quantum computing capability is enhanced, the method of the embodiment of the present disclosure can maintain a constant advantage; the y-axis of Figure 3(b) gives the number of quantum sub-problem process calls, which can also be equivalently understood as the running time. It can be found that as the performance of quantum computers improves and the sub-problems are allowed to expand in scale, the time spent by the algorithm of the embodiment of the present disclosure will be close to that of the traditional algorithm.
[0091] The embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned classification processing method is implemented.
[0092] The embodiment of the present disclosure also provides a terminal, including: a memory and a processor, wherein a computer program is stored in the memory;
[0093] in,
[0094] The processor is configured to execute the computer program in the memory;
[0095] When the computer program is executed by a processor, the above-mentioned classification processing method is implemented.
[0096] Figure 4 The structural block diagram of the classification processing device of the embodiment of the present disclosure is applied to combinatorial mathematical optimization problems, such as Figure 4 As shown, it includes: a determination association unit, a splitting unit, a calculation unit, a first construction unit, a second construction unit, a third construction unit, an optimization processing unit and a classification unit; wherein,
[0097] Determine the association unit setting as follows: determine the association matrix according to the increase value of the objective function when two or more variables in the independent variable matrix are independently reversed and simultaneously reversed, wherein the association matrix is used to describe the correlation between the two or more variables and the change of the objective function caused by the change of the variables;
[0098] The splitting unit is set to: split the determined correlation matrix into more than two first sub-correlation matrices according to the values of the matrix elements;
[0099] The calculation unit is set to: calculate each first sub-correlation matrix obtained by splitting, and obtain a corresponding feature matrix of each sub-correlation matrix;
[0100] The first construction unit is configured to: select a preset number of first eigenvectors from the obtained eigenmatrix respectively to construct a second sub-association matrix;
[0101] The second construction unit is configured to: construct a Laplace matrix corresponding to each first sub-incidence matrix;
[0102] The third construction unit is configured to: construct a sub-objective function multi-view correction function according to a predetermined distance function, a sub-objective function, and a constructed Laplace matrix, wherein the distance function represents the distance between subspaces constructed by the feature matrix corresponding to the second sub-association matrix, the sub-objective function is an objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplace matrix, and the sub-objective function multi-view correction function is used to solve a solution in which the distance function has a maximum value and the sub-objective function is minimized;
[0103] The optimization processing unit is set to: by solving the sub-objective function multi-view correction function, all second sub-association matrices contained in the distance function are alternately optimized until the third sub-association matrix is obtained when the sub-objective function multi-view correction function converges, and the third sub-association matrix is any one of the optimized second sub-association matrices;
[0104] The classification unit is set as follows: taking the row vector of each row of the third sub-association matrix as the second eigenvector, clustering the second eigenvectors into a preset number of clusters, and obtaining a preset number of variable classification groups.
[0105] In an exemplary embodiment, when the two or more variables in the embodiment of the present disclosure are variable i and variable j, the expression of the association matrix is:
[0106] Σ ij (x,Q)=Δf ij (x;Q)-Δf i (x;Q)-Δf j (x; Q);
[0107] Where Δf ij (X;Q) is the inversion variable x i and variable x j When the objective function is increased, the expression of Δf ij (X;Q) = f(x 1 ,x 2 ,…,x i ⊕1,…,x j ⊕1,…,x N ;Q)-f(X;Q);Δf i (X;Q) means inverting variable x i When the objective function is increased, the expression of Δf i (X;Q) = f(x 1 ,x 2 ,…,x i ⊕1,…,x N ; Q)-f(X; Q); Δf j (X;Q) means inverting variable x j When the objective function is increased, the expression of Δf j (X;Q) = f(x 1 ,x 2 ,…,x j ⊕1,…,x N ; Q)-f(X; Q), f(X; Q) is the optimization objective function x when the independent variable takes the value x T Function value of Qx.
[0108] In an exemplary embodiment, the embodiment of the present disclosure determines that the association unit is further configured to:
[0109] The correlation matrix is weighted by a preset weighting matrix.
[0110] In an exemplary embodiment, the second building unit of the embodiment of the present disclosure is configured as:
[0111] Calculate a non-normalized Laplacian matrix based on the first sub-incidence matrix;
[0112] Among them, the Laplace matrix is L, L = VW, W represents the first sub-incidence matrix, V is the diagonal matrix V ii =Σ j W ij .
[0113] In an exemplary embodiment, the splitting unit of the embodiment of the present disclosure is configured as follows:
[0114] Determine the value range of the matrix elements contained in the incidence matrix;
[0115] The value range is equally divided into two or more intervals, and the correlation matrix is split into two or more first sub-correlation matrices according to the two or more equally divided intervals.
[0116] In an exemplary embodiment, the distance function of the embodiment of the present disclosure is D:
[0117] The number of the first sub-incidence matrix is U 1 and U 2 When there are two, the expression of D is: D(U 1 ,U 2 )=tr((U 1 ) T (U 2 )(U 2 ) T (U 1 ));
[0118] The number of the first sub-incidence matrix is greater than two, which is U 1 ,U 2 ,…,U M hour,
[0119] In an exemplary embodiment, the Laplacian matrix of the first sub-incidence matrix of the embodiment of the present disclosure is L i , the second sub-incidence matrix of the i-th is U i , the corresponding sub-objective function is (U i ) T L i U i, the expression of the sub-objective function multi-view correction function is:
[0120]
[0121] Where M represents the number of the first sub-incidence matrix, and for each U i Yes (U i ) T U i =I.
[0122] In an exemplary embodiment, the classification unit of the embodiment of the present disclosure is configured as follows:
[0123] The second eigenvector is clustered into a preset number of clusters using a k-means clustering method to obtain a preset number of groups.
[0124] In an illustrative example, the value of the preset number in the embodiment of the present disclosure is determined according to the ability of a quantum computer to solve a sub-problem.
[0125] In an exemplary embodiment, the number of variables included in the independent variable matrix of the embodiment of the present disclosure is N, the preset number is R, and the clusters generated by clustering the second eigenvectors are C 1 ,C 2 ,…,C R , obtain the grouping of the preset number of variable classifications as A 1 ,A 2 ,…,A R Among them, A i ={j|y j ∈C i}.
[0126] In an exemplary embodiment, the apparatus of the embodiment of the present disclosure further includes a solving unit configured to: perform solving of a combinatorial mathematical optimization problem according to the obtained grouping of variable classifications.
[0127] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term "computer storage medium" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A classification processing method, applied to combinatorial optimization problems, characterized in that: include: According to the increase in the objective function when two or more variables in the independent variable matrix are inverted independently and simultaneously, the correlation matrix is determined, wherein the correlation matrix is used to describe the correlation between two or more variables and the change of the objective function caused by the change of the variables; Splitting the determined correlation matrix into two or more first sub-correlation matrices according to the values of the matrix elements; Calculate each first sub-correlation matrix obtained by splitting, and obtain the corresponding feature matrix of each sub-correlation matrix; Selecting a preset number of first eigenvectors from the obtained feature matrix to construct a second sub-association matrix; Construct the Laplacian matrix corresponding to each first sub-incidence matrix; According to the predetermined distance function, the sub-objective function, and the constructed Laplace matrix, a sub-objective function multi-view correction function is constructed, wherein the distance function represents the distance between the subspaces constructed by the characteristic matrix corresponding to the second sub-association matrix, the sub-objective function is the objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplace matrix, and the sub-objective function multi-view correction function is used to solve the solution in which the distance function takes the maximum value and the sub-objective function is the minimum value; By solving the sub-objective function multi-view correction function, all second sub-correlation matrices contained in the distance function are alternately optimized until the sub-objective function multi-view correction function converges to obtain a third sub-correlation matrix, and the third sub-correlation matrix is any one of the optimized second sub-correlation matrices; The row vector of each row of the third sub-association matrix is used as the second eigenvector, and the second eigenvectors are clustered into a preset number of clusters to obtain a preset number of variable classification groups.
2. The method according to claim 1, characterized in that When the two or more variables are variable i and variable j, the expression of the association matrix is: Σ ij (x,Q)=Δf ij (x;Q)-Δf i (x;Q)-Δf j (x;Q); Where Δf ij (X;Q) is the inversion variable x i and variable x j When the expression of the increase in the objective function is ij (X;Q) = f(x1,x2,…,x i ⊕1,…,x j ⊕1,…,x N ; Q)-f(X; Q); Δf i (X;Q) means inverting variable x i When the expression of the increase in the objective function is i (X;Q) = f(x1,x2,…,x i ⊕1,…,x N ; Q)-f(X; Q); Δf j (X;Q) means inverting variable x j When the expression of the increase in the objective function is j (X;Q) = f(x1,x2,…,x j ⊕1,…,x N ; Q)-f(X; Q), f(X; Q) is the optimization objective function x when the independent variable takes the value x T Function value of Qx.
3. The method according to claim 1, characterized in that The method further comprises: The association matrix is weighted by a preset weighting matrix.
4. The method according to claim 1, characterized in that: The step of splitting the determined correlation matrix into two or more first sub-correlation matrices according to the values of the matrix elements includes: Determining the value range of the matrix elements contained in the incidence matrix; The value range is equally divided into two or more intervals, and the correlation matrix is split into two or more first sub-correlation matrices according to the two or more equally divided intervals.
5. The method according to claim 1, characterized in that The step of constructing a Laplace matrix corresponding to each first sub-incidence matrix includes: Calculating the non-normalized Laplacian matrix according to the first sub-incidence matrix; Wherein, the Laplace matrix is L, L=VW, W represents the first sub-incidence matrix, and V is the diagonal matrix V ii =Σ j W ij .
6. The method according to any one of claims 1 to 5, characterized in that: The distance function is D: When the number of the first sub-incidence matrices is two, U1 and U2, the expression of D is: D(U1,U2)=tr((U1) T (U2)(U2) T (U1)); The number of the first sub-incidence matrices is greater than two, namely, U1, U2, ..., U M hour, 7. The method according to claim 6, characterized in that The Laplace matrix of the i-th first sub-incidence matrix is L i , the second sub-incidence matrix of the i-th is U i , the corresponding sub-objective function is (U i ) T L i U i , the expression of the sub-objective function multi-view correction function is: Where M represents the number of the first sub-incidence matrix. For each U i Yes (U i ) T U i =I.
8. The method according to any one of claims 1 to 5, characterized in that: The clustering of the second feature vector into a preset number of clusters includes: The second feature vector is clustered into a preset number of clusters using a k-means clustering method to obtain a preset number of groups.
9. The method according to any one of claims 1 to 5, characterized in that: The number of variables contained in the independent variable matrix is N, the preset number is R, and the clusters generated by clustering the second eigenvectors are C1, C2, ..., C R The preset number of variable classification groups are obtained as A1, A2, ..., A R ; Among them, A i ={j|y j ∈C i }.
10. The method according to any one of claims 1 to 5, characterized in that: After clustering the obtained second eigenvectors into a preset number of clusters to obtain a preset number of variable classification groups, the method further includes: According to the obtained grouping of the variable classifications, solving the combinatorial mathematical optimization problem is performed.
11. A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the classification processing method according to any one of claims 1 to 10 is implemented.
12. A terminal, comprising: A memory and a processor, wherein the memory stores a computer program; wherein, The processor is configured to execute the computer program in the memory; When the computer program is executed by the processor, the classification processing method according to any one of claims 1 to 10 is implemented.
13. A classification processing device, applied to combinatorial mathematical optimization problems, comprising: Determine an association unit, a splitting unit, a calculation unit, a first construction unit, a second construction unit, a third construction unit, an optimization processing unit and a classification unit; wherein, Determine the association unit setting as follows: determine the association matrix according to the increase value of the objective function when two or more variables in the independent variable matrix are independently reversed and simultaneously reversed, wherein the association matrix is used to describe the correlation between the two or more variables and the change of the objective function caused by the change of the variables; The splitting unit is set to: split the determined correlation matrix into more than two first sub-correlation matrices according to the values of the matrix elements; The calculation unit is set to: calculate each first sub-correlation matrix obtained by splitting, and obtain a corresponding feature matrix of each sub-correlation matrix; The first construction unit is configured to: select a preset number of first eigenvectors from the obtained eigenmatrix respectively to construct a second sub-association matrix; The second construction unit is configured to: construct a Laplacian matrix corresponding to each first sub-incidence matrix; The third construction unit is configured to: construct a sub-objective function multi-view correction function according to a predetermined distance function, a sub-objective function, and a constructed Laplace matrix, wherein the distance function represents the distance between subspaces constructed by the feature matrix corresponding to the second sub-association matrix, the sub-objective function is an objective function for solving the combinatorial data optimization problem determined according to the second sub-association matrix and the constructed Laplace matrix, and the sub-objective function multi-view correction function is used to solve a solution in which the distance function has a maximum value and the sub-objective function is minimized; The optimization processing unit is set to: by solving the sub-objective function multi-view correction function, all second sub-association matrices contained in the distance function are alternately optimized until the third sub-association matrix is obtained when the sub-objective function multi-view correction function converges, and the third sub-association matrix is any one of the optimized second sub-association matrices; The classification unit is set as follows: taking the row vector of each row of the third sub-association matrix as the second eigenvector, clustering the second eigenvectors into a preset number of clusters, and obtaining a preset number of variable classification groups.
