Polynomial calculation method and incremental calculation method for relaxation tense graph motif

By introducing the concept of relaxed temporal graph model and the corresponding proportional and constant relaxation constraints, the existing temporal graph model calculation methods are solved, and efficient calculation and practical application value are improved in low-quality data environments.

CN120124233AActive Publication Date: 2025-06-10BEIHANG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510274604.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-06-10
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

The existing calculation methods of time-matter diagram model are complex and inefficient, and cannot effectively deal with the problem of low-quality data.

Method used

A polynomial static calculation method and incremental calculation method based on the concept of relaxed temporal graph model is proposed. By introducing proportional relaxation constraints and constant relaxation constraints, edge labels are allowed to change within a certain range, thereby improving calculation efficiency and adapting to low-quality data.

Benefits of technology

It achieves the tolerance of a certain degree of data quality problems while maintaining computing efficiency, and improves the practical application value of the concept of approximation of temporal graph model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124233A_ABST
    Figure CN120124233A_ABST
Patent Text Reader

Abstract

The invention provides a polynomial static calculation method and incremental calculation method for a relaxation tense graph motif. The polynomial static calculation method comprises the steps of obtaining tense graph data and a frequency threshold k, a proportional relaxation constraint delta and a constant relaxation constraint c specified by a user; processing the tense diagram into a data structure which can be efficiently used; according to the frequency threshold k, the proportional relaxation constraint delta and the constant relaxation constraint c, calculating all relaxation tense network motifs conforming to the definition on the whole tense diagram; and after the tense graph is dynamically updated, incrementally updating a tense graph motif calculation result according to an existing calculation result and an intermediate result. The method provided by the invention has the technical effects that the problems of high complexity and low efficiency of most existing tense graph motif calculation methods are solved, and the problem that the existing polynomial solvable tense graph motif calculation method cannot cope with low-quality data can be relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computers, and more particularly, to a calculation method and an incremental calculation method based on the concept of relaxed temporal graph motifs. Background Art

[0002] As a data structure that can describe and model complex relationships, graphs have been widely used in many systems such as nature, society, and engineering technology. However, the relationships described by traditional graph data structures are often static, lacking in reflecting the dynamic characteristics of many systems. In recent years, researchers have proposed using a "temporal graph" that can better represent dynamic characteristics. Compared with traditional graph data structures, temporal graphs have an additional time dimension, and their vertices or edges are associated with temporal information (timestamps), which can describe and model the dynamic characteristics of networks and have now been widely applied. Temporal graph motifs are also an important part of many graph mining problems on temporal graphs.

[0003] A graph motif is a repeatedly occurring and statistically significant pattern in a graph, which is used to better understand the structure and function of a system and has been widely studied on traditional graph data structures. A temporal graph motif is a network motif defined on a temporal graph, considering various relationships such as the order, time difference, and trend formed among vertices, edges, and attributes at different times on the basis of network motifs.

[0004] Temporal graphs vary widely, and existing definitions of the concept of temporal graph motifs defined on temporal graphs often differ. Researchers generally propose new definitions of the concept of temporal graph motifs (even including the definition of temporal graphs) and corresponding mining problems according to actual application scenarios, and study algorithms for quickly solving temporal graph motif mining problems.

[0005] Most existing temporal graph motif algorithms cannot avoid subgraph isomorphism (which has been proven to be an NPC problem) testing in order to find frequently occurring subgraph patterns, and the use of exact counting algorithms is inefficient. Most existing concepts of temporal graph motifs are polynomially unsolvable, and their exact algorithms cannot avoid subgraph isomorphism testing or subgraph enumeration with exponential time complexity, resulting in low computational efficiency. Generally, by limiting the number of vertices and edges of temporal graph motifs; their approximation algorithms and parallel algorithms can effectively reduce the running time, but do not change the complexity of the problem itself. Therefore, proposing a temporally graph motif approximation concept suitable for practical applications and polynomially solvable is the key to overcoming the low algorithm efficiency problem of traditional temporal graph motif concepts.

[0006] Existing polynomially solvable approximations of the concept of temporal graph motifs are defined as follows:

[0007] Temporal graph: defined as a five-tuple G(V, E, T b , T e , L), where: (1) V is the set of vertices; (2) is a set of undirected edges; (3) T b and T e represent the start time and end time of the temporal graph respectively, and use [T b , T e to represent the time interval of the temporal graph with length (T e - T b + 1). (4) For each time t ∈ [T b , T e (time is discrete), L t () is a labeling function that maps each edge in E and each time t to a label. For convenience, G(V, E, L) or G(V, E, T b , T e ) is used to represent the temporal graph when there is no ambiguity in understanding.

[0008] Temporal subgraph: It is defined as G(V s , E s , L s ) that satisfies and and for e ∈ E s and there is

[0009] Temporal graph motif approximation concept: A temporal graph motif is a temporal subgraph and satisfies: (1) It is a connected graph, (2) for e ∈ E s there is that is, the label of each edge remains unchanged in the interval , (3) Let k be called the frequency threshold.

[0010] Scalability of the temporal graph motif approximation concept: Based on the above definition of the temporal graph motif, to reduce redundant mining results, the scalability of the temporal graph motif is further proposed and defined as: for each edge e of the temporal graph motif , if there are edge labels in the interval that satisfy When , the temporal graph motif is left - scalable; when , the temporal graph motif is right - scalable.

[0011] Maximality of the temporal graph motif approximation concept: Based on the above definition of the temporal graph motif, the maximality of the temporal graph motif is also proposed and defined as: for any adjacent edge e' of the temporal graph motif , if there are edge labels in the interval that do not satisfy the temporal graph motif is maximal, otherwise it is not maximal.

[0012] Problem definition: Given a temporal graph \(G(V, E, I, T, L)\) and a frequency threshold \(k\), output all maximal and non-extendable temporal graph motifs.

[0013] The existing approximate concept of temporal graph motifs requires that all edges in a temporal graph motif have the same label within their intervals, which is too restrictive. Considering that in practical applications, data quality problems are widespread, including data noise, measurement errors, and mistakes, etc., which affect the calculation of the approximate concept of temporal graph motifs. Any change in edge labels will result in the inability to obtain the temporal graph motif containing that edge.

[0014] The existing approximate concept of temporal graph motifs is affected by widespread data quality problems (taking the road traffic network as an example)

[0015] Figure 1 This is a practical example from a road network. The left figure is a road traffic network, where each edge represents a road monitored by sensors. The sensors mark the traffic conditions as "congested" or "smooth" and mark them once every minute for one day. For simplicity, only the time intervals of the "congested" road labels are shown, while ignoring the "smooth" edge labels at all other timestamps. However, the sensors on roads "BC" and "CD" (between 7:23 and 7:24) and roads "CE" and "EF" (between 7:27 and 7:28) malfunctioned, and the road labels were wrongly marked as "smooth". At this time, if calculated according to the concept proposed by the existing technology one, only two relatively distant roads "AB" and "FG" (marked by dashed circles in the right figure) can be found. In fact, these two roads are related. If data noise, that is, label errors, can be considered and all roads are combined into a traffic congestion pattern that lasts for at least 30 minutes, as shown in the overall right figure, it can better improve the practical application value of the approximate concept of temporal graph motifs. Summary of the Invention

[0016] The purpose of the embodiments of the present disclosure is to provide a calculation method based on the concept of relaxed temporal graph motifs, which solves the problems of high complexity and low efficiency of most existing temporal graph motif calculation methods, and can alleviate the problem that existing polynomial-solvable temporal graph motif calculation methods cannot handle low-quality data.

[0017] In a general aspect, a polynomial static calculation method for relaxed temporal graph motifs is provided, including:

[0018] Step 1: Read the temporal graph \(G\) representing a traffic network composed of multiple roads, the frequency threshold \(k\) representing finding traffic congestion patterns with a duration of at least \(k\) in the traffic network, the proportional relaxation constraint \(\delta\), and the constant relaxation constraint \(c\);

[0019] Step 2: Initialize the left endpoint of the currently calculated interval as m = 1, and calculate in ascending order of the left endpoint of the interval;

[0020] Step 3: Filter out the edges that cannot be used to form a relaxed temporal graph motif from the edge set E according to whether the proportional relaxation constraint δ and the constant relaxation constraint c are satisfied in the interval. Store the unfiltered edges in multiple edge sets R according to the maximum interval that can satisfy the relaxation constraint, and each edge set corresponds to an interval;

[0021] Step 4: Initialize the right endpoint of the currently calculated interval as i = T, and calculate in descending order of the right endpoint of the interval;

[0022] Step 5: For each interval, use the corresponding edge set obtained in Step 3 to form the connected components of each interval according to connectivity. Then temporarily delete the edges that do not satisfy the two relaxation constraints in the connected components, and recalculate the connected components. Each connected component corresponds to a maximum relaxed temporal graph motif, and construct a maximum relaxed temporal motif with the interval [m, i];

[0023] Step 6: Check whether each generated maximum temporal graph motif is extensible. The check range is limited by the interval corresponding to the set to which each edge belongs. Save the left non-extensible relaxed temporal motif in Step 5 to the final result TF[m, i];

[0024] Step 7: Judge whether the right endpoint i of the interval is greater than m + k - 1. If so, reduce i by 1 and go to Step 5;

[0025] Step 8: Judge whether the left endpoint m of the interval is less than T - k + 1. If so, increase m by 1 and go to Step 3 to continue; if not, output the finally satisfied traffic pattern as the result motif set TF.

[0026] The specific method for filtering out the edges that cannot be used to form a relaxed temporal graph motif from the edge set E in Step 3 is implemented based on a table structure DEL-Table of |E| × (|L| + T), which is divided into two parts. The first part records the edge label retention information of each edge e with respect to the time stamp t, and lab t represents the label of edge e at time stamp t, and dis t represents the number of snapshots in which the label of edge e in the interval [1, t] is not lab t to accelerate the calculation of the number of snapshots in which the label of edge e in the interval [m, h] is not L m (e). If L m (e) = L h (e), the number of snapshots in which the label of edge e in the interval [m, h] is not L m (e) is dis h -dis m; The second part records the last timestamp of each edge e for each label, denoted by tail lab Indicates;

[0027] The specific process is as follows:

[0028] 1) Initialize each set R[m, i] to be an empty set;

[0029] 2) Take the first edge e from the edge set E;

