Parallel Radius-Stepping Method and System for Computing Single-Source Shortest Paths on Large-Scale Graphs

By dividing a large-scale graph into subprocesses to process vertices in parallel and using the Radius function to calculate the upper bound for vertex selection, the problem of low computational efficiency of the Radius-Stepping algorithm on large-scale graphs is solved, and faster single-source shortest path calculation is achieved.

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

Patent Information

Application Number
CN202210228944.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2025-11-14
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

The Radius-Stepping algorithm is computationally slow when dealing with single-source shortest paths on large-scale graphs, and existing parallel processing methods still suffer from inefficiency.

Method used

By dividing all vertices in a large-scale graph into several parts and assigning them to different subprocesses, and using the Radius function to calculate the upper bound of the temporary shortest path to filter and process vertices, multiple processes are used to process the update of the temporary shortest path in parallel. Finally, the root process summarizes and updates the set S to determine whether to continue the loop.

Benefits of technology

It improves the computational speed and efficiency of the Radius-Stepping algorithm on large-scale graphs, especially when the graph data is too large, it significantly improves the running speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741183B_ABST
    Figure CN114741183B_ABST
Patent Text Reader

Abstract

This invention discloses a parallel Radius-Stepping method and system for calculating single-source shortest paths on large-scale graphs. The method includes the following aspects: in the algorithm, the vertices in the graph data are pre-divided into several parts and assigned to corresponding processes for processing. After determining the set of vertices to be processed, each process processes the vertices of its corresponding part, and then the information is summarized. This invention utilizes multiple processes to update the temporary shortest path in parallel, which is faster than the serial Radius-Stepping algorithm, thus improving efficiency in practical applications and increasing the running speed of the Radius-Stepping algorithm when the graph data is too large.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graph computing, and more specifically, to a parallel Radius-Stepping method and system for computing single-source shortest paths on large-scale graphs. Background Technology

[0002] The Radius-Stepping algorithm is a sequential algorithm that uses a predefined function as input to a vertex and outputs a positive real number, with the inner loop step size being a continuously adjusted value. Furthermore, the Radius-Stepping algorithm processes (k, ρ) graphs more quickly; converting the graph to (k, ρ) beforehand can further improve its efficiency.

[0003] However, the Radius-Stepping algorithm is slow to calculate the single-source shortest path in real time when dealing with large-scale graphs.

[0004] Existing technology discloses a method for processing large-scale graph data to address the inefficiency of existing methods. The technical solution involves converting each parallel job into a series of global iterative jobs, with each iteration consisting of three ordered phases: computation, global communication, and fence synchronization. Computation is divided into global computation and local computation, where local computation comprises a series of consecutive internal iterations. During the global communication phase, each worker node sends the message for the current global iteration to the worker node that will proceed to the next global iteration. During the fence synchronization phase, the master node waits for all worker nodes to complete message passing before starting the next global iteration. However, this solution also suffers from inefficiency. Summary of the Invention

[0005] The primary objective of this invention is to provide a parallel Radius-Stepping method for computing single-source shortest paths on large-scale graphs, thereby improving the efficiency of the Radius-Stepping algorithm.

[0006] A further objective of this invention is to provide a parallel Radius-Stepping system for computing single-source shortest paths on large-scale graphs.

[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0008] A parallel Radius-Stepping method for computing single-source shortest paths on large-scale graphs includes the following steps:

[0009] S1: For a large-scale graph to be computed, maintain a temporary shortest path and a set S for all vertices in the large-scale graph, where set S is a subset of the vertices in the large-scale graph;

[0010] S2: Divide all vertices in the large-scale graph into several parts and assign them to different subprocesses;

[0011] S3: Calculate an upper bound based on the temporary shortest path of each vertex, the set S, and the Radius function; and filter the vertices that need to be processed based on the upper bound.

[0012] S4: Each subprocess processes the corresponding vertex to obtain the updated temporary shortest path;

[0013] S5: The root process summarizes the updated temporary shortest path obtained after processing by all child processes and then passes it to all child processes;

[0014] S6: Update set S based on the upper bound calculated in step S3, and determine whether to continue the loop. If to continue, return to step S3; if not to continue, output the shortest path of all vertices in the large-scale graph.

[0015] Preferably, in step S1, a temporary shortest path is maintained for all vertices in the large-scale graph, specifically as follows:

[0016] Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity.

[0017] Preferably, the set S in step S1 specifically includes:

[0018] The set S initially contains only the source points of the large-scale graph.

[0019] Preferably, in step S2, all vertices in the large-scale graph are divided into several parts and assigned to different sub-processes, specifically as follows:

[0020] Set the number of child processes k. Based on the number of vertices in the large-scale graph and the set number of child processes k, divide all vertices in the large-scale graph into k equal parts and assign them to different child processes.

