Hash value calculator, hash value calculator, and program

The proposed hash value calculation method addresses the inefficiencies of conventional graph embedding by employing graph clustering and approximate eigenvalue techniques, enabling fast and memory-efficient representation of graph nodes.

JP7839436B2Active Publication Date: 2026-04-02NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Conventional methods for graph embedding, such as INH-MF, face challenges in calculating hash values that effectively represent nodes in large graphs quickly and with minimal memory usage, due to high computational cost and memory requirements, especially in real-world graphs with the small-world property.

Method used

A hash value calculation method involving graph clustering, tridiagonal matrix calculation, approximate eigenvalue calculation, and eigenvector computation to efficiently represent nodes using a reduced matrix decomposition, reducing computational cost and memory usage.

Benefits of technology

Enables fast and memory-efficient calculation of hash values that effectively represent graph nodes, overcoming the limitations of existing methods by utilizing sparse matrix structures and approximate eigenvalue techniques.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007839436000073
    Figure 0007839436000073
  • Figure 0007839436000074
    Figure 0007839436000074
  • Figure 0007839436000075
    Figure 0007839436000075
Patent Text Reader

Abstract

In the present invention, a clustering calculation unit calculates n clusters in a graph with N nodes. A tridiagonal matrix calculation unit calculates an n×n inter-cluster relationship matrix on the basis of a relationship matrix between the N nodes and n clusters, and calculates a tridiagonal matrix with the same eigenvalues as the inter-cluster relationship matrix. An approximate eigenvalue calculation unit calculates approximate eigenvalues of the tridiagonal matrix. A reordering matrix generation unit calculates a reordering matrix for reordering the clusters on the basis of a connection between the clusters. An eigenvector calculation unit calculates eigenvalues and eigenvectors of the inter-cluster relationship matrix on the basis of the approximate eigenvalues, the inter-cluster relationship matrix, and the reordering matrix. A hash value calculation unit calculates a hash value for each node on the basis of the eigenvalues and eigenvectors.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to a hash value calculation device, a hash value calculation method, and a program. [Background technology]

[0002] Interest in graph analysis has been growing in recent years. A representative technique in graph analysis is graph embedding. This technique represents each node in a graph as a vector of a fixed length consisting of continuous values. Graph embedding has been the subject of much research because it has the advantage of making nodes applicable to existing machine learning methods by representing them as vectors of continuous values. However, because graph embedding represents nodes as vectors of continuous values, it has the problem of requiring an enormous amount of memory to store the vectors for large graphs.

[0003] To solve this problem, a method called INH-MF (MF-based Information Network Hashing) has been proposed (see, for example, Non-Patent Document 1). This method represents nodes not as vectors of continuous values, but as vectors of hash values. By representing nodes as vectors of hash values, it becomes possible to store vectors with a small amount of memory. When the number of nodes is N, INH-MF calculates an N×N high-order similarity matrix to calculate the hash value, and to improve efficiency, elements with small values ​​in the calculated similarity matrix are set to zero. However, because elements are set to zero, there is a problem that hash values ​​that do not effectively represent the nodes cannot be calculated. In addition, there is a problem that calculating a high-order similarity matrix requires high computational cost and memory. [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] D. Lian, K. Zheng, VW Zheng, Y. Ge, L. Cao, IW Tsang, X. Xie, "High-order proximity preserving information network hashing", KDD 2018 - Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2018. [Overview of the project] [Problems that the invention aims to solve]

[0005] As mentioned above, conventional methods have found it difficult to calculate hash values ​​to represent each node in a graph quickly and with minimal memory usage.

[0006] In view of the above circumstances, the present invention aims to provide a hash value calculator, a hash value calculator, and a program that can calculate hash values ​​that effectively represent each node of a given graph at high speed and with low memory usage. [Means for solving the problem]

[0007] A hash value calculation device according to one aspect of the present invention comprises: a clustering calculation unit that calculates n clusters in a graph having N nodes; a tridiagonal matrix calculation unit that calculates an n × n relationship matrix between clusters based on a relationship matrix between the N nodes and the n clusters, and calculates a tridiagonal matrix having the same eigenvalues ​​as the relationship matrix between clusters; an approximate eigenvalue calculation unit that calculates approximate eigenvalues ​​in the tridiagonal matrix; a rearrangement matrix generation unit that calculates a rearrangement matrix for rearranging the clusters based on the connections between the clusters; an eigenvector calculation unit that calculates eigenvalues ​​and eigenvectors of the relationship matrix between clusters based on the approximate eigenvalues, the relationship matrix between clusters, and the rearrangement matrix; and a hash value calculation unit that calculates the hash value of each node based on the eigenvalues ​​and eigenvectors.

[0008] A hash value calculation method according to one aspect of the present invention comprises: a clustering step of calculating n clusters in a graph having N nodes; a tridiagonal matrix calculation step of calculating an n × n inter-cluster relationship matrix based on the relationship matrix between the N nodes and the n clusters, and calculating a tridiagonal matrix having the same eigenvalues ​​as the inter-cluster relationship matrix; an approximate eigenvalue calculation step of calculating approximate eigenvalues ​​in the tridiagonal matrix; a reordering matrix calculation step of calculating a reordering matrix for rearranging the clusters based on the connections between the clusters; an eigenvector calculation step of calculating eigenvalues ​​and eigenvectors of the inter-cluster relationship matrix based on the approximate eigenvalues, the inter-cluster relationship matrix and the reordering matrix; and a hash value calculation step of calculating the hash value of each node based on the eigenvalues ​​and eigenvectors.

[0009] One aspect of the present invention is a program that causes a computer to function as: a clustering calculation unit that calculates n clusters in a graph having N nodes; a tridiagonal matrix calculation unit that calculates an n × n inter-cluster relationship matrix based on the relationship matrix between the N nodes and the n clusters, and calculates a tridiagonal matrix having the same eigenvalues ​​as the inter-cluster relationship matrix; an approximate eigenvalue calculation unit that calculates approximate eigenvalues ​​in the tridiagonal matrix; a reordering matrix generation unit that calculates a reordering matrix for rearranging the clusters based on the connections between the clusters; an eigenvector calculation unit that calculates eigenvalues ​​and eigenvectors of the inter-cluster relationship matrix based on the approximate eigenvalues, the inter-cluster relationship matrix, and the reordering matrix; and a hash value calculation unit that calculates the hash value of each node based on the eigenvalues ​​and eigenvectors. [Effects of the Invention]

[0010] This invention makes it possible to calculate hash values ​​that effectively represent each node in a given graph at high speed and with minimal memory usage. [Brief explanation of the drawing]

[0011] [Figure 1] This is a diagram illustrating the configuration of a hash value calculator according to one embodiment of the present invention. [Figure 2] This figure shows the approximate eigenvalue calculation algorithm executed by the approximate eigenvalue calculation unit of the hash value calculation device according to the same embodiment. [Figure 3] This is a flowchart of the approximate eigenvalue calculation algorithm executed by the approximate eigenvalue calculation unit of the hash value calculator according to the same embodiment. [Figure 4] This figure shows the cluster sorting algorithm executed by the sorting matrix generation unit of the hash value calculation device according to the same embodiment. [Figure 5] This is a flowchart of the cluster sorting algorithm executed by the sorting matrix generation unit of the hash value calculator according to the same embodiment. [Figure 6]This is a flowchart of the cluster sorting algorithm executed by the sorting matrix generation unit of the hash value calculator according to the same embodiment. [Figure 7] This figure shows the eigenvector calculation algorithm executed by the eigenvector calculation unit of the hash value calculation device according to the same embodiment. [Figure 8] This is a flowchart of the eigenvector calculation algorithm executed by the eigenvector calculation unit of the hash value calculator according to the same embodiment. [Figure 9] This is a flowchart of the eigenvector calculation algorithm executed by the eigenvector calculation unit of the hash value calculator according to the same embodiment. [Figure 10] This figure shows the hash value calculation algorithm executed by the calculation unit of the hash value calculation device according to the same embodiment. [Figure 11] This is a flowchart of the hash value calculation algorithm executed by the calculation unit of the hash value calculation device according to the same embodiment. [Figure 12] This figure shows the hardware configuration of the hash value calculation device according to the same embodiment. [Modes for carrying out the invention]