[0030] 3) If m = 1, calculate the R set to which the edge e belongs by calling the function scanDEL-Table to scan the DEL-Table, and simultaneously maintain the arrays maxIntv, scanT, and tabuT;

[0031] 4) If m ≠ 1 and L m (e) = L m-1 (e), only need to update the array tabuT, and determine the R set to which the edge belongs according to the arrays maxIntv and the updated tabuT;

[0032] 5) If m ≠ 1 and L m (e) ≠ L m-1 (e), the process needs to update the array tabuT and determine whether to continue scanning the DEL-Table. If so, call the function scanDELTable, start scanning the DEL-Table from the timestamp max(m, scanT[e, L m (e)]), and simultaneously maintain the arrays maxIntv, scanT, and tabuT;

[0033] 6) Take the next edge e from the edge set E, and go back to step 3) to continue; if all edges have been traversed, the process returns the R set and the updated arrays maxIntv, scanT, tabuT, and the process ends.

[0034] The specific method for each connected component in step 5 corresponding to a maximum relaxed temporal graph motif with a construction interval of [m, i] for the maximum relaxed temporal motif is as follows:

[0035] 1) Initialize the sets CC[i, T] and checkCC[i, T] to CC[i + 1, T] and checkCC[i + 1, T], and initialize the set maxCC to be empty;

[0036] 2) Take the first edge e from the set R[m, i];

[0037] 3) Determine the connectivity of the edge e with each connected component in the set CC[i, T];

[0038] 4) If edge e is not connected to any connected component, create a new connected component G s containing edge e and maintain G s .tabuTS and G s .ccScope, and add G s to CC[i,T] and checkCC[i,T];

[0039] 5) If edge e is connected to a connected component G s , add edge e to G s and update G s .tabuTS and G s .ccScope. If G s is not in the set checkCC[i,T], add G s to checkCC[i,T];

[0040] 6) If edge e is connected to two connected components G s and G s' , merge G s and G s' along with edge e into a new connected component G ss' , update and maintain G ss' .tabuTS and G ss' .ccScope, and replace G ss' and G s and G s' with G

[0041] 7) Take 1 edge e from the set R[m,i], go back to step 3) to continue; if all edges have been traversed, take the first connected component G s from the set checkCC[i,T];

[0042] 8) Update the corresponding values of each edge in G s .tabuTS, G s .ccScope and the scope array. Use G s .tabuTS to delete the edges that do not belong to the set S[m,i], that is, the edges where L s (e)≠Li(e) or do not satisfy the relaxation constraints in the interval [m,i]. If no edge is deleted, delete G m from the set checkCC[i,T] and deposit it into the set maxCC. Otherwise, recalculate the connected components and deposit the newly obtained connected components into the set maxCC; s

[0043] ​9) Remove one connected component G from the set checkCC[i, T]. s , go back to step 8) to continue; if all connected components have been traversed, the process returns the sets maxCC, CC[i, T], and checkCC[i, T] and the updated array scope, and the process ends.

[0044] The specific method for checking whether each generated maximal temporal graph motif is extensible in step 6 is as follows:

[0045] 1) Initialize the set TF[m, i] to be an empty set;

[0046] 2) Take the first connected component G from the set maxCC. s ;

[0047] 3) Denote the ccScope value [l, r] of G. If there is an edge in G in the set R[m, i] and l = m, G is non - extensible and store it in the set TF[m, i]. Otherwise, use G.ccScope to check whether G can be extended to any sub - interval in the interval [l, r], and store the non - extensible G in the set TF[m, i]; s of G s has an edge in the set R[m, i] and l = m, G s is non - extensible and store it in the set TF[m, i]. Otherwise, use G s .ccScope, check whether G s can be extended to any sub - interval in the interval [l, r], and store the non - extensible G s in the set TF[m, i];

[0048] 4) Take the next connected component G from the set maxCC. s , go back to step 3) to continue; if all connected components have been traversed, the process returns the set TF[m, i], and the process ends.

[0049] In another general aspect, a polynomial incremental calculation method for relaxed temporal graph motifs is provided, including:

[0050] Step 1, Read the updated temporal graph G[1, T + ΔT], the frequent threshold k, the proportional relaxation constraint δ, the constant relaxation constraint c, the intermediate result sets EIntR and MIntR, and the already calculated motif set TF;

[0051] Step 2, Initialize the left endpoint m = 1 of the current calculation interval;

[0052] Step 3. When the left endpoint m of the current calculation interval is not greater than T - k + 1, filter out the edges in the input set EIntR that cannot be used to form the temporal graph motifs with intervals [m, T + 1], …, [m, T + ΔT] according to whether they satisfy two relaxation constraints in the interval, and store the unfiltered edges in multiple edge sets according to the maximum interval that can satisfy the relaxation constraints, namely sets R[m, T + 1], …, R[m, T + ΔT]. Only process the edges stored in the set EIntR instead of all the edges of the temporal graph, and only consider the temporal graph motifs with intervals [m, T + 1], …, [m, T + ΔT] instead of all intervals; otherwise, adopt the process of filtering out the edges in the edge set E that cannot be used to form the relaxed temporal graph motifs.

[0053] Step 4. Initialize the right endpoint i of the current calculation interval as i = T + ΔT;

[0054] Step 5. Adopt the process of constructing the maximum relaxed temporal motif with the interval [m, i] by corresponding each connected component to a maximum relaxed temporal graph motif and the process of checking whether each generated maximum temporal graph motif is extensible, and save the maximum and non - extensible relaxed temporal motifs into the final result TF[m, i];

[0055] Step 6. Determine whether the right endpoint i of the interval is greater than T;

[0056] If so, decrease the right endpoint i by 1, and go back to Step 5 to continue;

[0057] Step 7. Check all the temporal graph motifs in the set MIntR with the left endpoint of the interval being m. If the temporal graph motif is extensible, it means that the temporal graph motif is affected after the temporal graph is updated, and this temporal graph motif needs to be deleted from the result TF. Increase the left endpoint TF of the interval by 1, and determine whether the line number m is greater than T - k + 1; if not, go back to Step 3 to continue; otherwise, output the updated final result motif set TF, and the process ends.

[0058] The technical effects to be achieved by the embodiments of the present invention are as follows:

[0059] (1) A new relaxed temporal graph motif and several of its parameters are proposed, requiring the motif to continuously appear for a sufficient long time in a network where vertices and edges remain fixed and edges change over time, and allowing changes in edge labels within a certain parameter constraint. While meeting the requirements of repeated appearance and statistical significance of the original network motif, it can tolerate a certain degree of data quality problems and has more practical value.

[0060] (2) Based on the relaxed temporal graph motif, a method for calculating the relaxed temporal network motif is proposed without restricting the structure size of the temporal graph motif. It can also be efficiently calculated in low - order polynomial time and is suitable for application in large - graph scenarios.

[0061] (3) This method for calculating the relaxed temporal graph motif also supports calculations in an incremental update environment. After the temporal graph is updated, only based on the previously calculated results, the saved intermediate results, and the graph data information within a certain range, the new calculation results can be obtained. Description of the Drawings

[0062] The above and other objects and features of the present disclosure will become clearer through the following description in conjunction with the drawings.

[0063] Figure 1 It is a schematic diagram showing a traffic road network (left figure) and a traffic congestion pattern (right figure, the traffic congestion patterns that can be found by the existing temporal graph motif are in the two red frames, and the overall right figure is the traffic congestion pattern that can be found by the relaxed temporal graph motif of the embodiment of the present disclosure);

[0064] Figure 2 It is a schematic diagram showing a temporal graph, a relaxed temporal graph motif, and their scalability and maximality according to an embodiment of the present disclosure;