[0021] Preferably, in step S3, the upper bound of the temporary shortest path is calculated based on the temporary shortest path of each vertex, the set S, and the Radius function. The specific calculation formula is as follows:

[0022]

[0023] In the formula, v represents a vertex, δ(v) represents the temporary shortest path to vertex v, r(v) represents the radii function with vertex v as input, and d i This represents the upper bound of the temporary shortest path, and i represents the number of iterations.

[0024] Preferably, in step S3, the vertices that need to be processed are selected. If the temporary shortest path of a vertex is less than the upper bound of the temporary shortest path, then the vertex is selected as the vertex that needs to be processed.

[0025] Preferably, updating set S in step S6 specifically involves:

[0026] Set S is updated to the set of vertices v whose temporary shortest paths are less than the upper bound of the shortest path.

[0027] Preferably, determining whether to continue the loop in step S6 specifically involves:

[0028] Determine whether all vertices in the large-scale graph are in set S. If they are, determine that the loop should not continue; otherwise, determine that the loop should continue.

[0029] A parallel Radius-Stepping system for computing single-source shortest paths on large-scale graphs includes:

[0030] The maintenance module maintains a temporary shortest path and a set S for all vertices in the large-scale graph to be computed, where set S is a subset of the vertices in the large-scale graph.

[0031] A partitioning and allocation module, which divides all vertices in the large-scale graph into several parts and allocates them to different subprocesses;

[0032] The upper bound calculation module calculates an upper bound based on the temporary shortest path of each vertex, the set S, and the Radius function, and then filters the vertices that need to be processed based on the upper bound.

[0033] The subprocess processing module uses each subprocess to process the corresponding vertex to obtain the updated temporary shortest path.

[0034] The aggregation module is formed by the root process aggregating the updated temporary shortest paths obtained after processing by all child processes, and then passing them on to all child processes.

[0035] The loop determination module updates the set S based on the upper bound calculated by the upper bound calculation module, and determines whether to continue the loop. If it continues, the upper bound calculation module recalculates the upper bound; if it does not continue, it outputs the shortest path of all vertices in the large-scale graph.

[0036] Preferably, the maintenance module maintains a temporary shortest path for all vertices in the large-scale graph, specifically as follows:

[0037] Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity.

[0038] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0039] This invention utilizes multiple processes to update the temporary shortest path in parallel, which is faster than the serial Radius-Stepping algorithm, thus improving efficiency in practical applications and increasing the running speed of the Radius-Stepping algorithm when the graph data is too large. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the method flow of the present invention.

[0041] Figure 2 A schematic diagram of a scale-free BA network provided for an example.

[0042] Figure 3 A schematic diagram of an ER random network provided for an embodiment.

[0043] Figure 4 A schematic diagram of a rule network provided for an embodiment.

[0044] Figure 5 A schematic diagram of a WS small-world network provided for an embodiment.

[0045] Figure 6 This is a schematic diagram of the system modules of the present invention. Detailed Implementation

[0046] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0047] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;

[0048] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0049] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0050] Example 1

[0051] This embodiment provides a parallel Radius-Stepping method for calculating the single-source shortest path on a large-scale graph, such as... Figure 1 As shown, it includes the following steps:

[0052] S1: For a large-scale graph to be computed, maintain a temporary shortest path and a set S for all vertices in the large-scale graph, where set S is a subset of the vertices in the large-scale graph;

[0053] S2: Divide all vertices in the large-scale graph into several parts and assign them to different subprocesses;

[0054] S3: Calculate an upper bound based on the temporary shortest path of each vertex, the set S, and the Radius function; and filter the vertices that need to be processed based on the upper bound.

[0055] S4: Each subprocess processes the corresponding vertex to obtain the updated temporary shortest path;

[0056] S5: The root process summarizes the updated temporary shortest path obtained after processing by all child processes and then passes it to all child processes;

[0057] S6: Update set S based on the upper bound calculated in step S3, and determine whether to continue the loop. If to continue, return to step S3; if not to continue, output the shortest path of all vertices in the large-scale graph.

[0058] In step S1, a temporary shortest path is maintained for all vertices in the large-scale graph, specifically as follows:

[0059] Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity.

[0060] The set S in step S1 is specifically:

[0061] The set S initially contains only the source points of the large-scale graph.

[0062] In step S2, all vertices in the large-scale graph are divided into several parts and assigned to different sub-processes, specifically as follows:

[0063] Set the number of child processes k. Based on the number of vertices in the large-scale graph and the set number of child processes k, divide all vertices in the large-scale graph into k equal parts and assign them to different child processes.