[0012] Embodiments of the present invention will be described in detail below with reference to the drawings.

[0013] Figure 1 is a functional block diagram showing the configuration of a hash value calculator 10 according to one embodiment of the present invention. The hash value calculator 10 is implemented, for example, by a computer device. The hash value calculator 10 calculates a hash value representing each node in a given graph. The hash value calculator 10 comprises an input unit 20, a storage unit 30, a calculation unit 40, and an output unit 50.

[0014] The input unit 20 inputs information including a graph with N nodes to the hash value calculator 10. For example, the input unit 20 receives information entered by a user via a keyboard, mouse, touch panel, buttons, or keys. Alternatively, the input unit 20 may receive information from other computer devices connected via a network, or read information from a computer-readable recording medium. The storage unit 30 stores various types of information. The information stored in the storage unit 30 includes the information entered by the input unit 20, the information used by the calculator 40 for processing, and the information obtained through the processing of the calculator 40.

[0015] Instead of calculating the transition matrix of an N×N high-order graph, the calculation unit 40 calculates the hash value of each node using an N×n matrix that represents the relationship between N nodes and n clusters, where n is the number of clusters in the graph. The calculation unit 40 comprises a clustering calculation unit 41, a tridiagonal matrix calculation unit 42, an approximate eigenvalue calculation unit 43, a reordering matrix generation unit 44, an eigenvector calculation unit 45, and a hash value calculation unit 46.

[0016] The clustering calculation unit 41 calculates n clusters in a graph with N nodes. The tridiagonal matrix calculation unit 42 calculates an n×n inter-cluster relationship matrix from an N×n node-cluster relationship matrix and calculates a tridiagonal matrix with the same eigenvalues ​​as the cluster relationship matrix. The approximate eigenvalue calculation unit 43 calculates approximate eigenvalues ​​in the tridiagonal matrix calculated by the tridiagonal matrix calculation unit 42. The reordering matrix generation unit 44 calculates a cluster reordering matrix for reordering clusters based on the connections between clusters. The eigenvector calculation unit 45 calculates eigenvalues ​​and eigenvectors of the inter-cluster relationship matrix based on the inter-cluster relationship matrix calculated by the tridiagonal matrix calculation unit 42, the approximate eigenvalues ​​calculated by the approximate eigenvalue calculation unit 43, and the reordering matrix calculated by the reordering matrix generation unit 44. The hash value calculation unit 46 calculates the hash value of each node based on the eigenvalues ​​and eigenvectors calculated by the eigenvector calculation unit 45.

[0017] The output unit 50 outputs information about the hash values ​​of each node calculated by the calculation unit 40. The output unit 50 is a display such as a CRT (cathode ray tube) or an LCD (liquid crystal display). Alternatively, the output unit 50 may print the information to a printer connected to the hash value calculation device 10. Alternatively, the output unit 50 may write the information to an information recording medium or output the information to a computer device connected via a network.

[0018] The hash value calculator 10 may be implemented using multiple computer devices connected to a network. In this case, it is arbitrary which of these multiple computer devices implements each functional part of the hash value calculator 10. Furthermore, the same functional part may be implemented by multiple computer devices.

[0019] Here, we will first explain the conventional method, INH-MF. When V is a set of N nodes and E is a set of M edges, INH-MF considers each node in the graph G=(V,E) as a low-dimensional Hamming space {±1}. d The hash value is calculated by embedding the values. Here, d≪N is the number of bits in a pre-configured hash. INH-MF calculates the hash value of each node from a higher-order similarity matrix in the graph, satisfying the uncorrelated constraint and the equilibrium constraint. The uncorrelated constraint minimizes redundancy between bits. The equilibrium constraint ensures that approximately equal numbers of 1s and -1s are used in the hash value. To calculate the INH-MF hash value, the following N×N similarity matrix S is used.

[0020]

number

[0021] In this expression, log(·) is the operator that calculates the logarithm of each element. vol(G) is given by the following:

[0022]

number

[0023] Here, A[i,j] is the [i,j] element of the adjacency matrix A of the graph. Ω is the following diagonal matrix.

[0024]

number

[0025] Here, 1 N is a vector of length N and all elements are 1. In equation (1), s is the number of negative samples and t is the window size (see, for example, reference 1). Since log(1)=0, equation (1) cuts off non-zero elements less than 1 in the matrix S' in order to obtain the similarity matrix S.

[0026] (Reference 1) J. Qiu, Y. Dong, H. Ma, J. Li, K. Wang, J. Tang, "Network Embedding as Matrix Factorization: Unifying DeepWalk, LINE, PTE, and node2vec", WSDM '18: Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, p.459-467, 2018.

[0027] INH-MF calculates the hash value by minimizing the objective function in equation (4) below.

[0028]

number

[0029] Here, B ∈ {±1} N×d Q is a hash matrix, Q is an N×d dimensionality reduction matrix, and Id is the d×d identity matrix, and ||·|| F is the Frobenius norm. Also, the superscript T on the right represents transpose.

[0030] In Equation (4), B T B = NI d corresponds to the uncorrelated constraint, and B T 1 N = 0 corresponds to the equilibrium constraint. Q T Q = I d is the orthonormal constraint for columns to solve the optimization problem quickly. Since the above optimization problem is NP-hard, INH-MF optimizes the hash matrix B and the dimensionality reduction matrix Q sequentially.

[0031] When the hash matrix B is fixed, the optimization problem can be rewritten as Equation (5) below.

[0032]

Equation

[0033] Here, tr(·) is the trace of a matrix. S T Let X be the matrix of left singular vectors of size N×d when B is decomposed by singular value decomposition, and Y be the matrix of right singular vectors of size d×d. In this case, the optimal solution in the above optimization problem is Equation (6) below. The superscript * on the right represents the adjoint matrix.

[0034]

Equation

[0035] On the other hand, when the dimensionality reduction matrix Q is fixed, it is difficult to handle the uncorrelated constraint. Therefore, INH-MF introduces Equation (7) below to approximately obtain a solution and adds γ as a penalty.

[0036]

Equation

[0037] As a result, the objective function for optimizing the hash matrix B is given by equation (8) below.

[0038]

number

[0039] Here, β is given by equation (9) below.

[0040]

number

[0041] If Φ = SQ + γZ, the optimal hash matrix B is given by equation (10) below.

[0042]

number

[0043] Here, sgn is the sine function, and λ=median(Φ) is the median of the column at Φ.

[0044] INH-MF has the problem of high computational cost and memory usage. Because real-world graphs have the small-world property, the matrix S' becomes dense, and the number of non-zero elements is O(N). 2 Therefore, to obtain the similarity matrix S from equation (1), the computational cost is O(NM) and O(N 2 The amount of memory required is O(Nd 2 The computational cost of ) is required. Also, to store the hash matrix B, the dimensionality reduction matrix Q, matrix Z, matrix X, and matrix Y, an amount of memory of O(Nd) is required. Therefore, if the number of iterations to find the optimal solution is T, then O(NM + (Nd) 2 +N 2 d) The computational cost of T) and O(N) 2This requires a certain amount of memory. Furthermore, because non-zero elements are cut off when calculating the similarity matrix, there is a problem in that the hash value of the nodes cannot be calculated effectively.

[0045] Next, embodiments of the present invention will be described. The hash value calculator 10 of this embodiment calculates a similarity matrix between nodes based on the relationships between N nodes and n clusters. In real-world graphs, it is known that the number of clusters is much smaller than the number of nodes (see, for example, Reference 2). Therefore, the similarity matrix in this embodiment has low rank, and as a result, the hash value calculator 10 can calculate the hash value at high speed by matrix decomposition of the n×n matrix.

[0046] (Reference 2) H. Shiokawa, Y. Fujiwara, M. Onizuka, "Fast Algorithm for Modularity-Based Graph Clustering", AAAI'13: Proceedings of the Twenty-Seventh AAAI Conference on Artificial Intelligence, p.1170-1176, 2013.

