Rapid query method for accessibility on evolutionary graph based on 2-Hop Labeling
By constructing the index of the strongly connected component aging table and the 2-Hop Labeling accessibility label on a large-scale evolution graph, and combining the Tarjan algorithm for strongly connected component division, the problem of low accessibility query efficiency of evolution graph is solved, and a large-scale Quick query of accessibility on scale evolution graphs.
Patent Information
- Application Number
- CN202411581559.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When handling accessibility queries of large-scale evolutionary graphs, the query time is long and the processing efficiency is low. Especially when facing the demand for large-scale query, the response speed becomes a bottleneck.
By optimizing the index structure and query strategy, combining the Tarjan algorithm to divide the evolutionary graph with strong connectivity components, constructing the index of the strong connectivity component time table and 2-Hop Labeling accessibility label, designing an index-based accessibility fast query method, and implementing an index-based accessibility Quick query of accessibility on large-scale evolutionary maps.
It realizes rapid accessibility on large-scale evolutionary graphs, reduces spatial and time complexity, improves query efficiency, and can meet the needs of large-scale accessibility queries.
Smart Images

Figure CN119415745A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of information technology and relates to a fast query method for reachability on an evolutionary graph based on 2-Hop Labeling. Background Art
[0002] As a graph model that describes the dynamic changes of topological structures over time, the essential feature of evolutionary graphs is the frequent updates of their edges and nodes. This dynamicity leads to the continuous evolution of the graph structure. This evolution not only reflects the time-varying nature of the relationships between elements in the network, but also profoundly affects the accessibility of the same group of nodes in different time slices. Accessibility, as a basic concept in graph theory, refers to whether a node can reach another node through a certain path. It is particularly important in the analysis of evolutionary graphs. Because in practical applications, many key issues can be attributed to the judgment of accessibility, such as the scope of information dissemination, the availability of resources, and the evolution of system status.
[0003] In the field of biology, the application of evolutionary graphs is particularly prominent, especially in the study of protein interaction networks. As the basic executors of life activities, the interactions between proteins constitute complex networks that change over time, environmental conditions, and the developmental stages of organisms. Using evolutionary graph models, researchers can track whether two proteins belong to the same biological tissue or continue to participate in the same biological process over a period of time, which is of great significance for understanding life mechanisms, disease occurrence and development, and drug development. For example, in disease research, if two proteins remain reachable for a long time on an evolutionary graph, it may mean that they are jointly involved in a key biological pathway, and abnormalities in this pathway may be closely related to the occurrence of a certain disease.
[0004] Although existing methods such as HR-Index have made some progress in processing evolutionary graph reachability queries by building a strongly connected component time table to reduce space overhead and retain the complete reachability information of the graph, their limitations are also obvious. When the queried node pair is not within the coverage of the strongly connected component time table, the method still needs to fall back to traditional graph search algorithms such as breadth-first search (BFS) or depth-first search (DFS). When these methods process large-scale evolutionary graphs, they have a high time complexity due to the need to traverse the topological structure of the graph, resulting in low query efficiency. Especially when facing large-scale query requirements, the response speed becomes a bottleneck.
[0005] The introduction of 2-Hop Labeling technology provides a new idea for solving reachability queries on large-scale graphs. This technology generates forward and backward labels for each node in the preprocessing stage. These labels contain enough information to quickly determine whether there is a reachable path between any two nodes without actually traversing the topological structure of the graph. The advantages of this method are its high efficiency and high scalability, especially when dealing with static large-scale graphs, which can significantly improve the query speed. However, there are still challenges in directly applying 2-Hop Labeling to evolving graphs, mainly because it needs to effectively handle the dynamic changes of points and edges on the graph to ensure the accuracy of the query results.
[0006] In summary, although the existing technology has made some achievements in processing evolutionary graph reachability queries, it still has problems such as long query time and low processing efficiency when dealing with large-scale graphs and large-scale queries. Therefore, exploring new methods or optimizing existing technologies to achieve fast reachability queries on large-scale evolutionary graphs is an important direction of current research. Summary of the invention
[0007] In view of this, the purpose of the present invention is to provide a fast query method for reachability on an evolutionary graph based on 2-Hop Labeling, which can achieve fast query of reachability on a large-scale evolutionary graph by optimizing the index structure and query strategy.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] A fast query method for reachability on an evolutionary graph based on 2-Hop Labeling, the method comprising the following steps:
[0010] S1. Preprocess the original graph, use the Tarjan algorithm to divide the nodes in the graph on each time slice into strongly connected components, and convert the original graph into a simplified graph structure represented by strongly connected components;
[0011] S2. Construct an index containing a strongly connected component timeliness table and a 2-Hop Labeling reachability label; design and construct a data structure of the strongly connected component timeliness table to store the correspondence between the strongly connected component and the original graph nodes, and record the reachability information of the internal nodes of the strongly connected component; design a data structure of the 2-Hop Labeling reachability label in combination with the strongly connected component timeliness table, and construct a complete index structure to efficiently store and query the reachability relationship between nodes in the graph;
[0012] S3. Design an index-based fast reachability query method, make full use of the strong connected component time table and 2-HopLabeling reachability labels, and merge at most two-hop information to achieve fast reachability query.
[0013] Further, in step S1, it specifically includes: first reading the source node, target node and timestamp information in the data, and dividing the original graph according to a given time division standard (such as by day, week or month, etc.) to obtain a standardized evolutionary graph; using the Tarjan algorithm (an algorithm for solving strongly connected components based on depth-first search, the full name of the Tarjan algorithm is Tarjan's Strongly Connected Components Algorithm, that is, Tarjan's Strongly Connected Components Algorithm, which is an algorithm for solving the strongly connected components of a graph) to divide each time slice of the standardized evolutionary graph into strongly connected components to generate a simplified graph composed of strongly connected components; in this process, it is necessary to ensure that the strongly connected components containing different node sets have different numbers. If some strongly connected components have the same number, it means that their node sets have the same connectivity characteristics.
[0014] Further, in step S2, it specifically includes: first, according to the strongly connected component division result in step S1, the timeliness information of strongly connected components with different numbers and the time slices in which they appear are counted, and the node information contained therein is recorded in detail to form a strongly connected component timeliness table, so as to ensure that the strongly connected component data in each time slice can be accurately obtained in the subsequent steps, and provide intermediate information support for 2-Hop Labeling index construction; secondly, combined with the strongly connected component timeliness table obtained in the previous step, the reachability label of 2-Hop Labeling is constructed for the simplified graph on each time slice, because the index is not constructed from the original graph or the reachability is directly queried, so the space and time complexity is reduced; the reachability index records the reachability information between any two nodes on each time slice in the original graph, and does not use the original graph to construct an index or directly perform a reachability query, so the space and time complexity is reduced.
[0015] Further, in step S3, it specifically includes: designing an index-based fast query method for reachability, querying the strongly connected component time table and the 2-Hop Labeling reachability label; querying the strongly connected component number corresponding to the original node in the strongly connected component time table, and continuing to use the corresponding strongly connected component number to query in the 2-Hop Labeling reachability label, at most through two hops of information, to achieve fast query of reachability on a large-scale evolutionary graph.
[0016] The beneficial effects of the present invention are:
[0017] The technical solution provided by the present invention combines the strongly connected component compression method with the 2-Hop Labeling method, and proposes a fast query method for reachability on an evolutionary graph based on 2-Hop Labeling. This method can not only compress the original graph data using the strongly connected components, but also use the 2-Hop Labeling method to merge labels of at most two hops to quickly obtain reachability results, thereby realizing fast query of reachability on large-scale evolutionary graphs.
[0018] Other advantages, objectives and features of the present invention will be described in the following description to some extent. For those skilled in the art, these characteristics can be clearly understood through the study of the following content, or can be inspired through practical application. The objectives and other advantages of the present invention can be achieved and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0020] Figure 1 It is a flowchart of a fast query method for reachability on an evolutionary graph based on 2-Hop Labeling of the present invention;
[0021] Figure 2 A schematic diagram of the evolutionary graph used in the present invention;
[0022] Figure 3 A schematic diagram of the strongly connected components of the evolutionary graph used in the present invention;
[0023] Figure 4 A strongly connected component time table used in the present invention;
[0024] Figure 5 The reachability label based on the 2-Hop Labeling method constructed for the present invention;
[0025] Figure 6 A strongly connected component mapping table used in the present invention;
[0026] Figure 7 Generate an index flow chart for the strongly connected component time-effect table and the 2-Hop Labeling method of the present invention;
[0027] Figure 8 A flow chart for index construction of the present invention. DETAILED DESCRIPTION
[0028] The technical solution of the present invention is described in detail below with reference to the accompanying drawings.
[0029] Figure 1The flowchart of the fast query method of reachability on the evolutionary graph based on 2-Hop Labeling of the present invention is shown in the figure. The fast query method of reachability on the evolutionary graph based on 2-Hop Labeling disclosed by the present invention comprises the following steps:
[0030] S101, preprocess the original graph and convert it into a simplified graph structure represented by strongly connected components. The main steps are as follows:
[0031] a) According to actual needs, divide the timestamp data in the original graph into days, weeks, months, years or other longer time periods to obtain a standardized evolution graph, such as Figure 2 As shown, the evolution graph contains 4 time slices, G0, G1, G2, and G3.
[0032] b) Divide the original image according to the specified standard. Figure 3 As shown, the obtained evolutionary graph uses the Tarjan algorithm (an algorithm for solving strongly connected components based on depth-first search) to calculate strongly connected components. Nodes in the same strongly connected component will be identified with the same strongly connected component number, thereby preliminarily compressing the original graph information. For example, in the G0 time slice, nodes v1, v2, and v3 are interconnected and can be divided into the same strongly connected component S2. It means that v1, v2, and v3 nodes are represented by the strongly connected component S2 number in the G0 time slice.
[0033] S102, construct an index containing a strongly connected component time table and a 2-Hop Labeling reachability label. The main steps are as follows:
[0034] Design a strong connected component time-effect table structure, such as Figure 4 As shown, the main steps are as follows:
[0035] The node information of a node set represents the node set contained in a certain strongly connected component number. The same line records the corresponding strongly connected component number and its effective time slice. Let v i Represents the nodes of the original graph, S i Indicates v i The corresponding strongly connected component number. Figure 4 The first line of data is interpreted as node v4 alone forming a node set, which corresponds to S0 in the strongly connected component numbering, and the effective time slice is t0, corresponding to Figure 2 In G0, the strongly connected component numbered S0 does not exist in other time slices.
[0036] Construct 2-Hop Labeling reachability labels, such as Figure 5 As shown, the main steps are as follows:
[0037] a) Calculate the strongly connected component number S i The priority of . Using the simplified graph structure represented by the strongly connected components, calculate the in-degree and out-degree values corresponding to the strongly connected component numbers. The priority calculation formula is:
[0038] Priority i (S i )=(indegree(S i )+1)*(outdegree(S i )+1) (1)
[0039] Priority i (S i ) is the strongly connected component number S i The priority of indegree(S i ) is the strongly connected component number S i The in-degree value, outdegree(S i ) is the strongly connected component number S i The out-degree value of . The strongly connected component numbers will be divided separately in different time slices to ensure that different strongly connected component numbers S i The node set v that contains i different.
[0040] b) Generate 2-Hop Labeling reachability labels. The labels are divided into L in and L out The steps for generating the two parts are similar. The strongly connected component numbers are traversed in turn. If the corresponding reachability information is not recorded in the 2-Hop Label, a reachability label is generated. Each time the label only traverses the strongly connected component numbers with a priority lower than the current node, ensuring that the generated label meets the following conditions:
[0041] 1) In Figure G i In the example, node u i Can reach node v;
[0042] 2) In Figure G i In the example, node v i can be reached by node u;
[0043] 3) In Figure G i middle, Lout (u i ) and L in (u i ) can be expressed with respect to node u i All available information.
[0044] The feasibility labels generated are as follows Figure 5 As shown, the first row of data is interpreted as the in-degree index L of the strongly connected component number S0 in (S0) is (S1,{t0}) and (S2,{t0}), indicating that both strongly connected component numbers S1 and S2 can reach strongly connected component S0 at time slice t0, and the out-degree index L out (S0) is empty, indicating that the corresponding information is not recorded.
[0045] S103, given a query Q = (v s ,v t ,t x ), indicating whether there is a path that makes node v s In time slice t x Next to node v t According to the constructed index, the corresponding query method is designed, and the strong connected component time table and 2-Hop Labeling reachability label are fully utilized to realize the fast query of reachability on large-scale evolutionary graphs. The main steps are as follows:
[0046] a) Read the index information and generate a strongly connected component mapping table. The strongly connected component mapping table is as follows: Figure 6 As shown, the first row of data is interpreted as: in the time interval [t0, t2), the strongly connected component corresponding to the node v1 is numbered S2, in the time interval [t2, t3), the strongly connected component corresponding to the node v1 is numbered S6, and in the time interval [t3, t max ], the strongly connected component corresponding to node v1 is numbered S2, where t max Represents the maximum value over all given time slices. Input node v in the original graph i , query node v using the strongly connected component mapping table i The corresponding strongly connected component number S i , use binary search to search for t x The time interval it belongs to and its corresponding strongly connected component number S i , continue to query another node v j The strongly connected component number S in the corresponding time interval j , proceed to the next step.
[0047] b) Determine whether the query Q is reachable through a one-hop label. For the time slice t required for the query x . Query the L corresponding to the time slice out (S i ,t x ) or L in (S j ,t x ), according to S i or Sj Perform binary search based on the number priority. If you can find out (S i ,t x ) to find the target point v j The corresponding strongly connected component S j Or in L in (S j ,t x ) to find the source point v i The corresponding strongly connected component S i , then it means that at t x In the time slice, v i to v j If it is reachable, return the query result; otherwise, go to the next step.
[0048] c) Determine whether the query Q is reachable through the two-hop label. For the time slice t required for the query x , each L out and L in Query L separately out (S i ,t x ) and L in (S j ,t x ), because they are all based on S i The numbers are sorted by priority. If L out (S i ,t x ) <L in (S j ,t x ), then query L out (S i ,t x ); if L out (S i ,t x )>L in (S j ,t x ), then query L in (S j ,t x ); if L out (S i ,t x )=L in (S j ,t x ), representing node v i To node v j is reachable, return the reachable result; if the search index does not satisfy L out (S i ,tx )=L in (S j ,t x ), representing node v i To node v j is unreachable, returns an unreachable result.
[0049] Figure 7 Generate an index flow chart for the strongly connected component time-effect table and the 2-Hop Labeling method of the present invention, Figure 8 A flow chart for index construction of the present invention. The present invention is mainly aimed at accelerating reachability queries on a single time slice on an evolutionary graph, and therefore can support reachability queries on a variety of evolutionary graphs, such as continuous time interval queries, such as conjunction queries, which require that the reachability conditions are met in all time slices in the time interval, and the query result is reachable, otherwise it is judged as unreachable; disjunction queries, which only require that there is a reachable path in a certain time slice in the time interval, and the query result is reachable, otherwise it is judged as unreachable; and other evolutionary graph queries for non-continuous time intervals. These extended query functions further enhance the flexibility and applicability of the present invention in practical applications.
[0050] The above experimental results show that using the Tarjan algorithm to preprocess the graph and convert it into the corresponding strongly connected components for index construction can not only compress the space occupied by the original graph, but also maintain the complete information of the original graph. In addition, this method can meet the needs of judging large-scale reachability queries on large-scale evolutionary graphs in a short time, has good practical application potential, and can be effectively used in production environments.
[0051] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A fast query method for reachability on an evolutionary graph based on 2-Hop Labeling, characterized by: The method comprises the following steps: S1. Preprocess the original graph, use the Tarjan algorithm to divide the nodes in the graph on each time slice into strongly connected components, and convert the original graph into a simplified graph structure represented by strongly connected components; S2. Construct an index containing a strongly connected component timeliness table and a 2-Hop Labeling reachability label; design and construct a data structure of the strongly connected component timeliness table to store the correspondence between the strongly connected component and the original graph nodes, and record the reachability information of the internal nodes of the strongly connected component; design a data structure of the 2-Hop Labeling reachability label in combination with the strongly connected component timeliness table, and construct a complete index structure to efficiently store and query the reachability relationship between nodes in the graph; S3. Design an index-based fast reachability query method, make full use of the strong connected component time table and 2-HopLabeling reachability labels, and merge at most two-hop information to achieve fast reachability query.
2. According to claim 1, a fast query method for reachability on an evolutionary graph based on 2-Hop Labeling is characterized in that: In step S1, it specifically includes: first reading the source node, target node and timestamp information in the data, and dividing the original graph according to a given time division standard to obtain a standardized evolutionary graph; using the Tarjan algorithm to divide each time slice of the standardized evolutionary graph into strongly connected components, and generating a simplified graph composed of strongly connected components; in this process, it is necessary to ensure that the strongly connected components containing different node sets have different numbers. If some strongly connected components have the same number, it means that their node sets have the same connectivity characteristics.
3. The fast query method for reachability on an evolutionary graph based on 2-Hop Labeling according to claim 2, characterized in that: In step S2, it specifically includes: first, according to the strongly connected component division result in step S1, the timeliness information of strongly connected components with different numbers and the time slices in which they appear are counted, and the node information contained therein is recorded in detail to form a strongly connected component timeliness table, so as to ensure that the strongly connected component data in each time slice can be accurately obtained in the subsequent steps, and provide intermediate information support for 2-Hop Labeling to construct an index; secondly, combined with the strongly connected component timeliness table obtained in the previous step, the reachability label of 2-Hop Labeling is constructed for the simplified graph on each time slice. Because the index is not constructed from the original graph or the reachability is directly queried, the space and time complexity is reduced.
4. The fast query method for reachability on an evolutionary graph based on 2-Hop Labeling according to claim 3 is characterized by: In step S3, it specifically includes: designing an index-based fast query method for reachability, querying the strongly connected component time table and the 2-Hop Labeling reachability label; querying the strongly connected component number corresponding to the original node in the strongly connected component time table, and continuing to use the corresponding strongly connected component number to query in the 2-Hop Labeling reachability label, at most through two hops of information, to achieve fast query of reachability on a large-scale evolutionary graph.