[0064] In step S3, the upper bound of the temporary shortest path is calculated based on the temporary shortest path of each vertex, the set S, and the Radius function. The specific calculation formula is as follows:

[0065]

[0066] In the formula, v represents a vertex, δ(v) represents the temporary shortest path to vertex v, r(v) represents the radii function with vertex v as input, and di This represents the upper bound of the temporary shortest path, and i represents the number of iterations.

[0067] In step S3, vertices that need to be processed are selected. If the temporary shortest path of a vertex is less than the upper bound of the temporary shortest path, then the vertex is selected as a vertex that needs to be processed.

[0068] The update of set S in step S6 specifically involves:

[0069] Set S is updated to the set of vertices v whose temporary shortest paths are less than the upper bound of the shortest path.

[0070] The step S6, determining whether to continue the loop, specifically involves:

[0071] Determine whether all vertices in the large-scale graph are in set S. If they are, determine that the loop should not continue; otherwise, determine that the loop should continue.

[0072] Example 2

[0073] This embodiment, based on embodiment 1, discloses specific implementation details:

[0074] The platform used in this embodiment is an AMD R5-3500U CPU (8GB) computer, with the operating system being the Linux subsystem within Windows 10, and a CPU count of 4. The programming language for implementing the algorithm is Python, version 3.6.9. The parallel algorithm is implemented using the Python library mpi4py, built on top of MPI.

[0075] The pseudocode of the algorithm in this embodiment is shown in Table 1:

[0076] Figure 2 , 3 Four, five, represent four common network graph types: BA scale-free network, ER random network, regular network, and WS small-world network. Based on the number of vertices and edges, six graph sizes were generated. The edge weights range from 1 to 100. These six graph sizes can be categorized as sparse or dense based on the ratio of vertex to edge count. Each of these six graph sizes includes the four common network graph types mentioned earlier, meaning this embodiment uses 24 graph data types. Considering the characteristics of regular network graphs, the dense regular network graph with 3000 vertices has fewer edges than the other three types. The parameters of these 24 graph data types are shown in Table 2.

[0077] Table 1

[0078]

[0079] The algorithm sequentially inputs 24 graph data points. First, it maintains a temporary shortest path for all vertices, with the source vertex having a temporary shortest path of 0 and the remaining vertices having initial temporary shortest paths of infinity. Simultaneously, it maintains a set S, initially containing only the source vertex s. Then, based on the number of vertices in the graph and a predetermined number of processes k, it divides all vertices into k equal parts. Next, it calculates an upper bound using the temporary shortest paths, set S, and the radius function, and uses this upper bound to select the vertices to be processed. Each process then processes the corresponding vertices selected in the previous step. The root process then summarizes the temporary shortest paths updated by all processes and passes the summarized information back to each process. Based on the upper bound determined above, it updates set S, checking if all vertices in the graph are in S. If so, the algorithm terminates; otherwise, it calculates another upper bound using the temporary shortest paths, set S, and the radius function, and repeats the subsequent steps.

[0080] The results of the embodiment are shown in Tables 3 and 4. It can be seen that when the graph data is extremely dense (the number of vertices is 3000 and the number of edges exceeds 4 million), the running speed is the fastest when using 3 processes. At this time, the parallel Radius-Stepping algorithm in this embodiment has improved efficiency compared with the original algorithm.

[0081] Table 2

[0082]

[0083] Table 3

[0084]

[0085] Table 4

[0086]

[0087] Example 3

[0088] This embodiment, based on Embodiment 1, provides a parallel Radius-Stepping system for calculating single-source shortest paths on large-scale graphs, such as... Figure 6 As shown, it includes:

[0089] The maintenance module maintains a temporary shortest path and a set S for all vertices in the large-scale graph to be computed, where set S is a subset of the vertices in the large-scale graph.

[0090] A partitioning and allocation module, which divides all vertices in the large-scale graph into several parts and allocates them to different subprocesses;

[0091] The upper bound calculation module calculates an upper bound based on the temporary shortest path of each vertex, the set S, and the Radius function, and then filters the vertices that need to be processed based on the upper bound.

[0092] The subprocess processing module uses each subprocess to process the corresponding vertex to obtain the updated temporary shortest path.

[0093] The aggregation module is formed by the root process aggregating the updated temporary shortest paths obtained after processing by all child processes, and then passing them on to all child processes.

[0094] The loop determination module updates the set S based on the upper bound calculated by the upper bound calculation module, and determines whether to continue the loop. If it continues, the upper bound calculation module recalculates the upper bound; if it does not continue, it outputs the shortest path of all vertices in the large-scale graph.

[0095] The maintenance module maintains a temporary shortest path for all vertices in the large-scale graph, specifically as follows:

[0096] Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity.

[0097] The same or similar labels correspond to the same or similar parts;

