Abstract 1 Introduction 2 Preliminaries 3 High-Level Overview 4 Sequential Shortcut Set Construction 5 Parallel Reachability References

Parallel Reachability and Shortest Paths on Non-Sparse Digraphs: Near-Linear Work and Sub-Square-Root Depth

Vikrant Ashvinkumar Rutgers University, Piscataway, NJ, USA    Aaron Bernstein ORCID New York University, NY, USA    Maximilian Probst Gutenberg ORCID ETH Zurich, Switzerland    Thatchaphol Saranurak ORCID University of Michigan, Ann Arbor, MI, USA
Abstract

We present parallel algorithms for computing single-source reachability and shortest paths on directed n-vertex m-edge graphs using near-linear O~(m) work and o(n) depth whenever mn1+o(1). At the extreme of m=Ω(n2), our reachability and shortest path algorithms have depth only n0.136 and n0.25+o(1), respectively. The state-of-the-art parallel algorithms with near-linear work for both problems [11, 6, 17, 5, 4] require Ω(n) depth in all density regimes.

Keywords and phrases:
shortcut set, parallel reachability, hopset, parallel SSSP
Category:
Track A: Algorithms, Complexity and Games
Funding:
Aaron Bernstein: Supported by Sloan Fellowship, Google Research Fellowship, NSF Grant 1942010, and Charles S. Baylis endowment at NYU.
Maximilian Probst Gutenberg: The research leading to these results has received funding from grant no. 200021 204787 of the Swiss National Science Foundation.
Thatchaphol Saranurak: Supported by NSF Grant CCF-2238138 and a Sloan Fellowship.
Copyright and License:
[Uncaptioned image] © Vikrant Ashvinkumar, Aaron Bernstein, Maximilian Probst Gutenberg, and
Thatchaphol Saranurak; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2605.03892
Acknowledgements:
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 Puppis

1 Introduction

Single-source reachability and shortest paths (SSSP) are some of the most fundamental algorithmic problems on digraphs. Given a digraph G=(V,E) on n vertices and m=Ω(n) edges, and a source sV, reachability asks for the set of all vertices that s can reach, and shortest paths for the distances from s to v for all vV. While the solutions to these problems are fairly well understood in the sequential setting – reachability is solvable in O(m) time using a breadth-first search (BFS) and shortest paths in O~(m) time111Here and throughout, we use the O~() 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 W(n) of a parallel algorithm is the number of primitive operations it performs on an input of size n, which can be interpreted as the running time of the algorithm when sequentialized, i.e., the running time with just one processor. Ideally, W(n) 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 W(|E(G)|)=O(m), matching the running time of BFS. We call a parallel algorithm nearly work-efficient if W(n) matches the best sequential running time up to polylogarithmic factors. We interchangeably use the terms depth or span D(n) 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 o(n) 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 Ω(n) 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 G which, while highly parallel with polylog(n) 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 G, which is Ω(n) 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 O~(n2/3). This was then built upon by Jambulapati, Liu, and Sidford [11] to give a nearly work-efficient algorithm with n1/2+o(1) 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 G is a set HV×V such that the reachability relations of G and GH are the same, and for any u,vV such that u reaches v, there is a path from u to v using at most β hops in GH. Given a β-shortcut set H, one may compute single-source reachability in O(m+|H|) work and O(β) depth by computing a parallel BFS on GH from source s. There is a folklore construction of an O(n)-shortcut set H with |H|=O~(n): randomly sample O~(n) vertices and add all shortcut edges uv where u and v are sampled vertices such that u can reach v in G. 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 O~(n2/3)-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 H with only O~(n) edges. But for many problems, and for parallel reachability in particular, a shortcut set with O~(m) edges would do just as well. For non-sparse graphs, allowing H to contain more edges is conceptually advantageous because the folklore construction can be tuned to achieve a O(n/m)-shortcut set H with |H|=O~(m), 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 O~(m) size β-shortcut set where β scales with the density of the base graph; for any m polynomially larger than n, we achieve β polynomially better than n. We can further improve the tradeoff with fast matrix multiplication: at the extreme case, if ω=2, 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 (1+ε)-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 O~(m) work and O~(β) span. And instead of a β-shortcut set, one constructs a so-called (β,ε)-hopset of G which is a set HV×V such that distG(u,v)distGH(β)(u,v)(1+ε)distG(u,v) for all u,vV, where dist(β) is the length of the shortest path using at most β hops. The folklore shortcut set is easily adapted to showing the existence of (O(n),ε)-hopsets H with |H|=O~(n). Analogously, Cao, Fineman, and Russell [6] adapted the shortcut set construction of [11] to give a near-linear time construction of an (n1/2+o(1),ε)-hopset H with |H|=O~(n), essentially meeting this folklore bound. A work-span tradeoff was then later given in [7].

Just as with shortcut sets, the requirement that |H|=O~(n) is sometimes too stringent. The folklore hopset can in the same way be tuned to give an (O(n/m),ε)-hopset H with |H|=O~(m) 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 O~(m) 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.

