Spectral clustering method based on SimRank and sparse representation
By introducing sparse representation and representative point selection in the spectral clustering algorithm, the time complexity of SimRank calculation and spectral clustering is reduced, the problem of low data processing efficiency of large-scale nodes in the existing technology is solved, and efficient clustering is achieved analyze.
Patent Information
- Application Number
- CN202410933380.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-12-20
AI Technical Summary
The existing SimRank-based spectral clustering algorithm has a high time overhead when processing large-scale node data, and it is impossible to efficiently calculate the node similarity matrix, resulting in insufficiency of clustering.
Spectral clustering method based on SimRank and sparse representation is adopted, and by pre-processing the directed graph, selecting representative points, calculating the similarity matrix and performing singular value decomposition, reducing the computational complexity and improving clustering efficiency.
The time complexity of SimRank calculation and spectral clustering is significantly reduced, clustering efficiency is improved, and similarity calculation and clustering process are accelerated.
Smart Images

Figure QLYQS_2 
Figure QLYQS_3 
Figure QLYQS_5
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graph data mining and cluster analysis, and in particular to a spectral clustering method based on SimRank and sparse representation. Background Art
[0002] Clustering technology is an unsupervised learning algorithm used to divide objects in a data set into multiple categories. In clustering technology, each category consists of a group of similar objects, while objects in different categories have greater differences. Clustering technology is widely used in data mining, pattern recognition, information retrieval, bioinformatics and other fields. In data mining, clustering technology can be used to discover hidden patterns and structures in data sets, thereby helping companies develop better marketing strategies. In bioinformatics, clustering technology can be used to classify and analyze gene expression data. The core idea of clustering technology is to find a metric that makes the similarity between objects in the same category high, while the similarity between objects in different categories is low.
[0003] Spectral clustering is a hot topic in the current clustering algorithm research. Spectral clustering is widely used in social network analysis, bioinformatics and other fields, especially for application scenarios that need to process large-scale high-dimensional data. Spectral clustering is a clustering technology based on graph theory. It regards data as nodes, which are connected by edges and have weights. Nodes with higher similarity have higher weights, and nodes with lower similarity have lower weights. Spectral clustering transforms the clustering problem into a graph segmentation problem. The purpose is to find a way to cut the graph so that the sum of the weights between different subgraphs after cutting is as low as possible, while the weight within the subgraph is as high as possible, so as to achieve the purpose of clustering.
[0004] The input of the spectral clustering algorithm is the similarity matrix or its generation method. Therefore, the effect of spectral clustering depends on the quality of the similarity measurement method. The traditional similarity measurement method is based on the distance between nodes, but the node distance cannot fully reflect the node similarity. For example, in a social network, two friends may be geographically far apart, but have a high similarity, while two strangers who are close to each other have a low similarity. SimRank is a method for measuring the similarity of the structural context in which the nodes are located. Its main idea is that "two objects related to similar objects are similar." Existing spectral clustering algorithms based on SimRank first use SimRank to obtain the node similarity matrix, and then input the similarity matrix into the spectral clustering algorithm. When the number of nodes is large, the time overhead is very large. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention designs a spectral clustering method based on SimRank and sparse representation.
[0006] A spectral clustering method based on SimRank and sparse representation specifically includes the following steps:
[0007] Step 1: Preprocess the graph data of the directed graph;
[0008] The directed graph G(N,E) is a set of directed graph nodes, E is a set of directed edges, and the number of directed graph nodes is n; A is an n×n adjacency matrix;
[0009] Step 1.1: Sum the columns of the adjacency matrix A to obtain the in-degree of each node, which is represented by the graph in-degree matrix In; as shown in formula (1), where I k represents the in-degree of node k;
[0010] In=(I1,I2,…I n ) (1)
[0011] Step 1.2: Sum the adjacency matrix A row by row to obtain the out-degree of each node, which is represented by the graph out-degree matrix Out; as shown in formula (2), where O k represents the out-degree of node k;
[0012] Out=(O1,O2,…O n ) (2)
[0013] Step 2: Select representative points;
[0014] Sort all nodes by out-degree, and select p nodes with the largest out-degree from the directed graph node set N as representative nodes. If two nodes have the same out-degree, select the node with the smaller in-degree; where p is less than the total number of nodes n;
[0015] Step 3: Calculate the similarity matrix W k ;
[0016] Step 3.1: Solve the first-order reachability matrix R1; let the representative point i, R1(i,j) is calculated as shown in formula (3), and R1 is normalized to obtain
[0017]
[0018] Among them, R1(i,j) represents the probability of reaching the representative point i by taking one step of reverse random walk from node j, and I j represents the in-degree of node j, C is the random walk damping coefficient;
[0019] Step 3.2: Recursively solve the k-order reachability matrix R k ; Let from point i to point w k There exists a path i→w1→w2→…→w of length k k-1 →w k , from point wk Starting from a point, the probability of reaching point i after k steps of reverse random walk is as shown in formula (4), where C is the random walk damping coefficient;
[0020]
[0021] Formula (4) is the k - step reachability from point w k to point i; Denote as the k - step reachability matrix, and R k (i, j) represents the k - step reachability from point j to the representative point i; When k < K, solve the k - step reachability matrix R k , k > 1; Initialize R k as a p * n all - zero matrix; If R k-1 (i, j) ≠ 0, then find the set of vertices pointed to by point j, OutNeighbor(j) = {u|u ∈ N and <j, u> ∈ E}, for all u ∈ OutNeighbor(j), then R k (i, u) = R k-1 (i, j) * I(u) * C;
[0022] Step 3.3: Based on the reachability matrix R k Solve the k - step similarity matrix W k ; Suppose starting from the representative point i, there are two paths of length k to point j and point s, then formula (5) represents the probability that point j and point s meet at the representative point i after k steps of reverse random walk;
[0023]
[0024] Formula (6) represents the sum of the probabilities that point j and point s meet at all representative points after k steps of reverse random walk, and uses it to estimate the similarity between point j and point s;
[0025]
[0026] Then formula (7) represents the k - step similarity matrix of the directed graph G based on the representative points;
[0027]
[0028] Among them, is the matrix after column - normalization of R k ;
[0029] Step 4: Solve the eigenvector matrix V of the similarity matrix WW k ; Suppose
[0030] Let be an n * n diagonal matrix, Rij is the matrix R k The element value of the i-th row and j-th column; It is R k The purpose of the column-normalized matrix is to make W k The diagonal elements of are 1; The singular value decomposition of is shown in formula (8);
[0031]
[0032] in u i is the left singular vector, v i is a right singular vector; ∑=diag(σ1,σ2,…σ p ), and σ1≥σ2≥…≥σ p ≥0;u i is a matrix The eigenvector of i is the k-order similarity matrix The characteristic vector of yes or The characteristic value of First pass Perform eigendecomposition to obtain U and ∑, and then use formula (9) to solve the eigenvector matrix V;
[0033]
[0034] The time complexity of solving U is O(p 3 ), the time complexity of solving V through U and ∑ is O(np 2 ); therefore, solving for W k The time complexity of the eigenvector is O(n 3 ) is reduced to O(p 3 +np 2 );
[0035] Step 5: Perform k-means clustering on the feature vector matrix V.
[0036] The present invention has the following beneficial effects:
[0037] (1) Reduce the time complexity of SimRank’s computation of graph node similarity matrix from O(Kn 3 ) is reduced to O(pKn 2 ), where p<<n.
[0039] (2) Reduce the computational time complexity of spectral clustering from O(n 3 ) is reduced to O(p 3 +p 2n).
[0040] (3) The sparse representation technology is applied to the spectral clustering algorithm based on SimRank similarity, which accelerates both the similarity calculation and spectral clustering stages and improves the clustering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Flow chart of spectral clustering algorithm based on SimRank and sparse representation in the embodiment of the present invention; DETAILED DESCRIPTION
[0042] A spectral clustering method based on SimRank and sparse representation, such as Figure 1 As shown, the specific steps include:
[0043] Step 1: Preprocess the graph data of the directed graph;
[0044] The directed graph G(N,E) is a set of directed graph nodes, E is a set of directed edges, and the number of directed graph nodes is n; A is an n×n adjacency matrix;
[0045] Step 1.1: Sum the columns of the adjacency matrix A to obtain the in-degree of each node, which is represented by the graph in-degree matrix In; as shown in formula (1), where I k represents the in-degree of node k;
[0046] In=(I1,I2,…I n ) (1)
[0047] Step 1.2: Sum the adjacency matrix A row by row to obtain the out-degree of each node, which is represented by the graph out-degree matrix Out; as shown in formula (2), where O k represents the out-degree of node k;
[0048] Out=(O1,O2,…O n ) (2)
[0049] Step 2: Select representative points;
[0050] Sort all nodes by out-degree, and select p nodes with the largest out-degree from the directed graph node set N as representative nodes. If two nodes have the same out-degree, select the node with the smaller in-degree; where p is less than the total number of nodes n;
[0051] Step 3: Calculate the similarity matrix W k ;
[0052] Step 3.1: Solve the first-order reachability matrix R1; let the representative point i, R1(i,j) is calculated as shown in formula (3), and R1 is normalized to obtain
[0053]
[0054] Among them, R1(i, j) represents the probability of reaching the representative point i by reverse random walk for 1 step from node j, where I j represents the in-degree of node j, and C is the random walk damping coefficient;
[0055] Step 3.2: Recursively solve the k-order reachability matrix R k ; Suppose there is a path of length k from point i to point w k i → w1 → w2 → … → w k-1 → w k , the probability of reaching point i after reverse random walk for k steps starting from point w k is shown in formula (4), where C is the random walk damping coefficient;
[0056]
[0057] Formula (4) is the k-order reachability from point w k to point i; use to represent the k-order reachability matrix, and R k (i, j) represents the k-order reachability from point j to the representative point i; when k < K, solve the k-order reachability matrix R k , k > 1; initialize R k as a p*n all-zero matrix; if R k-1 (i, j) ≠ 0, then find the set of vertices pointed to by point j OutNeighbor(j) = {u|u ∈ N and <j, u> ∈ E}, for all u ∈ OutNeighbor(j), then R k (i, u) = R k-1 (i, j) * I(u) * C;
[0058] Step 3.3: Solve the k-order similarity matrix W k based on the reachability matrix R k ; Suppose there are two paths of length k from the representative point i to points j and s respectively, then formula (5) represents the probability that points j and s meet at the representative point i after reverse random walk for k steps;
[0059]
[0060] Formula (6) represents the sum of the probabilities that points j and s meet at all representative points after reverse random walk for k steps, and uses it to estimate the similarity between points j and s;
[0061]
[0062] Then formula (7) represents the k-order similarity matrix of the directed graph G based on the representative points;
[0063]
[0064] in, It is R k The matrix after column normalization;
[0065] Step 4: Solve the similarity matrix WW k The eigenvector matrix V of
[0066] set up is an n*n diagonal matrix, R ij is the matrix R k The element value of the i-th row and j-th column; It is R k The purpose of the column-normalized matrix is to make W k The diagonal elements of are 1; The singular value decomposition of is shown in formula (8);
[0067]
[0068] in u i is the left singular vector, v i is a right singular vector; ∑=diag(σ1,σ2,…σ p ), and σ1≥σ2≥…≥σ p ≥0;u i is a matrix The eigenvector of i is the k-order similarity matrix The characteristic vector of yes or The characteristic value of First pass Perform eigendecomposition to obtain U and ∑, and then use formula (9) to solve the eigenvector matrix V;
[0069]
[0070] The time complexity of solving U is O(p 3 ), the time complexity of solving V through U and ∑ is O(np 2 ); therefore, solving for W k The time complexity of the eigenvector is O(n 3 ) is reduced to O(p 3 +np 2 );
[0071] Step 5: Perform k-means clustering on the feature vector matrix V.
Claims
1. A spectral clustering method based on SimRank and sparse representation, It is characterized in that The following steps are involved: Step 1: Preprocess the graph data of the directed graph; Step 2: Select representative points; Step 3: Calculate the similarity matrix W k ; Step 4: Solve the similarity matrix WW k The eigenvector matrix V of Step 5: Perform k-means clustering on the feature vector matrix V.
2. A spectral clustering method based on SimRank and sparse representation according to claim 1, It is characterized in that The directed graph described in step 1 is G(N,E), N is a set of directed graph nodes, E is a set of directed edges, the number of directed graph nodes is n; A is an n×n adjacency matrix.
3. A spectral clustering method based on SimRank and sparse representation according to claim 2, It is characterized in that The step 1 comprises the following steps: Step 1.1: Sum the columns of the adjacency matrix A to obtain the in-degree of each node, which is represented by the graph in-degree matrix In; as shown in formula (1), where I k represents the in-degree of node k; In=(I 1 ,I 2 ,...I n ) (1) Step 1.2: Sum the adjacency matrix A row by row to obtain the out-degree of each node, which is represented by the graph out-degree matrix Out; as shown in formula (2), where O k represents the out-degree of node k; Out=(O 1 ,O 2 ,...O n ) (2)。 4. A spectral clustering method based on SimRank and sparse representation according to claim 3, It is characterized in that The step 2 is specifically as follows: sort all nodes according to their out-degree, select p nodes with the largest out-degree from the directed graph node set N as representative nodes, and if two nodes have the same out-degree, select the node with the smaller in-degree; wherein p is less than the total number of nodes n.
5. A spectral clustering method based on SimRank and sparse representation according to claim 4, It is characterized in that The step 3 comprises the following steps: Step 3.1: Solve the first-order reachability matrix R 1 ; Let the representative point i, R 1 The calculation of (i, j) is shown in formula (3). 1 Normalized to get Among them, R 1 (i,j) represents the probability of reaching the representative point i by taking one step of reverse random walk from node j, I j represents the in-degree of node j, C is the random walk damping coefficient; Step 3.2: Recursively solve the k-order reachability matrix R k ; Let from point i to point w k There exists a path i→w of length k 1 →w 2 →…→w k-1 →w k , from point w k Starting from, the probability of reaching point i after k steps of reverse random walk is shown in formula (4), where C is the random walk damping coefficient; Formula (4) is the k - step reachability from point w k to point i; denoted by the k - step reachability matrix, and R k (i, j) represents the k - step reachability from point j to the representative point i; when k < K, solve the k - step reachability matrix R k , where k > 1; initialize R k as a p * n all - zero matrix; if R k-1 (i, j) ≠ 0, then find the set of vertices pointed to by point j, OutNeighbor(j) = {u|u ∈ N and <j, u> ∈ E}, for all u ∈ OutNeighbor(j), then R k (i, u) = R k-1 (i, j) * I(u) * C; Step 3.3: Based on the reachability matrix R k Solve the k-order similarity matrix W k .
6. A spectral clustering method based on SimRank and sparse representation according to claim 5, It is characterized in that Step 3.3 is as follows: Assume that there are two paths starting from the representative point i to point j and point s, both of which have a length of k. Then formula (5) represents the probability that point j and point s meet at the representative point i after k steps of reverse random walk; Formula (6) represents the sum of the probabilities that point j and point s meet at all representative points after k steps of reverse random walk, which is used to estimate the similarity between point j and point s; Then formula (7) represents the k-order similarity matrix of the directed graph G based on the representative points; in, It is R k The matrix is normalized along its columns.
7. A spectral clustering method based on SimRank and sparse representation according to claim 6, It is characterized in that The step 4 is specifically as follows: set up is an n*n diagonal matrix, R ij is the matrix R k The element value of the i-th row and j-th column; It is R k The purpose of the column-normalized matrix is to make W k The diagonal elements of are 1; The singular value decomposition of is shown in formula (8); in u i is the left singular vector, v i is a right singular vector; ∑=diag(σ 1 ,σ 2 ,…σ p ), and there is σ 1 ≥σ 2 ≥…≥σ p ≥0;u i is a matrix The eigenvector of i is the k-order similarity matrix The characteristic vector of yes or The characteristic value of First pass Perform eigendecomposition to obtain U and ∑, and then use formula (9) to solve the eigenvector matrix V; The time complexity of solving U is O(p 3 ), the time complexity of solving V through U and ∑ is O(np 2 ); therefore, solving for W k The time complexity of the eigenvector is O(n 3 ) is reduced to O(p 3 +np 2 ).
