A subgraph matching based graph similarity search method

By employing a graph similarity search method based on neural subgraph matching, utilizing inverted indexes and self-loop strategies, and combining the SkipConGNN model for graph edit distance calculation, the accuracy and speed issues of similarity search in graph databases are resolved, achieving efficient similar graph search.

CN119415744BActive Publication Date: 2025-11-28NANJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411558282.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-11-28
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

Existing technologies for similarity searches in graph databases cannot guarantee finding all results and are relatively slow, especially methods based on neural network models, which cannot effectively shorten inference time.

Method used

A graph similarity search method based on neural subgraph matching is designed. It determines the isomorphism of subgraphs by querying the relative positions of the order of graphs and partitions generated in a high-dimensional space. It uses inverted index and coordinate index for hierarchical filtering and combines self-loop strategy and SkipConGNN model to calculate graph edit distance, thereby achieving fast isomorphism judgment.

Benefits of technology

Without losing any real results, it significantly improves the accuracy of similarity search, speeds up the search through an index mapping strategy, avoids the information distortion problem caused by virtual nodes, and improves the efficiency and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415744B_ABST
    Figure CN119415744B_ABST
Patent Text Reader

Abstract

The application discloses a graph similarity search method based on subgraph matching, divides data graphs into a plurality of mutually exclusive half-edge graphs, constructs an inverted index by taking subgraph embedding as a key and a data graph set containing the subgraph as a value, constructs a coordinate index based on size information of the data graph, realizes hierarchical filtering by using a mapping relationship between the two indexes, processes the half-edge by using a self-loop or loop-free strategy, designs a sequential embedding model, so that embeddings of two graphs with subgraph isomorphism have the same partial order position in a high-dimensional space, inputs a query graph, screens out a preliminary candidate set through the coordinate index, further screens the candidate set through the inverted index, accurately calculates a graph edit distance between the query graph and the candidate graph, and obtains a final result set, which not only avoids traditional subgraph isomorphism testing, but also can generate subgraph embedding in an offline stage, greatly shortens inference time of the model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of graph data application, and particularly relates to a graph similarity search method based on neural subgraph matching. BACKGROUND

[0002] As a powerful data model, graphs can not only describe the attributes of target objects, but also describe the structural relationships between components, and have been successfully applied to many fields. With the gradual widespread application of graph data and the increasing size of databases, more and more researches are trying to solve the similarity search problem in graph databases. Users just want to obtain some graph data with similar structures to a given query graph, and there may be some relatively small deviations. This search that allows for differences between the query graph and the given graph is a similarity search. The graph similarity search problem can be defined as follows: given a graph database G = {g1, g2,..., gn} and a query graph Q and a similarity threshold, find all graphs in the graph data set that have a similarity to the query graph Q within the threshold. This approximate search mechanism greatly reduces the search difficulty of users with little or no prior knowledge. Therefore, when exploring large-scale graph databases, a flexible and efficient graph similarity search method is particularly important. In recent years, researchers have proposed a large number of graph similarity search algorithms, among which the similarity search method using graph edit distance as a measurement standard has received widespread attention due to its good fault tolerance and universality.

[0003] CN202410923861.0 calculates the structural similarity features of graph pairs based on a diffusion model and an attention mechanism, and obtains super-edge-super-edge matching vectors and super-edge-super-graph matching vectors through multi-layer matching networks for comparison learning, generates semantic similarity features based on the super-edge-super-edge matching vectors and the super-edge-super-graph matching vectors; the structural similarity features and the semantic similarity features are spliced to obtain a global comparison feature vector of the graph pair, and the global comparison feature vector is input into a fully connected neural network to obtain a similarity score for reflecting the similarity degree of the graph pair. The method combines semantic and structural features, fuses the similarity features of the graph structure itself, and learns semantic information based on node and subordinate community features. The heterogenous graph similarity learning method proposed by the application considers more comprehensively and can effectively and accurately obtain the similarity score of the graph pair.

