Parallel Reachability and Shortest Paths on Non-Sparse Digraphs: Near-Linear Work and Sub-Square-Root Depth
Abstract
We present parallel algorithms for computing single-source reachability and shortest paths on directed -vertex -edge graphs using near-linear work and depth whenever . At the extreme of , our reachability and shortest path algorithms have depth only and , respectively. The state-of-the-art parallel algorithms with near-linear work for both problems [11, 6, 17, 5, 4] require depth in all density regimes.
Keywords and phrases:
shortcut set, parallel reachability, hopset, parallel SSSPCategory:
Track A: Algorithms, Complexity and GamesFunding:
Aaron Bernstein: Supported by Sloan Fellowship, Google Research Fellowship, NSF Grant 1942010, and Charles S. Baylis endowment at NYU.Copyright and License:
Thatchaphol Saranurak; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysisAcknowledgements:
We would like to thank Shang-En Huang, who declined co-authorship despite being involved in our discussions.Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Single-source reachability and shortest paths (SSSP) are some of the most fundamental algorithmic problems on digraphs. Given a digraph on vertices and edges, and a source , reachability asks for the set of all vertices that can reach, and shortest paths for the distances from to for all . While the solutions to these problems are fairly well understood in the sequential setting – reachability is solvable in time using a breadth-first search (BFS) and shortest paths in time111Here and throughout, we use the notation to suppress polylogarithmic factors. using Dijkstra’s algorithm – we are much more limited in our understanding of these problems in other computational models. We focus on these problems under the parallel setting in this paper.
The work of a parallel algorithm is the number of primitive operations it performs on an input of size , which can be interpreted as the running time of the algorithm when sequentialized, i.e., the running time with just one processor. Ideally, asymptotically equals the best sequential running time in which case we call the algorithm work-efficient. For example, a work-efficient algorithm for reachability would have , matching the running time of BFS. We call a parallel algorithm nearly work-efficient if matches the best sequential running time up to polylogarithmic factors. We interchangeably use the terms depth or span of a parallel algorithm to refer to the length of the longest chain of sequential dependencies in the algorithm, which can be interpreted as the fastest parallel time the algorithm could possibly run in, i.e., the running time when given an unconstrained number of processors.
In this paper, we give nearly work-efficient algorithms for both single-source reachability and SSSP that have depth on non-sparse digraphs. Prior to our work, the state-of-the-art nearly work-efficient algorithms for both reachability and SSSP had depth at least for all graph densities, achieved by [11, 4] and [17, 5, 4] respectively.
1.1 Prior Work and Background
Background on Parallel Reachability
The two most basic algorithms for parallel reachability are (i) using parallel matrix multiplication to compute the transitive closure of which, while highly parallel with depth, is not remotely work-efficient; and (ii) using parallel BFS which, while work-efficient, unfortunately has span proportional to the depth of the BFS-tree of , which is on worst-case inputs. Until somewhat recently, no nearly work-efficient algorithm with sublinear depth had been known. The breakthrough of Fineman [8] gave the first nearly work-efficient algorithm with sublinear depth . This was then built upon by Jambulapati, Liu, and Sidford [11] to give a nearly work-efficient algorithm with depth, which remains the best known upper bound. This algorithm can also be generalized to give a work-span tradeoff [7].
Both [8, 11] utilize a framework based on shortcut sets, which dates back to [19]. A -shortcut set of is a set such that the reachability relations of and are the same, and for any such that reaches , there is a path from to using at most hops in . Given a -shortcut set , one may compute single-source reachability in work and depth by computing a parallel BFS on from source . There is a folklore construction of an -shortcut set with : randomly sample vertices and add all shortcut edges where and are sampled vertices such that can reach in . This was (at the time of [8, 11]) the best known existential bound, but no efficient algorithmic constructions meeting these bounds were known, even in the sequential setting. The breakthrough of [8] was a nearly work-efficient construction of an -shortcut set with linear size. [11] then gave the first nearly work-efficient construction of a shortcut set that essentially matches the folklore bound. The key technical contribution to both results was the first near-linear time sequential construction of said shortcut sets, which they then showed how to parallelilize.
Both [8] and [11] construct a shortcut set with only edges. But for many problems, and for parallel reachability in particular, a shortcut set with edges would do just as well. For non-sparse graphs, allowing to contain more edges is conceptually advantageous because the folklore construction can be tuned to achieve a -shortcut set with , by simply sampling more vertices. Unfortunately, the constructions of [8, 11] are not so readily tunable in this way, so we do not have any efficient algorithmic constructions of these denser hopsets, even in the sequential settings. In this paper, we give a near-linear time sequential construction of an size -shortcut set where scales with the density of the base graph; for any polynomially larger than , we achieve polynomially better than . We can further improve the tradeoff with fast matrix multiplication: at the extreme case, if , our construction essentially matches the bounds of the tuned folklore construction, generalizing [11]. We then show that all our sequential bounds can be easily parallelized, leading to nearly work-efficient parallel reachability algorithms with significantly lower depth in non-sparse graphs.
Background on Parallel Shortest Paths
Rozhoň ⓡ222A randomized author ordering generated in the cited work is delimited by ⓡ separators. Haeupler ⓡ Martinsson ⓡ Grunau ⓡ Zuzic [17] gave a blackbox reduction from SSSP to single-source -approximate shortest paths, so we focus on the latter.
A similar framework to computing shortcut sets followed by parallel BFS is viable for approximate shortest paths. Instead of BFS, one uses an algorithm of Klein and Subramanian [12] for finding (exact) shortest hop paths in work and span. And instead of a -shortcut set, one constructs a so-called -hopset of which is a set such that for all , where is the length of the shortest path using at most hops. The folklore shortcut set is easily adapted to showing the existence of -hopsets with . Analogously, Cao, Fineman, and Russell [6] adapted the shortcut set construction of [11] to give a near-linear time construction of an -hopset with , essentially meeting this folklore bound. A work-span tradeoff was then later given in [7].
Just as with shortcut sets, the requirement that is sometimes too stringent. The folklore hopset can in the same way be tuned to give an -hopset with by sampling more vertices, but the hopset of [6] does not immediately generalize in this way. In this paper, we give a near-linear time sequential construction of an size -hopset where scales with the density of the base graph. This is then parallelized and plugged into the abovementioned framework to get faster nearly work-efficient parallel SSSP algorithms.
1.2 Our Results
See Figure 1 for a quick comparison of our main results with the strongest known bounds prior to this work. Note that the parallel SSSP algorithm is purely combinatorial; for reachability, we get a better tradeoff using fast matrix multiplication.
Parallel Reachability and Shortcut Sets
Our main result is on parallel reachability.
Theorem 1 (Parallel Reachability).
Let be the fast matrix multiplication exponent in the work for parallel algorithms using polylogarithmic (in ) span. There is an work and span randomized parallel algorithm that, given an unweighted digraph and source , outputs with high probability all vertices that can reach and all vertices that reach .
Using the fact that (by [1] and Proposition 5), we can compute reachability in work and span ( span when ). The previous best span for nearly work-efficient algorithms for reachability was at least , regardless of digraph density: [11] achieves depth , while the min-cost flow algorithm of [4] reduces the depth to when .
The technical developments used to get the parallel reachability algorithm of Theorem 1 is largely a near-linear time sequential construction for a -shortcut set with size .
Theorem 2 (Sequential Shortcut Set).
Let be the fast matrix multiplication exponent. There is an time randomized algorithm that, given an unweighted digraph , outputs with high probability a -shortcut set with size .
More generally, we show the following tradeoff which the above is a special case of. Let . There is an time randomized algorithm that, given an unweighted digraph , outputs with high probability an -shortcut set with size .
Refer to Table 1 for the spans of our algorithms given for different values of shown in a tabular format, summarizing Theorem 1 and Theorem 2. Of particular interest are the extremes where Theorem 2 outputs, if , a combinatorially constructed -shortcut set and, if an -shortcut set almost matching the tunable folklore shortcut set in its parameters. Also of note: the tradeoff given by Theorem 2 is strictly better than that given by [7], which is a randomized time construction of an -shortcut set with size ; most crucially, because of the term, their tradeoff could not achieve near-linear work for any graph density.
Parallelizing the previous state-of-the-art near-linear size -shortcut set of [11] was, while important, somewhat tedious. Using the new technology of [9], we can easily parallelize Theorem 2 – see Theorem 16 for details – and consequently use the parallel construction to immediately get our main result Theorem 1.
| Value of | Span (or ) | Span (or ) when |
|---|---|---|
| (Combinatorial): | ||
| (Ideal): | ||
| (Current [1]): |
Parallel SSSP and Hopsets
We then show analogous results for SSSP, albeit with slightly weaker bounds. The details of these results can be found in the full version.
Theorem 3 (Parallel SSSP).
There is an work and span randomized parallel algorithm that, given a polynomially bounded non-negative integer weighted digraph and source , outputs with high probability for all along with a shortest path tree rooted at .
On dense digraphs, this gives a nearly work-efficient span algorithm for SSSP. The previous best span for nearly work-efficient algorithms for SSSP was at least , similar to the previous state of reachability: [17, 5] achieve depth , while the min-cost flow algorithm of [4] reduces the depth to when .
Analogously to parallel reachability, the main driver of Theorem 3 is a near-linear time sequential construction of a -hopset with size .
Theorem 4 (Sequential Hopset).
There is an time randomized algorithm that, given a polynomially bounded non-negative integer weighted digraph , outputs with high probability a -hopset with size .
More generally, we show the following tradeoff which the above is a special case of. Let . There is an time randomized algorithm that, given a polynomially bounded 333Since we ultimately intend to compare our SSSP bounds with [17], we assume polynomially bounded edge weights the same way they have. Without this polynomial bound, our running time and hopset size suffers a factor where is the largest weight in . non-negative integer weighted digraph , outputs with high probability a -hopset with size .
In particular, Theorem 4 on dense digraphs runs in time and shortcuts -approximate shortest paths to hops, whereas the previous best hop bound was given by [6] for all density regimes. Similarly to shortcut sets, the tradeoff of Theorem 4 is strictly better than (the sequential version) of [7].
We get Theorem 3 by parallelizing Theorem 4, again simply, using the new technology of [9] – see the full version for details on said parallelization.
Due to technical complications described in the full version, not all of the ideas used for shortcut sets (Theorem 2) go through for constructing hopsets (Theorem 4). Nevertheless, the main conceptual ideas do indeed go through, allowing us to match the bound in the combinatorial version of Theorem 2, i.e. when (see Table 1 for more on the combinatorial version).
Related Work on Shortcut Sets and Hopsets
There exists a rich literature on shortcut sets and hopsets with stronger existential bounds than the folklore construction [14, 13, 3, 15, 16] though currently no near-linear time construction of is known, even in the sequential setting. In particular, the breakthrough of [14] showed the existence of a -shortcut set with size which, if constructible in near-linear work, would give a depth algorithm for reachability. Along another direction, [2] recently showed a deterministic construction of an -shortcut set with size in almost-linear time. We include a more detailed discussion of these related works in the full version.
1.3 Organization
Preliminaries are covered in Section 2. A high-level overview of our main technical ideas is then provided in Section 3. The core of the parallel reachability result is in Section 4 (which goes over a sequential construction of shortcut sets) and finished up in Section 5 where parallelization of the sequential construction is discussed. For the core of the parallel SSSP result (which goes over a sequential construction of hopsets) and open problems, see the full version.
2 Preliminaries
Numbers and Sets
For any positive integer , we use to denote . For integers , we use to denote .
Graphs
In this paper we work with unweighted digraphs and also weighted digraphs . We use (or when unambiguous, ) to refer to the vertex set of and (or when unambiguous, ) to refer to the edge set of . An edge pointing from vertex to vertex is denoted with . For any we use to denote the subgraph of induced on . When it is clear, we use and .
Paths and Distances
A path using hops is a sequence of vertices where . A subpath of is a path of the form with . If we say a path is split into subpaths we mean that the are disjoint and .
Hopbounds
We say that a digraph has reachability hopbound if for all such that reaches , there is a path using at most hops from to .
Shortcut Sets
is a -shortcut set of a digraph if 1) for all , which we call shortcuts, there is an -path in and 2) The reachability hopbound in is not more than .
Reachability Relations and Relevant Vertices
If there is a path from to we say reaches and also is reached by ; we say here that and are related. is the set of all vertices reaches in and is the set of all vertices which reach in . We denote the set of relevant vertices to with . These are extended to sets in the natural way; for example, .
Path-related Vertices (Ancestors, Descendants, Bridges)
For any path , we call its ancestors and its descendants and finally its bridges.
Fast Matrix Multiplication
We use the following result for parallel matrix multiplication, which states that we can multiply matrices with work matching the current best sequential time complexity of [1] and span only .
Proposition 5 (Paraphrasing (with some modification) of Theorem 5.7 Part 1 in [10]).
Let and be two by matrices with entries in a ring with operations . The matrix can be computed by a parallel algorithm with span and work, where is the best known sequential bound for computing over by an algorithm that can be written as an algebraic circuit with gates.
That is to say, throughout this paper (even in the parallel setting) which is established by [1], whose (sequential) algorithm satisfies the premise of Proposition 5.
Probability
We use the following one-sided Chernoff bound for sums of independent random variables with mean :
3 High-Level Overview
Here we give a sketch of the main ideas in this paper. To obtain our result, we introduce a new pruning step into the framework of [11, 6], respectively called TC-Pruning and TruncSSSP-Pruning. The main technical contribution is actually in the analysis of this. We sketch a new top-down analysis of [11, 6] which naturally suggests how to apply the pruning steps, leading to the improvements below. Since the core insights can be found within our reachability result, which is much simpler, we omit any discussion of SSSP in this overview.
3.1 Summary of Prior Work
By using standard techniques, the reachability problem on a digraph is reduced to constructing a shortcut set of ; indeed, if one can construct a -shortcut set in work and span, then one gets a parallel reachability algorithm by running a parallel BFS from the source on , which takes an additional work and span (so, in sum, an -work and -span algorithm). We thus focus on the problem of constructing a shortcut set.
[11] refines the breakthrough of [8] to give an work algorithm which constructs an -shortcut set in span . As a precursor to this, they give a sequential time algorithm which constructs an -shortcut set with size, henceforth called the JLS shortcut set. We first turn our attention to this sequential construction.
Let us assume is a directed acyclic graph (DAG). Suppressing some details (e.g. parameter settings) that are inessential to an overview, the JLS algorithm can be described recursively in the following way, where is the level recursive instance. On a level recursive instance , where , some pivot vertices are selected randomly. For each and , if reaches then add to the shortcut set, and if reaches then add to the shortcut set. Next, we partition into an equivalence relation based on the reachability relation to in ; that is, for all and , we have iff the set of pivots in that reach and are equal and the set of pivots in that and reach are equal. We then set each to be a level recursive instance. A complete description of JLS is given later in Section 4.
For appropriately chosen parameters, the above algorithm runs in time and yields an -shortcut set with near-linear size.
Framework for Bounding the Diameter
To bound the diameter of JLS, we fix an arbitrary path and show that is shortcut to length . First, observe that at any fixed recursion level, say , the path is split into contiguous subpaths each belonging to distinct level recursive instances respectively. To see this, note that if a pivot vertex reaches (resp. is reached by) any two vertices in , then it reaches (resp. is reached by) every vertex on the subpath between said two vertices in ; thus, if and are in the same subproblem , then so are all the vertices on any path from to . (See Observation 8 for the formal proof.)
We use this observation to define the subproblem tree of , which tracks how is shortcut. (i) The root node444Here and throughout, we use “node” to refer to the nodes of subproblem trees, which are analysis tools which our algorithms are not aware of, and “vertex” to refer to the vertices of digraphs, which are the objects our algorithms interface with. of this tree, at level , is ; (ii) If a bridge of a level node is selected in the recursion level instance (in which is contained) then is a leaf node and, otherwise, has level children nodes corresponding to how is split. The reader should observe that each leaf is shortcut to hops (moving through the bridge of ) and, hence, the number of nodes in the subproblem tree upper bounds the number of hops is shortcut to (up to a constant factor).
[11] shows that the number of nodes in the subproblem tree of any path is bounded above by . Crucially, they use the following key lemma within a bottom-up argument by induction:
| (Proposition 11) |
where (in subproblem ) is an arbitrary internal node in the subproblem tree and are the pivots selected in that split into subpaths in subproblems respectively. Recall (from Section 2) that are the vertices in that can reach or are reached by some vertex in .
We suggest that Proposition 11 is best interpreted in the following way. Intuitively, splitting a path into is detrimental to shortcutting (and hence ) since the algorithm will no longer be able to add any shortcut between and for . For example, if , then there would no longer be any hope of shortcutting to hops. On the other hand, Proposition 11 shows that splitting a path still offers progress: the number of relevant vertices to drops significantly. Since and each is a bridge of some , the fraction of bridges increases555This is not entirely true, since bridges of may cease to be bridges of for any .. It is consequently more likely to select bridges as pivots and shortcut the subpaths that is split into to hops each.
3.2 Summary of Our Main Result
We now sketch a new proof of the diameter bound of JLS, which reveals an opportunity to lessen the diameter of the shortcut set to at the expense of having more edges in the shortcut set. Thereafter, we will show concretely how to exploit this opportunity by adding just one line to JLS.
A New, Top-Down, More General Analysis of the JLS Diameter Bound
For simplicity’s sake, let us assume something stronger than Proposition 11: that the typical scenario occurs deterministically.
| (Idealized Proposition 11) |
Assuming Idealized Proposition 11 above does not change any structure of our argument and only removes clutter related to formalization of probabilistic guarantees.
Given this, we first bound the number of nodes in the subproblem trees.
Claim 6.
For all , there are at most nodes in the subproblem tree where .
Proof Sketch.
Define the function . We will show and from there the bound follows since each with contributes to the sum.
To see that , observe that ; the subproblem tree has levels (we have not justified this in the overview, see Section 4); and
where the first inequality is by Cauchy-Schwarz and the second is by Idealized Proposition 11.
By plugging in , we recover the diameter bound of JLS. Even more, we may plug in other values of to get more refined upper bounds. Noting that the fanout of the subproblem tree is polylogarithmic (another detail omitted here), this suggests the following type of strategy: shortcut all nodes with to hops. We can then consider the pruned subproblem tree of with all nodes where removed. By Claim 6, the number of nodes in the pruned tree is at most up to polylogarithmic factors, which upper bounds the number of hops to which is shortcut.
A Simple Combinatorial Improvement (Warmup)
Assume the input digraph is dense – that is, it has edges. Denote as the first vertices found in a BFS in starting from .
Here is a simple modification to the JLS algorithm. For each recursive subproblem and each , add all the following edges to the shortcut set: edges from to .
Note that runs in time, totaling up to time over all the calls made in all recursive subproblems. This additional step thus gives a negligible overhead to the running time of JLS.
Crucially, for any node in the subproblem tree with , the edge will be added to the shortcut set since . Namely, is shortcut to hops and is removed from the pruned subproblem tree which, accordingly, has nodes by Claim 6 (which, recall, upper bounds the length is shortcut to).
In summary, this simple modification to JLS gives a near-linear time construction of an -shortcut set on dense digraphs .
A Stronger but Non-Combinatorial Improvement
Our main result for reachability does not use the combinatorial improvement above, but instead utilizes fast matrix multiplication. Here we just briefly summarize the idea and leave the details to Section 4. Instead of computing from each in every recursive subproblem as in our warmup, we get even more of a speed up from loosely speaking computing shortcuts in an “all-pairs” fashion (i.e. transitive closures). This is easier said than done since one call to a transitive closure algorithm is more expensive than one BFS call; we must thus be judicious of when and on what vertices to call the transitive closures (instead of from every vertex like we did with BFS).
When is small (at the threshold where we wish to prune away the node from the subproblem tree of ), one might try to call a transitive closure on a ball centered at for some . The flaw in this idea is that the choices made by the algorithm must be oblivious to . A more oblivious approach would be to call a transitive closure on for some pivot . However, is not necessarily the same as since may not be a vertex in . In fact, may reach or be reached by many vertices that have no reachability relation to , and hence might be very large despite being very small; calling a transitive closure on may then be too expensive!
Instead, we do the following. For every pivot , if is small enough, we add all edges in the transitive closure of to the shortcut set. This can be done in time by repeatedly squaring the adjacency matrix of . By virtue of being small, we have control over the running time of this improvement. Moreover, since all edges in the transitive closure of are added to the shortcut set, would not contribute any children to the node . But would it allow us to prune the node completely when is small? Not quite. We show in Section 4 that it allows us to prune nodes in the subtree rooted at so that the pruned subtree has nodes; loosely, the argument is as follows: for any node in this subtree, if all have small then has at most one child and, otherwise, there is some with large , certifying that it is very unlikely for any vertex in to be sampled as a pivot. This yields the -shortcut set in near-linear time for dense graphs.
Parallelization
Finally, we parallelize the shortcut set construction by using a blackbox framework provided by [9]. Morally, the framework says that (up to some fudging) we need only guarantee that a parallel algorithm for computing a -shortcut set runs in span on DAGs with reachability hopbound ; this is enough to show that a -shortcut set runs in span on any digraph, regardless of its diameter. It is easy to show that our sequential construction for -shortcut sets run in span on DAGs with reachability hopbound , since BFS calls will run in span .
4 Sequential Shortcut Set Construction
In this section we prove Theorem 2 which pertains to a sequential construction of shortcut sets. Section 4.1 gives an overview of the JLS shortcut set and outlines a strategy for how to improve upon it. We then go over the details in Section 4.2 and finish things up in Section 4.3.
4.1 The JLS Shortcut Set, and a Strategy for Improved Bounds
The JLS shortcut set, which is a refinement of the construction of Fineman [8], can be summarized at a high level as follows. We first assume the input is a DAG (since it is easy to compute strongly connected components (SCCs) in a digraph in linear time and, adding edges to the shortcut set, shortcut each SCC to two hops). There is a global parameter , which we can think of as , that controls a sampling rate and recursion depth . The construction is found via a recursive algorithm where at recursion level , around pivot vertices from the base graph are selected uniformly at random (these pivots are divided up possibly unequally among all level subproblems on graphs ). Let us focus on one level subproblem, say, . Reachability within is computed for the pivots belonging to and based on this the following actions are made:
-
For each pivot , add the edges (resp. ) to the shortcut set if reaches (resp. is reached by) .
-
For each , give it a set of labels based on its reachability relation to the pivots. That is, for all pivots and (i) if reaches , give the label “ reaches me”; (ii) if reaches , give the label “I reach ”; (iii) otherwise give the label “I have no relation to ”.
-
Recurse into where the ’s are an equivalence class in using the labeling above. That is, iff and have the exact same labels.
The aggregate of added shortcuts forms the JLS shortcut set. Below we give a formal description of the algorithm.
JLS
Global Parameters: is a global parameter to be fixed later. is the number of vertices in the base input graph (it thus remains fixed through all recursive calls).
Input: A DAG and a recursion level .
Output: A shortcut set .
-
1.
Randomly and independently sample, with probability , each as a pivot. Let be the set of pivots.
-
2.
For each , compute , and:
-
Add to for all .
-
Add to for all .
-
Add label to all .
-
Add label to all .
-
-
3.
Partition of all such that iff and have the exact same labels.
-
4.
Output .
Proposition 7 (Paraphrasing Theorem 5 from [11]).
JLS runs in time and produces an -shortcut set of size with probability at least .
The above is proved in [11], with the running time and size bounds following quite easily from Proposition 9 (stated later) and Chernoff bounds. Modulo a few key statements, we will give an alternate (and more extendable) proof of the diameter bound in Section 4.2. For now, let us try to better understand the JLS shortcut set at a high level and, from this, outline a strategy for how to get a better shortcut set.
The Subproblem Tree
The way the diameter of the shortcut set is upper bounded comes from [8]. There, an arbitrary path is selected for the sake of analysis. Notice first that is split into contiguous subpaths in the recursive calls and the same is true of its subpaths, and so on. More specifically, observe the following (shown in [11]).
Observation 8.
Let be a subpath of , contained in a level recursive instance . If of the non-bridge vertices in are chosen as pivots at level , then is split into at most disjoint subpaths belonging to distinct level recursive instances .
Proof.
Let and be the set of pivots selected from . If reaches , then it reaches for . Similarly, if is reached by , then it is reached by for . Thus, if and are related to in the same way, then all have the same relation to . Since there are at most locations where the reachability relation can change, there are at most subpaths.
We will examine how evolves (i.e. is split and shortcutted) through the execution of JLS more carefully. To do this, we think of the subproblem tree of . Each node of the subproblem tree is associated with some subpath of , and the tree can be described as:
-
Root node . This is the th level of the tree.
-
For each node in level of the tree (i.e. is contained in a level recursive instance ), if a bridge of in is sampled at level , then is a leaf. Note that in this case has been shortcut to hops since, denoting and the sampled bridge , the edges and are added to the shortcut set.
-
Otherwise, the path is split in the instance into subpaths belonging to level recursive instances . The node will have children at level of the tree.
It is important to note that the algorithm is not aware of this subproblem tree and it is merely a tool for our analysis. Crucially, the number of nodes in this subproblem tree is (up to a constant factor) an upper bound on the number of hops that is shortcutted to since we can traverse from the start of to the end along the leaves (which have been shortcutted to hops) and the edges joining the leaves.
Our Strategy
[11] shows that the subproblem tree of any path has at most nodes. We employ algorithmic tactics to prune away nodes from this tree in our analysis, to the extent that the tree we analyze has a substantially smaller number of nodes. For example, a node in recursive instance may have a large subtree in ’s subproblem tree. If we are able to identify some structure in so that is immediately shortcutted to hops, we are then permitted to ignore the subtree rooted at in our analysis.
In view of this, we will use a pruning strategy (called TC-Pruning) which prunes away all nodes where is small. Using our new analysis of the diameter of the JLS shortcut set, we will be able to say that the number of nodes where is large is much less than , which yields our improvement. See Section 4.2 for details.
We close this subsection with the following crucial lemma from [11] which says that the size of balls around vertices are exponentially decreasing in , the recursion level.
Proposition 9 (Paraphrasing Lemma 4.1 from [11]).
With probability at least , the following event holds. For all recursion levels , for all level recursive instances ,
for all .
We omit rewriting a formal proof of Proposition 9, but this follows from a simple induction on the recursion level: if at level , then it is true also for level and, otherwise, one of the first ancestors of (say ) will be sampled as a pivot with high probability, precluding any of the later ancestors from being retained in at level since they receive the label “I have no relation to ” while receives the label “ reaches me”.
4.2 Bounding the Diameter Achieved From Using TC-Pruning on JLS
In this subsection, we first focus only on the reachability hopbound guarantee for Theorem 2. We will later analyze the size of the shortcut sets and construction time in Section 4.3.
Theorem 10.
Let . The union of independent calls to JLS with TC-Pruning outputs an -shortcut set with high probability.
To begin, TC-Pruning uses the transitive closure of subgraphs as a subroutine call. We use to denote all edges in the transitive closure of a digraph ; that is, if and only if can reach in . Note that can be computed in time using repeated squaring of the adjacency matrix of .
The very simple modification to JLS is then described below (the text is mostly JLS from the previous section, with the only substantial change being the addition of the ✏ line); we add edges from the transitive closure of the ball of each pivot if said balls are small.
JLS with TC-Pruning
Global Parameters: and are global parameters to be fixed later. is the number of vertices in the base input graph (it thus remains fixed through all recursive calls).
Input: A DAG and a recursion level .
Output: A shortcut set .
-
1.
Randomly and independently sample, with probability , each as a pivot. Let be the set of pivots.
-
2.
For each , compute , , and:
-
Add to for all .
-
Add to for all .
-
Add label to all .
-
Add label to all .
-
✏ TC-Pruning: If , add all edges in to .
-
-
3.
Partition of all such that iff and have the exact same labels.
-
4.
Output .
As before, we select an arbitrary path and count the nodes of its now pruned subproblem tree. Below, we describe how TC-Pruning allows us to prune the subproblem tree.
TC-Pruning on the Subproblem Tree
Consider a level node in the original subproblem tree satisfying , and which also has children arranged in the order so that . Let be the last subpath that is touched by a call to for some level pivot that is a descendant of , and let be the first subpath that is touched by a call to for some level pivot that is an ancestor of . We remove and (along with the subtrees rooted at them) from the subproblem tree of , so that now has children .
In the above event, (resp. ) has been shortcut to hop from the call to (resp. ) from which a shortcut is added from the start of to the end of (resp. start of to the end of ). The number of nodes in the pruned subproblem tree is thus, up to a constant factor, an upper bound on the number of hops is shortcut to. Moving forward, we will call nodes in subproblem small if , and otherwise we call them large. There are three basic steps to count the number of nodes in the pruned subproblem tree:
-
We show that there is at most large nodes. See Section 4.2.1.
-
We show that the number of children each node has is . We can use this to charge the maximal subtrees rooted at small nodes to their parent (a large node). See Section 4.2.2.
-
We show that for every small node, its subtree has at most nodes. See Section 4.2.3.
In all, letting be the number of large nodes, be an upper bound on the size of subtrees rooted at small nodes, and upper bound the number of children each node has, then for
See Section 4.2.4.
4.2.1 There Can’t be Many Large Nodes (Alternate Proof of the JLS Diameter)
We finally provide the proof of the diameter bound of JLS. To proceed, we will need the following key lemma as a blackbox.
Proposition 11 (Paraphrasing of Lemma 4.4 from [11]).
Let be an arbitrary path in , and be the set of pivots selected from . Suppose does not contain bridges and splits into (possibly empty) subpaths belonging respectively to recursive instances . Then
While splitting a path into precludes shortcutting (hence ) to hops, Proposition 11 says that, on average, it becomes times more likely to select pivots on and thus shortcut its descendants in the subproblem tree to hops each. So even if the algorithm fails to resolve by selecting a bridge, it makes progress towards resolving and it is this advantage that leads to the diameter bound of [11].
Henceforth, we will use the notation to refer to the recursive instance a subpath belongs to.
Lemma 12.
For any , let be the random variable counting the number of nodes in the (unpruned) subproblem tree such that . Then:
Proof.
Let be the (unpruned) subproblem tree.
Potential Function.
We use the potential function , and will show that . If we can show this, we are done since nodes with contribute at least each to the aforementioned sum; there can thus be at most such nodes in expectation.
Local Step.
We first show that for any
| (❀) |
The expectations in the following chain of inequalities are conditioned on the value of .
(Cauchy-Schwarz)
(Jensen’s Inequality)
(Key JLS Lemma: Proposition 11)
Using on both sides gives , establishing ❀.
Summing the Pieces Up.
The proof of Lemma 12 is then easily completed by summing up over the nodes of by levels, and using induction on the level to compute . Note that (deterministically) has levels, since the sampling probability of being a pivot at recursion level is after which the algorithm halts.
| ( has levels) | ||||
| (❀) | ||||
| () | ||||
As a special case when , we recover the diameter bound of JLS from Lemma 12 since every node must have . More importantly, for our proof, we will use , the threshold which separates small nodes from large. By Lemma 12, there are no more than large nodes in expectation when .
4.2.2 Nodes Have Few Children
Observation 13.
With probability at least , the event where every node in the subproblem tree has children holds.
Proof.
We will condition on holding, which occurs with probability by Proposition 9. Let be any level node in the subproblem tree, contained in some level recursive graph . Since and by , it follows that .
Let be the number of pivots chosen from at level . Since the sampling rate at level is , we have . By a Chernoff bound, . Therefore, . This implies, using Observation 8 which bounds the number of pieces is split to by the number of pivots, that .
4.2.3 Subtrees Rooted at Small Nodes are Heavily Pruned
Lemma 14.
Let be a small node in the (pruned) subproblem tree, and let be the subtree rooted at it.
Proof.
Assume holds.666The contribution from not holding is negligible since . This follows from Proposition 9 and . For any small node at level , we will call it bad if there is some such that ; otherwise is good.
Property of good nodes.
Notice that if is good, then it has at most child in the pruned subproblem tree since we run for any pivot .
Property of bad nodes.
If is bad, there is some such that . Using
we get . Consequently, the expected number of pivots selected from is at most . Letting be the number of children has, and using Observation 8 with the expected number of pivots, .
Total number of nodes.
Let for be the number of nodes in level of . Conditioning on , the above bound still holds and hence it follows that
| (Law of iterated expectations) | ||||
| (where is the th node in level ) | ||||
| () | ||||
| ( and ) | ||||
We conclude that .
4.2.4 Putting the Pieces Together
We now have all the components to prove Theorem 10.
Proof of Theorem 10.
Let be any path in , and be its subproblem tree, and . We will show later that . Then, by Markov’s inequality so that repeating JLS with TC-Pruning times shortcuts with probability . Union bounding over paths (one chosen for each pair ), the algorithm shortcuts all paths with probability . Let us hence return to showing that .
4.3 Remaining Analysis of the Shortcut Set
Here we finally prove Theorem 2 in full.
Theorem 2 (Sequential Shortcut Set). [Restated, see original statement.]
Let be the fast matrix multiplication exponent. There is an time randomized algorithm that, given an unweighted digraph , outputs with high probability a -shortcut set with size .
More generally, we show the following tradeoff which the above is a special case of. Let . There is an time randomized algorithm that, given an unweighted digraph , outputs with high probability an -shortcut set with size .
Proof.
With Theorem 10, it only remains to bound the running time of JLS with TC-Pruning and the size of the shortcut set it produces. We bound the contribution from TC-Pruning since the contribution from JLS is taken care of by Proposition 7. Set . We will condition on the following event:
which occurs with probability at least by a Chernoff bound, Proposition 9, and a union bound.
Time.
JLS takes time by Proposition 7. We next show that the transitive closure calls, from TC-Pruning, takes time. Recall that each level transitive closure call is made in a subgraph induced on for each level pivot , so long as . This takes time per call, using matrix multiplication and repeated squaring of the adjacency matrix. We will break these calls into two cases, based on the level of recursion .
-
Case 1: . Since there are pivots sampled at recursion level and below, the time at that level is, up to polylogarithmic factors, . Since there are levels, the bound follows.
-
Case 2: . Since there are pivots sampled at recursion level and holds, the time at that level is, up to polylogarithmic factors,
Since there are levels, the bound follows.
Size.
The argument for this is similar to the time bound.
-
Case 1: . Since there are pivots sampled at recursion level , the number of shortcuts added at that level is, up to polylogarithmic factors, . Since there are levels, the bound follows.
-
Case 2: . Since there are pivots sampled at recursion level and holds, the number of shortcuts added at that level is, up to polylogarithmic factors,
Since there are levels, the bound follows.
Main case ( size shortcut set).
Set .
5 Parallel Reachability
In this short section, we parallelize JLS with TC-Pruning, the shortcut set construction shown in Section 4, proving Theorem 16. We then use the shortcut set to prove Theorem 1, our main result for parallel reachability.
We use the following result from [9] to reduce the construction of shortcut sets on digraphs to that on so-called shallow digraphs.
Proposition 15 (Paraphrasing Corollary 3.2 from [9]).
Suppose and where is a sufficiently large constant.
Suppose there is a parallel algorithm that, given a digraph with vertices and edges and reachability hopbound , returns a -shortcut set of size .
Then there is a randomized parallel algorithm that, given a digraph with vertices and edges, returns a -shortcut set of size . makes a polylogarithmic number of sequential calls to on digraphs with at most edges, and takes an additional work and span.
We are now ready to parallelize JLS with TC-Pruning.
Theorem 16 (Parallel Near Linear Work Shortcut Set Construction).
Let be the fast matrix multiplication exponent in the work for parallel algorithms using polylogarithmic (in ) span. There is an work and span randomized parallel algorithm that, given an unweighted digraph , outputs with high probability a -shortcut set with size .
Proof.
Implementing (Part 1) – Parallel reduction to shallow DAGs.
888This part may be used for any shortcut set algorithm, hence one may assume that is given a shallow DAG (as opposed to a shallow digraph).Observe that we can use the algorithm of [18] with a parallel BFS oracle to find the SCCs of in work and span. To see this, note that the algorithm of [18] recurses into graphs induced on intervals of the topological order of the SCCs of , hence each recursive instance maintains a reachability hopbound.
By adding a bidirected star in each SCC of to our shortcut set, it then suffices to construct a -shortcut set for the DAG where the SCCs of are contracted. This incurs at most a factor of two dilation to give a -shortcut set for . We henceforth assume is a DAG with reachability hopbound .
Implementing (Part 2) – Parallel JLS with TC-Pruning on shallow DAGs.
Observe that for any , JLS with TC-Pruning runs in work and span for DAGs with reachability hopbound .
To see this, first note that the reachability hopbound is preserved in all recursive subgraphs: if an arbitrary pair are sent to the same recursive instance , then every vertex between and have the same reachability relations (to the pivots) as and are thus also sent to . In particular, the hop path from to is sent to . The reachability relations, which are computed by parallel BFS calls, are therefore done in work and span in each recursive instance . Next, note that each transitive closure call is done in work and polylogarithmic in span.
Setting parameters.
Fix for a sufficiently large power in the polylogarithm term. Let the output of JLS with TC-Pruning on shallow DAGs be a -shortcut set with . Note that for this setting of , we have where . Then, pulling back to shallow digraphs, note that accounts for the edges added by the bidirected stars and hence and .
Putting things together.
Invoking Proposition 15, outputs with high probability a -shortcut set with size in work and span.
Theorem 1 (Parallel Reachability). [Restated, see original statement.]
Let be the fast matrix multiplication exponent in the work for parallel algorithms using polylogarithmic (in ) span. There is an work and span randomized parallel algorithm that, given an unweighted digraph and source , outputs with high probability all vertices that can reach and all vertices that reach .
Proof.
This follows from using Theorem 16 to extract a -shortcut set of with size in work and span. Then, run a parallel BFS on from in work and span.
References
- [1] Josh Alman, Ran Duan, Virginia Vassilevska Williams, Yinzhan Xu, Zixuan Xu, and Renfei Zhou. More asymmetry yields faster matrix multiplication. In Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2005–2039. SIAM, 2025. doi:10.1137/1.9781611978322.63.
- [2] Ben Bals, Joakim Blikstad, Greg Bodwin, Daniel Dadush, Sebastian Forster, and Yasamin Nazari. Greedy algorithms for shortcut sets and hopsets. arXiv preprint arXiv:2511.20111, 2025. doi:10.48550/arXiv.2511.20111.
- [3] Aaron Bernstein and Nicole Wein. Closing the gap between directed hopsets and shortcut sets. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 163–182. SIAM, 2023. doi:10.1137/1.9781611977554.CH7.
- [4] Jan van den Brand, Hossein Gholizadeh, Yonggang Jiang, and Tijn de Vos. Parallel minimum cost flow in near-linear work and square root depth for dense instances. arXiv preprint arXiv:2503.13274, 2025. doi:10.48550/arXiv.2503.13274.
- [5] Nairen Cao and Jeremy T Fineman. Parallel exact shortest paths in almost linear work and square root depth. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4354–4372. SIAM, 2023. doi:10.1137/1.9781611977554.CH166.
- [6] Nairen Cao, Jeremy T Fineman, and Katina Russell. Efficient construction of directed hopsets and parallel approximate shortest paths. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pages 336–349, 2020. doi:10.1145/3357713.3384270.
- [7] Nairen Cao, Jeremy T Fineman, and Katina Russell. Brief announcement: An improved distributed approximate single source shortest paths algorithm. In Proceedings of the 2021 ACM Symposium on Principles of Distributed Computing, pages 493–496, 2021. doi:10.1145/3465084.3467945.
- [8] Jeremy T Fineman. Nearly work-efficient parallel algorithm for digraph reachability. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 457–470, 2018. doi:10.1145/3188745.3188926.
- [9] Bernhard Haeupler, Yonggang Jiang, and Thatchaphol Saranurak. Reducing shortcut and hopset constructions to shallow graphs. In 2026 SIAM Symposium on Simplicity in Algorithms (SOSA), pages 385–393. SIAM, 2026. doi:10.1137/1.9781611978964.30.
- [10] Joseph JáJá. Parallel algorithms. Addison Wesley, 1992.
- [11] Arun Jambulapati, Yang P Liu, and Aaron Sidford. Parallel reachability in almost linear work and square root depth. In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), pages 1664–1686. IEEE, 2019. doi:10.1109/FOCS.2019.00098.
- [12] Philip N Klein and Sairam Subramanian. A randomized parallel algorithm for single-source shortest paths. Journal of Algorithms, 25(2):205–220, 1997. doi:10.1006/JAGM.1997.0888.
- [13] Shimon Kogan and Merav Parter. Beating matrix multiplication for -directed shortcuts. In 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of Leibniz International Proceedings in Informatics (LIPIcs), pages 82:1–82:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ICALP.2022.82.
- [14] Shimon Kogan and Merav Parter. New diameter-reducing shortcuts and directed hopsets: Breaking the barrier. In Proceedings of the 2022 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1326–1341. SIAM, 2022. doi:10.1137/1.9781611977073.55.
- [15] Shimon Kogan and Merav Parter. Faster and unified algorithms for diameter reducing shortcuts and minimum chain covers. In Proceedings of the 2023 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 212–239. SIAM, 2023. doi:10.1137/1.9781611977554.CH9.
- [16] Shimon Kogan and Merav Parter. Towards Bypassing Lower Bounds for Graph Shortcuts. In 31st Annual European Symposium on Algorithms (ESA 2023), volume 274 of Leibniz International Proceedings in Informatics (LIPIcs), pages 73:1–73:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.ESA.2023.73.
- [17] Václav Rozhoň, Bernhard Haeupler, Anders Martinsson, Christoph Grunau, and Goran Zuzic. Parallel breadth-first search and exact shortest paths and stronger notions for approximate distances. In Proceedings of the 55th Annual ACM Symposium on Theory of Computing, pages 321–334, 2023. doi:10.1145/3564246.3585235.
- [18] Warren Schudy. Finding strongly connected components in parallel using reachability queries. In Proceedings of the twentieth annual symposium on Parallelism in algorithms and architectures, pages 146–151, 2008. doi:10.1145/1378533.1378560.
- [19] JD Ullman and M Yannakakis. High-probability parallel transitive-closure algorithms. SIAM Journal on Computing (Society for Industrial and Applied Mathematics);(United States), 20(1), 1991. doi:10.1137/0220006.