[0047] The calculation unit 40 of the hash value calculator 10 calculates the hash value according to existing research (for example, reference 3). Let S[i,j] be the [i,j] element of the similarity matrix S. The element S[i,j] corresponds to the similarity between the i-th node and the j-th node. Also, b i Let be the i-th row vector, which has length d and corresponds to the i-th node. Following existing research, elements S[i,j]≧0 and the similarity matrix S is a symmetric matrix. In this embodiment, the hash matrix B∈{±1} N×d This is obtained by minimizing the objective function in equation (11) below.

[0048]

number

[0049] Here, C is C = diag(S1 N Let it be a diagonal matrix given by ), where ||·|| is the L2 norm of the vector.

[0050] (Reference 3) Y. Weiss, A. Torralba, R. Fergus, "Spectral hashing", NIPS'08: Proceedings of the 21st International Conference on Neural Information Processing Systems, p.1753-1760, 2008.

[0051] In equation (11), B ∈ {±1} N×d The constraint is integers, and B T B=NI d This is a non-correlation constraint, and B T I N =0 is an equilibrium constraint. Since this problem is NP-hard, B∈{±1} N×d The integer constraints for B∈R N×d And the constraint is relaxed. Then the solution to this problem is d eigenvectors for the smallest non-zero eigenvalue in the graph Laplacian CS. If the similarity matrix S is a symmetric matrix, the eigenvectors are orthogonal to each other, so multiplying the eigenvectors by √N satisfies the non-correlation constraint, and B T B=N. Also, since the eigenvectors are orthogonal to each other, B T 1 N The equilibrium constraint of =0 is also satisfied. The calculation unit 40 of the hash value calculator 10 solves the relaxed problem and then applies a sine function to the eigenvectors to obtain the hash value. However, since the magnitude of the graph Laplacian is N × N, the computational cost of eigenvalue decomposition is O(N). 3 ) becomes O(N) in order to maintain the similarity matrix S. 2 This would require a certain amount of memory. Therefore, directly matrix-decomposing the graph Laplacian obtained from the similarity matrix S in equation (1) is not practical.

[0052] To efficiently obtain hash values, the calculation unit 40 of the hash value calculator 10 calculates a similarity matrix using graph clustering. When R is an N×n matrix representing the relationships between N nodes and n clusters, the calculation unit 40 calculates the similarity matrix as S=RR T The calculation is performed as follows. Here, the calculation unit 40 calculates the matrix R so that it is given by the following equation (12).

[0053]

number

[0054] The specific method for calculating R will be described later. The calculation unit 40 can quickly calculate the solution to equation (11) using the matrix R. Let Σ be the diagonal matrix of singular values ​​obtained when matrix R is decomposed into singular value vectors, and let U and V be the matrix of left singular vectors and the matrix of right singular vectors, respectively. Then, the matrix R can be decomposed into R = UΣV T It is decomposed as follows. Here, the size of matrix U is N×n, the size of the diagonal matrix Σ is n×n, and the size of matrix V is n×n. As a result, we get the following equation (13).

[0055]

number

[0056] Therefore, the graph Laplacian CS can be calculated as shown in equation (14) below.

[0057]

number

[0058] In this equation, the diagonal matrix Σ' is given by equation (15) below.

[0059]

number

[0060] σ iis the i-th largest singular value of matrix R. Equation (14) shows that the eigenvalues ​​of the graph Laplacian CS correspond to the singular values ​​of matrix R. Since the size of matrix R is N×n, the eigenvalues ​​of CS can be calculated quickly by calculating the singular value decomposition of matrix R. Furthermore, the following n×n diagonal matrix M=I n -R T By introducing R, the calculation unit 40 can quickly calculate the diagonal matrix Σ' as shown in equation (16) below. The diagonal matrix M is a relation matrix that represents the relationships between clusters.

[0061]

number

[0062] As seen in equations (14) and (16), the graph Laplacian and the diagonal matrix M have the same eigenvalues. Therefore, the calculation unit 40 first calculates the eigenvectors of the diagonal matrix M. Then, the calculation unit 40 calculates R = UΣV T Therefore, the eigenvalues ​​of the graph Laplacian are U = RVΣ -1 Calculate from this.

[0063] Next, the method for calculating the matrix R in the calculation unit 40 of the hash value calculator 10 will be described. The calculation unit 40 of the hash value calculator 10 uses graph clustering to calculate the matrix R. Graph clustering is a method of dividing nodes so that clusters are densely connected and clusters are loosely connected. The clustering calculation unit 41 of the calculation unit 40 uses IncMod as the graph clustering method (see, for example, reference 3). However, the clustering calculation unit 41 can also use other clustering methods. In the original IncMod, the number of clusters is determined automatically, but the clustering calculation unit 41 finds a specific number of clusters by graph clustering. Specifically, the clustering calculation unit 41 finds n-1 clusters. The nth cluster is a cluster that is connected to all nodes. The tridiagonal matrix calculation unit 42 calculates the N×n matrix W between the N nodes and the n clusters using the adjacency matrix A as shown in equation (17) below. The i-th row corresponds to the i-th node, and the j-th column corresponds to the j-th cluster.

[0064]

number

[0065] Here, c j This is the j-th cluster. If the i-th node is in cluster c j If it is not included in the set, then from equation (17), W[i,j]=0, and the matrix W has a sparse structure.

[0066] Let w[i] be given by the following equation (18).

[0067]

number

[0068] At this time, the calculation unit 40 obtains matrix W', which is obtained by normalizing each row of matrix W, as shown in equation (19) below.

[0069]

number

[0070] Furthermore, let w'[j] be given by the following equation (20).

[0071]

number

[0072] At this time, the calculation unit 40 calculates each element R[i,j] of the matrix R as shown in equation (21) below.

[0073]

number

[0074] Since matrix R is calculated from matrix W, it has a sparse structure. The nth cluster is connected to all nodes, so S = RR T Therefore, all elements of the similarity matrix S are positive. Furthermore, the similarity matrix S is a symmetric matrix, and nodes belonging to the same cluster are densely connected in the similarity matrix S. In addition, the similarity matrix S satisfies the conditions of the optimization problem given by equation (11). Furthermore, as shown in equations (19) and (21), the rows and columns of the adjacency matrix A are normalized, so the similarity matrix S is a double probability matrix. As a result, the similarity matrix S has the property given by equation (22) below.

[0075]

number

[0076] This is the assumption made in equation (14). Since the graph Laplacian is a double probability matrix, each eigenvalue is non-negative, and because all nodes are connected in the similarity matrix S, only one eigenvalue is zero. Furthermore, for the i-th eigenvalue of the graph Laplacian, we have the following equation (23).

[0077]

number

[0078] Therefore, if the λ in equation (24) below i If we let be the i-th smallest eigenvalue in the graph Laplacian, then we get the following equation (25).

[0079]

number

[0080]

number

[0081] As a result, in order to obtain the hash value, the calculation unit 40 first calculates the d small eigenvalues ​​λ1,...,λ in the diagonal matrix M. d The eigenvalue vectors of these are calculated, and the diagonal matrix Σ and matrix V in equation (16) are calculated. Then, the calculation unit 40 calculates the eigenvalue vectors of matrix R as U=RVΣ -1 The eigenvalue vector U is calculated using the method shown, and the sine function is applied to the obtained eigenvalue vector. However, the eigenvalue decomposition of the diagonal matrix M takes O(n 3 This requires the computational cost of ).

[0082] Next, we will describe a method for approximately calculating the d minimum eigenvalues ​​of a diagonal matrix M. The approximate eigenvalue calculation unit 43 of the calculation unit 40 uses the bisection method to approximately calculate the d minimum eigenvalues ​​(see Reference 4). This is because, as will be described later, the exact eigenvalues ​​can be calculated from the approximate eigenvalues ​​calculated using the bisection method.

[0083] (Reference 4) Sato, Tsuguo; Nakamura, Riichiro; Togawa, Hayato; Nagasaka, Hideko; "Understanding Numerical Calculation: Practical Algorithms and Error Analysis," Chapter 3 Simultaneous Equations, 3.5 Conjugate Gradient Method, pp. 72-85, Nikkan Kogyo Shimbun, 2001.