[0004] CN202411237914.X discloses a method, apparatus, storage medium, and terminal for searching similar network subgraphs based on semantic distance. The method includes: obtaining a reference network subgraph; obtaining predefined connection edges between all text units in the reference network subgraph based on preset filtering conditions; connecting all text units in the reference network subgraph into a search subgraph based on all predefined connection edges; obtaining a set of search text units in an inference database for the target text unit in the search subgraph; obtaining a set of search text units in the inference database for all text units in the search subgraph according to a preset search order; and obtaining all similar network subgraphs of the reference network subgraph based on the set of search text units for all text units in the reference network subgraph. However, the above-mentioned graph similarity calculation method, which relies solely on a neural network model, cannot guarantee finding all results when used for graph search, and the graph search speed is slower than traditional indexing methods. Summary of the Invention

[0005] Objective of the Invention: To address the shortcomings of the prior art, this invention provides a graph similarity search method based on neural subgraph matching. It designs a graph node sequential embedding model, which determines whether the query graph and the partition are subgraph isomorphic by comparing the relative positions of the sequential embeddings generated from the query graph and the partition in a high-dimensional space. This not only avoids traditional subgraph isomorphism testing but also allows for offline generation of partition embeddings. During the query, only the relative positions of the query graph and each partition embedding in the high-dimensional space need to be compared to achieve rapid isomorphism determination, significantly shortening the model's inference time.

[0006] Technical solution: The graph similarity search method based on neural subgraph matching of the present invention includes the following specific steps:

[0007] S1: Divide the data graph into several mutually exclusive half-graphs, construct an inverted index with the subgraph embedding as the key and the data graph set containing the subgraph as the value, construct a coordinate index based on the size information of the data graph, and use the mapping relationship between the two-level index to achieve hierarchical filtering.

[0008] S2: Use self-loop or acyclic strategies to process half-edges and design a sequential embedding model so that the embedding of two graphs with subgraph isomorphism has the same partial order position in the high-dimensional space.

[0009] S3: Input the query graph, filter out the initial candidate set through coordinate index, further filter the candidate set through inverted index, accurately calculate the graph edit distance between the query graph and the candidate graph, and obtain the final result set.

[0010] The specific steps of S1 include:

[0011] S11: For any data graph g, plot it with coordinates (|V g |,|E g|), that is, based on vertex-edge, is mapped in a two-dimensional coordinate system, wherein the x coordinate and the y coordinate represent the number of vertices and the number of edges of the graph g respectively.

[0012] S12: For the graph database G, the point set (|V g |, |E g |) can be obtained, and these points can form a rectangular region A = [x min , x max ] x [y min , y max ], wherein x min / x max and y min / y max are the minimum and maximum number of nodes and edges respectively. Given a query graph q and a threshold T, the query rectangle Aq is defined as a rectangle composed of the point set (x, y): |x-|V q ||+|y-|E q ||≤τ;

[0013] S13: Given a graph g, the graph is divided into (τ+k) semi-edge graphs, and the set of semi-edge graphs is P(g), wherein τ is a threshold, and k (k≥1) is an integer parameter. For a given query graph q, if GED(g, q)≤τ, then there are at least k semi-edge graphs: p i1 , p i2 ,..., p ik ∈P(g) in the semi-edge graph set P(g) that satisfy For any data graph g∈G, the subgraph set of g is P(g) = {p1, p2,..., p τ+k}. If , p i is called a matching subgraph, otherwise it is called a non-matching subgraph. If the number of matching subgraphs in the subgraph set P is less than k, then the graph edit distance GED(g, q) must be greater than τ.

[0014] S14: All data graphs are divided to construct an inverted index I(p) with the divided subgraph as the key and the set of data graphs containing the subgraph as the value. For a given query graph q, if all data graphs containing the divided subgraph p can be quickly found in the graph database G.

[0015] The specific steps of S2 include:

[0016] S21: All semi-edges in the semi-edge graph are connected to the far-end and near-end nodes of the semi-edge, the semi-edge is transformed into a self-loop, and in the process of message passing, the nodes connected by the self-loop formed by the transformation of the semi-edge are not passed, and only the degree information of the semi-edge is included in the embedding.

[0017] S22: The node features are processed by linear transformation to obtain the hidden layer representation. The model uses k graph convolution layers to aggregate local neighborhood information and iteratively update the node representation.

[0018] S23: A learnable skip connection is added between different convolution layers. These connections are determined by a parameter matrix S e R L×L , where L is the number of network layers. During training, this parameter matrix is used to determine the optimal contribution of each layer output to the final node representation.

[0019] S24: After k layers of convolution, the node representation is aggregated by a global pooling operation to generate a fixed-size graph embedding.

[0020] S25: Given a target graph instance G T = (V T , E T ) and a query graph instance G Q = (V Q , E Q ), where V T is the set of target graph nodes, E T is the set of target graph edges, V Q is the set of query graph nodes, and E Q is the set of query graph edges. The graph-level embedding Z T of G T and the graph-level embedding Z Q of G Q can be obtained by sequentially embedding the model, and if G Q is an isomorphic subgraph of G T , then according to the sequential embedding theory, the position of Z Q in the embedding space should be in the "lower left corner" of Z T .

[0021] S26: The GNN model generating the embedding is trained using the maximum marginal loss.

[0022] The specific steps of S3 include:

[0023] S31: Given a query graph q and a query threshold τ, the query region is calculated, and by dividing the mapping relationship between the subgraph and the data graph, all the graphs corresponding to the partition subgraph in the query region are taken as the subgraph to be searched in the inverted index.

[0024] S32: Before querying the inverted index, a score array S is first created to record the number of matching partitions between the current query graph and each data graph. The query graph is input into the neural subgraph matching model to obtain the query graph embedding. For each partition to be queried, the positional relationship between the query graph embedding and the partition embedding in the embedding space is compared in turn. If Z(p)≤Z(q), then p is an isomorphic subgraph of the query graph q. Then the score S[g]+1 of all data graphs containing that partition is increased. This process continues until all partitions to be queried have been compared. The partitions in the score array S with a score greater than or equal to k are the candidate set.

[0025] S33: Use the precise GED verification algorithm to verify the candidate set and obtain the final query results.

[0026] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: On all datasets, the method does not lose any true results in similarity search, and its accuracy is greatly improved compared to other learning-based methods. Secondly, to improve the efficiency of similarity graph search, we designed an index mapping strategy. This strategy utilizes statistical information from the data graph to generate a fast index. By maintaining the mapping relationship between the fast index and the partitioning index, hierarchical filtering of similarity graphs is achieved. Attached Figure Description

[0027] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0028] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0029] Example: Figure 1 As shown in S11: In real-world graph databases, the information and scale of graphs often vary significantly, while graph similarity queries target graph pairs with small similarity differences. Therefore, the database contains a large number of easily identifiable false positive samples. Thus, a label index based on graph statistics is established, utilizing the mapping relationship between two indexes to achieve hierarchical filtering. For any data graph g, it is mapped to a two-dimensional coordinate system using coordinates (|Vg|, |Eg|), i.e., based on vertex-edge representation, where the x and y coordinates represent the number of vertices and edges of graph g, respectively. Therefore, for a graph database G, the set of points (|Vg|, |Eg|) can be obtained. g |,|E g |): g∈G, and these points can form a rectangular region A=[x min x max ]×[y min y max ], where x minx max and y min / y max are the minimum and maximum number of nodes and edges respectively. Given a query graph q and a threshold τ, the query rectangle A q is defined as the rectangle consisting of the point set (x, y): |x-|V q ||+|y-|E q ||≤τ.