[0065] Figure 3 It is a schematic diagram showing the flow of a polynomial static calculation method for a relaxed temporal graph motif according to an embodiment of the present disclosure;

[0066] Figure 4 It is a schematic diagram showing the DEL-Table data structure according to an embodiment of the present disclosure;

[0067] Figure 5 It is a schematic diagram showing the update of the temporal graph and the addition of a new relaxed temporal graph motif according to an embodiment of the present disclosure;

[0068] Figure 6 It is a schematic diagram showing the flow of a polynomial dynamic calculation method for a relaxed temporal graph motif according to an embodiment of the present disclosure. Detailed Embodiments

[0069] The following detailed embodiments are provided to help the reader obtain a comprehensive understanding of the methods, devices, and / or systems described herein. However, various changes, modifications, and equivalents of the methods, devices, and / or systems described herein will be apparent after understanding the disclosure of the present application. For example, the order of operations described herein is merely exemplary and is not limited to those set forth herein, but may be changed as will be apparent after understanding the disclosure of the present application, except for operations that must occur in a specific order. In addition, descriptions of features known in the art may be omitted for greater clarity and conciseness.

[0070] The features described herein can be implemented in various forms and should not be construed as limited to the examples described herein. Instead, the examples described herein are provided only to illustrate some of the many viable ways of implementing the methods, devices, and / or systems described herein, which will be apparent after understanding the disclosure of the present application.

[0071] As used herein, the term "and / or" includes any one of the associated listed items and any combination of any two or more of them.

[0072] Although terms such as "first", "second", and "third" may be used herein to describe various components, elements, regions, layers, or parts, these components, elements, regions, layers, or parts should not be limited by these terms. Instead, these terms are only used to distinguish one component, element, region, layer, or part from another. Thus, a first component, first element, first region, first layer, or first part referred to in the examples described herein may also be referred to as a second component, second element, second region, second layer, or second part without departing from the teachings of the examples.

[0073] In the specification, when an element (such as a layer, region, or substrate) is described as "on", "connected to", or "coupled to" another element, the element may be directly "on", directly "connected to", or "coupled to" the other element, or there may be one or more other elements in between. Conversely, when an element is described as "directly on", "directly connected to", or "directly coupled to" another element, there may be no other elements in between.

[0074] The terms used herein are only for describing various examples and are not intended to limit the disclosure. Unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. The terms "comprising", "including", and "having" specify the presence of the recited features, quantities, operations, components, elements, and / or combinations thereof, but do not preclude the presence or addition of one or more other features, quantities, operations, components, elements, and / or combinations thereof.

[0075] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs after understanding the present disclosure. Unless explicitly defined as such herein, terms (such as those defined in a general dictionary) should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and should not be interpreted in an idealized or overly formal manner.

[0076] In addition, in the description of the examples, when a detailed description of related structures or functions that are considered to be well-known would cause an ambiguous interpretation of the present disclosure, such a detailed description will be omitted.

[0077] Figure 3 It is a schematic diagram showing the architecture of a calculation method based on the concept of relaxed temporal graph motifs according to an embodiment of the present disclosure.

[0078] In order to achieve the above-mentioned invention purpose, the present invention proposes a relaxed temporal graph motif, and based on this motif, a calculation method and an optimization method for the relaxed temporal graph motif are given. Finally, an incremental calculation method corresponding to this method is given.

[0079] First, the problem definition of the relaxed temporal graph motif calculation is given:

[0080] For the relaxed temporal graph motif, it is necessary to define a temporal graph and a temporal subgraph. On this basis, a new type of temporal graph motif (relaxed temporal graph motif) is defined, and then the problem definition of the relaxed temporal graph motif calculation is given based on it.

[0081] Temporal graph and temporal subgraph:

[0082] Temporal graph: It is defined as a five-tuple G(V, E, T b , T e , L), where: (1) V is the set of vertices; (2) is the set of undirected edges; (3) T b and T e respectively represent the start time and end time of the temporal graph, and [T b , T e represents the time interval with the length of (T e - T b + 1). (4) For each time t ∈ [T b , T e (time is discrete), L t () is a labeling function that maps each edge in E and each time t to a label. For convenience, when there is no impact on understanding, G(V, E, L) or G(V, E, T b , T e ) is used to represent the temporal graph.

[0083] Temporal subgraph: It is defined as G(V s , E s , L s ) satisfying and and for e ∈ E s and there is

[0084] Relaxed Temporal Graph Motif: Based on the definitions of temporal graphs and temporal subgraphs, a concept definition of relaxed temporal graph motifs is proposed, satisfying: (1) It is a connected temporal subgraph, and (2) for e ∈ E s in the interval (integer frequent threshold), the labels satisfy and satisfy the proportional relaxation constraint and the constant relaxation constraint. The proportional relaxation constraint requires that the proportion of the total number of snapshots with the label of edge e not being in the total number of snapshots of the motif is not greater than δ (δ is a decimal), and the constant relaxation constraint requires that the number of consecutive snapshots with the label of edge e not being is not greater than c (c is an integer). This concept relaxes the strict requirement that the edge labels in the approximate concept of temporal graph motifs remain fixed for a long enough time, only requiring that the edge labels are the same at both ends of the interval of the temporal graph motif, allowing the edge labels to change within the interval under conditional restrictions, that is, allowing label noise.

[0085] Scalability of Relaxed Temporal Graph Motifs: Based on the above definition of relaxed temporal graph motifs, to reduce redundant mining results, the scalability of relaxed temporal graph motifs is further proposed, defined as: for each edge e of the relaxed temporal graph motif , if there exists an interval in which the edge labels satisfy and satisfy the proportional relaxation constraint and the constant relaxation constraint, when , the motif is left-scalable; when , the motif is right-scalable.

[0086] Maximality of Relaxed Temporal Graph Motifs: Based on the above definition of relaxed temporal graph motifs, the maximality of relaxed temporal graph motifs is also proposed, defined as: for any adjacent edge e' of the relaxed temporal graph motif , if there exists an interval in which the edge labels do not satisfy any of the relaxation constraints or the relaxed temporal graph motif is maximal, otherwise it is not maximal.

[0087] Computational Problem of Relaxed Temporal Graph Motifs: Given a temporal graph G(V, E, 1, T, L), a frequency threshold k, a proportional relaxation constraint δ, and a constant relaxation constraint c, output all maximal and non-scalable relaxed temporal graph motifs that satisfy the same labels at both ends of the interval, the proportional relaxation constraint δ, and the constant relaxation constraint c.

[0088] Example: Figure 2 is a temporal graph G with 5 vertices, 6 edges, and 10 snapshots. The B-D graph is three temporal subgraphs H 1 , H 2 , H 3, with time intervals [1,7], [3,7], and [3,9] respectively. Given a frequency threshold k = 5, a proportional relaxation constraint δ = 0.3, and a constant relaxation constraint c = 2, H 1 , δ 2 , H 3 are all relaxed temporal graph motifs because all three temporal graph motifs are connected temporal subgraphs, the time intervals are not less than the frequency threshold k, and all edges satisfy the same labels at both endpoints of the time interval, the proportional relaxation constraint δ, and the constant relaxation constraint c. Among them, H 2 (Figure C) is a left-extendable relaxed temporal graph motif because there exists an interval [1,7] such that all edges satisfy the same labels at both endpoints of the interval, the proportional relaxation constraint δ, and the constant relaxation constraint c; H 3 (Figure D) is not a maximal relaxed temporal graph motif because there exists an edge (v 1 , v 4 ) adjacent to H 3 and satisfies the same labels at both endpoints of the interval [3,9], the proportional relaxation constraint δ, and the constant relaxation constraint c; only H 1 (Figure B) is a maximal and non-extendable relaxed temporal graph motif because there does not exist a larger interval such that all edges satisfy the same labels at both endpoints of the interval, the proportional relaxation constraint δ, and the constant relaxation constraint c, and there does not exist an adjacent edge that satisfies the same labels at both endpoints of the motif's time interval, the proportional relaxation constraint v, and the constant relaxation constraint c.

[0089] Calculation method for relaxed temporal network motifs:

[0090] After giving the relevant definitions and problem definitions of relaxed temporal motifs, the present invention provides the calculation method for this temporal network motif.

[0091] First, analyze the problem raised. First, divide the original problem into 3 sub-problems: (1) How to filter the edges that satisfy the two relaxation constraints and have the same labels at both ends in each interval? (2) How to construct the maximal relaxed temporal graph motif corresponding to each interval so that all edges in the motif still satisfy the two relaxation constraints and have the same labels at both ends in the interval? (3) Judging whether an edge satisfies the two relaxation constraints and has the same labels at both ends is independent of the size of the interval of the relaxed temporal graph motif. How to judge whether a maximal relaxed temporal graph motif is non-extendable?

[0092] For the first sub-problem, first define the sets S and R. The set S[m,i] represents all edges e that satisfy the two relaxation constraints and L m (e) = L i (e) in the interval [m,i], and the set R[m,j 1 represents the set of all edges that satisfy the three conditions of the two relaxation constraints, in the interval and 2All edges e(j that violate any of the conditions among them 1 <j 2 ≤T), formalized as m + k - 1 ≤ j 1 <T; R[m, T] = S[m, T].

[0093] Proposition 7: For any k, δ, c > 0, there exists an edge e ∈ S[m, h] but (i ≤ m ≤ T - k + 1, m + k - 1 ≤ i < h ≤ T).

[0094] Proof 7: There are two cases. (1) Assume there exists an edge e such that L t (e) = L m (e), t ∈ [m, i - 1] ∪ [i + 1, h], that is, L i (e) ≠ L m (e). If δ(h - m + 1) ≥ 1, then e ∈ S[m, h] but (2) Assume there exists an edge e such that L t (e) = L m (e), t ∈ [m, i - 2] ∪ [i, g], that is, L i-1 (e) ≠ L m (e). If δ(h - m + 1) ≥ 1 > δ(i - m + 1), then e ∈ S[m, h] but Combining (1) and (2), the conclusion can be drawn.

[0095] For the convenience of using S * [m, i] to represent ∪ i≤h≤T R[m, h], the following proposition holds:

[0096] Proposition 8: Each edge e ∈ S * [m, i] satisfies the threshold c in the interval [m, i].

[0097] Proof 8: According to the definition of the R set, each edge e ∈ R[m, i] satisfies the threshold c in the interval [m, i], i ∈ [m + k - 1, T], that is, the continuous snapshots where the label of each segment of the edge e is not L m (e) do not exceed the threshold c. This also holds for each edge e ∈ S * [m, i] = ∪ i≤h≤ T R[m, h] because all intervals [m, h], i ≤ h ≤ T contain the interval [m, i], and the conclusion can be drawn.

[0098] According to two set definitions and two propositions, this sub-problem is transformed into calculating the R set, and each S set is calculated by dynamic update, avoiding constructing a maximum relaxed temporal graph motif with the same edges and saving storage space.

[0099] Proposition 9: Given the edge set S[m, i] (i ≤ m ≤ T - k + 1, m + k - 1 ≤ i < h ≤ T), each temporal subgraph G s (S[m, i])'s connected component corresponds to a maximum relaxed temporal graph motif.

[0100] Proof 9: Assume that there exists a connected component that is not the maximum relaxed temporal graph motif G s (V s , E s , m, i), that is, there exists an edge adjacent to G s and satisfying two relaxation constraints and the same end labels in the interval [m, i], which contradicts the definition of the connected component, and the conclusion can be drawn.

[0101] For the second sub-problem, based on the calculated R set, there are two schemes, from left to right (R2L) and from right to left (L2R), to calculate the maximum relaxed temporal graph motif:

[0102] The L2R scheme calculates the maximum relaxed temporal graph motif in the order of intervals [m, m + k - 1], [m, m + k], …, [m, T]. First, use the edges in ∪ m+k-1≤i≤T R[m, i], delete the edges with different end labels or violating the proportional relaxation constraint in the interval [m, m + k - 1], and then calculate the connected components. Each connected component corresponds to the maximum relaxed temporal graph motif with the interval [m, m + k - 1]; then dynamically delete the edges with different end labels or violating the proportional relaxation constraint in the interval [m, i] and the edges in R[m, i - 1] from ∪ m+k-1<i≤T R[m, i - 1], and then calculate the connected components. Each connected component corresponds to the maximum relaxed temporal graph motif with the interval [m, i].

[0103] The R2L scheme calculates the maximum relaxed temporal graph motif in the order of intervals [m, T], [m, T - 1], …, [m, m + k - 1]. First, use the edges in R[m, T] to calculate the connected components. Each connected component corresponds to the maximum relaxed temporal graph motif with the interval [m, T]; then dynamically add the edges in R[m, i] to the calculated motif, and delete the edges with different end labels or violating the proportional relaxation constraint in the interval [m, i], and then calculate the connected components. Each connected component corresponds to the maximum relaxed temporal graph motif with the interval [m, i].

[0104] It can be analyzed by deleting and adding edges. Both the R2L and L2R schemes need to add O(|∪ m+k-1≤i≤ TR[m,i]|) edges, but the R2L scheme needs to delete O(∑ m+k-1≤i<T |S * [m,i] / S[m,i]|) edges, and the L2R scheme needs to delete O(∑ m+k-1≤i<T (|S * [m,i] / S[m,i]|+|R[m,i]|)) edges. Therefore, the R2L scheme needs to delete fewer edges, and the proposed algorithm is based on the R2L scheme.

[0105] For the third sub-problem, this problem is essentially to check whether all edges of the maximum relaxed temporal graph motif with the interval [m,j 1 can satisfy two relaxation constraints with the same edge labels at both ends in the intervals [1,j 2 ,[2,j 2 ,…,[m - 1,j 2 ,j 1 <j 2 ≤T. The checking range can be reduced by the R set to which each edge belongs.

[0106] Let the edge e ∈ R[p 2 ,j 2 ,…,R[p x ,j x ,p 2 ,…,p x ≤m,j 1 ≤j 2 ,…,j x . Denote scope[e] = [min(p 2 ,…,p x ),max(j 2 ,…,j x )]. For the maximum relaxed temporal graph motif with the interval [m,j 1 , the checking range is the intersection of scope[e] corresponding to each edge e in the motif, denoted as [scopeL,scopeR].

[0107] Proposition 10: For each maximum relaxed temporal graph motif with the interval in [m,i], if it contains the edge e ∈ R[m,i], then the relaxed temporal graph motif will not expand to the interval [m,h], i + 1 ≤ h ≤ T.

[0108] Proof 10: Assume that a maximum relaxed temporal graph motif with the interval in [m,i] is generated using the set R[m,i], m + k - 1 ≤ i ≤ T. Any edge e ∈ R[m,i] satisfies That is, if there exists an edge e ∈ R[m, i] in the maximum relaxed temporal graph motif, and the edge e does not exist in any maximum relaxed temporal graph motif in the interval [m, h], a conclusion can be drawn.

[0109] Proposition 11: To identify whether a maximum relaxed temporal graph motif in the interval [m, i] is extensible, it can be checked whether it appears in the maximum relaxed temporal graph motifs in the interval [n, h] (for scopeL ≤ n ≤ m - 1, i ≤ h ≤ scopeR; for n = m, i + 1 ≤ h ≤ scopeR).

[0110] Proof 11: (1) Assume that the maximum relaxed temporal graph motif in the interval [m, i] can appear in the interval [n, h], 1 ≤ n ≤ m, scopeR + 1 ≤ h ≤ T. According to the definition of scope, it can be proved that there exists an edge e ∈ R[p 2 , j 2 , …, R[p x , j x satisfying p 1 , …, p x ∈ [1, m] and max(j 2 , …, j x ) = scopeR. According to the definition of the set R, there is Therefore, the maximum relaxed temporal graph motif containing the edge e cannot appear in the intervals [p 1 , h], …, [p x , h], or even the interval [n, h], 1 ≤ n ≤ m, which is contrary to the assumption. (2) Similarly, it can be obtained that there is no maximum relaxed temporal graph motif in the interval [m, i] that appears in the interval [n, h], 1 ≤ n ≤ l - 1, i + 1 ≤ h ≤ scopeR.

[0111] According to Proposition 10, check whether the maximum relaxed temporal graph motif can be extended to the intervals [scopeL, j 2 , [scopeL + 1, j 2 , …, [m, j 2 , j 1 ≤ j 2 ≤ scopeR. In addition, for the maximum relaxed temporal graph motif with the interval [m, j 1 constructed by the R2L scheme, from Proposition 11, it can be obtained that: if there exists an edge e ∈ R[m, j 1 , the interval of this maximum temporal graph motif cannot be extended to [m, j 2 , j 1 < j 2 ≤ T.

[0112] The polynomial static calculation method of the relaxed temporal graph motif is for the following application scenarios: Similarly, taking Figure 1For example, (1) The structure of the temporal graph represents a traffic network composed of multiple roads. The interval represents the recording time of the traffic conditions (e.g., recorded once per minute for one day), and the whole represents the traffic conditions of multiple roads in the interval (e.g., one day); (2) The frequent threshold k represents the traffic congestion pattern that needs to be found from the traffic network with a duration of at least k. For example, k = 30 means that a traffic congestion pattern with a duration of at least 30 minutes needs to be found from the traffic network; (3) The proportional relaxation constraint δ of the relaxed temporal graph motif ensures that the road condition label mismatch of each edge (road) in the traffic congestion pattern occurs only within a limited time. When the proportional relaxation constraint δ = 5%, a complete traffic congestion pattern with a time interval of [7:10, 7:50] as shown in the right figure can be identified because it meets the condition of lasting at least 30 minutes. Through the proportional relaxation constraint, the mislabeled roads 'BC', 'CD', 'CE', and 'EF' are handled. (4) The constant relaxation constraint c ensures that the occurrence time of the road condition label mismatch of each edge in the traffic congestion pattern lasts only within a limited time. When the proportional relaxation constraint δ = 5%, a traffic pattern exactly the same as that in the right figure can also be identified, but the label of each edge is marked as 'fast' within the interval [0:00, 23:59]. However, this pattern essentially regards all edge labels within [0:00, 23:59] as 'fast', which is contradictory to the edges marked as 'congested' within [7:10, 7:50]. Therefore, the constant relaxation constraint c avoids this situation; (5) The output result motif set TF represents all traffic patterns found from the traffic network that meet the parameter settings of k, δ, and c, such as the area and congestion time composed of multiple roads with a continuous congestion time reaching k minutes, and allows the traffic condition of some of these roads to be unobstructed for no more than c each time, and the total unobstructed time accounts for no more than δ. Generally speaking, compared with the existing methods, the polynomial static calculation method of the relaxed temporal graph motif newly added proportional relaxation constraint δ and constant relaxation constraint c are both designed for the widespread data quality problems, such as the sudden change of road conditions in the traffic network or data noise caused by sensor failures, which has practical significance. Figure 1 The complete traffic congestion pattern with a time interval of [7:10, 7:50] shown in the right figure can be identified because it meets the condition of lasting at least 30 minutes. Through the proportional relaxation constraint, the mislabeled roads 'BC', 'CD', 'CE', and 'EF' are handled. (4) The constant relaxation constraint c ensures that the occurrence time of the road condition label mismatch of each edge in the traffic congestion pattern lasts only within a limited time. When the proportional relaxation constraint δ = 5%, a traffic pattern exactly the same as that in the right figure can also be identified, but the label of each edge is marked as 'fast' within the interval [0:00, 23:59]. However, this pattern essentially regards all edge labels within [0:00, 23:59] as 'fast', which is contradictory to the edges marked as 'congested' within [7:10, 7:50]. Therefore, the constant relaxation constraint c avoids this situation; (5) The output result motif set TF represents all traffic patterns found from the traffic network that meet the parameter settings of k, δ, and c, such as the area and congestion time composed of multiple roads with a continuous congestion time reaching k minutes, and allows the traffic condition of some of these roads to be unobstructed for no more than c each time, and the total unobstructed time accounts for no more than δ. Generally speaking, compared with the existing methods, the polynomial static calculation method of the relaxed temporal graph motif newly added proportional relaxation constraint δ and constant relaxation constraint c are both designed for the widespread data quality problems, such as the sudden change of road conditions in the traffic network or data noise caused by sensor failures, which has practical significance. Figure 1 The same traffic pattern as that in the right figure can be identified, but the label of each edge is marked as 'fast' within the interval [0:00, 23:59]. However, this pattern essentially regards all edge labels within [0:00, 23:59] as 'fast', which is contradictory to the edges marked as 'congested' within [7:10, 7:50]. Therefore, the constant relaxation constraint c avoids this situation; (5) The output result motif set TF represents all traffic patterns found from the traffic network that meet the parameter settings of k, δ, and c, such as the area and congestion time composed of multiple roads with a continuous congestion time reaching k minutes, and allows the traffic condition of some of these roads to be unobstructed for no more than c each time, and the total unobstructed time accounts for no more than δ. Generally speaking, compared with the existing methods, the polynomial static calculation method of the relaxed temporal graph motif newly added proportional relaxation constraint δ and constant relaxation constraint c are both designed for the widespread data quality problems, such as the sudden change of road conditions in the traffic network or data noise caused by sensor failures, which has practical significance.

[0113] Static algorithm FRTM: Through the analysis of three sub - problems, the present invention proposes a polynomial static calculation method for relaxed temporal graph motifs. Specifically, the calculation process is divided into the following steps:

[0114] (1) Read the temporal graph G, frequent threshold k, proportional relaxation constraint δ, and constant relaxation constraint c.

[0115] (2) Initialize the left endpoint m of the currently calculated interval to 1, and calculate in ascending order of the left endpoint of the interval (T2B scheme).

[0116] (3) Filter out the edges that cannot be used to form a relaxed temporal graph motif from the edge set E according to whether two relaxation constraints are satisfied in the interval, and store the unfiltered edges in multiple edge sets (i.e., R sets) according to the maximum interval that can satisfy the relaxation constraints. Each edge set corresponds to an interval (procedure compRES).

[0117] (4) Initialize the right endpoint of the currently calculated interval as i = T, and calculate in the order of decreasing right endpoint of the interval (R2L scheme).

[0118] (5) For each interval, use the corresponding edge set obtained in step (3), form the connected components of each interval according to connectivity, then temporarily delete the edges that do not satisfy the two relaxation constraints in the connected components, and recalculate the connected components. Each connected component corresponds to a maximum relaxed temporal graph motif with the construction interval [m, i] as the maximum relaxed temporal motif (genMaxRTM).

[0119] (6) Check whether each generated maximum temporal graph motif is extensible. The check range is limited by the interval corresponding to the set to which each edge belongs, and save the left non-extensible relaxed temporal motif in step (5) to the final result TF[m, i] (procedure genNExpRTM).

[0120] (7) Judge whether the right endpoint i of the interval is greater than m + k - 1. If so, decrease i by 1 and go to step (5) to continue.

[0121] (8) Judge whether the left endpoint m of the interval is less than T - k + 1. If so, increase m by 1 and go to step (3) to continue; if not, output the final result motif set TF.

[0122] Step (3): Filter out the edges that cannot be used to form a relaxed temporal graph motif from the edge set E (compRES)

[0123] Procedure compRES: mainly used to calculate the R set to which each edge belongs. This procedure is based on a table structure DEL-Table of |E| × (|L| + T), as Figure 4 shown. It is divided into two parts. The first part records the edge label retention information of each edge e with respect to the time stamp t. lab t represents the label of edge e at time stamp t. dis t represents the number of snapshots in which the label of edge e in the interval [1, t] is not lab t and is used to accelerate the calculation of the number of snapshots in which the label of edge e in the interval [m, h] is not L m (e). If L m (e) = L h (e), the number of snapshots in which the label of edge e in the interval [m, h] is not L m (e) is dish -dis m . It should be noted that if L m (e) ≠ L h (e), the interval [m, h] will not be the interval of any relaxed temporal graph motif containing edge e, so this case does not need to be considered. bef t and aft t have two semantic definitions respectively, which are distinguished by positive and negative signs. bef t (or aft t ) taking a positive value means the number of snapshots in which edge e maintains the label lab t unchanged until timestamp t (or the maximum number of snapshots in which edge e can maintain the label lab t unchanged starting from timestamp t); bef t (or aft t ) taking a negative value means the number of snapshots from the current timestamp t to the previous (or next) timestamp when the label of edge e is lab t . In addition, when bef t (or aft t ) takes a negative value, the timestamps are all the starting (or last) timestamps when edge e has the label lab t , that is, Lt -1 (e) ≠ L t (e) (or Lt(e) ≠ L t+1 (e)). The second part records the last timestamp of each edge e for each label, which is represented by tail lab .

[0124] Example: For edge (v 3 , v 5 ) and timestamp t = 5, from the above figure, it can be seen that edge (v 3 , v 5 ) maintains the label lab 5 = 1 unchanged in the interval [5 - max(bef 5 , 1) + 1, 5 + max(aft 5 , 1) - 1] = [4, 7]. The previous (or next) timestamp with the same label 1 in the interval [4, 7] is 4 + bef 4 = 2 (or 7 - aft 7 = 9); in addition, for the interval [1, 9], it can be seen that the number of snapshots in which the label of edge (v 3 , v 5 ) is not 1 is dis 9 - dis 1 = 2.

[0125] By scanning the DEL-Table, the R set to which each edge belongs can be obtained: Start scanning from the starting timestamp t = m, and at the same time maintain up to t + max(aft t , 1) - 1, where the edge label is not L m (e) for all snapshot counts allN, the continuous snapshot count contN of the edge label not being L m (e), and the last timestamp t (denoted as lastT) of the edge label being L m (e) and satisfying two relaxation constraints in the interval [m, t]. The scanning stop condition is allN > (T - m + 1) × δ or contN > l or all timestamps are scanned. If lastT e ≥ m + k - 1, then the edge e ∈ R[m, lastT]; otherwise h ∈ [m + k - 1, T].

[0126] Based on the DEL-Table, the process compRES can calculate the R set to which each edge belongs more quickly. Among them, the arrays maxIntv, scanT, and tabuT are maintained for each edge e and each label, used to accelerate the calculation of the process compRES and avoid repeated scanning of the DEL-Table. maxIntv[e, L m (e)] is used to maintain all intervals [n, h], n ≤ m including the interval [m, m + k - 1], satisfying two relaxation constraints and L n (e) = L h (e); scanT[e, L m (e)] is used to maintain the stop timestamp t after scanning the DEL-Table; tabuT[e, L m (e)] is used to maintain the multiple intervals (consecutive timestamps are merged into one interval) formed by all timestamps t in the interval [m + k - 1, scanT[e, L m (e)]] where Lt(e) ≠ L m (e) or the interval [m, t] does not satisfy two relaxation constraints. The intervals are sorted in ascending order of timestamps. The specific process of step (3) is given below:

[0127] 1) Initialize each set R[m, i] as an empty set.

[0128] 2) Take the first edge e from the edge set E.

[0129] 3) If m = 1, calculate the R set to which the edge e belongs by scanning the DEL-Table (represented by the function scanDEL-Table), and at the same time maintain the arrays maxIntv, scanT, and tabuT.

[0130] 4) If m ≠ 1 and L m (e) = Lm-1 (e), it is only necessary to update the array tabuT, and determine the R set to which the edge belongs according to the arrays maxIntv and the updated tabuT.

[0131] 5) If m ≠ 1 and L m (e) ≠ L m-1 (e), the process needs to update the array tabuT and determine whether to continue scanning the DEL-Table. If so, call the function scanDELTable to start scanning the DEL-Table from the timestamp max(m, scanT[e, L m (e)]), while maintaining the arrays maxIntv, scanT, and tabuT.

[0132] 6) Take 1 edge e from the edge set E, go to step 3) to continue; if all edges have been traversed, the process returns the R set and the updated arrays maxIntv, scanT, tabuT, and the process ends.

[0133] Step (5): Construct the maximum relaxed temporal motif (genMaxRTM) with the interval [m, i]

[0134] Process genMaxRTM: It is mainly used to calculate the connected components according to the R set calculated by the process compRES. Each connected component corresponds to a maximum relaxed temporal graph motif. The process inputs the R set, the arrays maxIntv, tabuT and scope, the current calculation interval [m, i], and two connected component sets CC[i + 1, T] and checkCC[i + 1, T], and outputs the connected component set maxCC (for subsequent scalability checking), CC[i, T] and checkCC[i, T], and the updated array scope. Among them, the array scope is the scope defined in the third sub-problem above (which needs to be calculated and maintained in this process). The connected component set CC[i, T] represents the connected components formed by the edges in ∪ i≤T The edges in R[m, i] (for convenience, CC[T + 1, T] is used to represent the empty set). checkCC[i + 1, T] is used to maintain the connected component cc in CC[i, T] that needs to check whether the component edge e satisfies the relaxation constraint or L m (e) ≠ L i (e).

[0135] In addition, this process additionally maintains 1 set tabuTS and 1 interval ccScope for each connected component cc, denoted as cc.tabuTS and cc.ccScope respectively. The set tabuTS is used to judge whether the edges in the connected component cc belong to the set S[m, i] for all edges e in cc, and it maintains the set tabuT[e, L m(e), each interval nIntv formed by the timestamps within the interval [m + k - 1, i], and each element in the set is denoted as the binary tuple <nIntv, e>; implemented through a max heap, with the right endpoint of nIntv as the key. The interval ccScope is used to update all edges e in cc when scope[e] changes. Its left endpoint is implemented through a max heap, and its right endpoint only needs to maintain a maxIntvl[e, L m (e), the minimum value where the right endpoint of each interval ≥ i. The following gives the specific process of step (5):

[0136] 1) Initialize the sets CC[i, T] and checkCC[i, T] as CC[i + 1, T] and checkCC[i + 1, T], and initialize the set maxCC to be empty.

[0137] 2) Take the first edge e from the set R[m, i].[[]]

[0138] 3) Judge the connectivity of the edge e with each connected component in the set CC[i, T].[[]]

[0139] 4) If the edge e is not connected to any connected component, create a new connected component G s containing the edge e, maintain G s .tabuTS and G s .ccScope, and add G s to CC[i, T] and checkCC[i, T].[[]]

[0140] 5) If the edge e is connected to a connected component G s connected, then add the edge e to G s inside, update G s .tabuTS and G s .ccScope, if G s is not in the set checkCC[i, T], it is necessary to add G s to checkCC[i, T].[[]]

[0141] 6) If the edge e is connected to two connected components G s and G s' connected, merge G s and G s' along with the edge e into a new connected component G ss' , update and maintain G ss' .tabuTS and G ss' .ccScope, and in CC[i, T] and checkCC[i, T], replace G ss' with G s and G s' .

[0142] 7) Take one edge e from the set R[m, i], and go to step 3) to continue; if all edges have been traversed, take the first connected component G from the set checkCC[i, T] s .

[0143] 8) Update G s .tabuTS, G s .ccScope and the corresponding values of each edge in the scope array of G s Among them, use G s .tabuTS to delete the edges that do not belong to the set S[m, i] (that is, L m (e) ≠ L i (e) or the edges that do not satisfy the relaxation constraint in the interval [m, i]). If no edge is deleted, then delete G from the set checkCC[i, T] s And store it in the set maxCC. Otherwise, it is necessary to recalculate the connected components and store the newly obtained connected components in the set maxCC.

[0144] 9) Take the next connected component G from the set checkCC[i, T] s , and go to step 8) to continue; if all connected components have been traversed, the process returns the sets maxCC, CC[i, T] and checkCC[i, T] and the updated array scope, and the process ends.

[0145] Step (6): Check whether each generated maximal relaxed temporal graph motif is extensible (genNExpRTM)

[0146] Procedure genNExpRTM: Mainly used to check whether each generated maximal relaxed temporal graph motif is extensible. The input of the procedure is the set of connected components maxCC and CC[i, T], the array scope and the current calculation interval [m, i], and the output is the set TF[m, i] of all maximal and non-extensible relaxed temporal graph motifs. The following gives the specific process of step (6):

[0147] 1) Initialize the set TF[m, i] to be an empty set.

[0148] 2) Take the first connected component G from the set maxCC s .