[0084] The approximate eigenvalue calculation unit 43 calculates the approximate eigenvalues ​​using the bisection method from the n × n tripodical matrix shown in equation (26) below, which has the same eigenvalues ​​as the diagonal matrix M.

[0085]

number

[0086] q i If we take a column vector of length n, the triplicate matrix calculation unit 42 calculates each element of the triplicate matrix as shown in equation (27) below.

[0087]

number

[0088] Here, the column vector q i ' is given by the following equation (28).

[0089]

number

[0090] In equation (27), we set q0=0 and q1 to a random vector less than or equal to ||q1||=1. If m is the number of non-zero elements in the diagonal matrix M, then the computational cost of finding the tridiagonal matrix in equation (27) is O(nm). In the bisection method, ν(λ) is used to calculate the approximate eigenvalues. ν(λ) is the sequence [f0(λ),f1(λ),...,f n In (λ), this is a number in which adjacent elements have the same sign. Here, f i (λ) is given by equation (29) below.

[0091]

number

[0092] In Equation (29), f0(λ) = 1 and f1(λ) = λ - α1. It is known that ν(λ) is the number of eigenvalues smaller than λ (see, for example, Reference 4). Therefore, the following Equation (30) represents the number of eigenvalues that satisfy Equation (31).

[0093]

Number

[0094]

Number

[0095] As a result, if Equation (32) holds, the approximate eigenvalue ~ λ i corresponding to Equation (33) can be calculated as shown in Equation (34).

[0096]

Number

[0097]

Number

[0098]

Number

[0099] As described above, since 0 < λ i ≤ 1 (1 ≤ i ≤ n), the approximate eigenvalue ~ λ i is set as the upper limit value λ = 1 and the lower limit value λ = 0 when searching for eigenvalues. Until Equation (32) is satisfied, ― λ or _ λ can be obtained by repeatedly updating it as ([λ + ― λ]) / 2. However, this method _ ― λ + _ λ) / 2 and updating it repeatedly. However, this method ― ​When λ = 1 _ Since λ = 0 is not tight, ― there is a problem that the number of times of updating λ _ increases. Therefore, in this embodiment, before executing the bisection method, ― the width between _ λ and λ is made as small as possible to reduce the number of updates.

[0100] FIG. 2 is a diagram showing an approximate eigenvalue calculation algorithm executed by the approximate eigenvalue calculation unit 43 of the hash value calculation device 10. FIG. 3 is a flowchart showing the processing of the approximate eigenvalue calculation algorithm executed by the approximate eigenvalue calculation unit 43. The approximate eigenvalue calculation algorithm is an algorithm for reducing the number of updates. The approximate eigenvalue calculation unit 43 obtains approximate eigenvalues in the order of ~ λ1, ~ λ2,..., ~ λ d by this approximate eigenvalue calculation algorithm.

[0101] First, the approximate eigenvalue calculation unit 43 inputs a tridiagonal matrix and the number d of eigenvalues (step S101). The approximate eigenvalue calculation unit 43 increases the variable i by 1 until it reaches d, and performs the processing of steps S103 to S115 for each variable i (step S102). When calculating the second and subsequent approximate eigenvalues in the processing of steps S103 to S109, the approximate eigenvalue calculation unit 43 ― makes the width between _ λ and λ as small as possible, and then executes the normal bisection method in steps S110 to S115.