[0030] S12: The focus of coordinate mapping is the size of the graph, considering a boundary condition, which helps to exclude those graphs that do not meet the requirements from the graph scale, and is a coarse-grained filtering means to reduce the time overhead of subsequent fine-grained filtering. Therefore, after this layer of coarse-grained filtering of coordinate mapping, the number of data graphs required to participate in subsequent fine-grained filtering of multiple graph partitioning is significantly reduced, which can significantly speed up the index construction time of the subsequent fine-grained filtering method.

[0031] S13: Theorem 1: Given a graph g, the graph is divided into (τ+k) half-edge graphs, and the set of half-edge graphs is P(g), where T is the threshold, and k (k≥1) is an integer parameter. For a given query graph q, if GED(g, q)≤τ, then there are at least k half-edge graphs: p i1 , p i2 ,..., p ik ∈P(g), which satisfy For any data graph g∈G, the partition set of g is P(g)={p1, p2,..., p τ+k}. If p i is called a matching partition, otherwise it is called a non-matching partition.

[0032] S14: According to Theorem 1, if the number of matching partitions in the partition set P is less than k, then the graph edit distance GED(g, q) must be greater than τ, so it can be judged that g is a false positive graph, which greatly saves the time cost. According to a partition p of the graph g, an inverted index I(p) is constructed. For a given query graph q, if all data graphs containing the partition p can be quickly found in the graph database G. In this way, after the necessary half-edge subgraph isomorphism calculation of the partition p is completed, all data graphs containing the partition p can be found through the inverted index, thereby reducing a large amount of calculation. A random partition strategy is adopted, that is, (τ+k) seed nodes in the graph g are randomly selected as the initial partition, and then the partition is expanded in a region growing manner until all nodes in the graph g are included in the partition.

[0033] S21: The graph partition strategy divides each data graph into several mutually exclusive half-edge graphs. These half-edge graphs are different from ordinary graphs because the existence of half-edges cannot be directly encoded by GNNs. For the processing of half-edge graphs, traditional isomorphism testing methods usually use the way of adding virtual nodes to add a virtual node to each half-edge graph, and connect the far end of all half-edges to the virtual node. The virtual node can be matched with any node. Then, when performing subgraph isomorphism testing, the half-edges can be effectively matched.

[0034] However, in GNNs, if the strategy of adding virtual nodes is still used, it may cause distortion of the original graph data. This is because GNNs cannot recognize virtual nodes as traditional algorithms do, and thus cannot achieve that virtual nodes can be matched with any node. Instead, they will treat them as normal nodes, which changes the structure and node information of the original half-edge graph, and thus learns biased or even incorrect information.

[0035] A self-loop strategy is proposed to realize lossless embedding of half-edge graphs. We connect the far end and the near end of all half-edges in the half-edge graph, and at this time, the half-edges become self-loops. In this way, we do not need to introduce virtual nodes and can still indicate the presence of half-edges. However, in the message passing process of GNNs, the self-loop is equivalent to passing the message to itself, which strengthens the role of the current node information in the current node embedding representation. This will not match the true result. Therefore, in the message passing process, we do not pass messages to the nodes connected by the self-loops modified from half-edges. In this way, we only include the degree information of the half-edges in the embedding. In GNNs, for nodes with self-loops, the message passing update formula is as follows:

[0036]

[0037] where N(v) represents the neighbor node set of node v, σ is the activation function, W is the weight matrix, and b is the bias.

[0038] A SkipConGNN model is trained to realize sequential embedding. This model integrates a learnable skip connection, so that the convolution operation of each layer not only depends on the output of the previous layer, but also directly uses the output of all previous layers. This skip connection allows a layer in the network to directly access the output features of the previous layers, allowing a more flexible and expressive feature propagation mechanism, thereby enriching the feature representation. This mechanism is very important in deep neural networks, helping to alleviate the gradient vanishing problem and improve the performance of the model.

[0039] Specifically, the SkipConGNN model achieves a more flexible and expressive feature propagation mechanism by introducing learnable skip connections, enabling information integration across multiple network layers. The architecture of SkipLastGNN can be divided into the following key components:

[0040] S22: The input layer is responsible for processing the initial node features. Let the node feature matrix be X ∈ R N×F , where N represents the number of nodes and F represents the feature dimension. First, the node features are processed through a linear transformation to obtain the hidden layer representation:

[0041] H (0) = XW0

[0042] where W0 ∈ R F×H is the weight matrix of the linear transformation, and H is the hidden layer dimension. If feature preprocessing is enabled, an additional preprocessing step is applied to enhance the original input features. The model uses k graph convolution layers to aggregate local neighborhood information and iteratively update node representations. This paper uses GraphSAGE convolution to implement node neighborhood information aggregation, and its propagation rule can be represented as:

[0043]

[0044] where H (1) is the node representation of the l-th layer, W l is the weight matrix of the l-th layer, N(v) is the neighbor node set of node v, and σ is the activation function.

[0045] S23: Learnable skip connections are added between different convolution layers of SkipConGNN. These connections are represented by a parameter matrix S ∈ R L×L , where L is the number of network layers. During training, this parameter matrix is used to determine the optimal contribution of each layer output to the final node representation.

[0046] Assuming H (0) , H (1) ,..., H (l) are the node representations of the first l layers, the output of the skip connection is represented as:

[0047]

[0048] where S l,i is the learnable skip connection weight. The introduction of skip connections effectively alleviates the gradient vanishing problem, enabling the model to capture information from different network depths. σ is the activation function, used to scale the weight of the skip connection to limit it within the range (0, 1). In this way, the weight of the skip connection will control the degree of influence of each input feature in the current layer.

[0049] S24: After k layers of convolution, the node representations are aggregated through a global pooling operation to generate a fixed-size graph embedding.

[0050] Z = Pool(H) (L) )

[0051] Among them, H( L ) is the node representation of the final layer L, Z is the global representation of the graph, and Pool is the global pooling function, which can select different pooling methods according to specific needs.

[0052] S25: Given a target graph instance G T =(V T E T ) and query graph example G Q =(V Q E Q ), where V T It is the target graph node set, E T It is the edge set of the target graph, V Q It queries the graph node set, E Q It queries the edge set of the graph. G can be obtained through a sequential embedding model. T Graph-level embedding Z T G Q Graph-level embedding Z Q And if G Q It is G T If Z is an isomorphic subgraph, then according to the order embedding theory, Z Q The position in the embedded space should be at Z. T The "bottom left corner", that is:

[0053]

[0054] Where D is the embedding dimension. We can use E(ZQ, Z) T To measure ZQ and Z T The degree to which ordered embedding theory is satisfied.

[0055]

[0056] S26: Therefore, the maximum marginal loss is used to train the GNN that generates the embeddings:

[0057]

[0058] Where P is the positive sample set, N is the negative sample set, and α is the hyperparameter. When Z... Q [i]>Z T When [i], the subgraph constraint is violated. E(Z) Q Z T) represents its magnitude. For positive cases P, E(Z T is minimized when all elements in the query node embedding Z Q , Z T ) are smaller than the corresponding elements in the target node embedding Z Q , Z T . For negative cases (Z Q , Z T ), the amount of violation E(Z Q , Z T ) should be at least a to obtain zero loss.

[0059] S3: After all the preparations such as building index, sequential embedding, index mapping are completed, the similar graph search can be performed. First, the coordinate index is built based on the size information of the data graph. Second, the data graph is divided, and the divided partitions are input into the neural subgraph embedding model to obtain the partition embedding representation. Finally, the inverted index is built with the partition embedding representation as the key and the id of all data graphs containing the partition as the value, while the mapping relationship between the data graph and the partition of the graph division is maintained. When querying, first, the query region is calculated through the query graph q and the query threshold τ. Through the mapping relationship between the partition and the data graph, all the partitions corresponding to the graphs in the query region are taken as the inverted index to be searched. Second, before searching the inverted index, a score array S is first created to record the number of matching partitions between the current query graph and each data graph. The query graph is input into the neural subgraph matching model to obtain the query graph embedding. For each to-be-searched partition, the positional relationship of the query graph embedding and the partition embedding in the embedding space is compared in turn. If Z(p)≤Z(q), p is the isomorphic subgraph of the query graph q, then the score S[g] of all data graphs containing the partition is incremented by 1, until all to-be-searched partitions are completely compared. According to Theorem 1, the scores in the score array S that are greater than or equal to k are the candidate set. Finally, the candidate set is verified using the accurate GED verification algorithm to obtain the final query result.

