Parallel single-source shortest path algorithm
A central problem in algorithmic graph theory is the shortest path problem. One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest path between every pair of vertices in a graph. There are classical sequential algorithms which solve this problem, such as Dijkstra's algorithm. In this article, however, we present two parallel algorithms solving this problem.
Another variation of the problem is the all-pairs-shortest-paths (APSP) problem, which also has parallel approaches: Parallel all-pairs shortest path algorithm.
Problem definition
Let be a directed graph with nodes and edges. Let be a distinguished vertex (called "source") and be a function assigning a non-negative real-valued weight to each edge. The goal of the single-source-shortest-paths problem is to compute, for every vertex reachable from , the weight of a minimum-weight path from to , denoted by and abbreviated . The weight of a path is the sum of the weights of its edges. We set if is unreachable from .[1]
Sequential shortest path algorithms commonly apply iterative labeling methods based on maintaining a tentative distance for all nodes; is always or the weight of some path from to and hence an upper bound on . Tentative distances are improved by performing edge relaxations, i.e., for an edge the algorithm sets .[1]
For all parallel algorithms we will assume a PRAM model with concurrent reads and concurrent writes.
Radius stepping algorithm
For the radius stepping algorithm, we must assume that our graph is undirected.
The input to the algorithm is a weighted, undirected graph, a source vertex, and a target radius value for every vertex, given as a function .[2] The algorithm visits vertices in increasing distance from the source . On each step , the Radius-Stepping increments the radius centered at from to , and settles all vertices in the annulus .[2]
Following is the radius stepping algorithm in pseudocode:
Input: A graph , vertex radii , and a source node . Output: The graph distances from . 1 , 2 foreach do , , 3 while do 4 | 5 | repeat 6 | | foreach s.t do 7 | | | foreach do 8 | | | | 9 | until no was updated 10 | 11 | 12 return
For all , define to be the neighbor set of S. During the execution of standard breadth-first search or Dijkstra's algorithm, the frontier is the neighbor set of all visited vertices.[2]
In the Radius-Stepping algorithm, a new round distance is decided on each round with the goal of bounding the number of substeps. The algorithm takes a radius for each vertex and selects a on step by taking the minimum over all in the frontier (Line 4).
Lines 5-9 then run the Bellman-Ford substeps until all vertices with radius less than are settled. Vertices within are then added to the visited set .[2]
Example

Following is a step by step description of the algorithm execution for a small example graph. The source vertex is the vertex A and the radius of every vertex is equal to 1.
At the beginning of the algorithm, all vertices except for the source vertex A have infinite tentative distances, denoted by in the pseudocode.
All neighbors of A are relaxed and .
Node | A | B | C | D | E | F | G |
---|---|---|---|---|---|---|---|
Tentative distance | 0 | 3 | 5 | 3 | 3 |
The variable is chosen to be equal to 4 and the neighbors of the vertices B, E and G are relaxed.
Node | A | B | C | D | E | F | G |
---|---|---|---|---|---|---|---|
Tentative distance | 0 | 3 | 6 | 5 | 3 | 8 | 3 |
The variable is chosen to be equal to 6 and no values are changed. .
The variable is chosen to be equal to 9 and no values are changed. .
The algorithm terminates.
Runtime
After a preprocessing phase, the radius stepping algorithm can solve the SSSP problem in work and depth, for . In addition, the preprocessing phase takes work and depth, or work and depth.[2]
References
- ^ a b Meyer, U.; Sanders, P. (2003-10-01). "Δ-stepping: a parallelizable shortest path algorithm". Journal of Algorithms. 1998 European Symposium on Algorithms. 49 (1): 114–152. doi:10.1016/S0196-6774(03)00076-2. ISSN 0196-6774.
- ^ a b c d e Blelloch, Guy E.; Gu, Yan; Sun, Yihan; Tangwongsan, Kanat (2016). "Parallel Shortest Paths Using Radius Stepping". Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures - SPAA '16. New York, New York, USA: ACM Press: 443–454. doi:10.1145/2935764.2935765. ISBN 978-1-4503-4210-0.