[0102] The approximate eigenvalue calculation unit 43 determines whether i = 1 (step S103). When the approximate eigenvalue calculation unit 43 determines that i = 1 (step S103: YES),[[ID=​​​​​​​​​d To calculate _ λ with the current ― value of λ is set (step S105). This is until ν( ― λ) - ν( _ λ) = 1 and ν( _ λ) = i - 1 holds. ― λ and _ λ are updated to ~ calculate λ i-1 For this, the following equation (35) holds. ~ λ i is ― not less than λ because of this.

[0103]

Equation

[0104] Also, because of the following equation (36), the approximate eigenvalue calculation unit 43 calculates the following equation (37).

[0105]

Equation

[0106]

Equation

[0107] If it is equation (38) (step S106: YES), the approximate eigenvalue calculation unit 43 determines that there are more than i eigenvalues smaller than the value obtained by adding the difference between ~ λ i-1 and ~ λ i-2 to

[0108]

Equation

[0109] In this case, the approximate eigenvalue calculation unit 43 ―Update λ as in Equation (39) (Step S107).

[0110]

Number

[0111] If the approximate eigenvalue calculation unit 43 does not use Equation (38) (Step S106: NO), it determines that the number of eigenvalues smaller than the value obtained by adding the difference between _λ and λ is i or less. In this case, the approximate eigenvalue calculation unit 43 updates _λ as in Equation (40) (Step S108). ~ λ i-1 and ~ λ i-2 If the approximate eigenvalue calculation unit 43 determines that the number of eigenvalues smaller than the value obtained by adding the difference between _λ and λ is i or less, the approximate eigenvalue calculation unit 43 updates _λ as in Equation (40) (Step S108).

[0112]

Number

[0113] The approximate eigenvalue calculation unit 43 performs the processes of Steps S106 to S108 until Equation (41) is obtained (Step S109: NO). As a result, the approximate eigenvalue calculation unit 43 slides λ and _λ used for calculating λ by the update width of λ - _λ. ~ λ i used for the calculation of ― λ and _λ by ~ λ i-1 - ~ λ i-2 the update width of λ - _λ.

[0114]

Number

[0115] Then, when Equation (41) is obtained (Step S109: YES), the approximate eigenvalue calculation unit 43 performs the normal bisection method. First, the approximate eigenvalue calculation unit 43 updates λ as in the following Equation (42) (Step S110).

[0116]

Number

[0117] The approximate eigenvalue calculation unit 43 determines whether ν(λ) is greater than i (step S111). If the approximate eigenvalue calculation unit 43 determines that ν(λ) is greater than i, that is, that the number of eigenvalues ​​less than λ is greater than i (step S111: YES), ― Set λ to λ (step S112). On the other hand, if the approximate eigenvalue calculation unit 43 determines that ν(λ) is less than or equal to i, that is, that the number of eigenvalues ​​smaller than λ is less than or equal to i (step S111: NO), _ Set λ to λ (step S113).

[0118] The approximate eigenvalue calculation unit 43 performs the processing in steps S110 to S113 until the following equation (43) is satisfied. ― λ and _ Update λ (Step S114: NO).

[0119]

number

[0120] Furthermore, here ~ Let λ0 = 0. If the approximate eigenvalue calculation unit 43 determines that the above equation (43) holds true (step S114: YES), then finally calculates the approximate eigenvalue ~ λ i This is calculated as shown in equation (44) below (step S115).

[0121]

number

[0122] The approximate eigenvalue calculation unit 43 adds 1 to the variable i and repeats the process from step S103 (step S102). When the repeated process of step S102 is completed, the approximate eigenvalue calculation unit 43 calculates the approximate eigenvalue ~ λ1,..., ~ λ d Output (step S116).

[0123] This approximate eigenvalue calculation algorithm can tightly bound ― λ and _ λ, thus reducing the number of updates. The computational cost and memory requirement of this algorithm are as follows.

[0124] (Lemma 1) Let t b be ― the average value of the number of iterative calculations required to initialize _ λ and u λ, and let t ― be _ the average value of the number of times to update b λ and u λ. Then, the approximate eigenvalue calculation algorithm requires a computational cost of O(d(nt

[0125] (Proof of Lemma 1) ~ To calculate λ1, ― the computational cost of initializing _ λ = 1 and ― λ = 0 is O(1). Since the computational cost of obtaining the series from Equation (43) is O(n), the computational cost of initializing _ λ and b λ is O(ndt ― ). To update _ λ and u λ, a computational cost of O(dt b ) is required. Also, the memory requirements for holding the series and approximate eigenvalues are O(n) and O(d), respectively. Since d < n, the computational cost of obtaining the approximate eigenvalues is O(d(nt u )), and the memory requirement is O(n).

[0126] Next, the method by which the calculation unit 40 calculates d exact eigenvalues and eigenvectors in the diagonal matrix M is described. The following Equation (45) holds.

[0127] [Equation]

[0128] Therefore, (M- ~ λ i I n ) -1 In (λ i - ~ λ i ) -1 This is the largest eigenvalue. Therefore, v i λ i Let ^M be the i-th column vector of matrix V in equation (16) corresponding to the following equation (46), then ^M -1 Applying multiplication to λ, i and v i It is possible to find this.

[0129]

number

[0130] In the power method, we repeatedly calculate equation (48) until we obtain equation (47).

[0131]

number

[0132]

number

[0133] Here, v i is||v i It is randomly initialized so that ||=1. After repeated calculations, the eigenvalue λ i The answer can be found using the following formula (49).

[0134]

number

[0135] However, this method ^ M -1 The computational cost is O(n 3Therefore, the calculation of equation (50) below takes time.

[0136]

number

[0137] To quickly calculate eigenvalues ​​and eigenvectors, the eigenvector calculation unit 45 uses the conjugate gradient method (see, for example, reference 4). This method decomposes the matrix ^M using an incomplete Cholesky decomposition as shown in equation (51) below.

[0138]

number

[0139] Here, ^L is a lower triangular matrix given by equation (52) below, and ^D is a diagonal matrix given by equation (53) below.

[0140]

number

[0141]

number

[0142] In the conjugate gradient method, instead of equation (50), the following equation (54) is calculated repeatedly.

[0143]

number

[0144] Since equation (55) is given below, we get equation (56).

[0145]

number

[0146]

number

[0147] Therefore, equation (54) can be solved with a small number of iterations. When solving equation (54), ( ^ L ^ D ^ L T ) -1 Since it is a dense matrix, we do not calculate it explicitly. Instead, ^ L is a lower triangular matrix. ^ D is a diagonal matrix. ^ L T This is an upper triangular matrix. Therefore, the eigenvector calculation unit 45 uses forward and backward substitution to calculate ( ^ L ^ D ^ L T ) -1 The eigenvector calculation unit 45 calculates the following by applying the conjugate gradient method to equation (54): ^ v i This can reduce the time required to calculate the matrix. ^ There is a problem in that the computation cost of the incomplete Cholesky decomposition of M is high. This is because l is a matrix ^ Let this be the average number of non-zero elements in each row of M. Then, from equation (52), we have an upper triangular matrix. ^ The computational cost of finding L is O(nl) 2 This is because it will result in )

[0148] upper triangular matrix ^ To quickly determine L, the eigenvector calculation unit 45 rearranges the clusters. The rearrangement matrix generation unit 44 generates a rearrangement matrix for this rearrangement. If P is an n×n rearrangement matrix, then an n×n matrix ^ M is M' = P ^ MP T It can be rearranged into matrix M'. In this equation, P is an orthogonal matrix such that each row and each column contains one 1, and all other elements are 0. The element P[i,j]=1 of the orthogonal matrix P indicates that the i-th row is the j-th row. Since P is an orthogonal matrix, ^Matrix M and matrix M' have the same eigenvalues. Therefore, if v i ’ is the i-th eigenvector of matrix M’, then v i =P T v i ’. Thus, the column vector v i can be obtained from v i ’. If cluster c i and cluster c j are not directly connected in matrix M’, then M’[i,j]=0 and M’[j,i]=0 hold; otherwise, M’[i,j]≠0 and M’[j,i]≠0 hold. The eigenvector calculation unit 45 applies the conjugate gradient method to matrix M’ instead of matrix M. This is because if matrix M’ is decomposed as shown in the following equation (57) by incomplete Cholesky decomposition, the properties of Lemma 2 below hold for the elements of matrix L. ^

[0149]

Equation

[0150] (Lemma 2) If the i-th cluster is not directly connected to the j-th cluster such that 1≦j<i, then L[k,i]=M’[k,i] holds for ∀k: i≦k≦n.

[0151] (Proof of Lemma 2) If cluster c<00(00193> is not directly connected to cluster c j such that 1≦j<i, then M’[i,j]=0 holds for all j-th clusters c j such that 1≦j<i. Therefore, from equation (52), L[i,j]=0 holds for all j-th clusters c j such that 1≦j<i. Thus, for all k such that i≦k≦n, from equation (52), the following equation (58) holds.

Equation

[0152] <(

[0153]

[0153] If L[k,i] = M'[k,i], then there is no need to calculate L[k,i], and we only need to calculate L[k,i] when, according to equation (52), L[k,i] ≠ M'[k,i].

[0154] Figure 4 is a diagram showing the cluster sorting algorithm executed by the sorting matrix generation unit 44 of the hash value calculation device 10. Figures 5 and 6 are flowcharts showing the processing of the cluster sorting algorithm executed by the sorting matrix generation unit 44. In the cluster sorting algorithm, l u =[l u [1],l u [2],...] is a set of clusters that are not directly connected to each other, l a =[l a [1],l a [2],...] is cluster l u This is a list of clusters directly connected to the set l. u The clusters included in are not directly connected to each other, therefore, set l u It contains many clusters, and set l a The fewer clusters included in the list, the more elements can be satisfied with L[k,i]=M'[k,i] in Lemma 2. Therefore, let R be the set of clusters not included in the list, and a[c i ] is one of the clusters included in the set R, specifically cluster c i In this embodiment, the number of clusters a[c] in the set R is the number of clusters directly connected to it. i The cluster that has the smallest size is repeated, cluster l u Add to n. u set l u The number of clusters included, n a set l a This represents the number of clusters included.

[0155] In the cluster rearrangement algorithm, the rearrangement matrix generation unit 44 first generates a diagonal matrix M and approximate eigenvalues. ~ Enter λ (step S201). Approximate eigenvalues ~ λ is an approximate eigenvalue.~ λ1,..., ~ λ d It is one of the following. The reordering matrix generator 44 generates the set l u and set l a So, a set R, a permutation matrix P, and the number of elements n. u and the number n a Initialize the following (step S202). The sorting matrix generation unit 44 generates the matrix as shown in equation (59) below. ^ Calculate M (step S203).

[0156]

number

[0157] The sorting matrix generation unit 44 increments the variable i from 1 to n by 1 (step S204), and sorts each i-th cluster c in the set R. i For this, the set R is included, and cluster c i The number of clusters directly connected to a[c i The process of initializing ] is repeated (step S205).

[0158] The sorting matrix generation unit 44 generates a cluster number a[c i ] is the smallest cluster c i set l u The process is repeated (steps S206 to S209). That is, the sorting matrix generation unit 44 generates the cluster c included in the set R according to equation (60). j Of these, the number of clusters a[c j The one with the smallest value is cluster c i (Step S206)

[0159]

number

[0160] The sorting matrix generation unit 44 generates the set l u The number of clusters included n uIncrement by 1 (step S207). The sorting matrix generation unit 44 generates the set l[n u Cluster C i Set (step S208). The sorting matrix generation unit 44 generates cluster c from the set R. i Excluding (step S209).

[0161] In a cluster reordering algorithm, set A[c i ] is cluster c i This is a set of adjacent clusters. The sorting matrix generator 44 generates the set A[c i All clusters included in ] j Select each one individually, and for each selected cluster c j The following steps S211 to S216 are performed (step S210). As a result, the sorting matrix generation unit 44 generates adjacent cluster c j From set R to set l a Add to it.

[0162] The sorting matrix generation unit 44 generates cluster c j If it is included in set R (step S211: YES), then set l a The number of clusters included n a Increase by 1 (step S212), and set l[n a Cluster C j Set (step S213). The sorting matrix generation unit 44 generates cluster c from set R. j Exclude (step S214). The sorting matrix generation unit 44 sorts all clusters c included in the set R. k Select each element one by one, and ensure that it is included in the set R and is in cluster c k The number of clusters directly connected to a[c k The process of subtracting 1 from ] is repeated (steps S215 to S216). Meanwhile, cluster c is added to set R. j If it is not included, the sorting matrix generation unit 44 does not perform the processing in steps S212 to S216.

[0163] The reordering matrix generation unit 44 repeats the process from step S206 to step S216 until the set R becomes an empty set (step S217). That is, if the reordering matrix generation unit 44 determines that the set R is not an empty set (step S217: NO), it returns to the process in step S206.

[0164] Then, if the sorting matrix generation unit 44 determines that the set R is an empty set (step S217: YES), the set l u and set l a After calculating this, in the matrix M' after the clusters have been rearranged, the first n u Clusters are gathered u Corresponds to the following n a Clusters are gathered a Find the corresponding matrix P (steps S218 to S223).

[0165] Specifically, the sorting matrix generation unit 44 generates the sorting matrix when the variable i is from 1 to n u It is increased by 1 until it reaches [value], and the processing of steps S219 to S220 is performed for each variable i (step S218). That is, the sorting matrix generation unit 44 generates cluster c i to l u Set [i] (step S219), P[i,c i Set ] to 1 (step S220).

[0166] Next, the sorting matrix generation unit 44 generates a sorting matrix where the variable i is from 1 to n a It is increased by 1 until it reaches a certain value, and the processing of steps S222 to S223 is performed for each variable i (step S221). That is, the sorting matrix generation unit 44 generates cluster c i to l a Set [i] (step S222), P[i+n u ,c i Set ] to 1 (step S223). After the repetition of step S221 is complete, the sorting matrix generation unit 44 generates matrix P and set L u ,set l a Output (step S224).

[0167] In the matrix P above, the first element is l u [1],...l u [n u ] corresponds to M', and the subsequent elements are l a [1],...l a [n a This corresponds to ]. After rearranging the clusters, the following property holds for matrix L.

[0168] (Lemma 3) If 1 ≤ i ≤ n u If 1≦j≦i-1 holds, then L[i,j]=0, and if n u +1≦i≦n and 1≦j≦n u If the above holds, then L[i,j]=M'[i,j].

[0169] (Proof of Lemma 3) The first element of matrix M' is set l u These correspond to and are not directly connected to each other, so if 1 ≤ i ≤ n u If 1≦j≦i-1 holds, then M'[i,j]=0. Therefore, from equation (52), if 1≦i≦n u If 1≦j≦i-1 holds, then L[i,j]=M'[i,j]=0. Furthermore, by Lemma 2, if 1≦i≦n u If 1≦j≦i-1 holds, then L[i,j]=0, so if n u +1≦i≦n and 1≦j≦n u If the above holds, then L[i,j]=M'[i,j].

[0170] Lemma 3 is the first n u This shows that the off-diagonal elements of a column can be obtained by referencing matrix M'. The computational cost of the cluster reordering algorithm is as follows:

[0171] (Lemma 4) To rearrange clusters using the cluster rearrangement algorithm, the time is O(n(Logn+l) 2 The computational cost of ) + m) and the amount of memory required are O(m).

[0172] (Proof of Lemma 4) Matrices ^Calculating M requires an O(m) computational cost, and for each cluster, the set a[c i Initializing ] requires an O(L) computational cost. In the processing of the cluster sorting algorithm, the set R is monotonically decreasing, so the set a[c i ] is also monotonically decreasing. Therefore, using a heap structure, the set a[c i Cluster c where ] is maximized i This can be calculated with a computational cost of O(logn). Set l a Adding adjacent clusters to the set a[c k To update ], O(l 2 This incurs a computational cost of O(n). Furthermore, setting the elements of matrix P requires a computational cost of O(n). ^ Storing M requires O(m) memory. Also, since the number of non-zero elements in matrix P is n, the set l u and set l a To store the set R and the matrix P, O(n) memory is required. As a result, O(n(logn+l 2 This requires a computational complexity of ) + m) and O(m) of memory.

[0173] Figure 7 shows the eigenvector calculation algorithm executed by the eigenvector calculation unit 45 of the hash value calculation device 10. Figures 8 and 9 are flowcharts showing the processing of the eigenvector calculation algorithm executed by the eigenvector calculation unit 45. The eigenvector calculation algorithm is an algorithm that finds d eigenvalues ​​and eigenvectors of the diagonal matrix M.

[0174] The eigenvector calculation unit 45 calculates approximate eigenvalues ~ λ1,..., ~ λ d The diagonal matrix M and matrix P are input (step S301). The eigenvector calculation unit 45 increments the variable i from 1 to d by 1 and performs the processing in steps S303 to S321 for each variable i (step S302).

[0175] The eigenvector calculation unit 45 calculates the matrix M' using the following equation (61) (step S303).

[0176]

number

[0177] From Lemma 3, if 1 ≤ j ≤ n u If so, the off-diagonal elements of the j-th row of matrix L are zero. Therefore, the eigenvector calculation unit 45 calculates the variable j from 1 to n u The values ​​are incremented by 1 until (step S304), and for each variable j, the diagonal elements L[j,j] of matrix L are calculated using equation (52), and the diagonal elements D[j,j] of matrix D are calculated using equation (53) (step S305).

[0178] If n u ≤j≦n and 1≦k≦n u If the above holds, then by Lemma 3, L[j,k]=M'[j,k], and the eigenvector calculation unit 45 finds the elements of matrix L by referring to the diagonal matrix M (steps S307 to S309). Otherwise, the eigenvector calculation unit 45 calculates each element of matrix L from equation (52) (steps S310 to S312).

[0179] Specifically, the eigenvector calculation unit 45 calculates the variable j as n u The variable j is incremented by 1 from +1 to n, and the processes in steps S307 to S313 are performed for each variable j (step S306).

[0180] First, the eigenvector calculation unit 45 calculates the variable k from 1 to n uThe values ​​are incremented by 1 until the value reaches the specified value, and the processes in steps S308 to S309 are performed for each variable k (step S307). That is, if the eigenvector calculation unit 45 determines that M'[j,k] is not 0 (step S308: YES), it sets M'[j,k] to L[j,k] (step S309). If the eigenvector calculation unit 45 determines that M'[j,k] is 0 (step S308: NO), or after the process in step S309, it repeats the process from step S308 for the next variable k.

[0181] When the eigenvector calculation unit 45 finishes the iterative processing of step S307, it sets the variable k to n u The variable k is incremented by 1 from +1 to j-1, and the processes of steps S311 to S313 are performed for each variable k (step S310). That is, if the eigenvector calculation unit 45 determines that M'[j,k] is not 0 (step S311: YES), it calculates L'[j,k] using equation (52) (step S312). If the eigenvector calculation unit 45 determines that M'[j,k] is 0 (step S311: NO), or after the process in step S312, it calculates L[j,j] using equation (52) and D[j,j] using equation (53) (step S313). The eigenvector calculation unit 45 repeats the process from step S311 for the next variable k (step S310).

[0182] When the iterative processing of step S310 is completed, the eigenvector calculation unit 45 repeats the processing from step S307 for the next variable j (step S306).

[0183] When the iterative processing of step S306 is completed, the eigenvector calculation unit 45 performs v i ' to ||v i Initialize as a random vector such that ||=1 (steps S314-S315). Specifically, the eigenvector calculation unit 45 initializes a random vector v of length n. i Set ' (step S314). The eigenvector calculation unit 45 calculates the random vector v according to equation (62). iUpdate ' (step S315).

[0184]

number

[0185] The eigenvector calculation unit 45 solves equation (63), ^ Calculate v (step S316).

[0186]

number

[0187] The eigenvector calculation unit 45 calculates the eigenvalue λ using equation (64) (step S317).

[0188]

number

[0189] The eigenvector calculation unit 45 calculates v according to equation (65). i Update ' (step S318).

[0190]

number

[0191] The eigenvector calculation unit 45 determines whether or not equation (66) is satisfied (step S319).

[0192]

number

[0193] If the eigenvector calculation unit 45 determines that equation (66) is not satisfied (step S319: NO), it repeats the process from step S316. If the eigenvector calculation unit 45 determines that equation (66) is satisfied (step S319: YES), it calculates the eigenvalue λ using equation (67). iCalculate (step S320), and use equation (68) to obtain the eigenvector v i Calculate (step S321).

[0194]

number

[0195]

number

[0196] The eigenvector calculation unit 45 repeats the process from step S303 for the next variable i (step S302). When the repeated process of step S302 is completed, the eigenvector calculation unit 45 calculates the eigenvalues ​​λ1,...,λ d and eigenvectors v1,...,v d Output (step S322).

[0197] The computational cost and memory usage of the eigenvector calculation algorithm described above are as follows:

[0198] (Lemma 5) t r Let t be the average number of iterations required to solve equation (62), i v i If we take the average number of iterations to find ', the eigenvector calculation algorithm is O(d(nl+n) a l(n u +n a l) / n+(n+mt i The computational cost of )tr)) and the amount of memory required are O(m+dn).

[0199] (Proof of Lemma 5) Since the number of non-zero elements in the diagonal matrix M is m, the computational cost of matrix M' is O(m). From equations (52) and (53), the cost of calculating the diagonal elements of matrices L and D is O(nl). u ≤j≦n and 1≦k≦n u The off-diagonal elements of L[j,k] that satisfy the condition can be referenced by the diagonal matrix M, so O(n u na It can be calculated using the computational cost of l / n. Also, from equation (52), n u ≤j ≤n and n u The off-diagonal elements of L[j,k] such that +1≦k≦j-1 can be found using the computational cost of equation (69) below.

[0200]

number

[0201] Initializing the vector v requires O(n) computation time. The number of non-zero elements in L is O(m), and since v is a vector of length n, iteratively calculating the vector v takes O((n+mt i )t r ) requires a calculation cost of v from P and v i To find this, a computational cost of O(n) is required. Also, matrix P, matrix D and v i To store this data, O(m) of memory is required. As a result, to find d eigenvectors, O(d(nl+n)) a l(n u +n a l) / n+((n+mt i )t r This requires the computational cost of )) and O(m+dn) of memory.

[0202] Figure 10 shows the hash value calculation algorithm executed by the hash value calculator 10. Figure 11 is a flowchart showing the processing of the hash value calculation algorithm executed by the hash value calculator 10. The hash value calculation algorithm is an algorithm that calculates a hash value from a graph.

[0203] First, the calculation unit 40 of the hash value calculation device 10 receives the graph G=(V,E) and the number of bits d for the hash as input. These are input, for example, by the input unit 20 (step S401). The clustering calculation unit 41 calculates n clusters of graph G using IncMod (step S402). The 1st to n-1th clusters are clusters obtained from graph G, and the nth cluster is a cluster connected to all nodes of graph G. The tridiagonal matrix calculation unit 42 calculates a matrix R representing the relationships between the nodes of graph G and the clusters calculated in step S402 using equation (21) (step S403). The tridiagonal matrix calculation unit 42 calculates a diagonal matrix M from matrix R using the following equation (70) (step S404).

[0204]

number

[0205] The tripodial matrix calculation unit 42 uses equation (27) to calculate each element of the tripodial matrix shown in equation (26), and obtains an n × n tripodial matrix of equation (27) consisting of the calculated elements (step S405). The approximate eigenvalue calculation unit 43 uses the number of eigenvalues ​​d input in step S401 and the tripodial matrix calculated in step S405 as input, and calculates the approximate eigenvalues ​​using the approximate eigenvalue calculation algorithm shown in Figures 2 and 3. ~ λ1,..., ~ λ d The following is calculated (step S406). The rearrangement matrix generation unit 44 generates the diagonal matrix M and approximate eigenvalues. ~ Using λ as input, the cluster rearrangement algorithm shown in Figures 4-6 is executed (step S407). Approximate eigenvalues ~ λ is an approximate eigenvalue. ~ λ1,..., ~ λ d It is one of the following, arbitrarily selected. The sorting matrix generation unit 44 generates the sorting matrix P, list I u and List I a Outputs.

[0206] The eigenvector calculation unit 45 calculates approximate eigenvalues ~ λ1,..., ~ λ d Using the diagonal matrix M and matrix P as inputs, the eigenvector calculation algorithm shown in Figures 7-9 is used to obtain the eigenvalues ​​λ1,...,λ d and eigenvectors v1,...,v d Calculate (step S408).

[0207] The matrix of eigenvalue vectors of the graph Laplacian is U = RVΣ -1 Here, Σ=diag(σ1,…,σ n ) is a diagonal matrix consisting of the singular values ​​of matrix R, and λ i = 1 - σ i 2 Therefore, if u i If we let be the i-th column vector of matrix U, then the i-th eigenvalue vector of the graph Laplacian is given by the following equation (71).

[0208]

number

[0209] The eigenvalue vector, when multiplied by √N, becomes the solution to the relaxed optimization problem in equation (11). Therefore, the hash value calculation unit 46 calculates √N as shown in equation (72). i Apply the sine function to calculate the hash value B[j,i].

[0210]

number

[0211] Specifically, the calculation unit 40 increments the variable i from 1 to d by 1, and performs steps S410 to S412 for each variable i (step S409). That is, the eigenvector calculation unit 45 calculates the eigenvalue vector u using the above equation (71). iThe hash value calculation unit 46 calculates the hash value B[i,j] for each variable j, incrementing it by 1 from 1 to N (step S411), and calculating the hash value B[i,j] for each variable j using formula (72) (step S412).

[0212] The eigenvector calculation unit 45 obtains a matrix B whose elements are the hash values ​​B[i,j] calculated in step S412 for each variable i and each variable j (step S413). The output unit 50 outputs the obtained matrix B.

[0213] The computational cost and memory usage of the hash value calculation algorithm described above are as follows:

[0214] (Theorem 1)n c If we take the average number of clusters that each node is directly connected to, the computational cost of the hash value calculation algorithm is O(dNn). c +M+nm+d(nt b +t u )+n(logn+l 2 )+d(nl+n a l(n u +n a l) / n+(n+mt i )t r )) and the memory size is given by the formula O((d+n c It is (N + M + m + dn).

[0215] (Proof) The computational cost of IncMod is O(M), and the memory size is O(M) (see, for example, reference 3). To find the matrix R, we have O(Nn c The computational cost of ) and O(Nn c The amount of memory required is ), and the diagonal matrix M can be calculated in O(mn c This requires a computational cost of O(nm) and memory usage of O(n). Calculating the tridiagonal matrix requires a computational cost of O(nm), and storing it requires memory usage of O(n). As shown in Lemma 1, the approximate eigenvalue calculation algorithm is O(d(nt). b +t uThe computational cost of ) and the amount of memory required are O(n). As shown in Lemma 4, the cluster rearrangement algorithm is O(n(logn+l 2 The computational cost of )+m) and the memory usage of O(m) are required. As shown in Lemma 5, the computational cost of the eigenvector calculation algorithm is O(d(nl+n)). a l(n u +n a l) / n+(n+mt i )tr)) and the memory size is O(m+dn). u i To find this, O(Nc c d) requires computational cost and O(N) memory, and matrix B requires computational cost and O(dN) memory. As a result, the computational cost of the hash value calculation algorithm is O(dNn c +M+nm+d(nt b +t u )+n(logn+l 2 )+d(nl+n a l(n u +n a l) / n+(n+mt i )t r )) and the memory size is O((d+n c It is (N + M + m + dn).

[0216] A hardware configuration example of the hash value calculator 10 is described below. Figure 12 is a device configuration diagram showing a hardware configuration example of the hash value calculator 10. The hash value calculator 10 comprises a processor 71, a storage unit 72, a communication interface 73, and a user interface 74.

[0217] The processor 71 is a central processing unit that performs calculations and control. The processor 71 is, for example, a CPU (central processing unit) or a GPU (Graphics Processing Unit). The processor 71 realizes the functions of the calculation unit 40 by reading and executing programs from the memory unit 72. The memory unit 72 further includes a work area for when the processor 71 executes various programs. The communication interface 73 connects to other devices for communication. The user interface 74 consists of input devices such as a keyboard, pointing device (mouse, tablet, etc.), buttons, and touch panel, as well as display devices such as a display. Human input is received through the user interface 74.

[0218] Furthermore, all or part of the functions of the calculation unit 40 may be implemented using hardware such as an ASIC (Application Specific Integrated Circuit), a PLD (Programmable Logic Device), or an FPGA (Field Programmable Gate Array).

[0219] According to the embodiment described above, the hash value calculation device includes a clustering calculation unit, a tridiagonal matrix calculation unit, an approximate eigenvalue calculation unit, a reordering matrix generation unit, an eigenvector calculation unit, and a hash calculation unit. The clustering calculation unit calculates n clusters in a graph G having N nodes. The tridiagonal matrix calculation unit calculates an n×n inter-cluster relation matrix M based on the relation matrix R between the N nodes and the n clusters, and calculates a tridiagonal matrix corresponding to the inter-cluster relation matrix M. The approximate eigenvalue calculation unit calculates the approximate eigenvalues ​​in the tridiagonal matrix. ~ λ1,..., ~ λ d The sorting matrix generation unit calculates a sorting matrix P for sorting clusters based on the connections between clusters. The eigenvector calculation unit calculates the approximate eigenvalues. ~ λ1,..., ~ λ dBased on the inter-cluster relation matrix M and the rearrangement matrix P, the eigenvalues ​​λ1,...,λ of the inter-cluster relation matrix M are calculated. d and eigenvectors v1,...,v d The hash value calculation unit calculates the eigenvalues ​​λ1,...,λ d and eigenvectors v1,...,v d The hash value of each node is calculated based on this.

[0220] The n clusters calculated by the clustering calculation unit are the n-1 clusters found for graph G, and the cluster connected to N nodes.

[0221] The approximate eigenvalue calculation unit, when iteratively calculating approximate eigenvalues ​​in a tridiagonal matrix in descending order using the bisection method, sets an upper limit on the range in which eigenvalues ​​are searched. ― λ is the lower bound of the range used in the previous eigenvalue calculation. _ Set λ, lower limit _ The search range may be extended in units of differences between adjacent calculated eigenvalues ​​until the number of eigenvalues ​​greater than λ exceeds the number of calculated eigenvalues. The differences between adjacent eigenvalues ​​are, for example, in the embodiment ~ λ i-1 and ~ λ i-2 It corresponds to.

[0222] The sorting matrix generation unit selects clusters with a small number of connections to other clusters, classifies the selected clusters into a first set, and repeatedly classifies the clusters connected to the selected clusters into a second set. It then calculates a sorting matrix P that rearranges the clusters so that those classified into the first set come first, and those classified into the second set come second. For example, the first set is set l in the embodiment. u Corresponding to this, the second set is the set l of embodiments. a It corresponds to.

[0223] The eigenvector calculation unit calculates a matrix obtained by subtracting an identity matrix multiplied by approximate eigenvalues ​​from the inter-cluster relation matrix M. ^The elements corresponding to clusters in M ​​are rearranged by the rearrangement matrix P, and the rearranged matrix is ​​obtained. ^ The eigenvalues ​​λ1, ..., λ are obtained for M using the conjugate gradient method. d and eigenvectors v1,...,v d You may also calculate this.

[0224] While embodiments of this invention have been described in detail above with reference to the drawings, the specific configurations are not limited to these embodiments and include designs and the like that do not depart from the spirit of this invention. [Explanation of Symbols]

[0225] 10 Hash value calculator 20 Input section 30 Storage section 40 Calculation section 41 Clustering Calculation Unit 42 Triple-diagonal matrix calculation unit 43 Approximate Eigenvalue Calculation Unit 44. Sorting Matrix Generation Unit 45 Eigenvector Calculation Unit 46 Hash Value Calculation Unit 50 Output section 71 processors 72 Memory section 73 communication interface 74 User Interface

Claims

1. A clustering calculation unit that calculates n clusters in a graph with N nodes, A tridiagonal matrix calculation unit calculates an n x n inter-cluster relationship matrix based on the relationship matrix between N nodes and n clusters, and calculates a tridiagonal matrix having the same eigenvalues ​​as the inter-cluster relationship matrix. An approximate eigenvalue calculation unit that calculates approximate eigenvalues ​​in the aforementioned tridiagonal matrix, A sorting matrix generation unit calculates a sorting matrix for rearranging the clusters based on the connections between the clusters, An eigenvector calculation unit calculates the eigenvalues ​​and eigenvectors of the inter-cluster relationship matrix based on the approximate eigenvalues, the inter-cluster relationship matrix, and the reordering matrix. A hash value calculation unit that calculates the hash value of each node based on the eigenvalues ​​and eigenvectors, Equipped with, The n clusters calculated by the clustering calculation unit are the n-1 clusters obtained for the graph, and the clusters connected to the N nodes. The sorting matrix generation unit repeatedly selects a cluster with a small number of connections to other clusters, classifies the selected cluster into a first set, and classifies the clusters connected to the selected cluster into a second set, and calculates a sorting matrix that sorts the clusters so that the clusters classified into the first set come first and the clusters classified into the second set come second. Hash value calculator.

2. The approximate eigenvalue calculation unit, when iteratively calculating the approximate eigenvalues ​​in the tridiagonal matrix in descending order using the bisection method, sets the lower limit of the range in the previous eigenvalue calculation as the upper limit of the range for searching for the eigenvalues, and expands the range in units of the difference between adjacent calculated eigenvalues ​​until the number of eigenvalues ​​greater than the lower limit becomes greater than the number of already calculated eigenvalues. The hash value calculation device according to claim 1.

3. The eigenvector calculation unit rearranges the elements corresponding to the clusters in the matrix obtained by subtracting the identity matrix multiplied by the approximate eigenvalues ​​from the relation matrix between the clusters using the rearrangement matrix, and calculates the eigenvalues ​​and eigenvectors of the rearranged matrix using the conjugate gradient method. The hash value calculation device according to claim 1.

4. A clustering step that calculates n clusters in a graph with N nodes, A tridiagonal matrix calculation step involves calculating an n x n inter-cluster relationship matrix based on the relationship matrix between N nodes and n clusters, and calculating a tridiagonal matrix having the same eigenvalues ​​as the inter-cluster relationship matrix, An approximate eigenvalue calculation step for calculating the approximate eigenvalues ​​in the aforementioned tridiagonal matrix, A rearrangement matrix calculation step, which calculates a rearrangement matrix for rearranging the clusters based on the connections between the clusters, An eigenvector calculation step of calculating the eigenvalues ​​and eigenvectors of the inter-cluster relation matrix based on the approximate eigenvalues, the inter-cluster relation matrix, and the sorting matrix, A hash value calculation step of calculating the hash value of each node based on the eigenvalue and the eigenvector, It has, The n clusters calculated in the clustering step are the n-1 clusters obtained for the graph, and the clusters connected to the N nodes. In the sorting matrix calculation step, a cluster with a small number of connections to other clusters is selected, the selected cluster is classified into a first set, and the clusters connected to the selected cluster are classified into a second set. This process is repeated, and a sorting matrix is ​​calculated that sorts the clusters so that those classified into the first set come first, and those classified into the second set come second. Hash value calculation method.

5. Computers, A clustering computation unit that calculates n clusters in a graph with N nodes. A tridiagonal matrix calculation unit calculates an n x n inter-cluster relationship matrix based on the relationship matrix between N nodes and n clusters, and calculates a tridiagonal matrix having the same eigenvalues ​​as the inter-cluster relationship matrix. Approximate eigenvalue calculation unit that calculates the approximate eigenvalues ​​in the aforementioned triple diagonal matrix, A sorting matrix generation unit calculates a sorting matrix for rearranging the clusters based on the connections between the clusters. An eigenvector calculation unit calculates the eigenvalues ​​and eigenvectors of the inter-cluster relation matrix based on the approximate eigenvalues, the inter-cluster relation matrix, and the sorting matrix. A hash value calculation unit that calculates the hash value of each node based on the eigenvalue and the eigenvector. It is a program designed to function as such. The n clusters calculated by the clustering calculation unit are the n-1 clusters obtained for the graph, and the clusters connected to the N nodes. The sorting matrix generation unit repeatedly selects a cluster with a small number of connections to other clusters, classifies the selected cluster into a first set, and classifies the clusters connected to the selected cluster into a second set, and calculates a sorting matrix that sorts the clusters so that the clusters classified into the first set come first and the clusters classified into the second set come second. program.

Citation Information

Patent Citations

  • Parallel processing method of tri-diagonalization of real symmetric matrix for shared memory scalar parallel computer

    WO2008136045A1