[0060] It should be noted that the above content only illustrates the technical idea of the present application and cannot limit the protection scope of the present application. For ordinary skilled persons in the technical field, they can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements all fall within the protection scope of the claims of the present application.

Claims

1. A subgraph matching based graph similarity search method, characterized by, The method comprises the following steps, S1, dividing the data graph into several mutually exclusive half-edge graphs, constructing an inverted index with sub-graph embedding as the key and the data graph set containing the sub-graph as the value, constructing a coordinate index based on the size information of the data graph, and realizing hierarchical filtering by using the mapping relationship between the two indexes; S2, using a self-loop or loop-free strategy to process the half-edge, designing a sequential embedding model so that the embeddings of two graphs with sub-graph isomorphism relationship also have the same partial order position in the high-dimensional space; Step S2 comprises: S21, connecting the far end and near end nodes of all half-edges in the half-edge graph, transforming the half-edges into self-loops, and in the process of message passing, not passing messages to the nodes connected by the self-loops transformed from the half-edges, but only including the degree information of the half-edges in the embedding; S22, processing the node features through a linear transformation to obtain a hidden layer representation, the model using one graph convolution layer to aggregate local neighborhood information and iteratively update the node representation; S23, learnable skip connections between different convolutional layers are added, which are determined by a parameter matrix wherein is the number of network layers, and during the training process, the parameter matrix is used to determine the optimal contribution of each layer output to the final node representation; S24, after passing through After layer convolution, node representations are aggregated through a global pooling operation to generate a fixed-size graph embedding; S25, given a target graph instance and a query graph instance where is a set of target graph nodes, is a set of target graph edges, is a set of query graph nodes, is a set of query graph edges, by sequential embedding model graph-level embedding of , graph-level embedding of and if is an isomorphic subgraph of , according to sequential embedding theory, the position of in embedding space is in the "lower left corner" of S26, using the maximum marginal loss to train the GNN model for generating embedding; S3, inputting the query graph, screening out the preliminary candidate set through the coordinate index, further screening the candidate set through the inverted index, accurately calculating the graph edit distance between the query graph and the candidate graph, and obtaining the final result set; Step S3 comprises: S31, given query graph and query threshold , calculate query region, by dividing the mapping relationship between subgraph and data graph, all graphs corresponding to the partition subgraph in the query region are taken as the to-be-searched subgraph of the inverted index; S32, before querying the inverted index, first create a score array , used to record the number of matching subgraphs between the current query graph and each data graph, input the query graph into the subgraph matching model to get the query graph embedding, for each subgraph to be searched, compare the position relationship of the query graph embedding and the subgraph embedding in the embedding space in turn, if , then is an isomorphic subgraph of the query graph , and the score of all data graphs containing the subgraph , until all subgraphs to be searched are compared, then the score in the score array that is greater than or equal to is the candidate set; S33, verifying the candidate set using an accurate GED verification algorithm to obtain the final query result.