[0149] 3) Denote the ccScope value [l, r] of G s . If there is an edge in G s in the set R[m, i] and l = m, G s is non-extensible. And store it in the set TF[m, i], otherwise use G s.ccScope, check G s whether it can be extended to any sub - interval within the interval [l, r], and store the non - extensible G s in the set TF[m, i].

[0150] 4) Take the next connected component G from the set maxCC s , and go back to step 3) to continue; if all connected components have been traversed, the process returns the set TF[m, i] and the process ends.

[0151] Algorithm complexity analysis: For each interval left - endpoint m, the total time complexity of executing the process compRES is O(T|E|), the total time complexity of executing the process genMaxRTM is O(T|E m,T |)(|E m,T | is the number of edges of G s (∪ m+k-1≤i≤T R[m, i])), and the total time complexity of executing the process genNExpRTM is O(maxI motif T|E m,T |)(maxI motif is the maximum number of intervals that need to be checked for extensibility for each temporal graph motif). Therefore, the overall time complexity of the algorithm FRTM is O(T 2 (|E| + maxI motif ·maxE m,T )) = O(maxI motif ·T 2 |E|)(maxE m,T is the maximum value of |E m,T |).

[0152] In terms of space complexity, the algorithm FRTM requires O(T|E|+T 2 ·maxE m,T ) space, which is mainly occupied by the data structure DEL - Table and the result set TF.

