A numa-aware community discovery method based on k-truss decomposition

By implementing task parallelism and adaptive triangle counting optimization on the NUMA architecture, the limited performance improvement of the k-truss decomposition method on the NUMA architecture is addressed, achieving efficient data distribution and improved computational performance.

CN114265691BActive Publication Date: 2025-11-18SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111560730.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-11-18
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

Existing k-truss decomposition methods suffer from problems such as contention for shared variable access between threads and high overhead for remote memory access when processed in parallel on the NUMA architecture, resulting in limited or negative performance improvements.

Method used

We employ a numa-aware approach, which divides tasks among numa nodes through task parallelism, maintains the local graph topology, and optimizes data distribution and computation by using adaptive triangle counting and dynamic task partitioning strategies.

Benefits of technology

It effectively reduces remote memory access latency, reduces data contention, and improves computing performance, especially in the case of multiple numa nodes and a large number of threads, achieving fast k-truss decomposition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265691B_ABST
    Figure CN114265691B_ABST
Patent Text Reader

Abstract

The application discloses a numa-aware community discovery method based on k-truss decomposition, comprising a data input module, a calculation support module and a K-truss decomposition module, and the method comprises the following steps: reading a graph in the form of text from a graph data file stored in a hard disk through the data input module, placing the graph topology structure into a memory, then building a CSR and generating an edge mapping array according to a CSR edge set array; selecting a triangle counting method by using the calculation system module, selecting a triangle counting method according to the size of the graph (the number of edges obtained by each thread), the density of the graph (the average vertex degree) and the balance degree of the vertex degree of the graph (the gap between the maximum degree, the minimum degree and the average degree); the support degree of each edge is calculated according to the method in the above step; the K-truss decomposition module is used for decomposition, including calculating the size of each execution unit, calculating the task interval of each unit, initializing the support degree of each unit, performing K-truss decomposition on a single unit and updating the global k value list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of graph algorithms, complex networks, and big data processing technology, and specifically to a Numa-aware community detection method based on k-truss decomposition. Technical Background

[0002] Existing mainstream k-truss decomposition methods—the Wang-optimized serial method and the PKT algorithm for multi-core parallel environments—do not take into account the characteristics of the NUMA architecture. Therefore, when running on NUMA servers with many NUMA nodes or cores, and using a large number of threads in parallel, especially across NUMA nodes, the performance improvement is limited, or even negative (compared to using fewer threads on the same NUMA node). Therefore, this invention proposes and implements a NUMA-aware k-truss decomposition algorithm, designed and optimized for NUMA-based server environments to fully utilize server performance and achieve fast k-truss decomposition of datasets of different sizes and densities.

[0003] Analysis revealed the following problems:

[0004] 1. The algorithm involves a large number of shared variables accessed between threads. As the number of threads increases, data contention will occur.

[0005] 2. On numa devices, remote memory access across nodes is costly, and the algorithm involves a large number of memory access behaviors (including a large number of unpredictable random memory access behaviors). Summary of the Invention

[0006] In view of the shortcomings of existing technologies, this invention aims to provide a NUMA-aware community detection method based on k-truss decomposition, which fully utilizes the performance of NUMA-based servers and simultaneously achieves:

[0007] 1. Parallel Tasks – Tasks are divided among task execution units (1 or 2 numa nodes) according to the range of k values;

[0008] 2. Data distribution – Maintain a local graph topology in each task execution unit;

[0009] 3. Task partitioning based on K value intervals: one is task partitioning based on the number of edges, and the other is task partitioning based on computation time prediction.

[0010] 4. Dynamically adjustable – task execution units (threads, number of numa nodes) are allocated according to the size and density of the graph.

[0011] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0012] A Numa-aware community detection method based on k-truss decomposition includes a data input module, a support calculation module, and a k-truss decomposition module. The method includes the following steps:

[0013] S1 reads the graph in text form from the graph data file stored on the hard disk through the data input module, puts the graph topology into memory, then constructs the CSR and generates an edge mapping array based on the CSR to build an edge set array.