Figure 1: Comparison of spans of O~(m) work parallel algorithms for reachability and SSSP on digraphs. Each plotted curve corresponds to such a parallel algorithm. The x-axis is the density of the input digraph, and the y-axis is the span of the algorithm. : The bound for parallel SSSP also holds for combinatorial parallel reachability (i.e. ω=3).
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 n) span. There is an O~(m) work and nω+o(1)/m2ω2 span randomized parallel algorithm that, given an unweighted digraph G and source sV, outputs with high probability all vertices that s can reach and all vertices that reach s.

Using the fact that ω<2.371339 (by [1] and Proposition 5), we can compute reachability in O~(m) work and n0.86461/m0.36461 span (n0.136 span when m=Ω(n2)). The previous best span for nearly work-efficient algorithms for reachability was at least Ω(n), regardless of digraph density: [11] achieves depth n1/2+o(1), while the min-cost flow algorithm of [4] reduces the depth to O~(n) when mn1.5.

The technical developments used to get the parallel reachability algorithm of Theorem 1 is largely a near-linear time sequential construction for a nω+o(1)/m2ω2-shortcut set with size O~(m).

Theorem 2 (Sequential Shortcut Set).

Let ω be the fast matrix multiplication exponent. There is an O~(m) time randomized algorithm that, given an unweighted digraph G, outputs with high probability a nω+o(1)/m2ω2 -shortcut set H with size O~(m).

More generally, we show the following tradeoff which the above is a special case of. Let ϱ[n]. There is an O~(m+nϱ2ω2) time randomized algorithm that, given an unweighted digraph G, outputs with high probability an n1/2+o(1)/ϱ-shortcut set H with size O~(nϱ2).

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 ω=3, a combinatorially constructed n3/4+o(1)/m1/4-shortcut set and, if ω=2 an n1+o(1)/m-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 O~(mϱ2+nϱ4) time construction of an n1/2+o(1)/ϱ-shortcut set H with size O~(nϱ2); most crucially, because of the mϱ2 term, their tradeoff could not achieve near-linear work for any graph density.

Parallelizing the previous state-of-the-art near-linear size n1/2+o(1)-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.

Table 1: Span of our near-linear work parallel reachability algorithms (or β value of our β-shortcut sets) for different values of ω.
Value of ω Span (or β) Span (or β) when m=Θ(n2)
(Combinatorial): 3 n3/4+o(1)/m1/4 n1/4+o(1)
(Ideal): 2 n1+o(1)/m no(1)
(Current [1]): 2.371339 n0.86461/m0.36461 n0.136
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 O~(m) work and n3+o(1)/m4 span randomized parallel algorithm that, given a polynomially bounded non-negative integer weighted digraph G and source sV, outputs with high probability dist(s,v) for all vV along with a shortest path tree rooted at s.

On dense digraphs, this gives a nearly work-efficient n1/4+o(1) span algorithm for SSSP. The previous best span for nearly work-efficient algorithms for SSSP was at least Ω(n), similar to the previous state of reachability: [17, 5] achieve depth n1/2+o(1), while the min-cost flow algorithm of [4] reduces the depth to O~(n) when mn1.5.

Analogously to parallel reachability, the main driver of Theorem 3 is a near-linear time sequential construction of a (n3+o(1)/m4,ε)-hopset H with size O~(m/ε2).

Theorem 4 (Sequential Hopset).

There is an O~(m/ε2) time randomized algorithm that, given a polynomially bounded non-negative integer weighted digraph G, outputs with high probability a (n3+o(1)/m4,ε)-hopset H with size O~(m/ε2).

More generally, we show the following tradeoff which the above is a special case of. Let ϱ[n]. There is an O~(m/ε2+nϱ4) 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 log(nW) factor where W is the largest weight in G. non-negative integer weighted digraph G, outputs with high probability a (n1/2+o(1)/ϱ,ε)-hopset H with size O~(n/ε2+nϱ2).

In particular, Theorem 4 on dense digraphs runs in O~(n2/ε2) time and shortcuts (1+ε)-approximate shortest paths to n1/4+o(1) hops, whereas the previous best hop bound was n1/2+o(1) 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 ω=3 (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 n2/m3-shortcut set with size O~(m) which, if constructible in near-linear work, would give a depth n2/m3n/m algorithm for reachability. Along another direction, [2] recently showed a deterministic construction of an O(n)-shortcut set with size O(nlogn) 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 z, we use [z] to denote {1,2,,z}. For integers ab, we use [a,b] to denote {a,a+1,,b}.

Graphs

In this paper we work with unweighted digraphs G=(V,E) and also weighted digraphs G=(V,E,w). We use V(G) (or when unambiguous, V) to refer to the vertex set of G and E(G) (or when unambiguous, E) to refer to the edge set of G. An edge pointing from vertex u to vertex v is denoted with uv. For any VV we use G[V] to denote the subgraph of G induced on V. When it is clear, we use n=|V| and m=|E|.

Paths and Distances

A path using h hops is a sequence of vertices P=v0,v1,,vh where vi1viE. A subpath of P=v0,v1,,vj is a path of the form va,va+1,,vz with 0azh. If we say a path P is split into k subpaths P1,P2,,Pk we mean that the Pi are disjoint and P=P1P2Pk.

Hopbounds

We say that a digraph G has reachability hopbound h if for all s,tV such that s reaches t, there is a path using at most h hops from s to t.

Shortcut Sets

HV2 is a β-shortcut set of a digraph G if 1) for all stH, which we call shortcuts, there is an st-path in G and 2) The reachability hopbound in GH is not more than β.