[0153] Algorithm optimization: Considering that there are many common edges among the S sets used in the process genMaxRTM of constructing the maximum relaxed temporal graph motif in the algorithm FRTM, such as the sets S[m, i] and S[m - 1, i], it indicates that if all the edges of a maximum relaxed temporal graph motif are in the sets S[m, i] and S[m - 1, i], the algorithm FRTM generates an extensible maximum relaxed temporal graph motif. In addition, for short - length intervals, the edge labels of the relaxed temporal graph motif will not contain perturbations, and it is not necessary for the algorithm FRTM to check the edges that do not belong to the set S[m, i] and recalculate the connected components in the process genMaxRTM. Therefore, two optimization strategies are proposed.

[0154] Strategy 1: Common edge recognition. For m ∈ [2, T - k + 1], let the set R + [m] contain all edges e ∈ R[m, i] (i ∈ [m - k + 1, T]) and L m-1 (e) = L m (e). This strategy only needs to make the following modifications to the algorithm FRTM: (1) Procedure compRES: Only when L m (e) ≠ L m-1 (e), if e ∈ R[m, i], add the edge e to the set R + [m]. (2) Procedure genMaxRTM: Add a marker mark (initialized to True) to each connected component. If the added edge e ∈ R + [m], then change the mark to False. If all edges of the connected component Then any component edge of this connected component cannot correspond to an inextensible connected component. Therefore, for the connected components marked as False, they are no longer added to the set checkCC. After reconstructing the connected components, it is not necessary to add all edges of the connected components to the set maxCC. Strategy 1 does not change the time complexity of the algorithm FRTM, but requires O(maxE m,T ) additional space to store the set R + and the mark.

[0155] Strategy 2: Short interval processing. Let maxI be the largest integer such that k ≤ maxI < 1 / δ. This strategy only needs to make the following modifications to the algorithm FRTM: (1) For intervals with large lengths, i.e., [m, i] (m + maxI ≤ i ≤ T), it is equivalent to executing the algorithm FRTM with k as maxI + 1. (2) For intervals with small lengths, maintain the set of connected components instead of the set CC. For each connected component in the set , only maintain ccScope, and each generated connected component is directly stored in the set maxCC (no need for the set checkCC). Strategy 2 does not change the time complexity of the algorithm FRTM, but processing short intervals only takes a shorter time, and the set requires less space than the set CC.