[0014] S2 uses the aforementioned support calculation module to select a triangle counting method based on the graph size (the number of edges allocated to each thread), graph density (average vertex degree), and the balance of vertex degrees (the difference between the maximum degree, minimum degree, and average degree).

[0015] S3 Calculate the support of each edge according to the method in step S2;

[0016] S4 uses the K-truss decomposition module to perform decomposition, including calculating the size of any execution unit, calculating the task range of each unit, initializing the support of each unit, performing K-truss decomposition on each unit, and updating the global k-value list.

[0017] It should be noted that step S1 includes:

[0018] S1.1 Read in data: Read the graph in text form from the graph data file stored on the hard disk and place the graph topology into memory;

[0019] S1.2 Construct CSR compressed sparse rows. Based on the existing graph topology, obtain the number of vertices n and the number of edges m. Initialize two arrays with sizes n and 2*m, respectively, denoted as Eo and Nb. Eo stores the starting position of each vertex's neighboring vertices in Nb; Nb sequentially stores the IDs of each vertex's neighboring vertices.

[0020] S1.3 Construct an edge mapping array. Based on the CSR from the previous step, construct an edge set array of size m, denoted as El. Each edge is represented in the form (u,v). Each edge (u,v) and (v,u) is recorded only once in the form (u,v). Then, traverse Eo and Nb, recording the position of the edge formed by each vertex on Nb and the corresponding vertex on Eo on El, generating the edge mapping array Eid.

[0021] It should be noted that step S2 includes the following methods when there are many cores / multiple numa nodes: for large graphs or small but sparse graphs, traversing by edge, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; for dense graphs, traversing by vertex, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; when using fewer cores / few numa nodes, traversing triangles by vertex, updating the support of edges for each triangle using atomic operations, and calculating edges using a bitmap.

[0022] It should be noted that the method of traversing triangles by vertex and updating the support of edges for each triangle using atomic operations is performed by calculating edges using a bitmap; the method of traversing edges by vertex and calculating triangles for each edge is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection; and the method of traversing edges and calculating triangles for each edge is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection.

[0023] It should be noted that step S3 includes initializing an array of size m to record the support value corresponding to each edge. Specifically, the triangles are traversed by vertex, and the support of the edges is updated by atomic operations on each triangle. The edge is calculated using a bitmap. Triangles are calculated for each edge, and the neighboring vertices of the two vertices of the edge are merged and their intersection is taken. After counting the triangles for all vertices / edges, the support calculation is completed.

[0024] It should be noted that the size of the computation task execution unit is calculated based on the number of server NUMA nodes, the number of physical cores, the size of the graph, and the density of the graph. When the graph is large or sparse, more NUMA nodes are allocated to each unit; when the graph is small or dense, fewer NUMA nodes are allocated to each unit.

[0025] It should be noted that the calculation of the task interval for each unit includes traversing each edge, calculating the maximum support Supmax, and creating an array Sd ​​of size Supmax; traversing each edge and calculating the number of edges with different support distributions; then, based on Sd, calculating the number of edges in the k-class corresponding to different k values, further predicting the workload of the iteration for the corresponding k value, thereby calculating the average partition point and dividing the k value interval into each execution unit.

[0026] It should be noted that the initial support of each unit includes the range of k values ​​[k l ,k r ],k l < k r , k lFor each task execution unit whose support is not 2, the support must first be reinitialized. First, a local support array of size m is created. Then, filtering is performed, retaining edges that meet the condition (support value greater than or equal to k). l (The edges), and perform triangle calculations on the remaining edges, which is the initialization of the support part.