2. The subgraph matching based graph similarity search method according to claim 1, wherein, The step 1 comprises the following steps, S11, for any data graph g, it is mapped in the coordinate system , that is, based on the vertex-edge way, in the two-dimensional coordinate system, wherein the x coordinate and the y coordinate represent the number of vertices and the number of edges of the graph g respectively; S12, for a graph database G, obtaining a set of points while these points form a rectangular region where and are the minimum and maximum number of nodes and edges respectively, given a query graph q and a threshold τ, the query rectangle Aq is defined as the rectangle formed by the set of points ​ S13, given a graph g, the graph is divided into half-edge graphs, the set of half-edge graphs is P (g), wherein is a threshold value, k (k≥1) is an integer parameter, for a given query graph q, if , then there are at least k half-edge graphs in the half-edge graph set P(g): , which satisfies pil⊆q (1 ≤ l ≤ k), for any data graph , whose subgraph set is P (g) = {p1, p2,..., pτ +k}, if pi⊆ q, then pi is called a matching subgraph, otherwise it is called a non-matching subgraph, if the number of matching subgraphs in the subgraph set is less than k, then the graph edit distance must be greater than ; S14, partition all data graphs, build an inverted index I(p) with partition sub-graph as key, and the data graph set containing the sub-graph as value, for a given query graph , if , the query graph is not in the inverted index I(p) , find all data graphs containing the partition sub-graph in the graph database .

3. The subgraph matching based graph similarity search method according to claim 1, wherein, In step S21, for the nodes with self-loops, the message passing update formula is as follows, , wherein, represents a set of neighbor nodes of a node , is an activation function, is a weight matrix, is a bias.

4. The subgraph matching based graph similarity search method according to claim 1, wherein, The architecture of the GNN model comprises the following components, The input layer is responsible for processing the initial node features, and let the node feature matrix be where denotes the number of nodes, denotes the feature dimension. First, the node features are processed by a linear transformation to obtain the hidden layer representation: , where, is the weight matrix of the linear transformation, H is the hidden layer dimension, if feature preprocessing is enabled, additional preprocessing steps are applied to enhance the original input features, the model adopts k graph convolution layers to aggregate local neighborhood information and iteratively update node representation, and the aggregation of node neighborhood information is realized by using GraphSAGE convolution, and the propagation rule is represented as: , in, It is the first Layer node representation, It is the first The weight matrix of the layer, It is a node The set of neighboring nodes, It is an activation function.

5. The subgraph matching based graph similarity search method according to claim 1, wherein, In the step S23, learnable skip connections are added between different convolutional layers of the SkipConGNN, which are determined by a parameter matrix denoted by wherein is the number of network layers, which is used to determine the optimal contribution of each layer output to the final node representation during the training process, Assume is the node representation of the previous layer, the output of the skip connection is represented as: , wherein, are learnable skip-connection weights that enable the model to capture information from different network depths, is an activation function that scales the weights of the skip-connection so as to limit them in the range (0, 1).

6. The subgraph matching based graph similarity search method according to claim 1, wherein, In the step S24, after the layer convolution After the layer convolution, the node representations are aggregated by a global pooling operation to generate a fixed-size graph embedding, , wherein, is the final layer whose nodes represent, Z is the global representation of the graph, Pool is a global pooling function.

7. The subgraph matching based graph similarity search method according to claim 1, wherein, In step S25, according to the sequential embedding theory, The position in the embedding space is at the "lower left corner" of , i.e.: , where D is the embedding dimension, measured by the largest singular value of the matrix and the degree to which the sequence satisfies the theory of sequential embedding. 。 8. The subgraph matching based graph similarity search method according to claim 1, wherein, In step S26, the GNN for generating embedding is trained using the maximum marginal loss: , wherein, is a set of positive samples, is a set of negative samples, is a hyperparameter, when in any dimension , the subgraph constraint is violated, denotes its magnitude, for positive pairs when all elements in the query node embedding are smaller than the corresponding elements in the target node embedding , is minimized, for negative pairs the amount of violation should be at least to obtain zero loss.

Citation Information

Patent Citations

  • A graph matching method, device and medium for heterogeneous graphs

    CN118467793B

  • Similar network subgraph search method and device based on semantic distance, storage medium and terminal

    CN118760780B

  • Vehicle-mounted laser point cloud and sequence panoramic image registration method

    CN112465732A

  • Ontology label knowledge graph-oriented sample query method

    CN113569057A