[0156] 3.2.3 Incremental calculation method for relaxed temporal network motifs

[0157] Computational Problem Definition in Dynamic Scenarios: Based on the proposed concept of approximate relaxed temporal graph motifs, this invention presents the problem definition of temporal graph motif mining: Given a temporal graph G'(V, E, 1, T+ΔT, L), a frequency threshold k, a proportional relaxation constraint δ, and a constant relaxation constraint c, for the temporal graph G(V, E, 1, T, L), the same frequency threshold k, the same proportional relaxation constraint δ, and the same constant relaxation constraint c, output the set TF of all maximal and non-extendable relaxed temporal graph motifs after the update of the temporal graph. + The update of the temporal graph is reflected in the increase of the number of snapshots from T to T+ΔT.

[0158] Example: As shown in the following figure, the number of snapshots of the temporal graph in the left figure increases by 2, and its interval becomes [1, 12]. The right figure shows the newly added relaxed temporal graph motifs after the update of the temporal graph.

[0159] The following presents an incremental calculation method for relaxed temporal network motifs. Due to the support for dynamics, the incremental calculation method is more efficient than directly using the method in 3.2.2. First, analyze the two problems brought about by the update of the temporal graph. One is to analyze which edges belong to the unaffected and affected R sets, that is, the edges belong to the sets R[m, T+1], …, R[m, T+ΔT] after the update of the temporal graph. The other is to analyze which of the already calculated temporal graph motifs are unaffected by the update and may be affected by the update, that is, the edges of the already calculated maximal and non-extendable temporal graph motifs become extendable after the update of the temporal graph.

[0160] Proposition 12: Unaffected Edges: For each edge, as long as it does not satisfy the threshold c in the interval [m, T], it cannot belong to the set R[m, i], where m ∈ [1, T-k+1] and i ∈ [T+1, T+ΔT].

[0161] Proof 12: Assume that an edge e does not satisfy the threshold c in the interval [m, T]. Let N be the number of snapshots in the interval [m, T] where the label of edge e is different from L m (e). Regardless of the value of ΔT, for any timestamp t ∈ [T+1, T+ΔT], edge e does not satisfy the threshold c in the interval [m, t].

[0162] From Proposition 12, it is also easy to infer that if each edge satisfies the threshold c in the interval [m, T], as long as ΔT is large enough, for any timestamp t ∈ [T+1, T+ΔT], there may exist an interval [m, t] such that edge e satisfies the two relaxation constraints and has the same label at both ends of the interval.

[0163] Proposition 13: Unaffected Temporal Graph Motifs: For the relaxed temporal graph motifs in the set TF, if any edge is not an affected edge, then the relaxed temporal graph motif is unaffected.

[0164] Proof 13: Assume that an edge e is not an affected edge, that is, edge e does not satisfy the threshold c in the interval [m, T]. Obviously, edge e does not satisfy the threshold c in any interval [n, h], where n < m and h ∈ [T + 1, T + ΔT]. Therefore, any relaxed temporal graph motif in the set TF that contains edge e cannot be extended to the interval [n, j], that is, it is not extensible.

[0165] It can also be easily deduced from Proposition 13 that all edges are affected edges and the relaxed temporal graph motif is affected.

[0166] Through the proof, the ranges of affected edges and affected temporal graph motifs can be obtained:

[0167] · Affected edges are defined as all edges in the set R whose continuous moments with label not L in the interval [m, T], where m ∈ [1, T - k + 1] ≤ c (satisfying the constant relaxation constraint) may be affected by the temporal graph update. m (e)

[0168] · Affected temporal graph motifs are defined as all edges in the calculated temporal graph motifs whose sets R are all affected by the update, and the temporal graph motifs will be affected by the temporal graph update.

[0169] To use affected edges and affected temporal graph motifs, the static algorithm needs to be simply modified to store some intermediate results, including: the set EIntR is used to store the affected edges that may be affected by the update and auxiliary information maxIntv[e, L m (e), scanT[e, L m (e)], and tabuT[e, L m (e)], and the set MIntR is used to store the affected temporal graph motifs that may be affected by the update. Since the information that needs to be saved in the sets EIntR and MIntR is calculated in the original static algorithm, the modification does not change the time complexity of the original static algorithm.

[0170] Through the analysis of the affected edges and affected temporal graph motifs that may be affected by the update, the present invention proposes a polynomial dynamic algorithm DFRTM for relaxed temporal graph motifs. The overall algorithm is based on the modified static algorithm, and the process is shown in the following figure.

[0171] The polynomial incremental calculation method for relaxed temporal graph motifs is for the following application scenarios: Similarly, taking Figure 1 as an example, for Figure 1For the roads in the left figure, all traffic congestion patterns during this day were calculated using the polynomial static calculation method of the described relaxed temporal graph motif. After that, as the second day passed, the traffic network updated the road condition data from 0:00 to 23:59 on the second day. At this time, all traffic congestion patterns in the previous two days needed to be calculated, and the frequency threshold k, the proportional relaxation constraint δ, and the constant relaxation constraint c were set unchanged. This required incrementally calculating the traffic congestion patterns spanning two days based on the calculation results of the first day, which was more efficient than calculating from scratch. At this time, (1) the structure of the temporal graph still represents the traffic network composed of multiple roads, but the interval represents the traffic conditions of two days (i.e., recorded once per minute for two days), and the whole represents the traffic conditions of multiple roads in two days; (2) the meanings of the frequency threshold k, the proportional relaxation constraint δ, and the constant relaxation constraint c are the same as those in the static calculation method; (3) the output result motif set TF represents all traffic patterns that meet the parameter settings of k, δ, and c found from the traffic network of two days. Generally speaking, the polynomial incremental calculation method of the relaxed temporal graph motif is applied to data dynamic update scenarios, such as the collection and update of road conditions in the traffic network over time, which has practical significance. This method also requires inputting the proportional relaxation constraint δ and the constant relaxation constraint c, and the application scenario is the same as that of the polynomial static calculation method of the relaxed temporal graph motif.

[0172] Specifically, the calculation process is divided into the following steps:

[0173] (1) Read the updated temporal graph G[1,T+ΔT], the frequent threshold k, the proportional relaxation constraint δ, the constant relaxation constraint c, the intermediate result sets EIntR and MIntR, and the already calculated motif set TF.

[0174] (2) Initialize the left endpoint m = 1 of the current calculation interval.

[0175] (3) When the left endpoint m of the current calculation interval is not greater than T - k + 1, the algorithm filters out the edges that cannot be used to form the temporal graph motifs in the intervals [m,T+1],…,[m,T+ΔT] from the input set EIntR according to whether they meet the two relaxation constraints in the interval (process compRES), and stores the unfiltered edges in multiple edge sets according to the maximum interval that can meet the relaxation constraints (i.e., sets R[m,T+1],…,R[m,T+ΔT]). Since only the edges stored in the set EIntR are processed instead of all the edges of the temporal graph, and only the temporal graph motifs in the intervals [m,T+1],…,[m,T+ΔT] are considered instead of all intervals, redundant calculations are reduced; otherwise, call the process compRES in the static algorithm FRTM.

[0176] (4) Initialize the right endpoint i = T+ΔT of the current calculation interval.

[0177] (5) Call the procedures genMaxRTM and genNExpRTM in the static algorithm FRTM, and save the maximal and non-extendable relaxed temporal motifs into the final result TF[m, i].

[0178] (6) Determine whether the right endpoint i of the interval is greater than T. If so, decrease the right endpoint i of the interval by 1, and go back to step (5) to continue.

[0179] (7) Check all the temporal graph motifs in the set MIntR whose left endpoint of the interval is m. If the temporal graph motif is extendable, it means that the temporal graph motif is affected after the temporal graph is updated, and this temporal graph motif needs to be deleted from the result TF. Increase the left endpoint m of the interval by 1, and determine whether the line number m is greater than T - k + 1. If not, go back to step (3) to continue; otherwise, output the updated final result motif set TF, and the process ends.

[0180] Compared with the static method, the incremental calculation method of the present invention has the following characteristics: 1) In step (3), selecting edges from the edge set E is changed to selecting edges from the edge set EIntR, which minimizes the calculation range and avoids redundant calculations; 2) When the left endpoint m of the interval is not greater than T - k + 1, only the relaxed temporal motifs of the interval [m, j] (T ≤ j ≤ T + ΔT) are calculated, and the relaxed temporal motifs of other intervals have been calculated and do not need to be recalculated; 3) Only when the left endpoint m of the interval is greater than T - k + 1, the steps of the incremental calculation method are the same as those of the static method. In summary, the incremental calculation method has an advantage in terms of efficiency.