[0027] It should be noted that the k-truss decomposition of each unit includes each execution unit computing its own task, i.e., the range [k l ,k r In each small iteration of calculating the value of k, the edges are traversed in parallel. Edges that meet the conditions are removed, and their class value is recorded as k. Before removal, the edges of other triangles formed by the edge are stripped, and the affected edges that meet the removal conditions are added to the next round of removal. Until there are no edges to remove, k is incremented by 1, and the next large iteration is entered until the entire interval is calculated.

[0028] It should be noted that the updated global k-value list includes setting all global support arrays to zero after the first execution unit finishes the decomposition task; after each execution unit completes the calculation, it traverses the local support array and updates the global support array. The update rule is that when the size of the local support array is within its own task range and the corresponding value in the global array is less than the local value, an atomic update is performed.

[0029] The beneficial effects of this invention are as follows:

[0030] 1. In terms of data structure, considering the fast speed and high bandwidth of accessing local memory in the NUMA architecture environment, but the slow speed and low bandwidth of accessing remote memory, this invention maintains a compressed graph topology and some auxiliary data locally (on each NUMA node), reducing the latency overhead caused by accessing remote memory. Simultaneously, a support-based filtering method is used to filter the graph before compression, improving computational performance while avoiding excessive memory overhead. Theoretical analysis and experimental verification show that the size of the graph topology data maintained by each node is approximately 2 - (i - 1). When there are 4 execution units, the total space occupied is 15 / 8 of the original graph topology data size; when there are more execution units, it does not exceed twice the size of the original graph topology data. (There are also 3 arrays of size m storing local edge states, support values, and k-class values.)

[0031] 2. Regarding parallel processing of tasks, because the algorithm itself involves numerous accesses to global variables, data contention intensifies when using a large number of threads in parallel, increasing read and modify wait times. This can lead to a situation where performance improvement slows down or even declines as the number of threads (numa nodes) increases. Therefore, for environments with a large number of threads and multiple numa nodes, a task parallelism approach is adopted, distributing the estimated range of k values ​​to each task execution unit (possibly one or more numa nodes). Each unit performs the decomposition calculation of the specified range of k values ​​locally using a method similar to PKT. Furthermore, as the graph size increases or its density decreases, increasing the number of threads on adjacent numa nodes can effectively improve performance. Therefore, a dynamic selection of task execution unit size is adopted, choosing one or more numa nodes as each task execution unit based on the graph size, density, and number of threads.

[0032] 3. Adaptive Triangle Counting: Triangle counting is required during the initialization of support for each task execution unit. A similar triangle decomposition operation is needed during the truss decomposition phase. Different triangle counting methods (enumeration methods adapt to different scenarios): Currently, the mainstream triangle counting methods include edge-based and vertex-based traversal. Edge-based traversal is less affected by graph skew (i.e., the existence of height vertices) during parallel processing, while vertex-based traversal avoids a certain amount of random memory access. When calculating triangles, i.e., finding the intersection of two vertices on an edge, there is the simplest two-array merging method, and another method uses an array X to maintain the neighboring vertices of one vertex and checks if the neighboring vertices of the other vertex are in X. Compared to the former, the former has better memory access behavior, while the latter has lower time complexity. Therefore, this invention adopts a higher-performance triangle counting method based on the graph size and density. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of the process of the present invention;

[0034] Figure 2 This is a schematic diagram of the data structure of the data reading module in this invention;

[0035] Figure 3 This is a schematic diagram of edge-based traversal and vertex-based traversal in this invention;

[0036] Figure 4 This is a flowchart illustrating the bitmap-based edge calculation method used in the support calculation of this invention.

[0037] Figure 5 for Figure 4 Specific example diagrams are shown below;

[0038] Figure 6 This is a flowchart of the operation of merging and finding the intersection of two neighboring vertices according to the edge in this invention;

[0039] Figure 7 for Figure 6 Specific example diagrams are shown below;

[0040] Figure 8 This is a schematic diagram after implementing the present invention. Specific Implementation

[0041] The present invention will be further described below with reference to the accompanying drawings. It should be noted that this embodiment is based on the present technical solution and provides detailed implementation methods and specific operation processes, but the protection scope of the present invention is not limited to this embodiment.

[0042] like Figure 1 As shown, this invention is a community detection method based on k-truss decomposition using NUMA, including a data input module, a support calculation module, and a k-truss decomposition module. The method includes the following steps:

[0043] S1 reads the graph in text form from the graph data file stored on the hard disk through the data input module, puts the graph topology into memory, then constructs the CSR and generates an edge mapping array based on the CSR to build an edge set array.

[0044] S2 uses the aforementioned support calculation module to select a triangle counting method based on the graph size (the number of edges allocated to each thread), graph density (average vertex degree), and the balance of vertex degrees (the difference between the maximum degree, minimum degree, and average degree).

[0045] S3 Calculate the support of each edge according to the method in step S2;

[0046] S4 uses the K-truss decomposition module to perform decomposition, including calculating the size of any execution unit, calculating the task range of each unit, initializing the support of each unit, performing K-truss decomposition on each unit, and updating the global k-value list.

[0047] It should be noted that step S1 includes:

[0048] S1.1 Read in data: Read the graph in text form from the graph data file stored on the hard disk and place the graph topology into memory;

[0049] S1.2 Construct CSR compressed sparse rows. Based on the existing graph topology, obtain the number of vertices n and the number of edges m. Initialize two arrays with sizes n and 2*m, respectively, denoted as Eo and Nb. Eo stores the starting position of each vertex's neighboring vertices in Nb; Nb sequentially stores the IDs of each vertex's neighboring vertices.

[0050] S1.3 Construct an edge mapping array. Based on the CSR from the previous step, construct an edge set array of size m, denoted as El. Each edge is represented in the form (u,v). Each edge (u,v) and (v,u) is recorded only once in the form (u,v). Then, traverse Eo and Nb, recording the position of the edge formed by each vertex on Nb and the corresponding vertex on Eo on El, generating the edge mapping array Eid.

[0051] It should be noted that step S2 includes the following methods when there are many cores / multiple numa nodes: for large graphs or small but sparse graphs, traversing by edge, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; for dense graphs, traversing by vertex, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; when using fewer cores / few numa nodes, traversing triangles by vertex, updating the support of edges for each triangle using atomic operations, and calculating edges using a bitmap.

[0052] It should be noted that the method of traversing triangles by vertex and updating the support of edges for each triangle using atomic operations is performed by calculating edges using a bitmap; the method of traversing edges by vertex and calculating triangles for each edge is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection; and the method of traversing edges and calculating triangles for each edge is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection.

[0053] It should be noted that step S3 includes initializing an array of size m to record the support value corresponding to each edge. Specifically, the triangles are traversed by vertex, and the support of the edges is updated by atomic operations on each triangle. The edge is calculated using a bitmap. Triangles are calculated for each edge, and the neighboring vertices of the two vertices of the edge are merged and their intersection is taken. After counting the triangles for all vertices / edges, the support calculation is completed.

[0054] It should be noted that the size of the computation task execution unit is calculated based on the number of server NUMA nodes, the number of physical cores, the size of the graph, and the density of the graph. When the graph is large or sparse, more NUMA nodes are allocated to each unit; when the graph is small or dense, fewer NUMA nodes are allocated to each unit.

[0055] It should be noted that the task interval for calculating each unit includes traversing each edge and calculating the maximum support Sup. max Create a size of Sup max The array Sd ​​is used to iterate through each edge and calculate the number of edges with different support distributions. Then, based on Sd, the number of edges in the k-class corresponding to different k values ​​is calculated. The iteration workload corresponding to the k value is further predicted, and the average partition point is calculated to divide the k value interval into each execution unit.

[0056] It should be noted that the initial support of each unit includes the range of k values ​​[k l ,k r ],k l < k r , k l For each task execution unit whose support is not 2, the support must first be reinitialized. First, a local support array of size m is created. Then, filtering is performed, retaining edges that meet the condition (support value greater than or equal to k). l (The edges), and perform triangle calculations on the remaining edges, which is the initialization of the support part.

[0057] It should be noted that the k-truss decomposition of each unit includes each execution unit computing its own task, i.e., the range [k l ,k r In each small iteration of calculating the value of k, the edges are traversed in parallel. Edges that meet the conditions are removed, and their class value is recorded as k. Before removal, the edges of other triangles formed by the edge are stripped, and the affected edges that meet the removal conditions are added to the next round of removal. Until there are no edges to remove, k is incremented by 1, and the next large iteration is entered until the entire interval is calculated.

[0058] It should be noted that the updated global k-value list includes setting all global support arrays to zero after the first execution unit finishes the decomposition task; after each execution unit completes the calculation, it traverses the local support array and updates the global support array. The update rule is that when the size of the local support array is within its own task range and the corresponding value in the global array is less than the local value, an atomic update is performed.

[0059] Example

[0060] To facilitate understanding of the method of this invention, the following embodiments use a server with 4 NUMA nodes, a total of 128 physical cores, and a Linux operating system, to implement the method using C++, OpenMP, and libnuma. Figures 1 to 8 As shown.

[0061] 1. Data Input Module

[0062] (1) Read in data

[0063] The graph is read in text form from the graph data file stored on the hard drive using the standard file operation interface provided by Linux. The graph topology is placed into memory. Specifically, the number of vertices n and edges m of the graph are obtained first, and an edge array of size 2*m is initialized to store the edges. Each edge is represented in the form of (u, v).

[0064] (2) Constructing CSR

[0065] Based on the existing graph topology, i.e., the edge set obtained in the previous step, and the number of vertices n and edges m, initialize two arrays of size n and 2*m, respectively denoted as Eo and Nb. Eo stores the starting position of each vertex's neighboring vertices in Nb; Nb sequentially stores the IDs of each vertex's neighboring vertices. The specific data structure is as follows: Figure 2 As shown.

[0066] (3) Construct the edge mapping array

[0067] Based on the CSR from the previous step, construct an edge set array of size m, denoted as El, where each edge is represented in the form (u,v). Each edge (u,v) and (v,u) is recorded only once in the form (u,v). Then, iterate through Eo and Nb, recording the position of the edge formed by each vertex on Nb and the corresponding vertex on Eo in El, generating an edge mapping array Eid.

[0068] 2. Support Calculation Module

[0069] (1) Choose the triangle counting method

[0070] The triangle counting method is chosen based on the graph size (the number of edges allocated to each thread), graph density (average vertex degree), and the balance of vertex degrees (the difference between the maximum, minimum, and average degrees). When there are many cores / multiple NUMA nodes, for large or small but sparse graphs, an edge-by-edge traversal is used, calculating triangles for each edge and merging the neighboring vertices of the two edges during calculation. For dense graphs, an edge-by-vertex traversal is used, calculating triangles for each edge and merging the neighboring vertices of the two edges during calculation. When using fewer cores / few NUMA nodes, a vertex-by-triangle traversal is used, updating the edge support for each triangle using atomic operations, and calculating edges using a bitmap. Figures 3-7 As shown.

[0071] Tnb traverses the triangles by vertex, updates the edge support for each triangle using atomic operations, and calculates the edges using a bitmap approach.

[0072] Enm iterates through the edges by vertex, calculates the triangle for each edge, and merges the neighboring vertices of the two edges to find the intersection.

[0073] Eem iterates along the edges, calculating the triangle for each edge by merging the neighboring vertices of the two edges and taking the intersection.

[0074] (2) Calculate support

[0075] Initialize an array of size m to record the support value (i.e., the number of edges that participate in forming a triangle) for each edge.

[0076] 3. K-truss decomposition module

[0077] (1) Calculate the size of the task execution unit

[0078] The task execution unit is selected based on the number of server NUMA nodes, the number of physical cores, the size of the graph, and the density of the graph. When the graph is large or sparse, more NUMA nodes are allocated to each unit; when the graph is small or dense, fewer NUMA nodes are allocated to each unit. For example... Figure 8 As shown in the Methods section of this paper.

[0079] (2) Calculate the task interval for each unit.

[0080] Iterate through each edge and calculate the maximum support Sup. max Create a size of Sup max The array Sd ​​is used. Each edge is traversed to calculate the number of edges with different support distributions. Then, based on Sd (i.e., the distribution of the number of edges with different support), the number of edges in the k-class corresponding to different k values ​​is estimated, and the workload (time) of the iteration corresponding to the k value is further predicted. Thus, the average partition point is calculated, and the k value interval (prediction) is divided into each execution unit.

[0081] (3) Task partitioning based on the number of edges

[0082] Theoretical analysis shows that the actual time taken for triangle counting is the sum of the time taken for each edge. Similarly, the time for the truss decomposition stage is approximately equal to the sum of the time taken to strip all edges for that task (for a given k value). The time taken for triangle counting / decomposition is roughly the same for most edges. Therefore, by estimating the number of edges corresponding to the k value and the number of remaining edges, we can estimate the total computational cost for a given range, such as for [k]. l ,k r The computational cost is approximately equal to that of a support greater than k. l The number of all edges plus support in [k l ,k rThe sum of all edges between [ ]. Finally, we divide the k value into corresponding intervals based on the number of task execution units, and the computational cost of each interval should be approximately the same.

[0083] (4) Task partitioning based on computation time prediction

[0084] Similar to task partitioning based on the number of edges, but the time is predicted based on the number of edges, and finally the interval is divided based on the predicted time of each round of tasks, so that the computation time of each interval is approximately the same.

[0085] (5) Initial support of each unit

[0086] For the range of k values ​​[k l ,k r ],k l < k r , k l For each task execution unit whose support is not 2, the support must first be reinitialized by creating a local support array of size m. The next step is filtering, retaining edges that meet the condition (support value greater than or equal to k). l (The edges), and perform triangle calculations on the remaining edges, which is the initialization of the support part.

[0087] (6) Perform k-truss decomposition on each unit.

[0088] Each execution unit computes its own task, i.e., the range [k]. l ,k r Referring to the original PKT method, from k l -1 starts (here k) l The value obtained by -1 is inaccurate because some edges were filtered out during the filtering process. In this case, k l The -1 structure is incomplete, but it must start from this level because the PKT method requires the calculation results of the previous round in each iteration. In the small iterations that calculate each k value, the edges are traversed in parallel, and the edges that meet the conditions are removed. Their class value is recorded as k. Before removal, the edges of other triangles formed by the affected edge are stripped, and the affected edges that meet the removal conditions are added to the next round of removal. This continues until no edges can be removed, k is incremented by 1, and the next large iteration begins, until the entire interval has been calculated.

[0089] (7) Update the list of global k values

[0090] After the first execution unit finishes its decomposition task, it sets the global support array to zero. After each execution unit completes its calculation, it iterates through the local support array (i.e., the class value array) and updates the global support array. The update rule is that if the size of the local support array is within its own task range and the corresponding value in the global array is less than the local value, then an atomic update is performed.

[0091] For those skilled in the art, various corresponding modifications can be made based on the above technical solutions and concepts, and all such modifications should be included within the scope of protection of the claims of this invention.

Claims

1. A Numa-aware community detection method based on k-truss decomposition, comprising a data input module, a support calculation module, and a K-truss decomposition module, characterized in that, The method includes the following steps: S1 reads the graph in text form from the graph data file stored on the hard disk through the data input module, puts the graph topology into memory, then constructs the CSR and generates an edge mapping array based on the CSR to build an edge set array. S2 uses the support calculation module to select a triangle counting method based on the graph size, graph density, and the balance of graph vertex degrees. S3 Calculate the support of each edge according to the method in step S2; S4 uses the K-truss decomposition module to perform decomposition, including calculating the size of any execution unit, calculating the task range of each unit, initializing the support of each unit, performing K-truss decomposition on each unit, and updating the global k-value list. The size of the computation task execution unit is calculated based on the number of server numa nodes, the number of physical cores, the size of the graph, and the density of the graph. When the graph size is large or the graph is sparse, more numa nodes are allocated to each unit; when the graph size is small or the graph is dense, fewer numa nodes are allocated to each unit. The task interval for calculating each unit includes traversing each edge and calculating the maximum support Sup. max Create a size of Sup max The array Sd ​​is used to iterate through each edge and calculate the number of edges with different support distributions. Then, based on Sd, the number of edges in the k-class corresponding to different k values ​​is calculated. The iteration workload corresponding to the k value is further predicted, and the average partition point is calculated to divide the k value interval into each execution unit. The initial support of each unit includes the range of k values ​​[k l ,k r ],k l <k r , k l For each task execution unit whose support is not 2, the support must first be reinitialized. First, a local support array of size m is created, then filtering is performed to keep the edges that meet the conditions, and triangle calculation is performed on the remaining edges, which is the support initialization part. The k-truss decomposition of each unit includes each execution unit computing its own task, i.e., the range [k l ,k r In each small iteration of calculating the value of k, the edges are traversed in parallel. Edges that meet the conditions are removed, and their class value is recorded as k. Before removal, the edges of other triangles formed by the edge are stripped, and the affected edges that meet the removal conditions are added to the next round of removal. Until there are no edges to remove, k is incremented by 1, and the next large iteration is entered until the entire interval is calculated. The updated global k-value list includes setting all global support arrays to zero after the first execution unit completes the decomposition task; after each execution unit completes the calculation, it traverses the local support array and updates the global support array. The update rule is that when the size of the local support array is within its own task range and the corresponding value in the global array is less than the local value, an atomic update is performed.

2. The community detection method based on k-truss decomposition using numa-awareness according to claim 1, characterized in that, Step S1 includes: S1.1 Read in data: Read the graph in text form from the graph data file stored on the hard disk and place the graph topology into memory; S1.2 Construct CSR compressed sparse rows. Based on the existing graph topology, obtain the number of vertices n and the number of edges m. Initialize two arrays with sizes n and 2*m, respectively, denoted as Eo and Nb. Eo stores the starting position of each vertex's neighboring vertices in Nb; Nb sequentially stores the IDs of each vertex's neighboring vertices. S1.3 Construct an edge mapping array. Based on the CSR from the previous step, construct an edge set array of size m, denoted as El. Each edge is represented in the form of (u,v). Each edge (u,v) and (v,u) is recorded only once in the form of (u,v). Then, traverse Eo and Nb, record the position of the edge formed by each vertex on Nb and the corresponding vertex on Eo on El, and generate the edge mapping array Eid.

3. The community detection method based on k-truss decomposition using numa-awareness according to claim 1, characterized in that, Step S2 includes the following steps when there are many cores / multiple numa nodes: for large graphs or small but sparse graphs, traversing by edge, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; for dense graphs, traversing by vertex, calculating triangles for each edge, and merging the neighboring vertices of the two edges to find the intersection; when using fewer cores / few numa nodes, traversing triangles by vertex, updating the support of edges for each triangle using atomic operations, and calculating edges using a bitmap.

4. The community detection method based on k-truss decomposition using numa-awareness according to claim 3, characterized in that, The method of traversing triangles by vertex updates the support of edges for each triangle using atomic operations, and the calculation is performed using a bitmap to find edges; the method of traversing edges by vertex calculates triangles for each edge, and the calculation is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection; the method of traversing edges calculates triangles for each edge, and the calculation is performed by merging the neighboring vertices of the two vertices of the edge and taking the intersection.

5. The community detection method based on k-truss decomposition using numa-awareness according to claim 1, characterized in that, Step S3 includes initializing an array of size m to record the support value corresponding to each edge. Triangles are traversed by vertex, and the support of each edge is updated by atomic operations on each triangle. The edge is calculated using a bitmap. Triangles are calculated for each edge, and the neighboring vertices of the two vertices of the edge are merged and their intersection is taken. After counting triangles for all vertices / edges, the support calculation is completed.

Citation Information

Patent Citations

  • Storage system cache prefetching method and system based on K-Truss graph and medium

    CN111506778A

  • Method and system for counting triangles in large-scale graph with low space overhead

    CN112131444A