Reachability Relations and Relevant Vertices

If there is a path from s to t we say s reaches t and also t is reached by s; we say here that s and t are related. R+(G,s) is the set of all vertices s reaches in G and R(G,t) is the set of all vertices which reach t in G. We denote the set of relevant vertices to v with R(G,v)=R+(G,v)R(G,v). These are extended to sets in the natural way; for example, R+(G,S)=sSR+(G,s).

Path-related Vertices (Ancestors, Descendants, Bridges)

For any path P, we call R(G,P)R+(G,P) its ancestors and R+(G,P)R(G,P) its descendants and finally R(G,P)R+(G,P) 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 O(logn).

Proposition 5 (Paraphrasing (with some modification) of Theorem 5.7 Part 1 in [10]).

Let A and B be two n by n matrices with entries in a ring R with operations +,×. The matrix AB can be computed by a parallel algorithm with O(logn) span and O(M(n)) work, where M(n) is the best known sequential bound for computing AB over R by an algorithm that can be written as an algebraic circuit with +,× gates.

That is to say, throughout this paper ω<2.371339 (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 {0,1} random variables Xi with mean μ=𝔼[iXi]:

Pr[X(1+δ)μ]eδ2μ/(2+δ) for δ0.

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 G is reduced to constructing a shortcut set of G; indeed, if one can construct a β-shortcut set H in O~(m) work and D span, then one gets a parallel reachability algorithm by running a parallel BFS from the source s on GH, which takes an additional O~(m+|H|) work and β span (so, in sum, an O~(m+|H|)-work and O(D+β)-span algorithm). We thus focus on the problem of constructing a shortcut set.

[11] refines the breakthrough of [8] to give an O~(m) work algorithm which constructs an n1/2+o(1)-shortcut set in span n1/2+o(1). As a precursor to this, they give a sequential O~(m) time algorithm which constructs an n1/2+o(1)-shortcut set with O~(n) size, henceforth called the JLS shortcut set. We first turn our attention to this sequential construction.

Let us assume G 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 G is the level 0 recursive instance. On a level r recursive instance G[V], where VV, some pivot vertices SV are selected randomly. For each vV and pS, if v reaches p then add vp to the shortcut set, and if p reaches v then add pv to the shortcut set. Next, we partition V=V1V2 into an equivalence relation based on the reachability relation to S in G[V]; that is, for all u,vV and i, we have u,vVi iff the set of pivots in S that reach u and v are equal and the set of pivots in S that u and v reach are equal. We then set each G[Vi] to be a level r+1 recursive instance. A complete description of JLS is given later in Section 4.

For appropriately chosen parameters, the above algorithm runs in O~(m) time and yields an n1/2+o(1)-shortcut set with near-linear size.

Framework for Bounding the Diameter

To bound the diameter of JLS, we fix an arbitrary path P and show that P is shortcut to length n1/2+o(1). First, observe that at any fixed recursion level, say r, the path P is split into contiguous subpaths P1,P2, each belonging to distinct level r+1 recursive instances G1,G2, respectively. To see this, note that if a pivot vertex reaches (resp. is reached by) any two vertices in P, then it reaches (resp. is reached by) every vertex on the subpath between said two vertices in P; thus, if x and y are in the same subproblem Gi, then so are all the vertices on any path from x to y. (See Observation 8 for the formal proof.)

We use this observation to define the subproblem tree of P, which tracks how P 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 0, is P; (ii) If a bridge of a level r node P is selected in the recursion level r instance G (in which P is contained) then P is a leaf node and, otherwise, P has level r+1 children nodes P1,P2, corresponding to how P is split. The reader should observe that each leaf P is shortcut to O(1) hops (moving through the bridge of P) and, hence, the number of nodes in the subproblem tree upper bounds the number of hops P is shortcut to (up to a constant factor).

[11] shows that the number of nodes in the subproblem tree of any path P is bounded above by n1/2+o(1). Crucially, they use the following key lemma within a bottom-up argument by induction:

𝔼[i=1|S|+1|R(Gi,Pi)|||S|]2|S|+1|R(G,P)|, (Proposition 11)

where P (in subproblem G) is an arbitrary internal node in the subproblem tree and S are the pivots selected in R(G,P) that split P into subpaths P1,P2,,P|S|+1 in subproblems G1,G2,,G|S|+1 respectively. Recall (from Section 2) that R(G,P) are the vertices in G that can reach or are reached by some vertex in P.

We suggest that Proposition 11 is best interpreted in the following way. Intuitively, splitting a path P into P1,P2,,P|S|+1 is detrimental to shortcutting P (and hence P) since the algorithm will no longer be able to add any shortcut between Pi and Pj for ij. For example, if |S|n1/2+o(1), then there would no longer be any hope of shortcutting P to n1/2+o(1) hops. On the other hand, Proposition 11 shows that splitting a path still offers progress: the number of relevant vertices to P drops significantly. Since Pi=1|S|+1R(Gi,Pi) and each vP is a bridge of some Pi, the fraction of bridges increases555This is not entirely true, since bridges of P may cease to be bridges of Pi for any i.. It is consequently more likely to select bridges as pivots and shortcut the subpaths that P is split into to O(1) 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 βn1/2+o(1) 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.

i=1|S|+1|R(Gi,Pi)|2|S|+1|R(G,P)|. (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 x, there are at most n1/2+o(1)/x nodes P in the subproblem tree where |R(G,P)|x.

Proof Sketch.

Define the function ϕ(P)=|R(G,P)|. We will show tree nodes Pϕ(P)=n1/2+o(1) and from there the bound follows since each P with |R(G,P)|x contributes ϕ(P)x to the sum.

To see that Pϕ(P)=n1/2+o(1), observe that ϕ(P)=O(n); the subproblem tree has O(logn/loglogn) levels (we have not justified this in the overview, see Section 4); and

i|S|+1ϕ(Pi)=i|S|+1|R(Gi,Pi)|(|S|+1)i|S|+1|R(Gi,Pi)|2ϕ(P)

where the first inequality is by Cauchy-Schwarz and the second is by Idealized Proposition 11.

By plugging in x=1, we recover the n1/2+o(1) diameter bound of JLS. Even more, we may plug in other values of x 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 P with |R(G,P)|<x to O(1) hops. We can then consider the pruned subproblem tree of P with all nodes P where |R(G,P)|<x removed. By Claim 6, the number of nodes in the pruned tree is at most n1/2+o(1)/x up to polylogarithmic factors, which upper bounds the number of hops to which P is shortcut.

A Simple Combinatorial Improvement (Warmup)

Assume the input digraph is dense – that is, it has Ω(n2) edges. Denote BFSn(G,v) as the first n vertices found in a BFS in G starting from vV(G).

Here is a simple modification to the JLS algorithm. For each recursive subproblem G and each vV(G), add all the following edges to the shortcut set: edges from v to BFSn(G,v).

Note that BFSn(G,v) runs in O(n) time, totaling up to O~(n2) 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 P=v0,v1,,vh in the subproblem tree with |R(G,P)|<n=x, the edge v0vh will be added to the shortcut set since vhBFSn(G,v0). Namely, P is shortcut to O(1) hops and is removed from the pruned subproblem tree which, accordingly, has O(n1/4+o(1)) nodes by Claim 6 (which, recall, upper bounds the length P is shortcut to).

In summary, this simple modification to JLS gives a near-linear time construction of an O(n1/4+o(1))-shortcut set on dense digraphs G.

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 BFSn(G,v) from each vV(G) in every recursive subproblem G 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 |R(G,P)| is small (at the threshold where we wish to prune away the node P from the subproblem tree of P), one might try to call a transitive closure on a ball centered at v for some vP. The flaw in this idea is that the choices made by the algorithm must be oblivious to P. A more oblivious approach would be to call a transitive closure on R(G,p) for some pivot pR(G,P). However, |R(G,p)| is not necessarily the same as |R(G,P)| since p may not be a vertex in P. In fact, p may reach or be reached by many vertices that have no reachability relation to P, and hence |R(G,p)| might be very large despite |R(G,P)| being very small; calling a transitive closure on |R(G,p)| may then be too expensive!

Instead, we do the following. For every pivot p, if |R(G,p)| is small enough, we add all edges in the transitive closure of R(G,p) to the shortcut set. This can be done in O~(|R(G,p)|ω) time by repeatedly squaring the adjacency matrix of G[R(G,p)]. By virtue of |R(G,p)| being small, we have control over the running time of this improvement. Moreover, since all edges in the transitive closure of R(G,p) are added to the shortcut set, p would not contribute any children to the node P. But would it allow us to prune the node P completely when |R(G,P)| is small? Not quite. We show in Section 4 that it allows us to prune nodes in the subtree rooted at P so that the pruned subtree has O(logn) nodes; loosely, the argument is as follows: for any node P′′ in this subtree, if all pR(G′′,P′′) have small |R(G′′,p)| then P′′ has at most one child and, otherwise, there is some pR(G′′,P′′) with large |R(G′′,p)|, certifying that it is very unlikely for any vertex in R(G′′,P′′) to be sampled as a pivot. This yields the n0.136-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 O~(β) span on DAGs with reachability hopbound O~(β); this is enough to show that a β-shortcut set runs in O~(β) 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 O~(β), 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 G is a DAG (since it is easy to compute strongly connected components (SCCs) in a digraph in linear time and, adding O(n) edges to the shortcut set, shortcut each SCC to two hops). There is a global parameter k, which we can think of as logn, that controls a sampling rate and recursion depth logk(n). The construction is found via a recursive algorithm where at recursion level r, around kr+1 pivot vertices from the base graph G are selected uniformly at random (these pivots are divided up possibly unequally among all level r subproblems on graphs G[V1],G[V2],). Let us focus on one level r subproblem, say, G[V1]. Reachability within G[V1] is computed for the pivots belonging to V1 and based on this the following actions are made:

  • For each pivot p, add the edges vp (resp. pv) to the shortcut set if v reaches (resp. is reached by) p.

  • For each vV1, give it a set of labels based on its reachability relation to the pivots. That is, for all pivots pV1 and vV1 (i) if p reaches v, give v the label “p reaches me”; (ii) if v reaches p, give v the label “I reach p”; (iii) otherwise give v the label “I have no relation to p”.

  • Recurse into V1,1,V1,2,V1 where the V1,i’s are an equivalence class in V1 using the labeling above. That is, x,yV1,i iff x and y 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: k is a global parameter to be fixed later. n is the number of vertices in the base input graph (it thus remains fixed through all recursive calls).

Input: A DAG G=(V,E) and a recursion level r.

Output: A shortcut set HV2.

  1. 1.

    Randomly and independently sample, with probability pr100kr+1lognn, each vV as a pivot. Let S be the set of pivots.

  2. 2.

    For each pS, compute R(G,p)reach p, R+(G,p)p reaches and:

    • Add vp to H for all vR(G,p).

    • Add pv to H for all vR+(G,p).

    • Add pAnc label to all vR(G,p).

    • Add pDes label to all vR+(G,p).

  3. 3.

    V1,V2,,Vt Partition of all vV such that x,yVi iff x and y have the exact same labels.

  4. 4.

    Output H(i[t]JLS on G[Vi],r+1).

Proposition 7 (Paraphrasing Theorem 5 from [11]).

JLS runs in time O~(mk) and produces an n1/2+O(1/logk)-shortcut set of size O~(nk) with probability at least 1O(n10).

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 n1/2+O(1/logk) 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 P is selected for the sake of analysis. Notice first that P 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 P be a subpath of P, contained in a level r recursive instance G. If z1 of the non-bridge vertices in R(G,P) are chosen as pivots at level r, then P is split into at most z disjoint subpaths P1,,Pz belonging to distinct level r+1 recursive instances G1,,Gz.

Proof.

Let P=v0,v1,,vh and S be the set of pivots selected from R(G,P). If pS reaches vi, then it reaches vj for j>i. Similarly, if pS is reached by vi, then it is reached by vj for j<i. Thus, if vi and vj are related to S in the same way, then vi,vi+1,,vj all have the same relation to S. Since there are at most z1 locations where the reachability relation can change, there are at most z subpaths.

We will examine how P evolves (i.e. is split and shortcutted) through the execution of JLS more carefully. To do this, we think of the subproblem tree of P. Each node of the subproblem tree is associated with some subpath of P, and the tree can be described as:

  • Root node P. This is the 0th level of the tree.

  • For each node P in level r of the tree (i.e. P is contained in a level r recursive instance G), if a bridge of P in G is sampled at level r, then P is a leaf. Note that in this case P has been shortcut to 2 hops since, denoting P=v1,v2,,vh and the sampled bridge b, the edges v0b and bvh are added to the shortcut set.

  • Otherwise, the path P is split in the instance G into subpaths P1,,Pz belonging to level r+1 recursive instances G1,,Gz. The node P will have z children P1,,Pz at level r+1 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 P is shortcutted to since we can traverse from the start of P to the end along the leaves (which have been shortcutted to 2 hops) and the edges joining the leaves.

Our Strategy

[11] shows that the subproblem tree of any path P has at most n1/2+O(1/logk) 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 P in recursive instance G may have a large subtree in P’s subproblem tree. If we are able to identify some structure in G so that P is immediately shortcutted to O(1) hops, we are then permitted to ignore the subtree rooted at P in our analysis.

In view of this, we will use a pruning strategy (called TC-Pruning) which prunes away all nodes P where |R(G,P)| 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 P where |R(G,p)| is large is much less than n1/2+O(1/logk), 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 r, the recursion level.

Proposition 9 (Paraphrasing Lemma 4.1 from [11]).

With probability at least 1O(n10), the following event 9 holds. For all recursion levels r, for all level r recursive instances G,

|R(G,v)|nkr
|R+(G,v)|nkr

for all vV(G).

We omit rewriting a formal proof of Proposition 9, but this follows from a simple induction on the recursion level: if |R(G,v)|nkr at level r1, then it is true also for level r and, otherwise, one of the first nkr ancestors of v (say p) will be sampled as a pivot with high probability, precluding any of the later ancestors from being retained in R(G,v) at level r since they receive the label “I have no relation to p” while v receives the label “p 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 Θ(logn) independent calls to JLS with TC-Pruning outputs an n1/2+o(1)/ϱ-shortcut set with high probability.

To begin, TC-Pruning uses the transitive closure of subgraphs as a subroutine call. We use TC(G) to denote all edges in the transitive closure of a digraph G; that is, stTC(G) if and only if s can reach t in G. Note that TC(G) can be computed in O~(|V(G)|ω) time using repeated squaring of the adjacency matrix of G.

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: k and ϱ are global parameters to be fixed later. n is the number of vertices in the base input graph (it thus remains fixed through all recursive calls).

Input: A DAG G=(V,E) and a recursion level r.

Output: A shortcut set HV2.

  1. 1.

    Randomly and independently sample, with probability pr100kr+1lognn, each vV as a pivot. Let S be the set of pivots.

  2. 2.

    For each pS, compute R(G,p)reach p, R+(G,p)p reaches, R(G,p)=R(G,p)R+(G,p) and:

    • Add vp to H for all vR(G,p).

    • Add pv to H for all vR+(G,p).

    • Add pAnc label to all vR(G,p).

    • Add pDes label to all vR+(G,p).

    • TC-Pruning: If |R(G,p)|(k2log2n)ϱ2, add all edges in TC(G[R(G,p)]) to H.

  3. 3.

    V1,V2,,Vt Partition of all vV such that x,yVi iff x and y have the exact same labels.

  4. 4.

    Output H(i[t]JLS with TC-Pruning on G[Vi],r+1).

As before, we select an arbitrary path P 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 r node P in the original subproblem tree satisfying |R(G,P)|(k2log2n)ϱ2, and which also has children P1,,Pz arranged in the order so that P=P1Pz. Let Px be the last subpath that is touched by a call to TC(G[R(G,p)]) for some level r pivot p that is a descendant of P, and let Py be the first subpath that is touched by a call to TC(G[R(G,q)]) for some level r pivot q that is an ancestor of P. We remove P1,,Px and Py,,Pz (along with the subtrees rooted at them) from the subproblem tree of P, so that P now has children Px+1,,Py1.

In the above event, P1,,Px (resp. Py,,Pz) has been shortcut to 1 hop from the call to TC(G[R(G,p)]) (resp. TC(G[R(G,q)])) from which a shortcut is added from the start of P1 to the end of Px (resp. start of Py to the end of Pz). The number of nodes in the pruned subproblem tree is thus, up to a constant factor, an upper bound on the number of hops P is shortcut to. Moving forward, we will call nodes P in subproblem G small if |R(G,P)|ϱ2, 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 n1/2+O(1/logk)/ϱ large nodes. See Section 4.2.1.

  • We show that the number of children each node has is O(klogn). 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 O(logn) nodes. See Section 4.2.3.

In all, letting L be the number of large nodes, T 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 k=Θ(logn)

(# of nodes)L+LΔT=n1/2+o(1)/ϱ.

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 n1/2+O(1/logk) 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 P be an arbitrary path in G, and S be the set of pivots selected from R(G,P). Suppose S does not contain bridges and S splits P into (possibly empty) subpaths P1,P|S|+1 belonging respectively to recursive instances G1G|S|+1. Then

𝔼[i=1|S|+1|R(Gi,Pi)|||S|]2|S|+1|R(G,P)|.

While splitting a path P into P1,P2,,P|S|+1 precludes shortcutting P (hence P) to o(|S|) hops, Proposition 11 says that, on average, it becomes Ω(|S|) times more likely to select pivots on P and thus shortcut its descendants in the subproblem tree to O(1) hops each. So even if the algorithm fails to resolve P by selecting a bridge, it makes progress towards resolving P1,P2,,P|S|+1 and it is this advantage that leads to the diameter bound of [11].

Henceforth, we will use the notation GP to refer to the recursive instance a subpath P belongs to.

Lemma 12.

For any x, let X be the random variable counting the number of nodes P in the (unpruned) subproblem tree such that |R(GP,P)|x. Then:

𝔼[X]n1+O(1/logk)x.
Proof.

Let T be the (unpruned) subproblem tree.

Potential Function.

We use the potential function ϕ(P)=|R(GP,P)|, and will show that 𝔼[tree nodes Pϕ(P)]n1/2+O(1/logk). If we can show this, we are done since nodes P with |R(GP,P)|x contribute at least x each to the aforementioned sum; there can thus be at most Xn1/2+O(1/logk)/x such nodes in expectation.

Local Step.

We first show that for any P

𝔼[P′′children(P)ϕ(P′′)]2𝔼[ϕ(P)]. (❀)

The expectations in the following chain of inequalities are conditioned on the value of ϕ(P).
𝔼[P′′children(P)ϕ(P′′)]=C[n]Pr[|children(P)|=C]𝔼[P′′children(P)ϕ(P′′)||children(P)|=C] C[n]Pr[|children(P)|=C]C𝔼[P′′children(P)|R(GP′′,P′′)|||children(P)|=C] (Cauchy-Schwarz) C[n]Pr[|children(P)|=C]C𝔼[P′′children(P)|R(GP′′,P′′)|||children(P)|=C] (Jensen’s Inequality) C[n]Pr[|children(P)|=C]C2C|R(G,P)| (Key JLS Lemma: Proposition 11) =2ϕ(P).

Using 𝔼[𝔼[X|ϕ(P)]]=𝔼[X] on both sides gives 𝔼[P′′children(P)ϕ(P′′)]2𝔼[ϕ(P)], establishing ❀.

Summing the Pieces Up.

The proof of Lemma 12 is then easily completed by summing up over the nodes of T by levels, and using induction on the level to compute (# expected nodes in level r)2r𝔼[ϕ(P)]. Note that T (deterministically) has O(logn/logk) levels, since the sampling probability of being a pivot at recursion level Ω(logn/logk) is 1 after which the algorithm halts.

𝔼[PTϕ(P)] =r[O(logn/logk)]𝔼[P in level r of Tϕ(P)] (T has O(logn/logk) levels)
r[O(logn/logk)]2r𝔼[ϕ(P)] (❀)
nr[O(logn/logk)]2r (ϕ(P)n)
=n1/2+O(1/logk).

As a special case when x=1, we recover the diameter bound of JLS from Lemma 12 since every node P must have |R(GP,P)|1. More importantly, for our proof, we will use x=ϱ2, the threshold which separates small nodes from large. By Lemma 12, there are no more than n1/2+o(1)/ϱ large nodes in expectation when k=Θ(logn).

4.2.2 Nodes Have Few Children

Observation 13.

With probability at least 1O(n10), the event 13 where every node in the subproblem tree has O(klogn) children holds.

Proof.

We will condition on 9 holding, which occurs with probability 1O(n10) by Proposition 9. Let P=v0,v1,,vh be any level r node in the subproblem tree, contained in some level r recursive graph G. Since R(G,P)=R+(G,v0)R(G,vh) and by 9, it follows that |R(G,P)|2nkr.

Let XP be the number of pivots chosen from R(G,P) at level r. Since the sampling rate at level r is 100kr+1logn/n, we have 𝔼[XP]100klogn. By a Chernoff bound, Pr[XP>200klogn]O(n12). Therefore, Pr[nodes P{XP>200klogn}]O(n10). This implies, using Observation 8 which bounds the number of pieces P is split to by the number of pivots, that Pr[13]1O(n10).

4.2.3 Subtrees Rooted at Small Nodes are Heavily Pruned

Lemma 14.

Let P be a small node in the (pruned) subproblem tree, and let TP be the subtree rooted at it.

𝔼[|V(TP)|]=O(logn).
Proof.

Assume 9 holds.666The contribution from 9 not holding is negligible since Pr[not 9]𝔼[|V(TP)||not 9]<1. This follows from Proposition 9 and |V(TP)|n. For any small node P′′ at level r, we will call it bad if there is some vR(GP′′,P′′) such that |R(GP′′,v)|>(k2log2n)ϱ2; otherwise P′′ is good.

Property of good nodes.

Notice that if P′′ is good, then it has at most 1 child in the pruned subproblem tree since we run TC(G[R(GP′′,p)]) for any pivot pR(GP′′,P′′).

Property of bad nodes.

If P′′ is bad, there is some vR(GP′′,P′′) such that |R(GP′′,v)|>(k2log2n)ϱ2. Using

(k2log2n)|R(GP′′,P′′)|P′′ small(k2log2n)ϱ2<P′′ bad|R(GP′′,v)|9nkr,

we get |R(GP′′,P′′)|<nkr2log2n. Consequently, the expected number of pivots selected from R(GP′′,P′′) is at most O(k1log1n). Letting XP′′ be the number of children P′′ has, and using Observation 8 with the expected number of pivots, 𝔼[XP′′]=1+O(k1log1n).

Total number of nodes.

Let Zr for rlogn/logk be the number of nodes in level r of TP. Conditioning on Zr, the above bound 𝔼[XP′′|Zr]=1+O(k1log1n) still holds and hence it follows that

𝔼[Zr+1] =𝔼Zr[𝔼Zr+1[Zr+1|Zr]] (Law of iterated expectations)
=𝔼Zr[𝔼Zr+1[i[Zr]XPi′′|Zr]] (where Pi′′ is the ith node in level r)
=𝔼[(1+O(k1log1n))Zr] (𝔼[XP′′|Zr]=1+O(k1log1n))
=(1+O(k1log1n))logn/logk (Z0=1 and rlogn/logk)
=O(1).

We conclude that 𝔼[|V(TP)|]=𝔼[r[logn/logk]Zr]lognlogkO(1)=O(logn).

4.2.4 Putting the Pieces Together

We now have all the components to prove Theorem 10.

Proof of Theorem 10.

Let P be any path in G, and TP be its subproblem tree, and k=Θ(logn). We will show later that 𝔼[|V(TP)|]n1/2+o(1)/ϱ. Then, by Markov’s inequality Pr[|V(TP)|n1/2+o(1)/ϱ]>1/2 so that repeating JLS with TC-Pruning Θ(logn) times shortcuts P with probability Ω(n3). Union bounding over O(n2) paths (one chosen for each pair s,tV), the algorithm shortcuts all paths with probability Ω(n1). Let us hence return to showing that 𝔼[|V(TP)|]n1/2+o(1)/ϱ.

Assume 13 holds777The contribution from 13 not holding is negligible since Pr[not 13]𝔼[|V(TP)||not 13]<1. This follows from 13 and |V(TP)|n.. Let L be the number of large nodes in TP. We may upper bound |V(TP)| by

𝔼[|V(TP)|] 𝔼[L+large PP′′children(P):P′′ small|V(TP′′)|]
𝔼[L]+𝔼[LO(log2n)13O(logn)14] (13 and Lemma 14)
=(1+O(log3n))𝔼[L]=n1/2+o(1)/ϱ. (Lemma 12)

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 O~(m) time randomized algorithm that, given an unweighted digraph G, outputs with high probability a nω+o(1)/m2ω2 -shortcut set H with size O~(m).

More generally, we show the following tradeoff which the above is a special case of. Let ϱ[n]. There is an O~(m+nϱ2ω2) time randomized algorithm that, given an unweighted digraph G, outputs with high probability an n1/2+o(1)/ϱ-shortcut set H with size O~(nϱ2).

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 k=Θ(logn). We will condition on the following event:

{r there are O~(kr+1) pivots sampled at level r}9,

which occurs with probability at least 1O(n10) by a Chernoff bound, Proposition 9, and a union bound.

Time.

JLS takes O~(m) time by Proposition 7. We next show that the transitive closure calls, from TC-Pruning, takes O~(nϱ2ω2) time. Recall that each level r transitive closure call is made in a subgraph induced on R(G,p) for each level r pivot p, so long as |R(G,p)|=O~(ϱ2). This takes O~(|R(G,p)|ω) 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 r.

  • Case 1: kr<n/ϱ2. Since there are O~(kr) pivots sampled at recursion level r and below, the time at that level is, up to polylogarithmic factors, kr(ϱ2)ω<nϱ2ω2. Since there are O(logn/loglogn) levels, the bound follows.

  • Case 2: krn/ϱ2. Since there are O~(kr) pivots sampled at recursion level r and 9 holds, the time at that level is, up to polylogarithmic factors,

    kr(nkr)ω=nωkr(ω1)nω(n/ϱ2)ω1=nϱ2ω2.

    Since there are O(logn/loglogn) levels, the bound follows.

Size.

The argument for this is similar to the time bound.

  • Case 1: kr<n/ϱ2. Since there are O~(kr) pivots sampled at recursion level r, the number of shortcuts added at that level is, up to polylogarithmic factors, kr(ϱ2)2<nϱ2. Since there are O(logn/loglogn) levels, the bound follows.

  • Case 2: krn/ϱ2. Since there are O~(kr) pivots sampled at recursion level r and 9 holds, the number of shortcuts added at that level is, up to polylogarithmic factors,

    kr(nkr)2=n2krn2n/ϱ2=nϱ2.

    Since there are O(logn/loglogn) levels, the bound follows.

Main case (𝑶~(𝒎) size shortcut set).

Set ϱ=(m/n)1/(2ω2).

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 λ>c0log3n and α<1/(c0logλ2n) where c0 is a sufficiently large constant.

Suppose there is a parallel algorithm 𝒜0 that, given a digraph G0 with n vertices and m0 edges and reachability hopbound h0=λβ, returns a β-shortcut set of size αm0+f(n).

Then there is a randomized parallel algorithm 𝒜 that, given a digraph G with n vertices and m edges, returns a β-shortcut set of size S(m)=O~(αm+f(n)). 𝒜 makes a polylogarithmic number of sequential calls to 𝒜0 on digraphs with at most S(m)+m edges, and takes an additional O~(m) work and O~(h0) 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 n) span. There is an O~(m) work and nω+o(1)/m2ω2 span randomized parallel algorithm that, given an unweighted digraph G, outputs with high probability a nω+o(1)/m2ω2-shortcut set H with size O~(m).

Proof.
Implementing 𝓐𝟎 (Part 1) – Parallel reduction to shallow DAGs.
888This part may be used for any shortcut set algorithm, hence one may assume that 𝒜0 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 G0 in O~(m) work and O~(h0) span. To see this, note that the algorithm of [18] recurses into graphs induced on intervals of the topological order of the SCCs of G0, hence each recursive instance maintains a h0 reachability hopbound.

By adding a bidirected star in each SCC of G0 to our shortcut set, it then suffices to construct a β/2-shortcut set for the DAG where the SCCs of G0 are contracted. This incurs at most a factor of two dilation to give a β-shortcut set for G0. We henceforth assume G0 is a DAG with reachability hopbound h0.

Implementing 𝓐𝟎 (Part 2) – Parallel JLS with TC-Pruning on shallow DAGs.

Observe that for any h0n1/2+o(1)/ϱ, JLS with TC-Pruning runs in work O~(m+nϱ2ω2) and span O~(h0) for DAGs with reachability hopbound h0.

To see this, first note that the h0 reachability hopbound is preserved in all recursive subgraphs: if an arbitrary pair uv are sent to the same recursive instance G, then every vertex between u and v have the same reachability relations (to the pivots) as u,v and are thus also sent to G. In particular, the h0 hop path from u to v is sent to G. The reachability relations, which are computed by parallel BFS calls, are therefore done in O~(|E(G)|) work and O~(h0) span in each recursive instance G. Next, note that each transitive closure call is done in O~(ϱ2ω) work and polylogarithmic in n span.

Setting parameters.

Fix ϱ=(m0/n)1/(2ω2)/polylog(n) for a sufficiently large power in the polylogarithm term. Let the output of JLS with TC-Pruning on shallow DAGs be a β-shortcut set H with β=n1/2+o(1)/ϱ=nω+o(1)/m02ω2. Note that for this setting of ϱ, we have |H|=O~(nϱ2)=αm0 where α<1/(c0logλ2n). Then, pulling back to shallow digraphs, note that f(n) accounts for the edges added by the bidirected stars and hence f(n)n and S(m)=O~(m).

Putting things together.

Invoking Proposition 15, 𝒜 outputs with high probability a nω+o(1)/m2ω2 -shortcut set with size O~(m) in O~(m) work and nω+o(1)/m2ω2 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 n) span. There is an O~(m) work and nω+o(1)/m2ω2 span randomized parallel algorithm that, given an unweighted digraph G and source sV, outputs with high probability all vertices that s can reach and all vertices that reach s.

Proof.

This follows from using Theorem 16 to extract a nω+o(1)/m2ω2 -shortcut set H of G with size O~(m) in O~(m) work and nω+o(1)/m2ω2 span. Then, run a parallel BFS on GH from s in O~(m) work and nω+o(1)/m2ω2 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 n1/3-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 O(log2n) 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.