[0181] Although some embodiments of the present disclosure have been shown and described, those skilled in the art should understand that these embodiments can be modified without departing from the principles and spirit of the present disclosure defined by the claims and their equivalents.

Claims

1. A polynomial static calculation method for a relaxed temporal graph motif, characterized in that: include: Step 1, a temporal graph G representing a traffic network composed of multiple roads, a frequent threshold k representing finding a traffic congestion pattern with a duration of at least k from the traffic network, a proportional relaxation constraint δ and a constant relaxation constraint c; Step 2: Initialize the left endpoint of the interval currently being calculated to m=1, and calculate in order from the left endpoint of the interval from small to large; Step 3: According to whether the proportional relaxation constraint δ and the constant relaxation constraint c are satisfied in the interval, the edges that cannot be used to form the relaxed temporal graph motif are filtered out from the edge set E, and the unfiltered edges are stored in multiple edge sets R according to the maximum interval that can satisfy the relaxation constraint, and each edge set corresponds to an interval; Step 4: Initialize the right endpoint of the interval currently being calculated to i=T, and calculate in descending order according to the right endpoints of the interval; Step 5: For each interval, use the corresponding edge set obtained in step 3 to construct the connected components of each interval according to the connectivity, and then temporarily delete the edges that do not satisfy the two relaxation constraints in the connected components, recalculate the connected components, and each connected component corresponds to a maximum relaxation temporal graph motif to construct a maximum relaxation temporal motif with an interval of [m, i]; Step 6: Check whether each generated maximal temporal graph motif is extensible. The checking range is limited by the corresponding interval of the set to which each edge belongs. Save the left non-expandable relaxed temporal motif in step 5 to the final result TF[m,i]; Step 7: Determine whether the right endpoint i of the interval is greater than m+k-1. If so, reduce i by 1 and go to step 5. Step 8: Determine whether the left endpoint m of the interval is less than T-k+1. If so, increase m by 1 and go to step 3; if not, output the traffic mode that finally meets the requirements as the result motif set TF.

2. A polynomial static calculation method for a relaxed temporal graph motif as claimed in claim 1, characterized in that: The specific method of filtering out the edges that cannot be used to form the relaxed temporal graph motif from the edge set E in step 3 is: based on a table structure DEL-Table of |E|×(|L|+T), it is divided into two parts. The first part records the edge label information of each edge e about the timestamp t, and the lab t represents the label of edge e at timestamp t, dis t Indicates that the label of edge e in the interval [1,t] is not lab t The number of snapshots is used to speed up the calculation of the edge e label not being L in the interval [m,h] m (e) The number of snapshots, if L m (e) = L h (e) The label of edge e in interval [m,h] is not L m The number of snapshots of (e) is dis h -dis m ; The second part records each edge e as the last timestamp of each label, using tail lab express; The specific process is: 1) Initialize each set R[m,i] to an empty set; 2) Take the first edge e from the edge set E; 3) If m=1, scan the DEL-Table by calling the function scanDEL-Table to calculate the R set to which the edge e belongs, and maintain the arrays maxIntv, scanT and tabuT; 4) If m≠1 and L m (e) = L m-1 (e) It is only necessary to update the array tabuT and determine the R set to which the edge belongs based on the array maxIntv and the updated tabuT; 5) If m≠1 and L m (e)≠L m-1 (e) The process needs to update the array tabuT and determine whether it is necessary to continue scanning the DEL-Table. If necessary, the function scanDELTable is called to start from the timestamp max(m,scanT[e,L m (e)]) Start scanning the DEL-Table and maintain the arrays maxIntv, scanT and tabuT; 6) Remove one edge e from the edge set E and go to step 3) to continue; if all edges have been traversed, the process returns the R set and the updated arrays maxIntv, scanT, tabuT, and the process ends.

3. A polynomial static calculation method for a relaxed temporal graph motif as claimed in claim 2, characterized in that: Each connected component in step 5 corresponds to a maximum relaxed temporal graph motif. The specific method for constructing a maximum relaxed temporal motif with an interval of [m, i] is: 1) Initialize the sets CC[i,T] and checkCC[i,T] to CC[i+1,T] and checkCC[i+1,T], and initialize the set maxCC to be empty; 2) Take the first edge e from the set R[m,i]; 3) Determine the connectivity between edge e and each connected component in the set CC[i,T]; 4) If edge e is not connected to any connected component, create a new connected component G s Include edge e, maintain G s .tabuTS and G s .ccScope, add G s to CC[i,T] and checkCC[i,T]; 5) If edge e is connected to a component G s Connected, then add edge e to G s In, update G s .tabuTS and G s .ccScope, if G s Not in the set checkCC[i,T], need to add G s to checkCC[i,T]; 6) If edge e is connected to two components G s and G s' Connect G s and G s' and edge e are merged into a new connected component G ss' , Update and maintain G ss' .tabuTS and G ss' .ccScope, and use G in CC[i,T] and checkCC[i,T] ss' Replace G s and G s' ; 7) Take an edge e from the set R[m,i] and go to step 3) to continue; if all edges have been traversed, take the first connected component G from the set checkCC[i,T] s ; 8) Update G s .tabuTS,G s G of .ccScope and scope array s The corresponding value of each edge in G s .tabuTS deletes the edges that do not belong to the set S[m,i], that is, L m (e)≠L i (e) Or the edge in the interval [m,i] that does not satisfy the relaxed constraint, if no edge is deleted, then delete G from the set checkCC[i,T] s And store it in the set maxCC, otherwise it is necessary to recalculate the connected components and store the newly obtained connected components in the set maxCC; 9) Take a connected component G from the set checkCC[i,T] s , go to step 8) and continue; if all connected components have been traversed, the process returns the sets maxCC, CC[i,T] and checkCC[i,T] and the updated array scope, and the process ends.

4. A polynomial static calculation method for a relaxed temporal graph motif as claimed in claim 3, characterized in that: The specific method of the process of checking whether each generated maximal temporal graph motif is scalable in step 6 is: 1) Initialize the set TF[m,i] to an empty set; 2) Take the first connected component G from the set maxCC s ; 3) Remember G s The ccScope value [l,r], if G s There is an edge in the set R[m,i] and l = m, G s is not extensible and is stored in the set TF[m,i]. Otherwise, G s .ccScope, check G s Can it be extended to any subinterval in the interval [l,r]? s Store into the set TF[m,i]; 4) Take one connected component G from the set maxCC s , go to step 3) and continue; if all connected components have been traversed, the process returns the set TF[m,i] and the process ends.

5. A polynomial increment calculation method for a relaxed temporal graph motif, characterized in that: include: Step 1, read the updated temporal graph G[1,T+ΔT] representing the traffic network composed of multiple roads, the frequent threshold k representing the search for traffic congestion patterns with a duration of at least k from the traffic network, the proportional relaxation constraint δ, the constant relaxation constraint c, the intermediate result sets EIntR and MIntR, and the traffic mode motif set TF that has been calculated to meet the requirements; Step 2: Initialize the left endpoint of the current calculation interval m=1; Step 3. When the left endpoint m of the current calculation interval is not greater than T-k+1, filter out the edges that cannot be used to form a temporal graph motif with an interval of [m, T+1],…,[m, T+ΔT] from the input set EIntR according to whether the two relaxation constraints are satisfied in the interval, and store the unfiltered edges in multiple edge sets according to the maximum interval that can satisfy the relaxation constraints, namely, the sets R[m, T+1],…,R[m, T+ΔT]. Only the edges stored in the set EIntR are processed instead of all the edges of the temporal graph, and only the temporal graph motif with an interval of [m, T+1],…,[m, T+ΔT] is considered instead of all intervals; otherwise, the process of filtering out edges that cannot be used to form a relaxed temporal graph motif from the edge set E is adopted. Step 4, initialize the right endpoint of the current calculation interval i=T+ΔT; Step 5: construct a maximum relaxed temporal motif with an interval of [m, i] using a maximum relaxed temporal graph motif corresponding to each connected component and check whether each generated maximum relaxed temporal graph motif is extensible, and save the maximum and non-extensible relaxed temporal motif to the final result TF[m, i]; Step 6, determine whether the right endpoint i of the interval is greater than T; If yes, reduce the right endpoint i of the interval by 1 and go to step 5; Step 7: Check all temporal graph motifs whose left endpoint of the interval is m in the set MIntR. If the temporal graph motif is extensible, it means that the temporal graph motif is affected after the temporal graph is updated, and the temporal graph motif needs to be deleted from the result TF. Increase the left endpoint m of the interval by 1, and determine whether the row number m is greater than T-k+1; If no, go to step 3; Otherwise, the updated traffic mode result motif set TF that finally meets the requirements is output, and the process ends.

Citation Information

Patent Citations

  • Method and device for detecting temporal constraint conflict

    CN101877014A

  • Temporal network motif calculation method and system supporting incremental updating

    CN113849947A

  • Recursive timing knowledge graph completion method and apparatus

    WO2022052374A1

  • Short-time community search method based on time span optimization

    WO2022236760A1