Method and device for constructing and maintaining parallel triangle connected k-trus community index
By constructing and maintaining a parallel triangular connected k-truss community index, and by using the truss decomposition algorithm and graph edge tensor optimization for index construction and maintenance, the inefficiency problem in existing technologies is solved, and efficient index updates and hardware resource utilization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies are inefficient in building and maintaining triangularly connected k-truss community indexes, cannot fully utilize the parallel computing capabilities of new hardware, and are difficult to update the index online to adapt to graph changes.
A parallel triangular connected k-truss community index construction and maintenance method is adopted. The truss value of the graph edge and the triangle are determined by the truss decomposition algorithm. The internal and marginal triangles are separated by the graph edge tensor. The EquiTruss index is constructed and the index is locally updated when the node is edited. The processing is optimized by tensor operators.
It reduces kernel startup overhead, improves index building and maintenance efficiency, and can fully utilize the parallel computing capabilities of new hardware to adapt to dynamic changes in the graph.
Smart Images

Figure CN122019874A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to a method and apparatus for constructing and maintaining a parallel triangular connected k-truss community index. Background Technology
[0002] In the real world, graphs are used to simulate relationships between entities, and they often contain closely connected subgraphs, i.e., community structures. Existing research related to community structures is mainly divided into community detection and community search. Community detection aims to find all communities in a graph and has been extensively studied over the past few decades; while community search, given a query point by a user, can return online communities containing the query point, which has attracted the interest of many researchers in recent years.
[0003] To meet the diverse needs of real-world applications, many community models have been proposed, including k-clique, k-truss, and k-core. However, most of these models either have low cohesion (k-core) or make the community search problem NP-hard (k-clique). k-truss strikes a trade-off between cohesion and time complexity, ensuring high cohesion while being solvable in polynomial time, and is therefore widely used in many studies. Building upon this, some works have added triangular connectivity constraints to k-truss community models, aiming to find more tightly connected triangularly connected k-truss communities in a graph.
[0004] Existing methods often involve first building an offline index (such as EquiTruss, EquiTree, etc.) that stores the truss values of all edges and triangular connectivity information in the original graph, storing it in memory. Then, the index is used to efficiently search for k-truss communities of triangular connectivity containing a specific query node. This can be executed serially and efficiently on a CPU. Furthermore, some works utilize the parallel computing power of multi-core CPUs to build the EquiTruss index in parallel. However, these index building methods are limited for graphs ranging from 3 to... For each truss value, iteratively checking the triangular connectivity of each edge, directly converting this into a parallel algorithm, cannot effectively utilize the computing power of new hardware. This is because fragmented iterative computation requires frequent kernel startups to check the corresponding triangular connectivity information, resulting in significant kernel startup overhead. Meanwhile, real-world graphs are constantly changing, and updating the index accordingly is crucial for online community searches. Existing methods can batch update inserted / deleted edges, but still lack parallel algorithms to leverage the computing power of new hardware.
[0005] There is currently no effective solution to the problem of inefficient index building and maintenance in existing related technologies. Summary of the Invention
[0006] This invention provides a method and apparatus for constructing and maintaining a parallel triangular connected k-truss community index, in order to solve the shortcomings of existing related technologies in terms of poor efficiency in index construction and maintenance.
[0007] In a first aspect, the present invention provides a method for constructing and maintaining a parallel triangularly connected k-truss community index, comprising: Read the original graph of the relationships between target entities from the text file, and determine the truss value of each edge and all triangles in the original graph using the truss decomposition algorithm to obtain three graph edge tensors; Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. When editing a node, determine the range of affected edges to obtain the set of edges whose truss values are affected; Based on the truss decomposition algorithm, update the truss value of the affected hyperedge and update the EquiTruss index.
[0008] According to the present invention, a method for constructing and maintaining a parallel triangular connected k-truss community index is provided. The original graph of the relationships between target entities is read from a text file, and the truss value of each edge and all triangles in the original graph are determined using a truss decomposition algorithm, resulting in three graph edge tensors, including: The original image is read from the text file using a compressed sparse line storage format; the compressed sparse line storage format consists of line pointers and an adjacency array. Calculate the truss value of each edge in the original graph, and simultaneously calculate all triangles in the original graph to obtain three graph edge tensors; the three elements at the same position in the three graph edge tensors form a triangle in the original graph.
[0009] According to the present invention, a method for constructing and maintaining a parallel triangular connected k-truss community index is provided, which, based on the truss values of the three graph edge tensors, divides the triangles inside the original graph into internal triangles and edge triangles, including: The triangle with the same truss value on all three sides in the original graph is taken as the inner triangle; The triangle in the original graph whose three sides have not all equal truss values is taken as the marginal triangle.
[0010] According to the present invention, a method for constructing and maintaining a parallel triangularly connected k-truss community index is provided, which constructs an EquiTruss index, including: For the internal triangle, the three sides are added to the same supernode; For the marginal triangle, sort the triangles according to the truss values of the three sides, and add the super edges of the super nodes to which the three sides belong based on the sorting results.
[0011] According to the method for constructing and maintaining a parallel triangular connected k-truss community index provided by the present invention, after constructing the EquiTruss index, if it is necessary to further construct the EquiTree index, the EquiTruss index is reconstructed in a chain to obtain the EquiTree index.
[0012] According to the present invention, a method for constructing and maintaining a parallel triangular connected k-truss community index is provided, which determines the range of affected edges and obtains the edge set of edges whose truss values are affected, including: For any edge inserted into the original graph, set an upper bound for its truss value after insertion. If there is an edge in the original graph whose truss value is less than the upper bound and is k-triangularly connected to the inserted edge, then the truss value of that edge may be affected. For any edge deleted from the original graph, if the truss value of an edge in the original graph does not exceed the truss value of the deleted edge, and the deleted edge is k-triangle connected, then the changed truss value may be affected. By merging and summing the edges that may be affected, we obtain the edge set of edges whose truss values are affected.
[0013] According to the present invention, a method for constructing and maintaining a parallel triangularly connected k-truss community index is provided, which updates the truss values of affected hyperedges, including: Determine the node set corresponding to the edge set of the edges whose truss values are affected, and extract the induced subgraph of the node set from the original graph; Perform truss decomposition on the induced subgraph and update the truss values of the affected hyperedges.
[0014] According to a method for constructing and maintaining a parallel triangularly connected k-truss community index provided by the present invention, updating the EquiTruss index includes: Search the original EquiTruss index for supernodes containing the affected superedges and delete them; Build an index for the induced subgraph and create a superedge between the interior and exterior of the induced subgraph; Merge supernodes with equal truss values but with superedges between them to complete the update of the EquiTruss index.
[0015] According to the method for constructing and maintaining a parallel triangularly connected k-truss community index provided by the present invention, if the EquiTree index needs to be updated, then: The affected supernodes are split into multiple equivalence classes, and the affected equivalence classes are determined. Search the original EquiTree index for supernodes containing the affected superedges and delete them; Build an index for the induced subgraph and create a superedge between the interior and exterior of the induced subgraph; Merge supernodes with equal truss values but with super edges between them to complete the update of the EquiTree index; The updated EquiTree index is restructured in a chain to maintain the tree structure of the EquiTree.
[0016] Secondly, the present invention also provides an apparatus for constructing and maintaining a parallel triangularly connected k-truss community index, comprising: The reading module is used to read the original image from the text file and determine the truss value of each edge and all triangles in the original image through the truss decomposition algorithm, thereby obtaining three graph edge tensors. A construction module is used to divide the triangles inside the original graph into internal triangles and edge triangles based on the truss values of the three graph edge tensors, and to construct an EquiTruss index. The processing module is used to determine the range of affected edges during node editing and obtain the set of edges whose truss values are affected. The update module is used to update the truss values of the affected hyperedges based on the truss decomposition algorithm, and to update the EquiTruss index.
[0017] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for constructing and maintaining a parallel triangular connected k-truss community index as described in the first aspect above.
[0018] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for constructing and maintaining a parallel triangularly connected k-truss community index as described in the first aspect above.
[0019] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for constructing and maintaining a parallel triangular connected k-truss community index as described in the first aspect above.
[0020] Compared with the prior art, the present invention has the following beneficial effects: The method for constructing and maintaining a parallel triangular connected k-truss community index provided by this invention eliminates the dependence on truss value iteration, processes triangles in batches in parallel, reduces kernel startup overhead, and uses local updates instead of full graph recalculation to avoid full graph recalculation. It processes the original graph through tensors and tensor operators, is compatible with new heterogeneous hardware, and can make full use of the parallel computing capabilities of new hardware, thus solving the problem of poor efficiency in index construction and maintenance in existing related technologies. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is a flowchart of the method for constructing and maintaining a parallel triangular connected k-truss community index provided by the present invention; Figure 2 This is an example diagram of the EquiTruss / EquiTree index constructed in an embodiment of the present invention; Figure 3 yes Figure 2 A diagram showing the edges and the ID of each edge; Figure 4 This is a schematic diagram illustrating the process of constructing the EquiTruss index in an embodiment of the present invention; Figure 5 This is a schematic diagram of the EquiTruss index and EquiTree index constructed in an embodiment of the present invention; Figure 6 This is a schematic diagram of the maintained EquiTruss index and EquiTree index in an embodiment of the present invention; Figure 7 This is a structural block diagram of the apparatus for constructing and maintaining a parallel triangular connected k-truss community index provided by the present invention; Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] This invention provides a method for constructing and maintaining a parallel triangularly connected k-truss community index. Figure 1 This is a flowchart of the method for constructing and maintaining a parallel triangularly connected k-truss community index provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps: Step S101: Read the original graph of the relationship between the target entities from the text file, and determine the truss value of each edge and all triangles in the original graph using the truss decomposition algorithm to obtain three graph edge tensors. Step S102: Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. Step S103: During node editing, determine the range of affected edges and obtain the edge set of edges whose truss values are affected; Step S104: Based on the truss decomposition algorithm, update the truss value of the affected hyperedge and update the EquiTruss index.
[0025] This method consists of two parts: the first part is a novel EquiTruss index construction method, and the second part is an index maintenance method. In the first part, the original graph G representing the relationships between target entities is read from a text file. Then, using a truss decomposition algorithm, the truss value of each edge in the original graph G and all triangles are determined, resulting in three graph edge tensors, denoted as follows: (The first part is missing from the original text, so the translation stops here). and . and These are three tensors that record the edge numbers of the original graph. The three edges at corresponding positions form a triangle in the original graph G. Then, based on the truss values of the three graph edge tensors, the triangles inside the original graph G are divided into internal triangles and marginal triangles, and an EquiTruss index is constructed.
[0026] The second part focuses on how to maintain the index in parallel when multiple edges are inserted / deleted simultaneously, since node insertion / deletion can be viewed as the simultaneous insertion / deletion of multiple edges. It is assumed that multiple edges inserted / deleted simultaneously within a certain time period are recorded in... First, the range of affected edges is determined, i.e., the set of edges whose truss values may be updated. Then, based on the truss decomposition algorithm, the truss values of the affected superedges are updated, and the EquiTruss index is updated.
[0027] For example, suppose the original image is The constructed index is ,in and These represent the node sets of the original graph and the index, respectively. and These represent the edge sets of the original graph and the index, respectively. Supernodes and superedges will be used later to represent the nodes and edges of the index to distinguish them from those of the original graph. Specifically, this method divides the triangles inside the original graph into two categories: internal triangles and marginal triangles. In subsequent index construction, three edges belonging to the same internal triangle will be added to the same supernode in the index. Marginal triangles will undergo different operations in subsequent index construction based on the truss value relationship between the three edges: assuming the three edges are ordered by their truss values from smallest to largest as follows... and First, you need to add and Check the superedges between the supernodes, and then determine... and The relationship between the truss values is determined by the fact that if the two values are equal, they are added to the same supernode; otherwise, a superedge between the two supernodes is added.
[0028] Through the above process, in terms of index construction, tensors are used to represent the original graph and the index graph, mapping the algorithm to a series of tensor operators. This approach is compatible with heterogeneous hardware storage and computing models while leveraging their powerful parallel computing capabilities. Furthermore, the original... Figure 3 Triangles are divided into internal triangles and marginal triangles. There's no need to distinguish the truss value iteration order; all or large batches of triangles can be processed simultaneously, significantly reducing kernel startup times and eliminating accumulated startup overhead. For index maintenance, a batch index update method is designed for new hardware, including "determining the range of affected edges," "updating the edge truss values," and "updating the index." The entire process is executed on the new hardware without migrating the index to memory. Simultaneously, parallelized induced subgraph local updates through affected edge location avoid recalculating the entire graph.
[0029] In summary, this method eliminates the dependence on truss value iteration, processes triangles in batches in parallel, reduces kernel startup overhead, and uses local updates instead of full graph recalculation to avoid full graph recalculation. It processes the original graph through tensors and tensor operators, is compatible with new heterogeneous hardware, and can make full use of the parallel computing capabilities of new hardware, thus solving the problem of poor efficiency in index building and maintenance in existing related technologies.
[0030] In some embodiments, step S101 involves reading the original graph of the relationships between target entities from a text file and determining the truss value of each edge and all triangles in the original graph using a truss decomposition algorithm, resulting in three graph edge tensors. This includes: reading the original graph from the text file using a compressed sparse row storage format; the compressed sparse row storage format consists of row pointers and an adjacency array; calculating the truss value of each edge in the original graph and simultaneously calculating all triangles in the original graph to obtain three graph edge tensors; and the three elements at the same position in the three graph edge tensors forming a triangle in the original graph. The row pointer and adjacency array are represented by `row_ptr` and `columns`, respectively. `row_ptr` records the offset of the first adjacent point of each node in `columns`, and `columns` is the set of adjacent points of all nodes. Using the row pointer and the adjacency array, the list of adjacent points of any vertex can be easily obtained. In some embodiments, step S102, based on the truss values of the three graph edge tensors, divides the triangles inside the original graph into internal triangles and edge triangles, including: taking triangles in the original graph with equal truss values of the three edges as internal triangles; and taking triangles in the original graph with truss values of the three edges that are not completely equal as edge triangles.
[0031] Based on this, the EquiTruss index is constructed, including: for internal triangles, the three sides are added to the same supernode; for marginal triangles, the three sides are sorted according to their truss values, and the super edges of the supernodes to which the three sides belong are added based on the sorting results.
[0032] For example, determine and Are the truss values in the data equal? For Zhongyu or Edges with equal truss values at corresponding positions are added to the same supernode; for the remaining edges, a new supernode is constructed containing... The supernode of the corresponding edge and or The superedges between the supernodes containing the corresponding edges.
[0033] If the input original image G contains a large number of triangles, exceeding the storage limit of the new hardware, the triangles can be divided into several batches. Step S102 is repeated until all triangles have been processed, yielding the final EquiTruss index. The processing order of the triangles does not affect the final result. For computational efficiency, when dividing the triangles into several batches, the hardware's storage capacity must be taken into account, processing as many triangles as possible in each batch.
[0034] Furthermore, after building the EquiTruss index, if it is necessary to build the EquiTree index, the EquiTruss index is restructured in a chain to obtain the EquiTree index.
[0035] This embodiment stores the constructed index in a COO storage format, meaning that the two supernodes contained in each superedge are located in two tensors respectively. and In the middle. For each superedge, The truss value of the Chinese Super League node is less than The truss value of the Chinese Super League node. The supernodes in the array are sorted in descending order of their truss values, and Supernodes with the same neighbors are also sorted in descending order of their truss values. Suppose a certain supernode is in... The starting position in is And it has The reconstruction method requires [number] adjacent supernodes. Central arrive Copy the element to Middle position arrive Then merge and The process involves identifying the supernodes with the same truss value at the corresponding position. This process needs to be repeated until the results converge, completing the construction of the EquiTree index.
[0036] In some embodiments, step S103, determining the range of affected edges and obtaining a set of edges whose truss values are affected, includes: for any edge inserted into the original graph, setting an upper bound for its truss value after insertion; if the truss value of an edge in the original graph is less than the upper bound and is k-triangularly connected to the inserted edge, then the truss value of that edge may be affected; for any edge deleted from the original graph, if the truss value of an edge in the original graph does not exceed the truss value of the deleted edge and is k-triangularly connected to the deleted edge, then the changed truss value may be affected; merging and summarizing the potentially affected edges to obtain a set of edges whose truss values are affected.
[0037] Since node insertion / deletion can be viewed as the simultaneous insertion / deletion of multiple edges, this method focuses on describing how to maintain the index in parallel when multiple edges are inserted / deleted simultaneously. It is assumed that multiple edges inserted / deleted simultaneously within a certain time period are recorded in... First, determine the range of affected edges, i.e., the set of edges whose truss values might be updated. For the edge set... any edge in When it is inserted into the original graph, it is assumed that the upper bound of its truss value after insertion is... If the original graph has edges with truss values And it is with If the edges are k-triangularly connected, then the truss value of the edge may be affected by the edge. Changes due to insertion; if Delete it from the original image, assuming its truss value is... If the truss value of an edge exists in the original graph And with If a k-triangle is connected, the truss value of that edge may be affected by... The deletion will change. It will be due to... The edges whose truss values change due to edge updates are combined to form all the affected edges, denoted as . .
[0038] In some embodiments, step S104, updating the truss value of the affected hyperedge, includes: determining the node set corresponding to the edge set of the edge whose truss value is affected, and extracting the induced subgraph of the node set from the original graph; performing truss decomposition on the induced subgraph, and updating the truss value of the affected hyperedge.
[0039] In this embodiment, it is assumed that yes The node set is extracted from the original graph. The induced subgraph, denoted as Re-examine Perform truss decomposition and update The truss value.
[0040] Based on this, the EquiTruss index is updated, including: searching for and deleting supernodes containing affected superedges in the original EquiTruss index; building an index for the induced subgraph and creating superedges between the inside and outside of the induced subgraph; merging supernodes with equal truss values but with superedges between them, thus completing the update of the EquiTruss index.
[0041] For the EquiTruss index, find the content in the original index. Remove the supernode from the index, and then for Build the index. Due to the boundary edge ( In addition to The existence of the outer edge is for Created at the same time as building the index The superedges between the internal and external nodes are defined. Finally, supernodes with the same truss value but with superedges between them are merged to complete the index update.
[0042] Furthermore, to update the EquiTree index, the following steps are taken: split the affected supernodes into multiple equivalence classes and identify the affected equivalence classes; search for and delete supernodes containing the affected superedges in the original EquiTree index; build an index for the induced subgraph and create superedges between the inside and outside of the induced subgraph; merge supernodes with equal truss values but with superedges between them to complete the update of the EquiTree index; and perform a chained reconstruction of the updated EquiTree index to maintain the tree structure of EquiTree.
[0043] Figure 2 This is an example diagram of the EquiTruss / EquiTree index constructed in an embodiment of the present invention. Figure 2 Taking this as an example, we will construct and maintain the EquiTruss / EquiTree index. The example graph G is passed into the algorithm as a text file. Each line in the text file represents an edge in graph G, recorded as source and destination points separated by spaces.
[0044] 1. For Figure 3 The input graph G is read into a compressed sparse row storage format. The truss decomposition algorithm is executed to calculate the truss value of each edge. Simultaneously, the triangles in graph G are calculated and denoted according to their truss values. and .
[0045] 2. Judgment and The truss values are determined by the following relationship: if the triangle is an internal triangle, it is merged into a single supernode; if the triangle is a marginal triangle, a supernode or superedge is constructed accordingly. For Figure 3 Example diagram in the image, and The number of marginal triangles with equal truss values is , , , Therefore, and The supernodes are merged into one and a new one is created. and The superedge between supernodes. Edges 3,10 and 4,10 belong to the same supernode (C3,3) because both edges have a truss value of 3 within this edge triangle. Edge 3,4 belongs to supernode C5 because its truss value is 5. A superedge is created between supernodes (C3,3) and C5. Triangles with all three edges having unequal truss values are... , First, construct the superedges between supernodes. After processing all triangles, complete the EquiTruss index construction.
[0046] like Figure 3 and Figure 4 As shown, Figure 3 yes Figure 2 A diagram illustrating the edges and their IDs. Figure 4 This is a schematic diagram illustrating the process of constructing the EquiTruss index in an embodiment of the present invention. In the diagram, ET represents... Figure 2 The edges in the graph are divided into src and dst; eid assigns a unique ID to each edge in the original graph. After completing the EquiTruss index construction, we obtain... Figure 4 (b) shows the index graph. The supernode is identified by the minimum eid of all edges within the same supernode. The superedge IT(b) is obtained according to the rules. Then, the superedge is adjusted according to the reconstruction rules to obtain (c) and IT(c). Finally, the supernodes with equal truss values at the corresponding positions of dst and src are found and merged to obtain (d) and IT(d).
[0047] 3. To further construct the EquiTree index, a chained reconstruction can be repeatedly performed on the EquiTruss index until the results converge, yielding the final EquiTree index. For example... Figure 5 As shown, Figure 5 This is a schematic diagram of the EquiTruss index and EquiTree index constructed in an embodiment of the present invention.
[0048] Assuming an edge (9,10) is inserted into the original graph, the detailed steps for index maintenance are as follows: 1. Insert the edge into graph G and calculate its truss value, which has an upper bound of 4.
[0049] 2. Find all affected edges, i.e. ={ (3,9), (3,10), (4,9), (4,10),} extracts the subgraph induced by all nodes of these edges. and calculate The truss value.
[0050] 3. Locate and delete all affected supernodes to form an induced subgraph. Build an index and merge supernodes with equal truss values and interconnected hyperedges. To update the EquiTree, first split the affected supernodes into equivalence classes, then delete the affected equivalence classes. After building the index, repeat the chained reconstruction until the result converges.
[0051] The steps for inserting multiple edges are similar, except that in step 2, it's necessary to find the edges affected after each insertion. This operation can also be performed in parallel. The steps for deleting edges are also similar, except that it's not necessary to calculate the upper bound of the updated edge truss value, and the definition of affected edges is slightly different. For example... Figure 6 As shown, Figure 6 This is a schematic diagram of the maintained EquiTruss index and EquiTree index in an embodiment of the present invention.
[0052] This invention presents a novel parallel method for constructing and maintaining a triangularly connected k-truss community index. This method eliminates the dependency of existing index construction algorithms on iterating based on truss values, focusing on processing more triangles simultaneously to reduce the significant overhead caused by repeated kernel startups. Furthermore, the parallel index maintenance algorithm is compatible with various hardware and can be seamlessly integrated with the index construction algorithm. The present invention also provides an apparatus for constructing and maintaining a parallel triangular connected k-truss community index. The apparatus for constructing and maintaining a parallel triangular connected k-truss community index provided by the present invention is described below. The apparatus for constructing and maintaining a parallel triangular connected k-truss community index described below can be referred to in correspondence with the method for constructing and maintaining a parallel triangular connected k-truss community index described above. Figure 7 This is a structural block diagram of the apparatus for constructing and maintaining a parallel triangularly connected k-truss community index provided by the present invention, as shown below. Figure 7 As shown, the device includes: The reading module 701 is used to read the original image from the text file and determine the truss value of each edge and all triangles in the original image through the truss decomposition algorithm, thereby obtaining three graph edge tensors. Module 702 is used to divide the triangles inside the original graph into internal triangles and marginal triangles based on the truss values of the three graph edge tensors, and to construct the EquiTruss index. Processing module 703 is used to determine the range of affected edges during node editing and obtain the edge set of edges whose truss values are affected; Update module 704 is used to update the truss values of affected hyperedges and update the EquiTruss index based on the truss decomposition algorithm.
[0053] The operation of this device consists of two parts: the first part is the novel EquiTruss index construction method, and the second part is the index maintenance method. In the first part, the reading module 701 reads the original graph G containing the relationships between target entities from a text file, and uses a truss decomposition algorithm to determine the truss value of each edge in the original graph G and all triangles, obtaining three graph edge tensors, which are denoted in ascending order of truss value as follows: and . and These are three tensors that record the edge numbers of the original graph. The three edges at corresponding positions form a triangle in the original graph G. Then, the construction module 702 divides the triangle inside the original graph G into internal triangles and marginal triangles based on the truss values of the three graph edge tensors, and constructs the EquiTruss index.
[0054] The second part, since node insertion / deletion can be viewed as the simultaneous insertion / deletion of multiple edges, focuses on describing how to maintain the index in parallel when multiple edges are inserted / deleted simultaneously. It is assumed that multiple edges inserted / deleted simultaneously within a certain time period are recorded in... First, the processing module 703 determines the range of affected edges, i.e., the set of edges whose truss values may be updated. Then, the update module 704 updates the truss values of the affected superedges based on the truss decomposition algorithm and updates the EquiTruss index.
[0055] Through the above process, in terms of index construction, tensors are used to represent the original graph and the index graph, mapping the algorithm to a series of tensor operators. This approach is compatible with heterogeneous hardware storage and computing models while leveraging their powerful parallel computing capabilities. Furthermore, the original... Figure 3 Triangles are divided into internal triangles and marginal triangles. There's no need to distinguish the truss value iteration order; all or large batches of triangles can be processed simultaneously, significantly reducing kernel startup times and eliminating accumulated startup overhead. For index maintenance, a batch index update method is designed for new hardware, including "determining the range of affected edges," "updating the edge truss values," and "updating the index." The entire process is executed on the new hardware without migrating the index to memory. Simultaneously, parallelized induced subgraph local updates through affected edge location avoid recalculating the entire graph.
[0056] In summary, this device eliminates the dependence on truss value iteration, processes triangles in batches in parallel, reduces kernel startup overhead, and uses local updates instead of full graph recalculation to avoid full graph recalculation. It processes the original graph through tensors and tensor operators, is compatible with new heterogeneous hardware, and can make full use of the parallel computing capabilities of new hardware, thus solving the problem of inefficient index building and maintenance in existing related technologies.
[0057] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804. The processor 801 can call logical instructions in the memory 803 to execute a method for constructing and maintaining a parallel triangularly connected k-truss community index, the method including: Read the original graph of the relationships between target entities from the text file, and use the truss decomposition algorithm to determine the truss value of each edge and all triangles in the original graph to obtain three graph edge tensors; Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. When editing a node, determine the range of affected edges to obtain the set of edges whose truss values are affected; Based on the truss decomposition algorithm, update the truss values of the affected hyperedges and update the EquiTruss index.
[0058] Furthermore, the logical instructions in the aforementioned memory 803 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0059] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the method for constructing and maintaining a parallel triangularly connected k-truss community index provided by the above methods, the method comprising: Read the original graph of the relationships between target entities from the text file, and use the truss decomposition algorithm to determine the truss value of each edge and all triangles in the original graph to obtain three graph edge tensors; Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. When editing a node, determine the range of affected edges to obtain the set of edges whose truss values are affected; Based on the truss decomposition algorithm, update the truss values of the affected hyperedges and update the EquiTruss index.
[0060] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for constructing and maintaining a parallel triangularly connected k-truss community index provided by the methods described above, the method comprising: Read the original graph of the relationships between target entities from the text file, and use the truss decomposition algorithm to determine the truss value of each edge and all triangles in the original graph to obtain three graph edge tensors; Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. When editing a node, determine the range of affected edges to obtain the set of edges whose truss values are affected; Based on the truss decomposition algorithm, update the truss values of the affected hyperedges and update the EquiTruss index.
[0061] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing and maintaining a parallel triangularly connected k-truss community index, characterized in that, include: Read the original graph of the relationships between target entities from the text file, and determine the truss value of each edge and all triangles in the original graph using the truss decomposition algorithm to obtain three graph edge tensors; Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, and an EquiTruss index is constructed. When editing a node, determine the range of affected edges to obtain the set of edges whose truss values are affected; Based on the truss decomposition algorithm, update the truss value of the affected hyperedge and update the EquiTruss index.
2. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 1, characterized in that, The original graph representing the relationships between target entities is read from a text file. Then, using a truss decomposition algorithm, the truss value of each edge and all triangles in the original graph are determined, resulting in three graph edge tensors: The original image is read from the text file using a compressed sparse line storage format; the compressed sparse line storage format consists of line pointers and an adjacency array. Calculate the truss value of each edge in the original graph, and simultaneously calculate all triangles in the original graph to obtain three graph edge tensors; the three elements at the same position in the three graph edge tensors form a triangle in the original graph.
3. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 1, characterized in that, Based on the truss values of the three graph edge tensors, the triangles inside the original graph are divided into internal triangles and edge triangles, including: The triangle with the same truss value on all three sides in the original graph is taken as the inner triangle; The triangle in the original graph whose three sides have not all equal truss values is taken as the marginal triangle.
4. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 3, characterized in that, Building the EquiTruss index includes: For the internal triangle, the three sides are added to the same supernode; For the marginal triangle, sort the triangles according to the truss values of the three sides, and add the super edges of the super nodes to which the three sides belong based on the sorting results.
5. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 1, characterized in that, After constructing the EquiTruss index, if it is necessary to further construct the EquiTree index, the EquiTruss index is reconstructed in a chain to obtain the EquiTree index.
6. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 1, characterized in that, Determine the range of affected edges to obtain the set of edges whose truss values are affected, including: For any edge inserted into the original graph, set an upper bound for its truss value after insertion. If there is an edge in the original graph whose truss value is less than the upper bound and is k-triangularly connected to the inserted edge, then the truss value of that edge may be affected. For any edge deleted from the original graph, if the truss value of an edge in the original graph does not exceed the truss value of the deleted edge, and the deleted edge is k-triangle connected, then the changed truss value may be affected. By merging and summing the edges that may be affected, we obtain the edge set of edges whose truss values are affected.
7. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 5, characterized in that, Update the truss values of the affected superedges, including: Determine the node set corresponding to the edge set of the edges whose truss values are affected, and extract the induced subgraph of the node set from the original graph; Perform truss decomposition on the induced subgraph and update the truss values of the affected hyperedges.
8. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 7, characterized in that, Update the EquiTruss index, including: Search the original EquiTruss index for supernodes containing the affected superedges and delete them; Build an index for the induced subgraph and create a superedge between the interior and exterior of the induced subgraph; Merge supernodes with equal truss values but with superedges between them to complete the update of the EquiTruss index.
9. The method for constructing and maintaining a parallel triangularly connected k-truss community index according to claim 7, characterized in that, To update the EquiTree index, then: The affected supernodes are split into multiple equivalence classes, and the affected equivalence classes are determined. Search the original EquiTree index for supernodes containing the affected superedges and delete them; Build an index for the induced subgraph and create a superedge between the interior and exterior of the induced subgraph; Merge supernodes with equal truss values but with super edges between them to complete the update of the EquiTree index; The updated EquiTree index is restructured in a chain to maintain the tree structure of the EquiTree.
10. A device for constructing and maintaining a parallel triangularly connected k-truss community index, characterized in that, include: The reading module is used to read the original image from the text file and determine the truss value of each edge and all triangles in the original image through the truss decomposition algorithm, thereby obtaining three graph edge tensors. A construction module is used to divide the triangles inside the original graph into internal triangles and edge triangles based on the truss values of the three graph edge tensors, and to construct an EquiTruss index. The processing module is used to determine the range of affected edges during node editing and obtain the set of edges whose truss values are affected. The update module is used to update the truss values of the affected hyperedges based on the truss decomposition algorithm, and to update the EquiTruss index.