[0098] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0099] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A parallel Radius-Stepping method for calculating single-source shortest paths on large-scale graphs, characterized in that, Includes the following steps: S1: For a large-scale graph to be computed, maintain a temporary shortest path and a set S for all vertices in the large-scale graph, where set S is a subset of the vertices in the large-scale graph; S2: Divide all vertices in the large-scale graph into several parts and assign them to different sub-processes; S3: Calculate the upper bound of the temporary shortest path based on the temporary shortest path of each vertex, the set S, and the Radius function; and filter the vertices that need to be processed based on the upper bound of the temporary shortest path. S4: Each subprocess processes the corresponding vertex to obtain the updated temporary shortest path; S5: The root process summarizes the updated temporary shortest path obtained after processing by all child processes and then passes it to all child processes; S6: Update set S based on the upper bound calculated in step S3, and determine whether to continue the loop. If to continue, return to step S3; if not to continue, output the shortest path of all vertices in the large-scale graph. In step S1, a temporary shortest path is maintained for all vertices in the large-scale graph, specifically as follows: Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity; The set S in step S1 is specifically: The set S initially contains only the source points of the large-scale graph; In step S3, the upper bound of the temporary shortest path is calculated based on the temporary shortest path of each vertex, the set S, and the Radius function. The specific calculation formula is as follows: In the formula, v represents a vertex, δ(v) represents the temporary shortest path to vertex v, r(v) represents the radii function with vertex v as input, and d i This represents the upper bound of the temporary shortest path, and i represents the number of iterations. In step S3, vertices that need to be processed are selected. If the temporary shortest path of a vertex is less than the upper bound of the temporary shortest path, then the vertex is selected as a vertex that needs to be processed. The update of set S in step S6 is specifically as follows: Set S is updated to the set of vertices v whose temporary shortest paths are less than the upper bound of the shortest path; The step S6, determining whether to continue the loop, specifically involves: Determine whether all vertices in the large-scale graph are in set S. If they are, determine that the loop should not continue; otherwise, determine that the loop should continue.

2. The parallel Radius-Stepping method for calculating single-source shortest paths on large-scale graphs according to claim 1, characterized in that, In step S2, all vertices in the large-scale graph are divided into several parts and assigned to different sub-processes, specifically as follows: Set the number of child processes k. Based on the number of vertices in the large-scale graph and the set number of child processes k, divide all vertices in the large-scale graph into k equal parts and assign them to different child processes.

3. A parallel Radius-Stepping system for calculating single-source shortest paths on large-scale graphs, characterized in that, include: The maintenance module maintains a temporary shortest path and a set S for all vertices in the large-scale graph to be computed, where set S is a subset of the vertices in the large-scale graph. A partitioning and allocation module, which divides all vertices in the large-scale graph into several parts and allocates them to different subprocesses; The upper bound calculation module calculates an upper bound based on the temporary shortest path of each vertex, the set S, and the Radius function, and then filters the vertices that need to be processed based on the upper bound. The subprocess processing module uses each subprocess to process the corresponding vertex to obtain the updated temporary shortest path. The aggregation module is formed by the root process aggregating the updated temporary shortest paths obtained after processing by all child processes, and then passing them on to all child processes. The loop determination module updates the set S based on the upper bound calculated by the upper bound calculation module, and determines whether to continue the loop. If it continues, the upper bound calculation module recalculates the upper bound; if it does not continue, it outputs the shortest path for all vertices in the large-scale graph. For all vertices in the large-scale graph, maintain a temporary shortest path, specifically as follows: Set the temporary shortest path of the source vertex to 0, and set the initial temporary shortest path of the other vertices to infinity; The set S is specifically as follows: The set S initially contains only the source points of the large-scale graph; The upper bound of the temporary shortest path is calculated based on the temporary shortest path of each vertex, the set S, and the Radius function. The specific calculation formula is as follows: In the formula, v represents a vertex, δ(v) represents the temporary shortest path to vertex v, r(v) represents the radii function with vertex v as input, and d i This represents the upper bound of the temporary shortest path, and i represents the number of iterations. The vertex to be processed is selected if the temporary shortest path of the vertex is less than the upper bound of the temporary shortest path. The update set S is specifically as follows: Set S is updated to the set of vertices v whose temporary shortest paths are less than the upper bound of the shortest path; The determination of whether to continue the loop is as follows: Determine whether all vertices in the large-scale graph are in set S. If they are, determine that the loop should not continue; otherwise, determine that the loop should continue.

Citation Information

Patent Citations

  • Urban road network multi-source shortest path obtaining method based on common calculation and dijkstra algorithm

    CN114001747A

  • Computer-implemented k-shortest path finding method

    US20150256442A1