Skip to main content
Springer logoLink to Springer
. 2026 Sep 28;88(6):64. doi: 10.1007/s00453-026-01407-2

New Tradeoffs for Decremental Approximate All-Pairs Shortest Paths

Michal Dory 1, Sebastian Forster 2, Yasamin Nazari 3, Tijn de Vos 4,✉
PMCID: PMC13619683  PMID: 42812489

Abstract

We provide new tradeoffs between approximation and running time for the decremental all-pairs shortest paths (APSP) problem. For undirected graphs with m edges and n nodes undergoing edge deletions, we provide four new approximate decremental APSP algorithms, two for weighted and two for unweighted graphs. Our first result is (2+ϵ)-APSP with total update time O~(m1/2n3/2) (when m=n1+c for any constant 0<c<1). Our second result is (2+ϵ,Wu,v)-APSP with total update time O~(nm3/4), where the second term is an additive stretch with respect to Wu,v, the maximum weight on the current shortest path from u to v. Prior to our work the fastest algorithm for weighted graphs with approximation at most 3 had total O~(mn) update time for (1+ϵ)-APSP (Bernstein [11], SICOMP 2016). Our third result is (2+ϵ)-APSP for unweighted graphs in O~(m7/4) update time, which for sparse graphs (m=o(n8/7)) is the first subquadratic (2+ϵ)-approximation. Our last result for unweighted graphs is (1+ϵ,2(k-1))-APSP, for k≥2, with O~(n2-1/km1/k) total update time. For comparison, in the special case of (1+ϵ,2)-approximation, this improves over the state-of-the-art algorithm by Henzinger et al. [2], SICOMP 2016 with total update time of O~(n2.5). All of our results are randomized, work against an oblivious adversary, and have constant query time.

Keywords: All-pairs shortest paths, Distance oracle, Decremental graph algorithm, Approximate shortest paths

Introduction

The dynamic algorithms paradigm is becoming increasingly popular for studying algorithmic questions in the presence of gradually changing inputs. A natural goal in this area is to design algorithms that process each change to the input as fast as possible to adapt the algorithm’s output (or a data structure for querying the output) to the current state of the input. The time spent after an update to perform these computations is called the update time of the algorithm. In many cases, bounds on the update time are obtained in an amortized sense as an average over a long enough sequence of updates. Among dynamic graph problems, the question of maintaining exact or approximate shortest paths has received considerable attention in the past two decades [1–22]. The main focus usually lies on maintaining a distance oracle that answers queries for the distance between a pair of nodes. For this problem, we call an algorithm fully dynamic if it supports both insertions and deletions of edges, and partially dynamic if it supports only one type of updates; in particular we call it decremental if it only supports edge deletions (which is the focus of this paper), and incremental if it only supports edge insertions.

The running times of partially dynamic algorithms are usually characterized by their bounds on the total update time, which is the accumulated time for processing all updates in a sequence of at most m deletions (where m is the maximum number of edges ever contained the graph). A typical design choice, which we also impose in this paper, is small (say polylogarithmic) query time. In particular, our algorithms will have constant query time. While fully dynamic algorithms are more general, the restriction to only one type of updates in partially dynamic algorithms often admits much faster update times. In particular, some partially dynamic algorithms have a total update time that almost matches the running time of the fastest static algorithm, i.e., computing all updates does not take significantly more time than processing the graph once.

Decremental shortest paths. For the decremental single-source shortest paths problem, conditional lower bounds [10, 23] suggest that exact decremental algorithms have an Ω(mn) bottleneck in their total update time (up to subpolynomial factors). On the other hand, this problem admits a (1+ϵ)-approximation (also called stretch) with total update time m1+o(1) in weighted, undirected graphs [1, 6, 8, 14, 18], which exceeds the running time of the state-of-the art static algorithm by only a subpolynomial factor. Hence for the single-source shortest paths problem on undirected graphs we can fully characterize for which multiplicative stretches the total update time of the fastest decremental algorithm matches (up to subpolynomial factors) the running time of the fastest static algorithm.

Obtaining a similar characterization for the decremental all-pairs shortest paths (APSP) problem is an intriguing open question. Conditional lower bounds [10, 24] suggest an Ω(mn) bottleneck in the total update time of decremental APSP algorithms with (a) any finite stretch on directed graphs and (b) with any stretch guarantee with a multiplicative term of α≥1 and an additive term of β≥0 with 2α+β<4 on undirected graphs. This motivates the study of decremental (α,β)-approximate APSP algorithms such that 2α+β≥4, i.e., with a multiplicative stretch α≥2 or an additive stretch β≥2.

Apart from two notable exceptions [2, 25], all known decremental APSP algorithms fall into one of two categories. They either (a) maintain exact distances or have a relatively small multiplicative stretch of (1+ϵ) or (b) they have a stretch of at least 3. The space in between is largely unexplored in the decremental setting. This stands in sharp contrast to the static setting where for undirected graphs approximation guarantees different from multiplicative (1+ϵ) or “3 and above” have been the focus of a large body of works [24, 26–36]. The aforementioned exceptions in dynamic algorithms [2, 25], concern unweighted undirected graphs and maintain (1+ϵ,2)-approximations that simultaneously have a multiplicative error of 1+ϵ and an additive error of 2, which implies a purely multiplicative (2+ϵ)-approximation. The algorithms run in O~(n5/2)1 and n5/2+o(1) total update time respectively. In the next section, we will detail how our algorithms improve over this total update time and generalize to weighted graphs.

Concerning the fully dynamic setting, Bernstein [5] provided an algorithm for (2+ϵ)-APSP which takes m1+o(1) time per update. That is, it cannot be directly compared to total update time; for example it takes m2+o(1) time for a series of m updates. Although we are not aware of any lower bounds, it seems to be hard to beat this: no improvements have been made since. The lack of progress in the fully-dynamic setting motivates the study in a partially dynamic setting, where we obtain improvements for the decremental case.

Our Results

In this paper, we provide novel decremental APSP algorithms with approximation guarantees that previously were mostly unexplored in the decremental setting. For an overview of our results, see Table 1. Our algorithms are randomized and we assume an oblivious adversary, i.e., the sequence of updates is fixed at the start and thus independent of the random choices in the algorithm. For each pair of nodes, we can provide not only the distance estimate, but also a shortest path π of this length in O~(|π|) time using standard techniques, see e.g. [22]. In all our algorithms, we maintain an APSP distance oracle, that is, a data structure that answers APSP-queries in constant time, see Sect. 2.1 for details on the model. In this section, we assume ϵ to be a constant and hence can hide 1/ϵ factors in our asymptotic notation. Update times with ϵ as a parameter, and hence containing 1/ϵ factors, can be found in our technical sections.

Table 1.

An overview of our results and the closest related work

Approximation Total update time
Weighted 1+ϵ nm [11]
2+ϵ n3/2m1/2 Theorem 1.1
(2+ϵ,Wu,v) nm3/4 Theorem 1.2
3+ϵ n1/2m [20]
Unweighted (1+ϵ,2) or 2+ϵ n5/2 [2, 25]
2+ϵ m7/4 Theorem 1.3
(1+ϵ,2(k-1)) n2-1/km1/k Theorem 1.4
(1+ϵ,2(1+2ϵ)k-2) n2+1/k [7]

We use the simplifying assumptions: (a) subpolynomial factors are omitted from the total update time; (b) the ratio W between the maximum and minimum weight is polynomial in n; and (c) ϵ is a constant. The combination of (a) and (c) means that 1/ϵ factors are not displayed in the total update time here

(2+ϵ)-APSP for weighted graphs. Our first contribution is a Las Vegas algorithm for maintaining a (2+ϵ)-approximation in weighted, undirected graphs.

Theorem 1.1

Given a graph G with positive, integer weights and a constant 0<ϵ<1, there is a decremental data structure that maintains a (2+ϵ)-approximation of APSP. The algorithm has constant query time and works against an oblivious adversary. The total update time is w.h.p.

  • O~(m1/2n3/2log3(nW)) if m=n1+Ω(1) and m≤n2-ρ for an arbitrary small constant ρ,

  • O~(m1/2n3/2+ρlog3(nW)) if m≥n2-ρ for any constant ρ,

  • O~(m1/2n3/2+o(1)log3(nW)) otherwise,

where W is the ratio between the maximum and minimum weight.

The fastest known algorithm with an approximation ratio at least as good as ours is the (1+ϵ)-approximate decremental APSP algorithm by Bernstein [11] with total update time O~(mn). With our (2+ϵ)-approximation, we improve upon this total update time when m=n1+η, for any η>0. Furthermore, the fastest known algorithm with a larger approximation ratio than our algorithm is the (3+ϵ)-approximate decremental distance oracle by Ła̧cki and Nazari [20] with total update time O~(mn). Our result also has to be compared to the fully dynamic algorithm of Bernstein [5] for maintaining a (2+ϵ)-approximation that takes amortized time m1+o(1) per update. Note that in unweighted graphs, (2+ϵ)-approximate decremental APSP algorithm can be maintained with total update time O~(n2.5) (which is implied by the results of Abraham and Chechik [25] and Henzinger et al. [2]). Our approach improves upon this bound for most densities, and matches it for m=n2.

(2+ϵ,1)-APSP for unweighted and (2+ϵ,Wu,v)-APSP for weighted graphs. Our second contribution is a faster algorithm with an additional additive error term of 1 for unweighted graphs, which in turn can be used to obtain our unweighted (2+ϵ)-APSP result. The corresponding generalization to weighted graphs can be formulated as follows.

Theorem 1.2

Given a graph G with positive, integer weights and a constant 0<ϵ<1, there is a decremental data structure that maintains a (2+ϵ,Wu,v)-approximation for APSP, where Wu,v is the maximum weight on a current shortest path from u to v. The algorithm has constant query time and works against an oblivious adversary. The total update time is w.h.p. O~(nm3/4log3(nW)) if m=n1+Ω(1), and O~(n1+o(1)m3/4log3(nW)) otherwise, where W is the ratio between the maximum and minimum weight.

Here, W is a global parameter, while Wu,v is local and depends on u and v.

(2+ϵ)-APSP for unweighted graphs. We obtain this result by a general reduction from mixed approximations to purely multiplicative approximations, which might be of independent interest beyond the dynamic setting. See Theorem 3.1 for the statement. We can then combine this with Theorem 1.2 to obtain a fast algorithm for non-dense unweighted graphs.

Theorem 1.3

Given an undirected unweighted graph G, there is a decremental data structure that maintains a (2+ϵ)-approximation for APSP with constant query time. The algorithm works against an oblivious adversary. W.h.p. the total update time is bounded by O~(m7/4) if m=n1+Ω(1), and O~(m7/4+o(1)) otherwise.

Note that for m=o(n8/7) this gives the first subquadratic decremental (2+ϵ)-approximate APSP algorithm. For m≤n6/5, this approach is faster than our weighted result, Theorem 1.1, which was already beating the unweighted state-of-the-art [2, 25].(1+ϵ,2(k-1))-APSP for unweighted graphs. Our fourth contribution is an algorithm for unweighted, undirected graphs that maintains, for any k≥2, a (1+ϵ,2(k-1))-approximation, i.e., a distance estimate that has a multiplicative error of 1+ϵ and an additive error of 2(k-1).

Theorem 1.4

Given an undirected unweighted graph G, a constant 0<ϵ<1 and an integer 2≤k≤logn, there is a decremental data structure that maintains (1+ϵ,2(k-1))-approximation for APSP with constant query time. The algorithm works against an oblivious adversary. The expected total update time is bounded by min{O(n2-1/k+o(1)m1/k),O~((n2-1/km1/k)O(1/ϵ)k/ρ)} where m=n1+ρ.

Note that for small values of k and if m=n1+ρ for a constant ρ>0, we get total update time of O~(n2-1/km1/k), and otherwise we have an extra no(1) factor. In addition, in the special case of k=logn, we get a near-quadratic update time of O(n2+o(1)). The state-of-the-art for a purely multiplicative (1+ϵ)-approximation is the algorithm of Roditty and Zwick with total update time O~(mn).2 It was shown independently by Abraham and Chechik [25] and by Henzinger et al. [2] how to improve upon this total update time bound at the cost of an additional small additive error term: a (1+ϵ,2)-approximation can be maintained with total update time O~(n2.5). This has been generalized by Henzinger et al. [7] to an additive error term of 2(1+2ϵ)k-2 and total update time O~(n2+1/kO(1ϵ)k-1). We improve upon this tradeoff in two ways: (1) our additive term is independent of 1/ϵ and linear in k and (2) our algorithm profits from graphs being sparse.

Static follow-up work. Interestingly, our techniques inspired a new algorithm for a static 2-approximate distance oracle [37], giving the first such distance oracle algorithm with subquadratic construction time for sparse graphs. Moreover, for m=n they match conditional lower bounds [38, 39].

Related Work

Static algorithms. The baseline for the static APSP problem are the exact textbook algorithms with running times of O(n3) and O~(mn), respectively. There are several works obtaining improvements upon these running times by either shaving subpolynomial factors or by employing fast matrix multiplication, which sometimes comes at the cost of a (1+ϵ)-approximation instead of an exact result. See [40] and [41], and the references therein, for details on these approaches. For the regime of stretch 3 and more in undirected graphs, a multitude of algorithms have been developed with the distance oracle of Thorup and Zwick [42] arguably being the most well-known construction. In the following, we focus on summarizing the state of affairs for approximate APSP with stretch between 1+ϵ and 3.

In weighted, undirected graphs, Cohen and Zwick [27] obtained a 2-approximation with running time O~(m1/2n3/2). This running time has been improved to O~(mn+n2) by Baswana and Kavitha [28]. Employing fast matrix multiplication, Kavitha [30] provided an algorithm for (2+ϵ)-APSP that takes O~(n2.25) time. Subsequently, Dory et al. [37] provided two algorithms for (2+ϵ)-APSP, for dense graphs: O(n2.214) and sparse graphs: O~(mn2/3). In addition, efficient approximation algorithms for stretches of 73 [27] and 52 [30] have been obtained. These results have recently been generalized by Akav and Roditty [36] who presented an algorithm with stretch 2+k-2k and running time O~(m2/kn2-3/k+n2) for any k≥2. Moreover, Cohen and Zwick [27] obtained an O~(n1-1/km1/k)-time algorithm that outputs an APSP approximation d^(·,·), which for any two vertices u,v∈V and any u-v path π satisfies d(u,v)≤d^(u,v)≤w(π)+2∑i=1k-1ωi, where ωi is the i-th heaviest edge on π.

In unweighted, undirected graphs, a (1, 2) -approximate APSP algorithm with running time O~(n2.5) has been presented by Aingworth, Chekuri, Indyk and Motwani [26]. This has been improved by Dor, Halperin, and Zwick [24] that showed a (1, 2)-approximation with running time O~(min{n3/2m1/2,n7/3}). They also show a generalized version of the algorithm that gives stretch (1, k) and running time O~(min{n2-2/(k+2)m2/(k+2),n2+2/(3k-2)}) for every even k>2. Recently, faster (1, k)-approximation algorithms based on fast matrix multiplication techniques were developed [43–45], here as well the fastest (1, 2)-approximation runs in O(n2.260) time [44]. This was extended to a (1+ϵ,2)-approximation in O(n2.152) time [37]. In addition, recently Roditty [46] extended the approach of [24] to obtain a combinatorial (2, 0)-approximation for APSP in O~(n2.25) time in unweighted undirected graphs. Using fast matrix multiplication, this running time was improved to O(n2.032) [37, 45].

Berman and Kasiviswanathan [29] showed how to compute a (2, 1) -approximation in time O~(n2). Subsequent works [28, 31–34] have improved the polylogarithmic factors in the running time and the space requirements for such nearly 2-approximations. Recently, slightly subquadratic algorithms have been given: an algorithm with stretch (2(1+ϵ),5) by Akav and Roditty [35], and an algorithm with stretch (2, 3) by Chechik and Zhang [47].

Decremental algorithms. The fastest algorithms for maintaining weighted, exact APSP under edge deletions have total update time O~(n3) [3, 19, 48]. There are several algorithms that are more efficient at the cost of returning only an approximate solution. In particular, a (1+ϵ)-approximation can be maintained in total time O~(mn) [4, 11, 15]. If additionally, an additive error of 2 is tolerable, then a (1+ϵ,2)-approximation can be maintained in total time O~(n2.5) in unweighted, undirected graphs [2, 25]. Note that such a (1+ϵ,2)-approximation directly implies a (2+ϵ)-approximation because the only paths of length 1 are edges between neighboring nodes. All of these decremental approximation algorithms are randomized and assume an oblivious adversary. Deterministic algorithms with stretch 1+ϵ exist for unweighted, undirected graphs with running time O~(mn) [2], for weighted, undirected graphs with running time O~(mn1+o(1)) [18] and for weighted, directed graphs with running time O~(n3) [16].

Decremental approximate APSP algorithms of larger stretch, namely at least 3, have first been studied by Baswana, Hariharan, and Sen [49]. After a series of improvements [4, 6, 8, 12], the state-of-the-art algorithms of [13, 20] maintain (2k-1)(1+ϵ)-approximate all-pairs shortest paths for any integer k≥2 and 0<ϵ≤1 in total update time O~((m+n1+o(1))n1/k) with query time O(loglog(nW)) and O(k) respectively. All of these “larger stretch” algorithms are randomized and assume an oblivious adversary.

Deterministic decremental algorithms have been developed by Chuzhoy and Saranurak [21] and by Chuzhoy [17], which have even been improved and generalized to fully dynamic algorithms. For example, Haeupler, Long, and Saranurak[50] provide worst update time O~(mμ) for any constant μ and constant stretch. As observed by Mądry [51], decremental approximate APSP algorithms that are deterministic – or more generally work against an adaptive adversary – can lead to fast static approximation algorithms for the maximum multicommodity flow problem via the Garg-Könemann-Fleischer framework [52, 53]. Similarly, decremental Single Source Shortest Paths (again, deterministic or against an adaptive adversary) play a role in the recent fast min cost flow algorithms [18, 54, 55]. The above upper bounds for decremental APSP have recently been contrasted by conditional lower bounds [56] stating that constant stretch cannot be achieved with subpolynomial update and query time under certain hardness assumptions on 3SUM or (static) APSP.

Fully dynamic algorithms. Next, we discuss the related work on fully dynamic shortest paths. We would like to point out that all “combinatorial” algorithms discussed in the following (i.e., algorithms that do not rely on “algebraic” techniques like dynamic matrix inverse) are internally employing decremental algorithms.

The reference point in fully dynamic APSP with subpolynomial query time is the exact algorithm of Demetrescu and Italiano [57] with update time O~(n2) (with log-factor improvements by Thorup [58]) and constant query time for weighted directed graphs.. Subsequently, researchers have developed algorithms with subcubic worst-case update time and constant query time [59, 60] with some of them being deterministic [61, 62]. Note that one can construct a simple update sequence for which any fully dynamic algorithm maintaining the distance matrix or the shortest-path matrix explicitly needs to perform Ω(n2) changes to this matrix per update. Algorithms breaking the n2 barrier at the cost of large query time have been obtained in unweighted directed graphs [23, 63, 64] and sparse weighted directed graph [65].

In addition to exact algorithms, combinatorial and algebraic algorithms have also been developed for the low stretch regime of (1+ϵ)-approximation. In particular, Roditty and Zwick [4] obtained the following trade-off with a combinatorial algorithm: update time O~(mn/t) and query time O(t) for any δ>0 and t≤m1/2-δ. Subsequently, for t≤n, a deterministic variant was developed [66] and it was generalized to weighted directed graphs [11]. Furthermore, by a standard reduction (see e.g. [67]) using a decremental approximate single-source shortest paths algorithm [8, 18], one obtains a combinatorial deterministic algorithm with update time O(nm1+o(1)/t) and query time O(t) for any t≤n, for the fully dynamic all-pairs problem in weighted undirected graphs. Algebraic approaches can achieve subquadratic update time and sublinear query time, namely worst-case update time O(n1.863) and query time O(n0.666) in weighted directed graphs [68], or worst-case update time O(n1.788) and query time O(n0.45) in unweighted undirected graphs [69]. In directed graphs, van den Brand and Karczmarz [70] provided explicit APSP with O(n2.293/ε) worst case update time for unweighted graphs.

Several fully dynamic distance oracles have been developed that obtain a larger stretch of 2+ϵ. In particular, Bernstein [5] developed a distance oracle with update time O(m1+o(1)) and query time O(logloglogn) in weighted undirected graphs. It can be made deterministic using the deterministic approximate single-source shortest path algorithm by Bernstein, Probst Gutenberg, and Saranurak [18]. The only conditional lower bound in this regime that we are aware of states that no algorithm can maintain a (3-ϵ)-approximation with update time O(n1/2-δ) and query time O(n1-δ) for any δ>0, unless the OMv conjecture fails [10].

In the regime of stretch at least 3, the following trade-offs between stretch and update time have been developed: Abraham, Chechik, and Talwar [12] designed an algorithm for unweighted undirected graphs with stretch 2O(ρk), update time O~(m1/2n1/k), and query time O(k2ρ2), where k≥1 is a freely chosen parameter and ρ=1+⌈logn1-1/k/log(m/n1-1/k)⌉. Forster, Goranci, and Henzinger [71] designed an algorithm for weighted undirected graphs with stretch O(logn)3k-2, update time m1/k+o(1)·O(logn)4k-2, and query time O(klog2n), where k≥2 is an arbitrary integer parameter. Further, we note that any algorithm whose update time depends on the sparsity of the graph (possibly also a static one) can be run on a spanner of the input graph maintained by a fully dynamic spanner algorithm [72]. Finally, recent works [50, 73] have developed deterministic fully dynamic distance oracles. In particular, the work of Kyng, Meierhans, and Probst Gutenberg [73] achieves an no(1) approximation ratio with no(1) worst-case update time and polylogarithmic query time. Meanwhile, the work of Haeupler, Long, and Saranurak [50] provides a constant-factor approximation with arbitrarily low polynomial worst-case update time and polylogarithmic query time.

Outline

We give an overview of the notation, terminology, and various decremental tools we use in Sect. 2. Next, we give a high-level overview of our techniques and provide an intuition for our algorithms in Sect. 3. Then follow three technical sections. In Sect. 4, we prove Theorem 1.1. Then we prove Theorem 1.2 and 1.3 in Sect. 5. Lastly, we prove Theorem 1.4 in Sect. 6.

Preliminaries

Notation and Terminology

Throughout this paper, neighbors of a node v are denoted by N(v). We denote by dG(u,v) the distance between u and v in the graph G. If G is clear from the context, we use the notation d(u, v). When G is a weighted graph, we allow for positive, integer weights. We denote by W the ratio between the maximum and minimum weight of the graph. Moreover, we denote by Wu,v the maximum weight on a shortest path from u to v. In particular, Wu,v≤W and hence additive approximations in terms of Wu,v can be tighter than in terms of W.

We are interested in designing dynamic graph algorithms for shortest path problems, which support both update and query operations. In particular, we look at decremental algorithms, which support weight increases and edge deletions. This is opposed to fully dynamic algorithms, which also support weight decreases and edge insertions. To be concrete, we support the following three operations:

  • Delete(u, v): delete the edge {u,v} from the graph;

  • Update(u,v,Δ): increase the weight of an edge {u,v} to Δ, i.e., w(u,v)←Δ;

  • Distance(u, v): return a distance approximation d^G(u,v) between the nodes u and v in the current graph G.

We assume that we have an oblivious adversary, i.e., that the sequence of updates is fixed from the start. This is as opposed to the adaptive adversary, which can use the random choices made by the algorithm to determine the next update. More formally, let St denote the state of the algorithm after update t and let Rt be the random bits used in this update step. An oblivious adversary chooses the entire update sequence σ=(σ1,⋯,σm) before execution begins, and hence purely based on the algorithm’s description and independent of the algorithm’s states St and random bits Rt. An adaptive adversary selects each input σt sequentially based on the algorithm’s description, the history of the algorithm’s past states S1,⋯St-1, and the used random bits R1,⋯Rt-1. Since an adversary can determine future states of a deterministic algorithm, any correct deterministic algorithm holds against an adaptive adversary.

Edge weights can be positive integers bounded by W, for some parameter W∈N. We say that Distance(()u,v) returns (α,β)-approximate distances, denoted by d^G, if dG(u,v)≤d^G(u,v)≤αdG(u,v)+β for all u,v∈V. Moreover we denote (α,0)-approximate by α-approximate. Throughout, we denote d^G for the output of our algorithms, and δ (potentially with subscript) for approximate distances used internally.

In all our algorithms, we maintain a distance oracle rather than explicit APSP. This means that we maintain a data structure that can answer distance queries Distance(u,v) for any u,v∈V. The time to answer a distance query Distance(u,v) is called the query time. All our algorithms use constant query time. Further, we give the total update time, which is the time needed to process a sequence of up to m edge deletions or weight increases, where m is the number of edges before the first deletion.

For any object, value, or data structure x that changes over time, we use a superscript x(t) to specify its state at time t, i.e., x(t) is x after processing t updates.

Bunches and Clusters

We start by reviewing the concepts of bunch and cluster as defined in the seminal distance oracle construction of Thorup and Zwick [42]. Given a parameter p∈[0,1], called the cluster sampling rate, we let A be a set of sampled nodes, where each node is sampled uniformly at random with probability p. Then we define the pivot of a node v to be the closest node in A, i.e., p(v)=pA(v)=argmins∈Ad(s,v). Since our algorithms contain only one level of sampling, and thus A we will be fixed throughout, we omit the subscript A henceforth. The bunch B(v) of a node v is the set B(v):={u∈V:d(u,v)<d(v,p(v))} and the clusters are C(u):={v∈V:d(u,v)<d(v,p(v))}={v∈V:u∈B(v)}. Hence bunches and clusters are inverses of each other: u∈B(v) if and only if v∈C(u).

Thorup and Zwick showed how to compute bunches and clusters in the static setting in O~(mp) time [42]. However, it is challenging to maintain them exactly under deletions: for starters, we cannot compute exact distances from the pivots efficiently. In the static setting, we can compute such distances in O~(pnm) time, by running Dijkstra’s algorithm from every pivot. In the decremental setting, we only have efficient exact shortest path computation (through ES-trees, defined in Sect. 2.4) when we restrict to bounded depth, which is not sufficient for our applications. It is possible to maintain approximate bunches that can deal with these challenges. We note that Roditty and Zwick [4] provide an algorithm that is efficient for maintaining decremental bunches exactly, but again only up to bounded depth, see Lemma B.1. So, this is too expensive for our purpose. Instead we use another type of approximate bunches proposed by Łącki and Nazari [20]. We start by relaxing the definition of the pivot: the approximate pivot p~(v)∈A of a node v does not have to be the closest node in A, but just within a (1+ϵ) factor of it:

dG(v,p(v))≤δB~(v,p~(v))≤(1+ϵ)dG(v,p(v)).

Next, we define an approximate bunch B~(v), which rather than containing the exact bunch B(v) contains all nodes that are at least a factor 1/(1+ϵ) closer than the exact pivot p(v). More precisely, for our analysis, our approximate bunch B~(v) needs to contain all nodes {w∈V:(1+ϵ)dG(v,w)<dG(v,p(v))}. More precisely, in the stretch analysis of Theorem 1.1 (see Lemma 4.8), we need that if w∉B~(v), that dG(v,w)≥dG(v,p(v))1+ϵ, i.e., that nodes not in the bunch are far enough away. Since we can lose a factor (1+ϵ) in our distance estimates, we do not need that the nodes are actually farther away than the pivot (this would mean that the entire bunch B(v)⊆B~(v)), but it suffices that all nodes sufficiently closer than the pivot are in there. It can also contain additional nodes. For efficiency purposes, we still want the approximate bunch to remain small, say only polylogarithmically larger than the exact bunch B(v).

Finally, for every node v∈V and every node u∈B~(v), we need to maintain a distance estimate δB~(u,v). Here also an approximate distance will suffice:

dG(u,v)≤δB~(u,v)≤(1+ϵ)dG(u,v).

The following lemma provides these approximate objects. It is implicitly proven by Łącki and Nazari [20], but for completeness we sketch a proof in Appendix B. The lemma outputs: approximate pivots, approximate bunches, and a distance estimate δB~(u,v) for v∈V and u∈B~(v).

Lemma 2.1

Let G=(V,E,w) be a decremental graph, and let 0<ϵ<1 and 0<ρ<1/2 be parameters, let 0<p<1 be a sampling probability, and let A⊆V be a set of sampled nodes, where each element of V is sampled uniformly at random with probability p. There exists an algorithm that maintains for each v∈V: (i) an approximate pivot p~(v)∈A; (ii) an approximate bunch B~(v); and (iii) distance estimates δB~(v,u) for every u∈B~(v). These objects satisfy:

  • dG(v,p(v))≤δB~(v,p~(v))≤(1+ϵ)dG(v,p(v));

  • {w∈V:(1+ϵ)dG(v,w)<dG(v,p(v))}⊆B~(v);

  • δB~ is monotone (non-decreasing over updates);

  • for any u∈B~(v): dG(u,v)≤δB~(u,v)≤(1+ϵ)dG(u,v); and

  • with high probability, |B~(v)|=OlognlognWp.

The algorithm has total update time O~(mnρp·log2(nW))·O(1ρϵ)1+2/ρ.

The approximate cluster is the reverse of the approximate bunch: C~(u):={v∈V:u∈B~(v)}.

In our algorithms for balancing out different terms in the running time we set the parameter ρ depending on the graph density so that m=n1+ρ. Hence for graphs with m=n1+Ω(1) edges, we can set ρ to be a constant and for sparser graphs we can set ρ=lognloglogn. For simplicity of our statements in the introduction (Sect. 1) and the overview (Sect. 3) we assume 0<ϵ<1 is a constant, and thus we hide (1/ϵ)c factors in O~ when c is constant, or in no(1) when c=ω(1).

Decremental Multi-Source Shortest Paths

We will use the following lemma from Łącki and Nazari [20] to maintain (1+ϵ)-approximate distances for S×V, for S some given set of sources.

Lemma 2.2

([20]) There is a data structure which given a weighted, undirected graph G=(V,E) explicitly maintains (1+ϵ)-approximate distances from a set of sources S in G under edge deletions, where 0<ϵ<1/2 is a parameter. After each update, the algorithm returns all nodes for which the distance estimate has changed. During the execution of the algorithm, nodes can be added to S. We write s for the final size of S. Assuming that |E|=n1+Ω(1) and s=nΩ(1), the total update time is w.h.p. O~(sm/ϵ). If |E|=n1+o(1) or s=no(1), then the total update time is O~smn(1/ϵ)O~(logn).

Here the factor (1/ϵ)O~(logn) again simplifies to no(1) for constant ϵ.

ES-Trees

An Even-Shiloach tree (ES-tree) is a central data structure for maintaining distances in a decremental setting. It maintains the exact distances from a source s under edge deletions, giving the following.

Lemma 2.3

([74–76]) There is a data structure called ES-tree that, given an integer-weighted directed graph G undergoing deletions and edge weight increases, a root node s, and a depth parameter d, maintains, for every node v a value ℓs(v) such that ℓs(v)=dG(s,v) if dG(s,v)≤d and ℓs(v)=∞ if dG(s,v)>d. It has constant query time and a total update time of O(md+n), where m is the number of edges in G.

A monotone ES-tree is a generalization of ES-tree studied in [2, 8, 14, 77] that handles edge insertions. This is a data structure that maintains distances from a source s in a graph undergoing deletions, insertions and edge weight increases. Note that when edges are inserted to the graph, it can potentially decrease some distances in the graph. However, the data structure ignores such decreases, and maintains distance estimates ℓs(v) from s to any other node, that can only increase during the algorithm. In particular, these distance estimates are not necessarily the correct distances in the graph, and when using this data structure the goal is to prove that these estimates still provide a good approximation for the current distances. We call ℓs(v) the level of v in the monotone ES-tree rooted at s.

We next describe the main properties of monotone ES-trees that we use in our algorithms. A pseudo-code appears in Appendix A. The following lemma follows from [2] and from the pseudo-code.

Lemma 2.4

The following holds for a monotone ES-tree of a graph H rooted at s, that is maintained up to distance d:

  1. At the beginning of the algorithm, ℓs(v)=dH(s,v) for all nodes v where dH(s,v)≤d.

  2. It always holds that dH(s,v)≤ℓs(v).

  3. The level ℓs(v) of a node v never decreases.

  4. When the level ℓs(v) increases to a value that is at most d, we have ℓs(v)=minx∈N(v){ℓs(x)+wH(x,v)}.

Lemma 2.5

([2]) For every d≥1, the total update time of a monotone ES-tree up to maximum level d on a graph H undergoing edge deletions, edge insertions, and edge weight increases is O(E(H)·d+W(H)+n), where E(H) is the total number of edges ever contained in H and W(H) is the total number of updates to H.

Near-Additive Decremental APSP

In [7], the authors show an algorithm that obtains near-additive approximations for decremental APSP. This result will be used to handle certain cases in Sect. 6.

Theorem 2.6

(Theorem 1.3 in [7]) For any constant 0<ϵ<1 and integer 2≤k≤logn, there is a (1+ϵ,2(1+2/ϵ)k-2)-approximation algorithm for decremental APSP with constant worst-case query time and expected total update time of O~(n2+1/k(37/ϵ)k-1).

Notation Overview and Choice of Parameters

To guide the reader, we give an overview of how notation is used in this paper. Whenever we deviate from these assumptions, this is clearly stated in the text.

Generally, superscripts ·(t) are used to denote a value or object at time step t. For readability, this superscript is omitted when it is not necessary. We denote the exact distance from u to v by d(u, v). As defined in Sect. 2.4, ℓs(v) denotes the level of v in the (monotone) ES-tree rooted at s. Hence ℓs(v)=d(s,v) maintains the exact distance. We denote any (1+ϵ)-approximate distance estimate by δ. It can be equipped with a subscript to denote the origin of the approximation. Given some value w, we write w~ to denote a (1+ϵ) approximation that changes at most O(log1+ϵ(nW)) times. Formally, this is achieved by setting w~=(1+ϵ)⌈log1+ϵw⌉. Similarly, δ~ is a (1+ϵ)-approximate distance that only changes O(log1+ϵ(nW)) times. Finally, we denote the approximate APSP that the algorithm outputs by d^, e.g., a (2+ϵ)-approximation of APSP.

High-Level Overview

In this section we provide a high-level overview of our algorithms. First we describe our (2+ϵ)-APSP algorithms for weighted graphs, by giving a simpler static version first. Then we describe our (2+ϵ,Wu,v)-APSP algorithm, where we introduce a notion of bunch overlap threshold to overcome the challenge of dynamically maintaining a well-known static adaptive sampling technique [78] (see Sect. 3.2). We give a reduction from mixed approximations to purely multiplicative approximations, which together with the previous result gives our (2+ϵ)-APSP algorithm for unweighted graphs. Finally, we describe our (1+ϵ,2(k-1))-APSP algorithm for any k≥2 in unweighted graphs.

As in Sect. 1, we assume ϵ to be a constant in this section. Hence, we can hide 1/ϵ factors in our asymptotic notation. Update times with ϵ as a parameter, and hence containing 1/ϵ factors, can be found in our technical sections. In all cases, these factors are inherited from the use of decremental single source shortest path (SSSP) algorithms (see, e.g., [79]), and hence do not form a critical part of our paper.

(2+ϵ)-APSP for Weighted Graphs

We first present a warm-up static algorithm that we later turn into a dynamic algorithm.

Static 2-APSP

We consider the bunches and clusters of the well-known distance oracles of Thorup and Zwick [42], as introduced in Sect. 2.2. In particular, we consider sampling probability p, set of sampled nodes A, and bunches B(v) and clusters C(v) for v∈V. We store the distances A×V, together with the clusters and bunches of each node. Moreover, we store the distances d(u, v) for all u∈V and v∈B(u). With this information, we can query 3-approximate distances for any pair u,v∈V×V. At a high-level, this works as follows. We either have v∈B(u) and so we explicitly have stored their distance, or we can get a 3-approximate estimate by computing d(u,p(u))+d(p(u),v), since

d(u,p(u))+d(p(u),v)≤d(u,p(u))+d(u,p(u))+d(u,v)≤3d(u,v),

where the first step follows by the triangle inequality and the second step by the fact that d(u,p(u))≤d(u,v) if v∉B(u). In the following, we explain that in some special cases we can directly use the estimate d(u,p(u))+d(p(u),v) to obtain a 2-approximation for a pair u, v. In other cases, we can store more information depending on how B(u) and B(v) overlap and use this to obtain a 2-approximation to d(u, v).

Let us assume that for all nodes v we have computed B(v) and have access to all the distances from v to each node u∈B(v). Also assume that we have computed the distances from the set A to all nodes. We now describe how using this information we can get a 2-approximate estimate of any pair of nodes u, v in the first case. In another case we will discuss what other estimates we need to precompute. Let π be a shortest path between u and v. We consider two cases depending on how the bunches B(u) and B(v) interact with π. A similar case analysis was used in [80, 81] in distributed approximate shortest paths algorithms.

  1. There exists w∈π such that w∉B(u)∪B(v) (left case in Fig. 1): Since w is on the shortest path π, we either have d(w,u)≤d(u,v)/2 or d(v,w)≤d(u,v)/2. Suppose d(w,u)≤d(u,v)/2. We observe that by definition d(u,p(u))≤d(u,w), hence we obtain d(u,p(u))+d(p(u),v)≤d(u,p(u))+d(u,p(u))+d(u,v)≤2d(u,v), where the first step follows by the triangle inequality and the second step by the fact that d(u,p(u))≤d(u,w)≤d(u,v)/2. The case that d(v,w)≤d(u,v)/2 is analogous, and hence by computing min{d(u,p(u))+d(p(u),v),d(v,p(v))+d(p(v),u)} we get a 2-approximation.

  2. There exists no w∈π such that w∉B(u)∪B(v). In other words, (B(u)∪B(v))∩π=π and hence there exists at least one edge {u′,v′} on π where u′∈B(u) and v′∈B(v) (right case in Fig. 13): in this case we can find the minimum over estimates obtained through all such pairs u′,v′, i.e. by computing d(u,u′)+w(u′,v′)+d(v′,v). We note that this case includes the arguably easier situation that the bunches overlap, i.e., B(u)∩B(v)≠∅ (not reflected in the picture).

Fig. 1.

Fig. 1

Possible scenarios for the overlap between the bunches B(u), B(v) and a shortest path π from u to v

If we had access to all the above distances for the bunches and the pivots, we could then use them to query 2-approximate distances between any pair u,v∈V. As we will see, in our algorithms we only have approximate bunches and pivots which lead to (2+ϵ)-approximate queries.

Running time. We can compute bunches and clusters in O~(mp) time [42]. We need to compute shortest paths from the set of pivots A for the estimates in Case 1. This takes O(|A|m)=O~(pnm) time using Dijkstra’s algorithm. Finally, we consider Case 2. A straight-forward approach is to consider each pair of vertices u, v, and all u′∈B(u) and v′∈B(v). This takes O(n2p2) time.

We use an intermediate step that computes the distance between u′ and v if there is an edge {u′,v′}∈E such that v′∈B(v). For each node v∈V, we consider all v′∈B(v), for which we consider all neighbors u′∈N(v′) and compute the estimate w(u′,v′)+d(v′,v) (and replace current u′-v minimum if it is smaller). Since |B(v)|=O~(1p), we can compute these estimates for all d(u′,v) in O~(n2p) time.

Next, for each pair u,v∈V, we take the minimum over the distances d(u,u′)+d(u′,v) for all u′ in the bunch B(u) using the precomputed distances from the previous step in time O~(n2/p), by iterating over all pairs u,v∈V, and all u′∈B(u). So in total the adjacent case takes time O~(n2p). Hence the total running time of the algorithm will be O~(pnm+m/p+n2/p)=O~(pnm+n2/p). By setting p=nm we obtain the total update time O~(m1/2n3/2).

There are several subtleties that make it more difficult to maintain these estimates in decremental settings. Not only do distances change, but also which nodes are part of a bunch change due to the updates. Moreover, which bunches are adjacent to each other changes. We next discuss how these intricacies can be handled. We obtain a total update time that matches the stated static running time (up to subpolynomial factors).

Dynamic Challenges

Maintaining bunches and pivots. First, we need to dynamically maintain bunches efficiently as nodes may join and leave a bunch throughout the updates using an adaptation of prior work. One option would be maintaining the clusters and bunches using the [4] framework, however using this directly is slow for our purposes. Hence we maintain approximate clusters and bunches using hopsets of Łącki and Nazari [20]. This algorithm also maintains approximate pivots, i.e. pivots that are within (1+ϵ)-approximate distance of the true closest sampled node. These estimates let us handle the first case (up to (1+ϵ) approximation). One subtlety is that the type of approximate bunches used in [20] is slightly different from the type of approximate bunches we need for other parts of our algorithm. Specifically, we need to bound the number of times nodes in a bunch can change. Roughly speaking, we can show this since the graph is decremental and the estimates obtained from the algorithm of [20] are monotone. Hence we perform lazy bunch updates, where we only let a bunch grow if the distance to the pivot grows by at least a factor 1+ϵ. This means a bunch grows at most O(log1+ϵ(nW)) times. In addition, these approximate bunches need to be taken into account in our stretch analysis.

We note that (1+ϵ)-approximate decremental SSSP takes O~(m1+o(1)) total update time. However, we use the multi-source shortest path result from [20], where the no(1)-term vanishes when applied with polynomially many sources, giving us a total update time of O~(|A|m).

Maintaining estimates for Case 2. When we are in Case 2, we need more tools to keep track of estimates going through these nodes since both the bunches and the distances involved are changing. In particular, we explain how by using heaps in different parts of our algorithm we get efficient update and query times. Moreover, note that we have an additional complication: there are two data structures in this step, where one impacts the other. We need to ensure that an update in the original graph does not lead to many changes in the first data structure, which all need to be processed for the second data structure.

To be precise, we need intermediate data structures Qu′,v that store approximate distances for u′ and v of the form w(u′,v′)+δ(v′,v) for each v′∈B(v) such that {u′,v′}∈E, as explained for the static algorithm. The static algorithm used the exact distance d(v′,v), while here we use an estimate: throughout this section (Sect. 3.1.2), δ(·,·) denotes (1+ϵ)-approximate distances in our dynamic data structures. Also as opposed to the static algorithm, we do not only keep the minimum, but instead maintain a min-heap, from which the minimum is easily extracted.

However, this approach has a problem: δ(v′,v) might change many times, and for each such change we need to update at most |N(v′)|≤n heaps. To overcome this problem, we use another notion of lazy distance update: we only update a bunch if the estimate of a node changes by at least a factor 1+ϵ. Combining this with the fact that, due to the lazy bunch update, nodes only join a cluster at most O(log1+ϵ(nW)) times, and thus there is only an O(log1+ϵ(nW)log(nW)) overhead in maintaining these min-heaps Qu′,v dynamically due to bunch updates. Note that at this stage, it is not relevant which node is declared the pivot: only the distance to the pivot influences the bunch.4

Similarly, w(u′,v′) might change many times, which has an impact for every v∈C(v′). Since this can be many nodes, we need to use an additional trick so that an adversary cannot increase our update time to mn. Again the solution is a lazy update scheme: instead of w(u′,v′) we use w~(u′,v′)=(1+ϵ)⌈log1+ϵw(u′,v′)⌉, which can only change log1+ϵW times. This comes at the cost of a (1+ϵ) approximation factor.

We note that our bunches are approximate bunches in three different ways. We have one notion of approximation due to the fact that we are using hopsets (that implicitly maintain bunches on scaled graphs). We have a second notion of approximation due to our lazy bunch update, which only lets nodes join a bunch a bounded number of times. We have a third notion of approximation due to the lazy distance update, which only propagates distance changes O(log(nW)) times. We need to carefully consider how these different notions of approximate bunch interact with each other and with the stretch of the algorithm.

Next, we want to use the min-heaps Qu′,v to maintain the distance estimates for u,v∈V (see again the right case in Fig. 1). We construct min-heaps Qu,v′, for each pair u, v with entries δ(u,u′)+δ(u′,v) for u′∈B(u). Here δ(u′,v) is the minimum from the intermediate data structure Qu′,v.

An entry δ(u,u′)+δ(u′,v) in Qu,v′ has to be updated when either δ(u,u′) or δ(u′,v) change. We have to make sure we do not have to update these entries too often. For the first part of each entry, we bound updates to the distance estimates δ(u,u′) by the lazy distance updates. One challenge here is that when the distance estimates in a bunch change we need to update all the impacted heaps i.e. if δ(u,u′) inside a bunch B(u) changes, we must update all the heaps Qu,v′ such that there exists {u′,v′}∈E with v′∈B(v). For this purpose one approach is the following: for each u∈V,u′∈B(u) we keep an additional data structure Setu,u′ that stores for which v∈V we have v′∈B(v) with {u′,v′}∈E. This means that given a change in δ(u,u′), we can update each of the heaps in logarithmic time.

For the second part of the entry, which is the distance estimate δ(u′,v) from the first data structure, this is more complicated. Another subtlety for our decremental data structures is the fact that δ(u′,v) may also decrease due to a new node being added to B(v). However, our lazy bunch update ensures that δ(u′,v) can only decrease O(log1+ϵ(nW)) times. Further, we use lazy distance increases in between such decreases. Hence in total we propagate changes to δ(u′,v) at most O(log1+ϵ(nW)log(nW)) times, and thus our decremental algorithm has O~(log1+ϵ(nW)log(nW)) overhead compared to the static algorithm.

(2+ϵ,Wu,v)-APSP for Weighted Graphs

For a moment, let us go back to the first static algorithm. It turns out, that if instead of computing an estimate for two ‘adjacent’ bunches, we keep an estimate for bunches that overlap in at least one node, we obtain a (2,Wu,v)-approximation, where Wu,v is the maximum weight on a shortest path from u to v.

We fix an arbitrary shortest path from u to v denoted by π. The stretch analysis comes down to the following cases:

  1. There exists no w∈π∩B(u)∩B(v) (the left and right case in Fig. 2).

  2. There exists w∈π such that w∈B(u)∩B(v) (the middle case in Fig. 2).

The crucial observation here is that the distance estimate via the pivot (Case 1 in the previous section) already gives a (2,Wu,v)-approximation for the adjacent case (the right case in Fig. 2), see Sect. 5.1 for the details. So if we maintain an estimate for d(u, v) if there exists w∈π such that w∈B(u)∩B(v) (the ‘overlap case’), then we obtain a (2,Wu,v)-approximation in total.

Fig. 2.

Fig. 2

Possible scenarios for the overlap between the bunches B(u) and B(v) and a shortest path π from u to v

Here we need to create a min-heap for the overlap case, later we show we can maintain it in O~(nCmax/p) time, where Cmax is the size of the largest cluster. First we focus on the challenge of bounding Cmax.

Efficiency challenge. While the bunches are small, there is no bound on the size of the clusters. To overcome this issue in the static case, Thorup and Zwick developed an alternative way to build the bunches and clusters, that guarantees that the clusters are also small [78]. At a high-level, their approach is to adaptively change (grow) A by sampling big clusters into smaller clusters using a sampling rate proportional to the cluster size and adding these nodes to the set of pivots A. In total, in O~(m/p) time we obtain bunches and clusters, both of size O~(1/p). This idea was developed in the context of obtaining compact routing schemes, and later found numerous applications in static algorithms for approximating shortest paths and distances (see e.g., [28, 35, 36, 82]).

Using this trick, the static algorithm has running time O~(mp+pnm+np2)=O~(nm3/4+m4/3), for p=m-1/3 or O~(mn1/2+n2) for p=n-1/2.

However, the adaptive sampling procedure does not seem to be well-suited to a dynamic setting. The reason is that the sampling procedure is adaptive in such a way that when the bunches/clusters change, the set of sampled nodes can also change. Although (a dynamic adaptation of) the algorithm can guarantee that the set of sampled nodes is small at any particular moment, this would require to both add nodes to and remove nodes from A at any time. This would add a significant amount of computation necessary to propagate these changes to other parts of the algorithm. A possible solution is to enforce A to only grow, by never letting nodes leave A. This would require us to bound the total number of nodes that would ever be sampled, which seems impossible with the current approach. In that approach, we could only bound the number of new nodes for a single deletion, which can become too larger after many deletions. To overcome this issue, we next suggest a new approach that gives us a set that is only increasing in size, but remains bounded. For simplicity, we first present this in a static setting.

Introducing bunch overlap thresholds. Our proposed approach is to divide the nodes into two types depending on the number of bunches they appear in. In particular, we consider a threshold parameter τ and we define a node to be a heavy node if it is in more than τ bunches (equivalently its cluster contains more than τ nodes), and otherwise we call it a light node. In other words, for the set of light nodes we have Cmax≤τ. This threshold introduces a second type of ‘pivot’ for each node u, which we denote by q(u) that is defined to be the closest heavy node to u. In particular, instead of computing all distance estimates going through nodes w∈B(u)∩B(v), we only compute them for the case that w is light, and otherwise it is enough to compute the minimum estimates going through the closest heavy node, i.e. min{d(u,q(u))+d(q(u),v),d(v,q(v))+d(q(v),u)}. We emphasize that although the heavy nodes fullfill a similar role to the pivots, they are not a subset of our pivots p(v),v∈V. Moreover, heavy nodes have a different behavior in bounding the running time than the pivots. As we will see later, introducing these thresholds is crucial in efficiently obtaining the estimates required for Case 2 as we can handle the light and heavy case separately.

Stretch of the algorithm with bunch overlap thresholds. As discussed above, the stretch analysis was divided into two cases. In the new variant of the algorithm we add a third case, where we look at the distance estimates going through the closest heavy node, i.e. min{d(u,q(u))+d(q(u),v),d(v,q(v))+d(q(v),u)}. The main idea is that now we only need to consider the difficult case, Case 2, if the relevant node is light, which allows us to implement the algorithm efficiently.

If the relevant node w∈B(u)∩B(v) in Case 2 is heavy, we obtain a 2-approximation through the closest heavy node: we get that min{d(u,w),d(v,w)}≤d(u,v)/2, since d(u,v)=d(u,w)+d(w,v). W.l.o.g. say d(u,w)≤d(u,v)/2. Then d(u,q(u))≤d(u,w)≤d(u,v)/2, hence d(u,q(u))+d(q(u),v)≤d(u,q(u))+d(q(u),u)+d(u,v)≤2d(u,v).

Maintaining estimates through heavy nodes. For the stretch analysis above, we need to maintain a shortest path tree from each heavy node. We ensure a bunch grows at most O(log1+ϵ(nW)) times. Hence by a total load argument we get that the total number of nodes in all bunches over all updates is at most O(np·log1+ϵ(nW)). This implies there cannot be too many heavy nodes in total, hence we can enforce that Vheavy only grows by keeping in Vheavy all nodes that were once heavy (for details see Lemma 5.1). As a consequence, we can maintain multi-source approximate distances from all heavy nodes efficiently: we can compute shortest paths from this set to all other nodes in O(|Vheavy|m)=O~(nmpτ) time.

Running time of the algorithm with bunch overlap thresholds. Summarizing, we compute bunches and clusters in O(m/p) time, compute distances from A to V in O(|A|m)=O~(pnm) time, and we can compute shortest paths from the heavy nodes in O(|Vheavy|m)=O(nmpτ) time.

Finally, we consider Case 2. For each node u∈V, we consider every light node w∈B(u), and then all nodes v∈C(w). Since w is light, we have |C(w)|≤τ, so this takes time O~(n·1p·τ).

Hence, in the total update time, we obtain O~((pnm+nmpτ+nτ/p)log2(nW)). Setting p=m-1/4 and τ=m1/2 gives a total update time of O~(nm3/4log(nW)). We provide the details in Sect. 5.1.

Again, for a decremental algorithm, we need to combine this new idea with the subtleties we had in the previous section: the bunches, their overlaps, and the heavy nodes keep on changing over the updates. We obtain a total update time that matches the stated static running time (up to subpolynomial factors) for the algorithm using bunch overlap thresholds.

(2+ϵ)-APSP for Unweighted Graphs

We observe that in unweighted graphs mixed approximation can always be turned into a multiplicative approximation – at the cost of a blow-up in the number of vertices. More precisely, we prove the following reduction.

Theorem 3.1

Let A be an algorithm that provides a (a+ϵ,k)-approximation for APSP in τA(n′,m′) time, for any unweighted n′-node m′-edge graph G′, and any constants a,k∈N≥1 and ϵ≥0. Given an unweighted graph G=(V,E) on n nodes and m vertices, we can compute (a+(k+2)ϵ,0)-APSP in τA(n+km,(k+1)m) time.

If A is a dynamic algorithm, then each update takes (k+1)·[update time ofA] time. The query time remains the same (up to a constant factor).

This reductions allows for ϵ=0 as well. However, for our applications the update time of A will depend on 1/ϵ, so we only apply this reduction for ϵ>0. Theorem 1.3 is obtained by splitting every edge into k edges, by introducing new nodes on the edge. Now a path corresponding to a +k approximation cannot take a non-trivial detour. We combine this result with Theorem 1.2 to obtain a (2+ϵ)-approximation for unweighted graphs in O~(m7/4) total update time. For details, see Sect. 5.2.

(1+ϵ,2(k-1))-APSP for Unweighted Graphs

In this section, we describe our near-additive APSP algorithm. Our work is inspired by a classic result of Dor, Halperin, and Zwick [24], that presented a static algorithm that computes purely additive +2(k-1) approximation for APSP in O~(n2-1/km1/k) time in unweighted graphs. Our goal is to obtain similar results dynamically. More concretely, we obtain decremental (1+ϵ,2(k-1))-approximate APSP in O(n2-1/k+o(1)m1/k) total update time in unweighted graphs.

(1+ϵ,2)-APSP

To explain the high-level idea of the algorithm, we first focus on the special case that k=2, and that we only want to approximate the distances between pairs of nodes at distance at most d from each other, for a parameter d. In this case, we obtain a +2-additive approximation in O~(n3/2m1/2d) time. This case already allows to present many of the high-level ideas of the algorithm. Later we explain how to extend the results to the more general case. We start by describing the static algorithm from [24], and then explain the dynamic version. At a high level, we compute exact distances v×V for some nodes v∈A1⊆V, and then use this to obtain approximate distances v×V for all other nodes v∈V\A1. The static version of the data structure is as follows. See also the pseudocode in Algorithm 1.

  • Let s1=(mn)1/2. Let V1 be the set of heavy nodes: V1:={v∈V:deg(v)≥s1}. Also let E2 be the set of light edges, i.e. edges with at least one endpoint with degree less than s1.

  • Node set A1. Construct a hitting set A1 of neighborhoods of nodes in V1. This means that every node v∈V1 has a neighbor in A1. The size of A1 is O(nlogn/s1).

  • Edge set E∗. Let E∗ be a set of size O(n) such that for each v∈V1, there exists u∈A1∩N(v) such that {u,v}∈E∗.

  • Computing distances from A1. Store distances A1×V by running a BFS from each u∈A1 on the input graph G.

  • Computing distances from V\A1. For each u∈V\A1 store a shortest path tree, denoted by Tu rooted at u by running Dijkstra on (V,E2∪E∗∪Eu1), where Eu1 is the set of weighted edges corresponding to distances in ({u}×A1) computed in the previous step.

graphic file with name 453_2026_1407_Figa_HTML.webp

Dynamic data structure. The static algorithm computes distances in two steps. First, it computes distances from A1 by computing BFS trees in the graph G. This step can be maintained dynamically by using Even-Shiloach trees (ES-trees) [74], a data structure that maintains distances in a decremental graph. Maintaining the distances up to distance O(d) takes O(|A1|md) time. The more challenging part is computing distances from the remaining nodes V\A1. Here the static algorithm computes distances in the graphs Hu=(V,E2∪E∗∪Eu1). Note that the graphs Hu change dynamically in several ways. First, in the static algorithm, the set E2 is the set of light edges. To keep the correctness of the dynamic algorithm, every time that a node v no longer has a neighbor in A1, we should add all its adjacent edges to E2. Second, when an edge in E∗ is deleted from G, we should replace it by an alternative edge if such an edge exists. Finally, the weights of the edges in Eu1 can change over time, when the estimates change. This means that other than deletions of edges, we can also add new edges to the graphs Hu or change the weights of their edges. Because of these edge insertions we can no longer use the standard ES-tree data structure to maintain the distances, because that only works in a decremental setting.

To overcome this, we use monotone ES-trees, a generalization of ES-trees proposed by [2, 7]. In this data structure, to keep the algorithm efficient, when new edges are inserted, the distance estimates do not change. In particular, when edges are inserted, some distances may decrease, however, in such cases the data structure keeps an old larger estimate of the distance. The main challenge in using this data structure is to show that the stretch analysis still holds. In particular, in our case, the stretch analysis of the static algorithm was based on the fact that distances from the nodes V\A1 are computed in the graphs Hu, where in the dynamic setting, we do not have this guarantee anymore.

Stretch analysis. The high-level idea of the stretch analysis uses the special structure of the graphs Hu. To prove that the distance estimate between u and v is at most d(u,v)+2, we distinguish between two cases: 1) N(v)∩A1≠∅; and 2) N(v)∩A1=∅.

In the first case, an edge of the form {v,x} is in E∗ for some x∈A1∩N(v), and since we maintain correctly the distances from A1, we can prove that we get an additive stretch of at most 2 in this case.

In the second case, all the edges adjacent to v are in E2⊆Hu, and here we can use an inductive argument on the length of the path to prove that we get an additive stretch of at most 2. Note that the estimate that we get can be larger compared to the distance between u and v in the graph Hu, but we can still show that the additive approximation is at most 2 as needed. For a detailed stretch analysis, see Sect. 6.1.2.

Update time. Our update time depends on the size of the graphs Hu. While in the static setting it is easy to bound the number of edges in E2 and E∗, in the decremental setting, as new edges are added to these sets, we need a more careful analysis. For example, in the static setting |E∗|=O(n), as any node only adds one adjacent edge to the set E∗, where in the decremental setting, we may need to add many different edges to this set because the previous ones got deleted. However, we can still prove that even if a node needs to add to E∗ edges to all its adjacent neighbors in A1 during the algorithm, the size of Hu is small enough as needed. A detailed analysis of the update time appears in Sect. 6.1.3, where we show that the total update time is O~(m1/2n3/2d) in expectation, this matches the static complexity up to the factor d.

Handling large distances. The algorithm described above is efficient if d is small, to obtain an efficient algorithm for the general case, we combine our approach with a decremental near-additive APSP algorithm. More concretely, we use an algorithm from Henzinger et al. [7] that computes (1+ϵ,β)-approximate APSP in a total update time that depends on β. For β=no(1), their total update time is bounded by O(n2+o(1)). Now we set d=Θ(β/ϵ), and distinguish between two cases. For pairs of nodes at distance at most d from each other, we get a +2-additive approximation as discussed above, in O(m1/2n3/2+o(1)) time. For pairs of nodes at distance larger than d, the near-additive approximation is already a (1+O(ϵ))-approximation by the choice of the parameter d. For such pairs, the additive β term becomes negligible, as their distance is Ω(β/ϵ). Overall, we get a (1+ϵ,2)-approximation for APSP in O(m1/2n3/2+o(1)) time. In fact, if the graph is dense enough (m=n1+Ω(1)), the no(1) term is replaced by a poly-logarithmic term. For more details see Sect. 6.2.4.

General k

We can extend the algorithm to obtain a (1+ϵ,2(k-1))-approximate APSP in O(n2-1/k+o(1)m1/k) total update time, by adapting the general algorithm of [24] to the dynamic setting. At a high-level, instead of having one hitting set A1, we have a series of hitting sets A1,A2,...,Ak, such that the set Ai hits nodes of degree si. We compute distances from Ai in appropriate graphs Hui, that are sparser when the set Ai is larger. Balancing the parameters of the algorithm leads to the desired total update time. For full details and proofs see Sect. 6.2.

Limitations of previous approaches

We next explain why approaches used in previous decremental algorithms cannot be generalized to obtain our near-additive results. First, the unweighted (1+ϵ,2)-approximate APSP algorithm that takes O~(n5/2/ϵ) time [2], is inspired by static algorithms for +2-additive emulators, sparse graphs that preserve the distances up to a +2-additive stretch. The main idea is to maintain a sparse emulator of size m′=O~(n3/2), and exploit its sparsity to obtain a fast algorithm taking O~(m′n)=O~(n5/2/ϵ) time. This construction however is specific for the +2 case, and cannot be generalized to a general k. Note that the update time of the algorithm crucially depends on the size of the emulator, and to obtain a better algorithm for a general k, we need to be able to construct a sparser emulator for a general k. However, a beautiful lower bound result by Abboud and Bodwin [83] shows that for any constant k and δ>0, a purely additive +k emulator should have Ω(n4/3-δ) edges. This implies that dynamic algorithms that are based on purely additive emulators with m′ edges seem to require Θ(n·m′)=Ω(n7/3-δ) time, and we cannot get running time arbitrarily close to O(n2). An alternative approach is to build a near-additive emulator. This is done in [7], where the authors show a (1+ϵ,2(1+2/ϵ)k-2)-approximation algorithm for decremental APSP with expected total update time of O~(n2+1/k(37/ϵ)k-1). Here the running time indeed gets closer to O(n2), but this comes at a price of a much worse additive term of 2(1+2/ϵ)k-2. While in the static setting there are also other bounds obtained for near-additive emulators, such as O(1+ϵ,O(k/ϵ)k-1) emulators of size O(kn1+12k+1-1) [84–87], in all of the constructions the additive term depends on ϵ, and the dependence on ϵ is known to be nearly tight for small k by lower bounds from [86]. Hence this approach cannot lead to small constant additive terms that do not depend on ϵ.

(2+ϵ)-Approximate APSP for Weighted Graphs

Given an undirected, weighted graph G=(V,E,w), where w takes positive, integer values, our goal is to maintain (2+ϵ)-approximate all-pairs distances in G, denoted by d^. We provide an algorithm Inline graphic with parameters 0<p,ϵ≤1, and 0<ρ≤1 that gives a (2+ϵ)-approximation of APSP for weighted graphs, with ratio between the maximum and minimum weight W. Overall, the total update time scales with pnm+n2p, for an exact statement see Lemma 4.7, which explicitly states the dependency on ρ, W, and 1/ϵ. The algorithm has a constant query time.

We recommend the reader to first read Sect. 3.1, where we provide a static version of the algorithm and we discuss the challenges and techniques of making this dynamic. This section starts with our high-level dynamic algorithm in Sect. 4.1, we provide further details and parametrized update time analysis of each step in Sect. 4.2, and we provide the stretch analysis in Sect. 4.3. In Sect. 4.4, we combine these and set the parameter p appropriately to obtain our final result.

Decremental Data Structures

We will make use of the (1+ϵ1)-approximate5 bunches and clusters that are introduced in Sect. 2.2. However, for efficiency purposes, we do not use these bunches themselves, but instead look at bunches with some additional approximation. The goal is to ensure that the bunches do not increase too often.

Let A be a set of nodes sampled with probability p≥1/n. Recall that, for each node v, the pivot p(v) is the closest node in A to v.

Lemma 2.1 gives us an approximate pivot p~(v), together with a distance estimate δB~, such that dG(v,p(v))≤δB~(v,p~(v))≤(1+ϵ1)dG(v,p(v)). Further, we have (1+ϵ1)-approximate bunches: B~(v):={w∈V:(1+ϵ1)d(v,w)<δB~(v,p~(v))}, and distance estimate δB~ such that d(u,v)≤δB~(u,v)≤(1+ϵ1)d(u,v) for all u∈B~(v).

We now define our final approximate bunch, which we denote by B(v).6

Definition 1

We need the following notions related to bunches and clusters:

  • For all v∈V, we keep track of a (1+ϵ2)-approximate bunch radius r(v), which is a (1+ϵ2)-approximation of the approximate distance to the approximate pivot, i.e., of δB~(v,p~(v)). We denote by r(t) the bunch radius at time t. Initially, we set r(0)(v):=δB~(v,p~(v)). We update r(t)(v) whenever δB~(v,p~(v))>(1+ϵ2)r(t-1)(v), if so then we set r(t)(v):=δB~(v,p~(v)).

  • Initially, we set B(0)(v):=B~(0)(v). Whenever r(t)(v)≠r(t-1)(v), we set B(t)(v):=B~(t)(v), otherwise we set B(t)(v):=B(t-1)(v).

  • The cluster of a node u∈V is the set C(u):={v∈V:u∈B(v)}.

Note that these bunches B(v) increase at most log1+ϵ2(nW) times by construction. Next, let us investigate the sizes of these sets.

Lemma 4.1

At any given time

  • (i)

    With high probability, A has size O~(pn);

  • (ii)

    With high probability, each bunch B(v) has size O~log(nW)p;

Proof

  • (i)
    Since A is created by sampling each element of V with probability p≥1/n, we have |A|∼Binomial(n,p), so E[|A|]=pn. By Chernoff bounds, for any δ>0:
    Pr[|A|≥(1+δ)pn]≤e-δ2pn2+δ.
    Setting δ=3clogn gives Pr[|A|≥(1+3clogn)pn]≤e-pnclogn≤n-c, so with high probability |A|=O(pnlogn).
  • (ii)

    This holds trivially as B(v)⊆B~(v), and |B~(v)|=O~log(nW)p at any moment in time due to Lemma 2.1.

□

Now, we give a description of the algorithm in Algorithm 2, which is a dynamic version of the static algorithm given in Sect. 3.1.1. Next, we give a proof of correctness and show how to implement each of the steps. We provide a separate initialization procedure, as for some steps it will turn out that the initialization step and the update steps are quite different.

Throughout the algorithm, we set δ~:=(1+ϵ3)⌈log1+ϵ3(δ)⌉ whenever we want a distance estimate δ to update at most log1+ϵ3(nW) times. Note that we can always maintain such a δ~ with only a constant multiplicative factor in the total update time. Moreover, it is clear that δ≤δ~≤(1+ϵ3)δ. Below we define the functions Initialization(), and functions used after each edge update {u,v}∈E: Delete(u, v), Update(u, v, w(u, v)). Finally we have the Query() function that returns a final estimate over different data structures maintained.

Algorithm 1.

Algorithm 1

APSP2(V,E,w,p,ϵ)

Update bunches and heaps (Update Step (2)). Now let us look more closely at how we maintain the bunches and clusters, and how these effect the heaps. We maintain the approximate bunches B~(v) for all v∈V by Lemma 2.1. From here maintain the additional approximate bunches B(v) for all v∈V as given in Definition 1, i.e., If there is a change to δB~(v′,p~(v′)), do the following two things:

  • We check if δB~(t)(v′,p~(t)(v′))>(1+ϵ2)r(t-1)(v′), and if so we set r(t)(v′)=δB~(t)(v′,p(t)(v′)) and we set B(t)(v):=B~(t)(v). If not, we set r(t)(v′)=r(t-1)(v′) and B(t)(v)=B(t-1)(v).

Let u′∈V be a node for which there is a change to the bunch involving a node w∈V. Such a change can be: (i) w can leave the bunch of u′ (ii) the distance estimate of w to u′ can change while w stays within the bunch, or (iii) w can join the bunch of u′. We formalize this as follows, using Δ to denote which case we are in.

  • (i)

    w∈B(t-1)(u′) and w∉B(t)(u′), we set Δ=∞ to indicate that w is no longer in B(u′).

  • (ii)

    w∈B(t-1)(u′) and w∈B(t)(u′) with an increased distance estimate δ~B(t)(u′,w), we set Δ=δ~B(t)(u′,w) to be the new distance.

  • (iii)

    w∉B(t-1)(u′) and w∈B(t)(u′), we set Δ=δ~B(t)(u′,w) to be the distance.

Next, we do the following.

  • Nbr-BunchChange(w,u′,∞) to update the corresponding entries w~(v′,w)+δ~B(w,u′) in the data structures Qv′,u′nbr-bunch for every v′∈Setw,u′nbr-bunch. If this changes the minimal entry δnbr-bunch(x,y) in Qx,ynbr-bunch for some x,y∈V, we check whether we need to update δ~nbr-bunch(x,y), if so we run the procedure

    Adj-MinHeapChange(x,y,δ~nbr-bunch(x,y)).

  • UpdateAdjacent(w,u′,Δ) to update the corresponding entries δ~B(u′,w)+δ~nbr-bunch(w,v′) in the data structures Qu′,v′adjacent for every v′∈Setu′,wadj-bunch.

Further Details and Time Analysis

In this section, we add further details of the procedures described and analyze the total update time. Considering the sampling of A in the algorithm, we note that A remains unchanged throughout the algorithm, hence it is only sampled once at the initialization. This takes O(n) time. To maintain distances from A, we use the decremental shortest path algorithm from Lemma 2.2 together with Lemma 4.1, which bounds the size of A, to obtain the following lemma.

Lemma 4.2

With high probability, we can maintain (1+ϵ1)-approximate SSSP from each node in A, providing us with δA(s,v) for s∈A and v∈V. We can do this in time O~(pnm/ϵ1) if m=n1+Ω(1) and pn=nΩ(1), and in time O~(pnm(1/ϵ1)O~(logn)) otherwise.

Bunches and clusters. We have approximate bunches B~(v) and pivots p~(v) by Lemma 2.1, now we maintain the bunch radii r(v) and approximate bunches B(v) and clusters C(v) according to Definition 1. As before, we simply set δ~B(u,v):=(1+ϵ3)⌈log1+ϵ3(δB(u,v))⌉. It is immediate that these extra steps do not incur more than a constant factor in the update time with respect to Lemma 2.1, so we obtain the following result.

Lemma 4.3

We can maintain (1+ϵ2)-approximate bunch radii r(v) with respect to the approximate pivots p~. With high probability, we can maintain approximate bunches B(v) and clusters C(v), and distance estimates δB(v,u) for u∈B(v), for all nodes v∈V. Moreover, we can maintain δ~B(u,v), a (1+ϵ3)-approximation of δB(u,v) that updates at most O(log1+ϵ3(nW)) times. This takes total update time O~(mnρplog2(nW))·O(1ρϵ2)1+2/ρ, for some arbitrarily small constant ρ, if m=n1+Ω(1), and O~mp(1/ϵ2)O~(logn) otherwise.

Neighboring bunch data structure. To maintain Qu,vadjacent, we maintain an auxiliary data structure, which is another Min-Heap Qx,vnbr-bunch. This data structure consists of the following ingredients. We say B(v) is a neighboring (approximate) bunch of x if there exists an edge from x to B(v). For every node x, and every neighboring bunch B(v) our goal is to store all neighbors y such that y∈B(v)∩N(x) together with w~(x,y)+δ~B(y,v), which allows us to find the neighbor y minimizing this sum for each neighboring bunch.7 Later, we will combine this with the distance estimate δ~B(u,x) for u∈B(x) to get a distance estimate from u to v, which will be stored in Qu,vadjacent. To make sure we do not have to update the entries in Qu,vadjacent, we do not maintain the minimum of Qx,vnbr-bunch exactly, but instead we maintain an additional approximation, denoted δ~nbr-bunch(x,v) that only changes at most a polylogarithmic number of times.

Lemma 4.4

With high probability, we can maintain the data structures Qx,vnbr-bunch for all x,v∈V in total update time O~(n2p·log(nW)·(log1+ϵ3(nW))+log1+ϵ2(nW))). Moreover, in the same total update time, we can maintain an approximation δ~nbr-bunch(x,v) of the minimum entry of Qx,vnbr-bunch that only changes at most log1+ϵ2(nW)log1+ϵ3(nW) times for each pair (x, v).

Proof

This data structure is initialized as follows:

  • Iterate over every vertex v∈V, and over all y∈B(v). Then iterate over all neighbors x∈N(y) of y and add an entry to the data structure Qx,vnbr-bunch with key w~(x,y)+δ~B(y,v). This takes O~(n2p·log(nW)) initialization time, since there are n options for v, it has bunch size O~(log(nW)p), so O~(log(nW)p) options for y, which has at most n neighbors.

We need to facilitate two types of updates for an entry of Qx,vnbr-bunch corresponding to an edge {x,y}: increases in the weight w~(x,y) and increases in the distance estimates δ~B(y,v). We define the functions Nbr-EdgeChange(a)nd Nbr-BunchChange(r)espectively.

Next, we consider how to update this data structure. Suppose a value δ~B(y,v) changed for some y∈B(v) due to an update to the bunches (Lemma 4.3), then we would need to change the corresponding entries in Qx,vnbr-bunch. Lemma 4.3 gives us y, v, and the new distance δ~B(y,v), which we need to update in all data structures Qx,vnbr-bunch for which {x,y}∈E. To do this efficiently, we maintain a set Setx,ynbr-bunch-edge for each edge {x,y}∈E that stores for which v∈V there is an entry in Qx,vnbr-bunch and a pointer to where in that data structure it appears. We equip this set with the structure of a self-balancing binary search tree, so we have polylogarithmic insertion and removal times. We update this every time the appearance or location in Qx,vnbr-bunch changes. Now if w~(x,y) changes due to an update, we can efficiently change the corresponding places in Qx,vnbr-bunch for all relevant v∈V.

Moreover, for the changes in the distances from the bunches, we maintain a set Sety,vnbr-bunch for each v∈V,y∈B(v) that stores for which x∈V there is an entry in Qx,vnbr-bunch and a pointer to where in that data structures it appears. We equip this set with the structure of a self-balancing binary search tree, so we have polylogarithmic insertion and removal times. We update this every time the appearance or location in Qx,vnbr-bunch changes. Now if δ~B(y,v) changes due to an update, we can efficiently change the corresponding places in Qx,vnbr-bunch for all relevant x∈V.

We define the function Nbr-EdgeChange(x,y,Δ), where {x,y}∈E, and Δ is the new value w~(t)(x,y), or ∞ if the edge {x,y} is deleted. Depending on Δ, we do one of the following:

  • (i)
    If Δ<∞, we update the corresponding estimates:
    • For each entry v∈Setx,ynbr-bunch-edge, update the corresponding entry w~(x,y)+δ~B(y,v) in Qx,vnbr-bunch and update the entry in Setx,ynbr-bunch-edge accordingly.
  • (ii)
    If Δ=∞, we remove the corresponding estimates:
    • For each entry v∈Setx,ynbr-bunch-edge, remove the corresponding entry in Qx,vnbr-bunch.

Concerning the total update time of Nbr-EdgeChange(,) we recall that w~(x,y)=(1+ϵ3)⌈log1+ϵ3(w(x,y))⌉. This means that each weight w~(x,y) gets updated at most log1+ϵ3(W) times, giving total update time O~(n2p·log(nW)·log1+ϵ3(W)).

We define the function Nbr-BunchChange(y,v,Δ), where y is an element of B(t-1)(v) and/or B(t)(v), and Δ is the new value δ~B(t)(y,v), or ∞ if y is no longer in B(v). Nbr-BunchChange(d)oes one of three things:

  • (i)
    If Δ<∞, y∉B(t-1)(v), and y∈B(t)(v), we add the corresponding new estimates:
    • We initialize Sety,vnbr-bunch to be empty.
    • For all neighbors x∈N(y) of y, we add w~(x,y)+δ~B(y,v) to Qx,vnbr-bunch and store x together with its location in Qx,vnbr-bunch in Sety,vnbr-bunch.
  • (ii)
    If Δ<∞, y∈B(t-1)(v), and y∈B(t)(v), we update the corresponding estimates:
    • For each entry x∈Sety,vnbr-bunch, update the corresponding entry w~(x,y)+δ~B(y,v) in Qx,vnbr-bunch and update the entry in Sety,vnbr-bunch accordingly.
  • (iii)
    If Δ=∞, y∈B(t-1)(v), and y∉B(t)(v), we remove the corresponding estimates:
    • For each entry x∈Sety,vnbr-bunch, remove the corresponding entries from Qx,vnbr-bunch and from Sety,vnbr-bunch.

Moreover, if one of these three actions change the minimum of Qx,vnbr-bunch, this has an impact on the data structures Q·,vadjacent. We run Adj-MinHeapChange(x,v,Δ), which is defined and analyzed in Lemma 4.5, to propagate this change. Here Δ is the minimum of Qx,vnbr-bunch. The total update time of Adj-MinHeapChange(i)s included in Lemma 4.5, and not in this lemma.

As δ~B(y,v) can change at most O(log1+ϵ3(nW)+log1+ϵ2(nW)) times, and for each time we need at most O~(deg(y))=O(n) time to update the data structure, we get total update time O~(deg(y)(log1+ϵ3(nW))+log1+ϵ2(nW))) for the pair (y, v). Now note that there are at most O~(np·log(nW)) such pairs, since there are n options for v, with O~(log(nW)p) options for y∈B(v). So we get total update time O~(n2p·log(nW)·(log1+ϵ3(nW))+log1+ϵ2(nW))).

Further, we maintain δ~nbr-bunch(x,v), which is a (1+ϵ3)-approximation of the minimal entry δnbr-bunch(x,v) of Qx,vnbr-bunch, defined by δ~nbr-bunch(x,v):=(1+ϵ3)⌈log1+ϵ3(δnbr-bunch(x,v))⌉. Note that δ~nbr-bunch(x,v) is not monotone over time, so it is not trivial how often the estimate changes. However, note that δ~nbr-bunch(x,v) increases at most log1+ϵ3(nW) times in a row. It can only decrease log1+ϵ2(nW) times, since the values w~(x,y)+δ~B(y,v) are non-decreasing, except if new vertices y∈B(t)(v) are considered. This is only the case when the bunch B(t)(v) grows, which happens at most log1+ϵ2(nW) times by Lemma 4.3. □

Adjacent data structure. Using Qx,vnbr-bunch, we construct the required Min-Heap Qu,vadjacent for each pair u,v∈V. For every pair of nodes u,v∈V our goal is to store all edges {x,y} such that x∈B(u) and y∈B(v), together with the distance δ~B(u,x)+w~(x,y)+δ~B(y,v).

Lemma 4.5

With high probability, we can maintain the data structures Qu,vadjacent for all u,v∈V in total update time O~(n2p·log(nW)·log1+ϵ3(nW)log1+ϵ2(nW)).

Proof

This data structure is initialized as follows:

  • Iterate over all nodes u, all x∈B(u), and all neighboring bunches B(v) of x and add an entry for x to Qu,vadjacent with key δ~B(u,x)+δ~nbr-bunch(x,v). As there are at most n bunches in total, this takes O~(n·log(nW)p·n)=O~(n2p·log(nW)) time.

Again, we maintain additional data structures to facilitate updates: for each x,v∈V, we maintain Setx,vadjacent which shows for which u∈V there is an entry in Qu,vadjacent and a pointer to where in that data structure it appears. We update this every time the appearance or location in Qu,vadjacent changes. Now if δ~B(u,w) changes due to an update, we can efficiently change the corresponding places in Qu,vadjacent.

We define Adj-BunchChange(a)nalogously to Nbr-BunchChange(.) Adj-BunchChange(u,x,Δ) does one of the following three things:

  • (i)
    If Δ<∞, x∉B(t-1)(u), and x∈B(t)(u), we add the corresponding new estimates:
    • We initialize Setu,xadj-bunch to be empty.
    • For all nodes with non-empty δ~nbr-bunch(x,v), we add δ~B(u,x)+δ~nbr-bunch(x,v) to Qu,vadjacent and store v together with its location in Qu,vadjacent in Setu,xadj-bunch.
  • (ii)
    If Δ<∞, x∈B(t-1)(u), and x∈B(t)(u), we update the corresponding estimates:
    • For each entry v∈Setu,xadj-bunch, update the corresponding entry δ~B(u,x)+δ~nbr-bunch(x,v) in Qu,vadjacent and update the entry in Setu,xadj-bunch accordingly.
  • (iii)
    If Δ=∞, x∈B(t-1)(u), and x∉B(t)(u), we remove the corresponding estimates:
    • For each entry v∈Setu,xadj-bunch, remove the corresponding entries from Qu,vadjacent and from Setu,xadj-bunch.

As updates in bunches/distance estimates in bunches happen O(log1+ϵ3(nW)+log1+ϵ2(nW)) times, see Definition 1, we get total update time O~(n2p·log(nW)·(log1+ϵ3(nW)+log1+ϵ2(nW))).

We also define the function Adj-MinHeapChange(t)o process changes in δ~nbr-bunch(·,·). The function Adj-MinHeapChange(x,v,Δ) does one of the following three things:

  • (i)
    If Δ<∞ and the distance estimate from x to v is new,, we add the corresponding new estimates:
    • We initialize Setx,vadj-heap to be empty.
    • For all u∈C(x), we add δ~B(u,x)+δ~nbr-bunch(x,v) to Qu,vadjacent and store u together with its location in Qx,vadjacent in Setx,vadj-heap.
  • (ii)
    If Δ<∞ and there already was a distance estimate from x to v,, we update the corresponding estimates:
    • For each entry x∈Setx,vadj-heap, update the corresponding entry δ~B(u,x)+δ~nbr-bunch(x,v) in Qu,vadjacent and update the entry in Setx,vadj-heap accordingly.
  • (iii)
    If Δ=∞ and there is no longer a distance estimate from x to v,, we remove the corresponding estimates:
    • For each entry x∈Setx,vadj-heap, remove the corresponding entries from Qu,vadjacent and from Setx,vadj-heap.

Since each δ~nbr-bunch(·,·) updates at most log1+ϵ2(nW)log1+ϵ3(nW) times by Lemma 4.4, we get total update time O~(n2p·log(nW)·log1+ϵ2(nW)·log1+ϵ3(nW)) for this operation.

Together, Nbr-BunchChange(a)nd Adj-BunchChange(f)orm the function UpdateAdjacent(.) To be precise, we define UpdateAdjacent(a)s follows:

UpdateAdjacent(u,v,Δ):

  1. Nbr-BunchChange(u,v,Δ)

  2. Adj-BunchChange(u,v,Δ)

This means we obtain total update time

O~(n2p·log(nW)·(log1+ϵ3(nW)+log1+ϵ2(nW)+log1+ϵ2(nW)·log1+ϵ3(nW)))=O~(n2p·log(nW)·log1+ϵ3(nW)·log1+ϵ2(nW)).

□

Query time. Finally, we observe that the query is relatively straightforward and can be done in constant time.

Lemma 4.6

Inline graphic has constant query time.

Proof

A query Query(u,v) consists of the minimum over four values. The first two can be computed in constant time, as the components are all maintained explicitly. The last two are maintained explicitly. This gives us constant query time in total. □

We summarize this section in the following lemma.

Lemma 4.7

With high probability, the algorithm Inline graphic has total update time O~((pnm+n2p)log3(nW)(1ρε)O(1/ρ)) if m=n1+Ω(1), p=nΩ(1)-1, and m≤n2-ρ for an arbitrarily small constant ρ. If m≥n2-ρ, we have total update time O~((pnm+mnρ+n2p)log3(nW)(1ρε)O(1/ρ)). Otherwise we have total update time O~((pnm+n2p)log3(nW)(1/ε)O~(logn)).

Proof

We inspect the total update times from all components of Algorithm 2, using that ε1=ε2=ε3=ε4=ε/3. First of all, we can perform the sampling of A in O(n) time. By Lemma 4.2, we can maintain distances from A in O~(pnm/ε) total update time if m=n1+Ω(1) and pn=nΩ(1), or in O~pnm(1/ε)O~(logn) total update time otherwise. By Lemma 4.3, we can maintain the bunches and clusters in O~(mnρp·log2(nW)))·O(1ρε)1+2/ρ total update time, for some arbitrarily small constant ρ, if m=n1+Ω(1), or in O~(mp·log2(nW))(1/ε)O~(logn)) total update time otherwise. Moreover, by Lemma 4.4, we can maintain our neighboring bunch data structure in O~(n2p·log(nW))·(log1+ϵ2(nW)+log1+ϵ3(nW))) total update time. Finally, by Lemma 4.5, we can maintain our adjacent data structure in O~(n2p·log(nW))·(log1+ϵ2(nW)·log1+ϵ3(nW)) total update time.

In total, this means for the case that m=n1+Ω(1) and p=nΩ(1)-1, we have total update time

O~((pnm+mnρp+n2p)log(nW)log1+ϵ2(nW)log1+ϵ3(nW)(1ρε)1/ρ)=O~((pnm+mnρp+n2p)log3(nW)(1ρε)O(1/ρ)),

If we furthermore assume that nρ=O(n/p), i.e., p=O(n1-ρ) for some arbitrarily small ρ, then we obtain the simplified version

O~((pnm+n2p)log3(nW)(1ρε)O(1/ρ)).

For other choices of m, n,  and p, we obtain

O~((pnm+n2p)log3(nW)(1/ε)O~(logn)).

□

Stretch Analysis

We can now follow the same structure as outlined in the high-level overview to prove the stretch in different cases for each pair u,v∈V. In our analysis we also discuss how maintaining approximate bunches and distances impacts the final stretch.

Lemma 4.8

For all u,v∈V, the distance estimate d^(u,v) returned by a query to Inline graphic is a (2+ϵ)-approximation of the distance d(u, v).

Proof

Let u,v∈V. We will show that at any time t, if Query(u, v) returns d^(t)(u,v), then we have d(t)(u,v)≤d^(t)(u,v)≤(2+ϵ)d(t)(u,v). Since we look at all data structures at the same time t, we omit the superscripts ·(t) in the remainder of this proof.

First, let us note that d^(u,v) consists of different distance estimates that all correspond to actual paths in G, hence we clearly have d(u,v)≤d^(u,v). Heaps do not contain ‘old’ entries, entries that correspond to paths that are no longer in G at the time of query, since the update functions Nbr-BunchChange(,) Nbr-EdgeChange(,) Adj-MinHeapChange(,) and Adj-BunchChange(t)ake such entries out as soon as they are no longer relevant.

Next, we do a case distinction as follows. Let π denote the shortest path from u to v.

  1. There exists w∈π such that w∉(B(u)∪B(v)) (the left case in Fig. 1). Since w∉B(u), we have d(u,w)≥r(u)≥δB~(u,p~(u))1+ϵ2, so δB~(u,p~(u))≤(1+ϵ2)d(u,w). Similarly δB~(v,p~(v))≤(1+ϵ2)d(w,v). Since d(u,w)+d(w,v)=d(u,v), we have either d(u,w)≤d(u,v)2 or d(v,w)≤d(u,v)2. Without loss of generality, assume d(u,w)≤d(u,v)2, then by Query Step (a) in the algorithm we have:
    d^(u,v)≤δB~(u,p~(u))+δA(v,p~(u))≤δB~(u,p~(u))+(1+ϵ4)d(v,p~(u))≤δB~(u,p~(u))+(1+ϵ4)(d(u,p~(u))+d(u,v))≤δB~(u,p~(u))+(1+ϵ4)(δB~(u,p~(u))+d(u,v))≤(2+ϵ4)(1+ϵ2)d(u,w)+(1+ϵ4)d(u,v)≤(2+32ϵ4+12ϵ4ϵ2+ϵ2)d(u,v)≤(2+ϵ)d(u,v),
    where in the last step we use ϵ4=ϵ2=ϵ/3.
  2. There is no w∈π such that w∉(B(u)∪B(v)) (the right case in Fig. 1). This means there has to be a direct edge from the cluster of u to the cluster of v: the shortest path π consists of a path from u to u′, for some u′∈B(u), an edge {u′,v′}∈E, for some v′∈B(v), and a path from v′ to v (see the right case in Fig. 1). Note that in particular this includes the cases where u∈B(v) or v∈B(u), or more general when B(u)∩B(v)≠∅, since we do not require u≠u′, v≠v′, u′∉B(v), or v′∉B(u). By Query Step (b) we have
    d^(u,v)≤δ~B(u,u′)+δ~nbr-bunch(u′,v)≤(1+ϵ3)δB(u,u′)+(1+ϵ3)δnbr-bunch(u′,v)≤(1+ϵ3)(1+ϵ1)d(u,u′)+(1+ϵ3)(w~(u′,v′)+δ~B(v′,v))≤(1+ϵ3)(1+ϵ1)d(u,u′)+(1+ϵ3)2(w(u′,v′)+δB(v′,v))≤(1+ϵ3)(1+ϵ1)d(u,u′)+(1+ϵ3)2(w(u′,v′)+(1+ϵ1)d(v′,v))≤(1+ϵ3)2(1+ϵ1)d(u,v)≤(2+ϵ)d(u,v),
    where in the last step we use ϵ1=ϵ3=ϵ/3, and ϵ<1.

□

Putting Everything Together

In this section we combine our lemmas in the following theorem. To obtain this result, we pick p to balance the different terms in the total update time.

Theorem 1.1Given a graph G with positive, integer weights and a constant 0<ϵ<1, there is a decremental data structure that maintains a (2+ϵ)-approximation of APSP. The algorithm has constant query time and works against an oblivious adversary. The total update time is w.h.p.

  • O~(m1/2n3/2log3(nW)) if m=n1+Ω(1) and m≤n2-ρ for an arbitrary small constant ρ,

  • O~(m1/2n3/2+ρlog3(nW)) if m≥n2-ρ for any constant ρ,

  • O~(m1/2n3/2+o(1)log3(nW)) otherwise,

where W is the ratio between the maximum and minimum weight.

Proof

This follows from Lemma 4.7 and 4.8, by picking p to minimize pnm+n2p. This gives p=nm, implying pnm=n2p=m1/2n3/2. Note that whenever m=n1+Ω(1) and m≤n2-ρ, this choice of p indeed satisfies the other requirements of Lemma 4.7: p=nΩ(1)-1. Since we now assume that ε and ρ are constants, the factor (1ρε)O(1/ρ) simplifies to O(1).

When m=n1+o(1), we obtain an extra factor (1/ε)O~(logn) in the total update time, which simplifies to no(1) for constant ε. And when m≥n2-ρ, we obtain the extra factor nρ and (1/ε)O~(logn), where the latter again simplifies to O(1) for constant ρ and ϵ. □

(2+ϵ,Wu,v)-APSP for Weighted Graphs and Unweighted 2-APSP

In this section, we show that an adapted version of the algorithm from Sect. 4 returns (2+ϵ,Wu,v)-approximate distances with improved update time, where Wu,v is the maximum weight on a shortest path from u to v. This result follows by the fact that in this case we do not need to handle the adjacent bunch case, but instead can consider an overlap bunch case (see the middle case in Fig. 2), which leads to an improved total update time.

To make this efficient, there are some additional complications. We introduce a parameter τ, the bunch overlap threshold, which bounds the cluster size. For nodes w∈B(u)∩B(v) with cluster smaller than τ, we can compute the estimate in the overlap case efficiently. If all nodes in the overlap B(u)∩B(v) have larger clusters, we obtain an estimate by computing shortest paths from the heavy nodes.

We recommend the reader to first read the static version of this algorithm in Sect. 3.2. We then present the details of the dynamic version in Sect. 5.1. Moreover, in Sect. 5.2, we show our general reduction from mixed APSP to purely multiplicative APSP for unweighted graphs. We use this reduction to obtain our unweighted (2+ϵ,0)-APSP result.

(2+ϵ,Wu,v)-APSP for Weighted Graphs

We use the same structure as in Sect. 4: we have bunches, and clusters exactly as before. We introduce the parameter 1≤τ≤n to be set later. Now we define nodes to be heavy or light based on their cluster size.

  • We call a node u heavy if it is or ever was contained in at least τ approximate bunches B(v), i.e., u is heavy at time t if |C(t′)(u)|≥τ for some t′≤t. If a node is not heavy, we call it light.

  • We denote Vheavy for the set of heavy nodes, and Vlight=V\Vheavy for the light nodes. By definition of heavy nodes, a light node can become heavy, but a heavy node can never become light.

  • Suppose we have a distance estimate δH(s,v) for all s∈Vheavy,v∈V. For each node u∈V, q(u) is the closest node in Vheavy to u according to the distance estimate δH.

We can show that the size of Vheavy is bounded.

Lemma 5.1

At any given time, with high probability, Vheavy has size O~(npτ·log(nW)·log1+ϵ3(nW)).

Proof

Let B(t)(v) and C(t)(w) denote the bunch of v and the cluster of w respectively at time t. Since bunch radius r(v) increases by at least a factor 1+ϵ3 if the bunch changes, we have at most log1+ϵ3(nW) different bunch radii. Until the bunch radius increases, the bunch can only lose vertices, which does not contribute to the total size. Since each bunch is of size O~(log(nW)p) with high probability by Lemma 4.1, we obtain that the total size of a bunch over the course of the algorithm is bounded by ⋃tB(t)(v)=O~log(nW)·log1+ϵ3(nW)p. Hence we have

|Vheavy|τ≤∑w∈Vheavyτ≤∑w∈Vheavy⋃tC(t)(w)≤∑w∈V⋃tC(t)(w)=∑v∈V⋃tB(t)(v)=O~(np·log(nW)·log1+ϵ3(nW)).

Thus |Vheavy|=O~(npτ·log(nW)·log1+ϵ3(nW)). □

Now we are ready to present our new algorithm, see Algorithm 3.

Algorithm 2.

Algorithm 2

APSP2,W(V,E,w,p,τ,ϵ)

Updating bunches and heaps. For completeness, we recall how we update the bunches and clusters. We now maintain different heaps. Again, we maintain the approximate bunches B~(v) for all v∈V by Lemma 2.1. From here maintain the additional approximate bunches B(v) for all v∈V as given in Definition 1, i.e., If there is a change to δB~(v′,p~(v′)), do the following two things:

  • We check if δB~(t)(v′,p~(t)(v′))>(1+ϵ3)r(t-1)(v′), and if so we set r(t)(v′)=δB~(t)(v′,p(t)(v′)) and we set B(t)(v):=B~(t)(v). If not, we set r(t)(v′)=r(t-1)(v′) and B(t)(v)=B(t-1)(v).

Let u′∈V be a node for which there is a change to the bunch involving a node w∈V. Such a change can be: (i) w can leave the bunch of u′ (ii) the distance estimate of w to u′ can change while w stays within the bunch, or (iii) w can join the bunch of u′. We formalize this as follows, using Δ to denote which case we are in.

  • (i)

    w∈B(t-1)(u′) and w∉B(t)(u′), we set Δ=∞ to indicate that w is no longer in B(u′).

  • (ii)

    w∈B(t-1)(u′) and w∈B(t)(u′) with an increased distance estimate δ~B(t)(u′,w), we set Δ=δ~B(t)(u′,w) to be the new distance.

  • (iii)

    w∉B(t-1)(u′) and w∈B(t)(u′), we set Δ=δ~B(t)(u′,w) to be the distance.

Next, we do the following. If we are in Case (iii), we check the cluster size of w: if |C(t)(w)|≥τ, then we add w to Vheavy and we initialize a SSSP approximation, denoted by δH(w,δ). Moreover, for each u′ in C(t-1)(w) we do the following:

  • UpdateOverlap(w,u′,∞) to remove the corresponding entries δ~B(u′,w)+δ~B(v′,w) from the data structures Qu′,v′overlap for all v′∈Setw,u′overlap. Here Setw,u′overlap stores exactly those v′ such that there is an entry for w in Qu′,v′overlap. The details on Setoverlap can be found together with the definition and total update time of UpdateOverlap(a)re given in Lemma 5.3.

If we are in Case (iii) but |C(t)(w)|<τ, or we are in Case (i) or (ii), then we do the following

  • UpdateOverlap(w,u′,Δ) to update the corresponding entries δ~B(u′,w)+δ~B(v′,w) in the data structures Qu′,v′overlap for all v′∈Setw,u′overlap.

Distances from Vheavy . First, we note that a node is heavy if it is contained in at least τ bunches, or equivalently, if |C(w)|>τ. Hence by Lemma 4.3, we can easily keep track when nodes become heavy and should join Vheavy.

Next, we use the shortest path algorithm from Lemma 2.2, which we combine with Lemma 5.1, which states that Vheavy might be growing over time, but its size is always bounded by O~(npτ·log(nW)·log1+ϵ3(nW)). Moreover, we maintain the closest heavy nodes q(v) by maintaining a Min-Heap Qvheavypivot for each node v, with all nodes u∈Vheavy as entries with key δH(u,v). Throughout, we will use that we can extract the minimum entry of a Min-Heap in constant time, that we can insert entries in log(n) time, and that we can edit or delete entries in log(n) time, given that we know either the key or have a pointer to their location in the Min-Heap.

This clearly does not incur more than a constant factor in the update time, so together we obtain the following lemma.

Lemma 5.2

With high probability, we can maintain (1+ϵ1)-SSSP from each node in Vheavy, providing us with δH(s,v) for s∈Vheavy and v∈V. Further, for all v∈V, we can maintain the closest heavy nodes q(v) if d(v,q(v))≤d. We can do this in total update time O~(mnpτε1·log(nW)·log1+ϵ3(nW)) if m=n1+Ω(1) and npτ=nΩ(1), and O~(mnpτ·log(nW)·log1+ϵ3(nW)(1/ε1)O~(logn)) otherwise.

Overlap data structure. Now we provide the details of how we maintain the data structure Qu,voverlap for all u,v∈V, which has entries for all nodes w∈B(u)∩B(v)∩Vlight.

Lemma 5.3

With high probability, we can maintain the data structures Qu,voverlap for all u,v∈V in total update time O~(nτp·log(nW)·log1+ϵ3(nW)·log1+ϵ4(nW)).

Proof

Conceptually, we initialize a Min-Heap Qu,voverlap for each pair (u,v)∈V×V. In practice, we only create the Min-Heap if the first entry is about to be added. This avoids a Θ(n2) initialization time. Now fix v∈V, and consider the moment we add a node w to B(v). For this data structure, we only need to consider w∈Vlight, hence w is part of at most τ bunches. When we add w to to B(v), we know it is part of at most τ other bunches B(u). For each such tuple (u, w, v), we add an entry to the Min-Heap Qu,voverlap for (u, v), which stores w with as key the distance estimate δw(u,v):=δ~B(u,w)+δ~B(w,v). For the total time, notice that for each v∈V, we have at most O~(log(nW)p) different w∈B(v) for which we store at most τ distances, hence we have total initialization time O~(n·log(nW)p·τ).

Next, we consider how to update this data structure. Suppose a value δ~B(u,w) changed for some w∈B(u) due to an update to the bunches (Lemma 4.3), then we would need to change the corresponding entries in Qu,voverlap. Lemma 4.3 gives us u, w, and the new distance δ~B(u,w), which we need to update in all data structures Qu,voverlap for which w∈B(u)∩B(v). Clearly, checking all possible v and looking through the entire Qu,voverlap is too slow. Instead, we keep an additional data structure for each node w∈B(u): a set Setw,uoverlap that shows for which v∈V it appears in Qu,voverlap and a pointer to where in Qu,voverlap it appears. We equip this set with the structure of a self-balancing binary search tree, so we have polylogarithmic insertion and removal times. We update this every time the appearance or location in Qu,voverlap changes. Now, if δ~B(u,w) changes due to an update, we can efficiently change the corresponding places in Qu,voverlap as follows.

We define the function UpdateOverlap(u,w,Δ), where w is an element of B(t-1)(u) and/or B(t), and Δ is the new value δ~B(t)(u,w), or ∞ if w is no longer in B(t)(u). Note that we will only call this function for light w.8UpdateOverlap(d)oes one of three things:

  • (i)
    If Δ<∞, w∉B(t-1)(u) and w∈B(t)(u). We add the new estimates:
    • We initialize Setw,uoverlap to be empty.
    • For each v∈C(w), we add δw(u,v):=δ~B(u,w)+δ~B(w,v) to Qu,voverlap and store v together with its location in Qu,voverlap as entries in Setw,uoverlap and Setw,voverlap.
  • (ii)
    If Δ<∞, w∈B(t-1)(u) and w∈B(t)(u). We update the estimates:
    • For each entry of v in Setw,uoverlap, update δw(u,v)=δ~B(u,w)+δ~B(w,v) in Qu,voverlap and update the entries in Setw,uoverlap and Setw,voverlap accordingly.
  • (iii)
    If Δ=∞, then w∈B(t-1)(u) and w∉B(t)(u). We remove the corresponding estimates:
    • For each entry of v in Setw,uoverlap, remove δw(u,v) from Qu,voverlap and remove the corresponding entries from Setw,uoverlap and Setw,voverlap.

For the total update time, notice that in total at most O~(np·log(nW)·log1+ϵ3(nW)) nodes get added to a bunch, see Lemma 4.1. Since we only call this function when the added node w is light at that time, we have |C(w)|≤τ and thus step (i) takes O(nτp·log(nW)·log1+ϵ3(nW)) total update time. For step (ii), note that the distance can be updated at most O(log1+ϵ4(nW)) times and therefore this step has total update time O(nτp·log(nW)·log1+ϵ3(nW)log1+ϵ4(nW)). Further nodes get deleted from bunches at most as often as they get added, so the total update time of step (iii) is dominated by step (i). We obtain total update time O~(nτp·log(nW)·log1+ϵ3(nW)·log1+ϵ4(nW)). □

We summarize the update times in the following lemma.

Lemma 5.4

With high probability, the algorithm Inline graphic has total update time O~((pnm+mnpτ+nτp)log2(nW)(1/ε)O(1)) if m=n1+Ω(1), p=nΩ(1)-1, npτ=nΩ(1), and τ=O(n1-ρ). Otherwise we have total update time O~((pnm+mnpτ+nτp)·log3(nW)·(1/ε)O~(logn)).

Proof

We inspect the total update times from all components of Algorithm 3. First of all, we can perform the sampling of A in O(n) time. By Lemma 4.2, we can maintain distances from A in O~(pnm/ε1) total update time if m=n1+Ω(1) and pn=nΩ(1), or in O~(pnm(1/ε1)O~(logn)) total update time otherwise. By Lemma 4.3, we can maintain the bunches and clusters in O~(mnρplog2(nW))·O(1ρϵ2)1+2/ρ total update time, for some arbitrarily small constant ρ, if m=n1+Ω(1), or in O~mp(1/ϵ2)O~(logn) total update time otherwise. Moreover, by Lemma 5.2, we can maintain distances from Vheavy in O~(mnpτε1·log(nW)·log1+ϵ3(nW)) total update time if m=n1+Ω(1) and npτ=nΩ(1), or in O~(mnpτ·log(nW)·log1+ϵ3(nW)(1/ϵ1)O~(logn)) total update time otherwise. Finally, by Lemma 5.3, we can maintain our overlap data structure in O~(nτp·log(nW)·log1+ϵ3(nW)·log1+ϵ4(nW)) total update time.

In total, this means for the case that m=n1+Ω(1), p=nΩ(1)-1, and npτ=nΩ(1), we have total update time

O~(pnm+mnρp+mnpτ+nτp)·log3(nW)(1/ε)O(1),

using that ρ is a constant. If we furthermore assume that nρ=O(n/τ), i.e., τ=O(n1-ρ) for some arbitrarily small ρ, then we obtain the simplified version

O~((pnm+mnpτ+nτp·log3(nW)).

For other choices of m, n, p,  and τ, we obtain

O~((pnm+mnpτ+nτp)·log3(nW)·(1/ϵ)O~(logn)).

□

Theorem 1.2Given a graph G with positive, integer weights and a constant 0<ϵ<1, there is a decremental data structure that maintains a (2+ϵ,Wu,v)-approximation for APSP, where Wu,v is the maximum weight on a current shortest path from u to v. The algorithm has constant query time and works against an oblivious adversary. The total update time is w.h.p. O~(nm3/4log3(nW)) if m=n1+Ω(1), and O~(n1+o(1)m3/4log3(nW)) otherwise, where W is the ratio between the maximum and minimum weight.

Proof

This result follows from exchanging the adjacent data structure for the overlap data structure as described in this section.

By Lemma 5.4, we have a total update time scaling with pnm+mn/(pτ)+nτ/p. To balance out these terms, we set mn/(pτ)=nτ/p, hence τ=m. We set pnm=mn/(pτ), hence p=m-1/4. Note that for m=n1+o(1), this choice for ρ and τ also satisfies the additional constraints of Lemma 5.4, so in this case we obtain total update time O~((pnm+mn/(pτ)+nτ/p)log3(nW)(1/ε)O(1))=O~(nm3/4log3(nW)(1/ε)O(1))=O~(nm3/4log3(nW)), where the last equality holds for constant ε. If m=n1+o(1), we obtain O~(nm3/4log3(nW)(1/ϵ)O~(logn))=O~(n1+o(1)m3/4log3(nW)), where again the equality holds for constant ε.

Stretch analysis. It remains to show that d^(u,v) is a (2+ϵ,Wu,v)-approximation of the distance d(u, v). We do a similar case distinction as in Lemma 4.8. Case 1 is exactly the same, since we maintain the relevant estimate through the pivots. For the remainder, we know there is no w∈π such that w∉(B(u)∪B(v)), hence the two bunches are adjacent. We know create cases depending on whether the bunches overlap, and if so, if the node in the overlap is heavy or light.

  • Case 2:
    π∩B(u)∩B(v)=∅ (the right case in Fig. 2). Hence π consists of a path from u to u′∈B(u), the edge {u′,v′} with v′∈B(v), and a path from v′ to v. Since v′∉B(u), we have d(u,v′)≥r(u)≥δB~(u,p~(u))1+ϵ3, so δB~(u,p~(u))≤(1+ϵ3)d(u,v′). Similarly, we have δB~(v,p~(v))≤(1+ϵ3)d(u′,v). Combining this, we obtain δB~(u,p~(u))+δB~(v,p~(v))≤(1+ϵ3)(d(u′,v)+d(u,v′))=(1+ϵ3)(d(u,v)+w(u′,v′)). Without loss of generality, assume that δB~(u,p~(u))≤1+ϵ32(d(u,v)+w(u′,v′)). By Query Step (a) we have:
    d^(u,v)≤δB~(u,p~(u))+δA(v,p~(u))≤δB~(u,p~(u))+(1+ϵ1)d(v,p~(u))≤δB~(u,p~(u))+(1+ϵ1)(d(u,p~(u))+d(u,v))≤δB~(u,p~(u))+(1+ϵ1)(δB~(u,p~(u))+d(u,v))≤(2+ϵ1)1+ϵ32(d(u,v)+w(u′,v′))+(1+ϵ1)d(u,v)≤(2+32ϵ1+12ϵ1ϵ3+ϵ3)d(u,v)+(1+12ϵ1+12ϵ1ϵ3+ϵ3)w(u′,v′)≤(2+ϵ/2)d(u,v)+(1+ϵ/2)Wu,v≤(2+ϵ)d(u,v)+Wu,v.
  • Case 3:
    There exists w∈π such that w∈B(u)∩B(v) and w∈Vlight (the middle case in Fig. 2). By Query Step (c), we have
    d^(u,v)≤δ~B(u,w)+δ~B(v,w)≤(1+ϵ4)(δB(u,w)+δB(v,w))≤(1+ϵ4)(1+ϵ2)(d(u,w)+d(v,w))=(1+ϵ2+ϵ2ϵ4+ϵ4)d(u,v)≤(1+ϵ)d(u,v).
  • Case 4:
    There exists w∈π such that w∈B(u)∩B(v) and w∈Vheavy (See Fig. 3). If w=q(u) then by Query Step (b), we have d^(u,v)≤δH(u,q(u))+δH(v,q(u))≤(1+ϵ1)(d(u,q(u))+d(v,q(u))=(1+ϵ1)d(u,v)≤(1+ϵ)d(u,v). If w=q(v), the argument is analogous. If q(u)≠w≠q(v), then by definition of q(u) and q(v) we obtain δH(u,q(u))≤δH(u,w) and δH(v,q(v))≤δH(v,w). So we have δH(u,q(u))+δH(v,q(v))≤(1+ϵ1)d(u,v), hence either δH(u,q(u))≤(1+ϵ)d(u,v)2 or δH(v,q(v))≤(1+ϵ1)d(u,v)2. Without loss of generality, assume δH(u,q(u))≤(1+ϵ1)d(u,v)2. Combining this with the triangle inequality, we obtain
    d^(u,v)≤δH(u,q(u))+δH(q(u),v)≤δH(u,q(u))+(1+ϵ1)d(q(u),v)≤δH(u,q(u))+(1+ϵ1)(d(u,q(u))+d(u,v))≤(2+ϵ1)δH(u,q(u))+(1+ϵ1)d(u,v)≤(2+52ϵ1+12ϵ12)d(u,v)≤(2+ϵ)d(u,v).

Query time. A query Query(u,v) consists of the minimum over three values. The first two can be computed in constant time, as the components are all maintained explicitly. The last one is maintained explicitly. This gives us constant query time in total. □

Fig. 3.

Fig. 3

Possible scenario for the overlap between the bunches B(u) and B(v) and the shortest path π from u to v where the estimate can be obtained using the closest heavy node qu and qv

In particular, this means we get (2+ϵ,1)-approximate APSP for unweighted graphs.

Reduction and Unweighted (2+ϵ)-APSP

Next, we provide a reduction that transforms (a+ϵ,k)-APSP to (a+(k+2)ϵ,0)-APSP on unweighted graphs. This reductions allows for ϵ=0 as well. However, for our applications the update time of A will depend on 1/ϵ, so we only apply this reduction for ϵ>0.

Intuitively, we split every edge into k+1 edges to form G′. Then we compute (2, k)-APSP on G′, divide the result by k+1, and round down to the nearest integer. Because the additive error k is not enough to reach a new node in G, we can simply ignore this part of the path. In the following theorem we make this formal.

Theorem 3.1Let A be an algorithm that provides a (a+ϵ,k)-approximation for APSP in τA(n′,m′) time, for any unweighted n′-node m′-edge graph G′, and any constants a,k∈N≥1 and ϵ≥0. Given an unweighted graph G=(V,E) on n nodes and m vertices, we can compute (a+(k+2)ϵ,0)-APSP in τA(n+km,(k+1)m) time.

If A is a dynamic algorithm, then each update takes (k+1)·[update time ofA] time. The query time remains the same (up to a constant factor).

Proof

We construct the auxiliary graph G′=(V′,E′) as follows.

V′:=V∪{{u,v}i:{u,v}∈E,i∈{1,2,⋯,k}};E′:=⋃{u,v}∈E{{u,{u,v}1},{{u,v}1,{u,v}2},⋯,{{u,v}k-1,{u,v}k},{{u,v}k,v}}.

Clearly this graph has n+km vertices and (k+1)m edges. We compute (a+ϵ,k)-APSP on G′ in τA(n+km,(k+1)m) time using algorithm A, and denote the output by δG′. We set δ(u,v):=δG′(u,v)k+1 for all u,v∈V.

We now show that δ gives (a+(k+2)ϵ,0)-approximate APSP on G. Let u,v∈V. We remark that dG′(u,v)=(k+1)dG(u,v) for all u,v∈V. Which we will use twice.

First, we show that dG(u,v)≤δ(u,v). This follows from δ(u,v)=δG′(u,v)k+1≥dG′(u,v)k+1=(k+1)dG(u,v)k+1=dG(u,v).

Second, we show that δ(u,v)≤(a+(k+2)ϵ)·dG(u,v). This follows from

δ(u,v)=δG′(u,v)k+1≤(a+ϵ)·dG′(u,v)+kk+1=(a+ϵ)·(k+1)dG(u,v)+kk+1=(a+ϵ)·dG(u,v)+kk+1.

Now if ϵ=0, then a·dG(u,v) is an integer, hence a·dG(u,v)+kk+1=a·dG(u,v). If ϵ>0, then ϵdG(u,v)+kk+1 can be bigger than 1 – if it is not, we are done by the same argument. If ϵdG(u,v)+kk+1>1, then

(k+1)ϵ·dG(u,v)≥(k+1)-k=1.

Hence we obtain

(a+ϵ)·dG(u,v)+kk+1≤(a+ϵ)·dG(u,v)+1≤(a+ϵ)·dG(u,v)+(k+1)ϵ·dG(u,v)=(a+(k+2)·ϵ)dG(u,v).

For the claim about dynamic algorithms, note that any update to an edge in G, corresponds to updating k+1 edges in G′. The query consists of computing δ(u,v)=δG′(u,v)k+1, which requires a query to the distance in G′ plus constant time operations. □

In particular, this can give fast algorithms for sparse graphs. For the decremental case, we obtain the following result.

Theorem 1.3Given an undirected unweighted graph G, there is a decremental data structure that maintains a (2+ϵ)-approximation for APSP with constant query time. The algorithm works against an oblivious adversary. W.h.p. the total update time is bounded by O~(m7/4) if m=n1+Ω(1), and O~(m7/4+o(1)) otherwise.

Proof

We apply the theorem above with the (2+ϵ,1)-APSP of this paper, Theorem 1.2. This takes O~(nm3/4) time if m=n1+Ω(1), and O~(n1+o(1)m3/4) time otherwise. □

Approximate APSP with Additive Factors

In this section we give our last result, which is maintaining approximate APSP on unweighted graphs with a mixed additive and multiplicative stretch. First, we provide a decremental (1+ϵ,2)-APSP algorithm as a warm-up in Sect. 6.1. In Sect. 6.2, we generalize our techniques to provide an efficient decremental (1+ϵ,2(k-1))-APSP algorithm.

Warm-up: (1+ϵ,2)-APSP

Our goal in this section is to use a simpler algorithm based on [24] that let us maintain (1+ϵ,2)-APSP in total update time of O(m1/2n3/2O(1/ϵ)O(logn)) in unweighted undirected graphs with m=Ω(n) edges. Such an algorithm would outperform the approach in Sect. 4 when m=Ω(n5/3+o(1)), and it also gives a better near-additive approximation. We focus on obtaining an algorithm that can maintain +2-additive approximate distances for pairs within distance d in total update time O~(m1/2n3/2d). This approach can be combined with Theorem 2.6 to get our desired bounds.

Dynamic Data Structure

In Sect. 3.3, we described the static algorithm of [24]. We next describe the dynamic version of the algorithm. As mentioned above, we first focus on maintaining a data structure for pairs of nodes at distance at most d from each other. The algorithm is a variant of the static algorithm. At a high-level, we use ES-trees to maintain distances from nodes in A1 in the graph G, giving us exact distances for these nodes. For the remaining nodes u∈V\A1, we use monotone ES-trees to maintain distances in the graph Hu:=(V,E2∪E∗∪Eu1), giving us approximate distances. The algorithm is summarized as follows.

  1. Node set A1 . We define a random set A1 by sampling each node to A1 with probability clnns1 for s1=(mn)1/2 and a constant c≥2 of our choice.

  2. Edge set E∗ . For each node v that has at least one neighbor in A1, we add one edge {v,u} to E∗, where u is an arbitrarily chosen neighbor of v in A1.9

  3. Edge set E2 . For each node v that does not have a neighbor in A1, we add all the adjacent edges to v to the set E2.

  4. Maintaining ES-trees from nodes in A1 . For every u∈A1, we maintain an ES-tree rooted at u up to distance d+2 in the graph G.

  5. Maintaining monotone ES-trees from nodes in V\A1 . For each node u∈V\A1, we maintain a monotone ES-tree rooted at u up to distance d+2 in the graph Hu=(V,E2∪E∗∪Eu1), where Eu1 are all the edges of the form {u,v} where v∈A1. The weight of an edge {u,v}∈Eu1 is ℓv(u), the level of u in the ES-tree rooted at v computed in the previous step.

Maintaining the monotone ES-trees. Next, we give more details about maintaining the monotone ES-trees from nodes u∈V\A1.

  1. Initially, we construct a shortest path tree from u∈V\A1 in the original graph Hu, up to distance d+2.

  2. Each time the distance estimate between u and a node x∈A1 increases, we update the weight of the edge {u,x}∈Eu1. Note that we can maintain these distances exactly (up to distance d+2) as we compute them in the ES-tree rooted at x∈A1. We also update the monotone ES-tree rooted at u according to the weight change of {u,x}.

  3. Each time an edge {v,x}∈E∗ between a node v∈V\A1 and x∈A1 is deleted from the graph G, we distinguish between two cases. If v still has a neighbor w∈A1, we first add a new edge {v,w} to the set E∗ and then delete the edge {v,x}. Otherwise, we add to E2 all the edges incident to v in the current graph G, and then delete the edge {v,x}.

  4. If an edge e∈E2 is deleted, we delete it from Hu.

There are several challenges in maintaining the monotone ES-trees. First, during the algorithm there are insertions to the graph Hu, as new edges are added to E2 and E∗, and our goal is to show that our distance estimates still give a good approximation to the actual distances. In the static version of the algorithm, the algorithm computes the exact distances in the graphs Hu and this provides a good approximation for the distances. However, in our case, the monotone ES-trees are not guaranteed to keep the actual distances in Hu because they ignore distance decreases that come from edge insertions, and we should prove that this does not affect the stretch of the algorithm.

In addition, in the static version of the algorithm it is easy to argue that the graphs Hu are sparse. For example, E∗ is a set of at most O(n) edges, since each node v added at most one edge. In our case, as Hu changes dynamically, we need to prove that the total number of edges added to it is small. In particular, as each time that an edge in {v,x}∈E∗ gets deleted, we replace it by another edge, it could be the case that overall in the algorithm we add many different edges to E∗ which can affect the total update time of the algorithm. In addition, each time that a node v no longer has a neighbor in A1, we add all its adjacent edges to E2, and we should argue that the number of edges added to E2 is small. We will discuss these issues in more detail later, and show that we can implement the monotone ES-trees efficiently. Next, we provide the stretch analysis of the algorithm.

Stretch Analysis

For any pair of nodes u, v, we denote by ℓu(v) the level of v in the ES-tree or monotone ES-tree rooted at u. We start with the following simple observation.

Claim 6.1

For any u∈V,x∈A1 such that dG(u,x)≤d+2, we have that ℓx(u)=ℓu(x)=dG(u,x).

Proof

As x∈A1, we maintain the exact distances from x up to distance d+2 in the ES-tree rooted at x. Hence, we have ℓx(u)=dG(u,x). If u∈A1, the same argument holds also for ℓu(x). If u∈V\A1, in Step 2 of the algorithm for maintaining the ES-tree we make sure that we also maintain the correct distance between u and x in the monotone ES-tree rooted at u, hence ℓu(x)=dG(u,x). Note that as the edge {u,x} always appears in Hu, and by part (4) of Lemma 2.4 we always maintain the exact distance estimate in this case. □

Claim 6.2

For any u,v∈V such that dG(u,v)≤d, we have that dG(u,v)≤ℓu(v)≤dG(u,v)+2.

Proof

If v∈A1, this already follows from Claim 6.1. Hence we focus on the case that v∈V\A1. The left side of the inequality follows as dG(u,v)≤dHu(u,v)≤ℓu(v), using part (2) of Lemma 2.4, and since the distances in Hu can only increase compared to distances in G. This holds as the edges in Hu are either edges in G or have a weight that is at least the weight of the shortest path between the corresponding endpoints in G. We next show that ℓu(v)≤dG(u,v)+2. We prove the claim by double-induction. First, on the time in the algorithm, and second on the distance dG(u,v).

Base Case. At the beginning of the algorithm, this follows from the correctness of the static algorithm, we give the details for completeness. Note that at the beginning of the algorithm, from part (1) of Lemma 2.4, we have that ℓu(v)=dHu(u,v) as long as dHu(u,v)≤d+2, and we show that this is indeed the case when dG(u,v)≤d.

  1. v has a neighbor in A1. In this case there is an edge {v,x}∈E∗ such that x∈A1. Note that as x is a neighbor of v it holds that dG(u,x)≤d+1. As x∈A1 and dG(u,x)≤d+1, the graph Hu has an edge {u,x} with weight dG(u,x), and it also has the edge {v,x}∈E∗. Hence, at the beginning of the algorithm, we have
    ℓu(v)=dHu(u,v)≤dG(u,x)+dG(v,x)=dG(u,x)+1.
    Now, by the triangle inequality
    dG(u,x)≤dG(u,v)+dG(v,x)=dG(u,v)+1.
    Hence, overall, we get that ℓu(v)≤dG(u,v)+2. Note that we get the dHu(u,v)≤d+2, which implies that the distance is indeed maintained correctly in the monotone ES-tree.
  2. v does not have a neighbor in A1. In this case, all the edges adjacent to v are in E2⊆Hu. Let {w,v} be the edge adjacent to v in the shortest path between u and v in G. Then, dG(u,w)=dG(u,v)-1. From the induction hypothesis, we have that ℓu(w)≤dG(u,w)+2. Since the edge {w,v} exists in Hu, we get that
    ℓu(v)=dHu(u,v)≤dHu(u,w)+dHu(w,v)=ℓu(w)+1≤dG(u,w)+3=dG(u,v)+2.
    As dHu(u,v)≤d+2, we indeed maintain the value correctly in the monotone ES-tree.

Induction Step. Assume now that the claim holds after t-1 edge deletions, and we will prove it holds after t edge deletions. We prove it by induction on the length of the path between u and v in the current graph G. In the base case that u=v it trivially holds. First, if the value ℓu(v) did not change after the t-th edge deletion, then the claim follows from the induction hypothesis (as the distance dG(u,v) can never decrease). Hence, we focus on the case that ℓu(v) changed. By parts (3) and (4) of Lemma 2.4, when the level ℓu(v) is changed it is necessarily increased, and the new value is equal to minx∈N(v){ℓu(x)+wHu(x,v)}.

  1. When the value ℓu(v) increases, v has a neighbor in A1. By Step 3 of the algorithm for maintaining the ES-tree, it is guaranteed that there is an edge {v,x}∈E∗⊆Hu. Also, ℓu(x)=dG(u,x) by Claim 6.1 and since dG(u,x)≤d+1, as x is a neighbor of v. Hence, when we update the value ℓu(v), the new value is at most ℓu(x)+wHu(x,v)=dG(u,x)+1. The exact same proof that we used in the base case, shows that dG(u,x)≤dG(u,v)+1. Hence, ℓu(v)≤dG(u,v)+2, as needed. Again, as this value is bounded by d+2 it is maintained correctly.

  2. When the value ℓu(v) increases, v does not have a neighbor in A1. It follows from Step 3 of the algorithm for maintaining the ES-tree that all the edges adjacent to v are in Hu. Let x be the neighbor of v in the shortest u-v path in G. By the induction hypothesis, ℓu(x)≤dG(u,x)+2. Hence,
    ℓu(v)≤ℓu(x)+wHu(x,v)≤dG(u,x)+3=dG(u,v)+2,
    this value is again at most d+2, hence it is maintained correctly, completing the proof.

□

Time Complexity

To analyze the time complexity of the algorithm, we first bound the total number of edges added to E2 and E∗ in the algorithm.

Claim 6.3

The total number of edges added to E2 during the algorithm is bounded by O(ns1) with high probability.

Proof

By definition, the edges in E2 are the edges adjacent to all nodes that do not have a neighbor in A1. We show that as long as the degree of a node v is s1 then with high probability it has a neighbor in A1. This follows as A1 is obtained by sampling each node with probability clnns1. Hence, as long as the degree of v is at least s1, the probability that none of its neighbors is in A1 is at most (1-clnns1)s1≤e-clnn=1nc. It follows that with high probability each node adds less than s1 edges to E2, proving the claim. □

Claim 6.4

The expected number of edges to ever be present in E∗ is O((mn)1/2logn).

Proof

Recall that each node is added to the set A1 with probability clnns1. Hence, in expectation each node v has O(deg(v)logns1) neighbors in the set A1, where deg(v) is the degree of v at the beginning of the algorithm. These edges are candidates to be added to the set E∗, and in the worst case all of them are added to E∗ during the algorithm. Summing over all nodes, the expected number of edges added to E∗ is bounded by

∑v∈VOdeg(v)logns1=Omlogn(mn)1/2=O((mn)1/2logn).□
Lemma 6.5

The total update time of the algorithm is O~(m1/2n3/2d) in expectation.

Proof

Computing the set A1 takes O(n) time by sampling each node to the set independently with probability clnns1.

Maintaining the sets E∗ and E2 is done as follows. At the beginning of the algorithm, each node v scans its neighbors until it finds the first neighbor u in the set A1 if exists, and it adds the edge {v,u} to the set E∗. If there is no such u, then v adds all its adjacent edges to the set E2. During the algorithm, when the edge {v,u} is deleted, v continues scanning its neighbors until it finds the next neighbor w in the set A1 if exists. If w exists it adds the edge {v,w} to E∗, and otherwise it adds all its adjacent edges to E2. Note that in the whole algorithm, v only needs to scan its neighbors once to find all the edges it adds to E∗. Hence, overall maintaining the sets E∗ and E2 takes O(m) time. We can also keep a list of the new edges added to E∗ and E2 after a deletion, to help maintaining the monotone ES-trees.

We maintain the ES-trees from nodes u∈A1 as follows. Every time that an edge is deleted we delete it from all the trees. In addition, every time that a level ℓu(v) increases for u∈A1,v∈V\A1, we update the weight of the edge {v,u} in the graph Hv, and update it in the monotone ES-tree rooted at v. Maintaining the ES-trees from nodes in A1 takes O(|A1|(md+n)) time by Lemma 2.3. By the definition of A1, this equals

Onlogns1md+n2=O(m1/2n3/2(logn)d)

in expectation, when m=Ω(n).

We maintain the monotone ES-trees rooted at nodes u∈V\A1 as follows. After an edge e is deleted, we update the weights of the edges {u,v}∈Eu1 when their weights are increased in the ES-trees rooted at nodes v∈A1, as described above. In addition, we add to Hu all the edges that were added to E2 and E∗ after the deletion of the edge e (we kept them in a list as described above), and finally we delete the edge e from the monotone ES-tree. By Lemma 2.5, the total update time for maintaining the monotone ES-tree rooted at the node u is O(E(Hu)·d+W(Hu)+n), where E(Hu) is the total number of edges ever contained in Hu and W(Hu) is the total number of updates to Hu. There are O(n) edges in Eu1 and each of them is updated O(d) times, as the distance estimates only increase and can have O(d) values. This adds O(nd) term to the complexity of one tree, and O(n2d) summing up over all trees. The edges in E2 and E∗ are only added and removed once in the algorithm. The total number of edges in E2 is O(ns1) with high probability from Claim 6.3. Summing up over all trees these edges add O(n2s1d)=O(n3/2m1/2d) term to the complexity. The total number of edges in E∗ is bounded by O((mn)1/2logn) in expectation from Claim 6.4. Summing up over all trees they add O(n3/2(logn)m1/2d) term to the complexity, completing the proof. □

Claim 6.6

The query time of the algorithm is O(1).

Proof

To answer a distance query for a pair of nodes u, v, we just return the value ℓu(v). This can be done in O(1) time if we keep for each node u an array of the values ℓu(v) which is updated each time a distance estimate change. □

In conclusion, we get the following.

Theorem 6.7

Given an undirected unweighted graph G, there is a decremental data structure that maintains +2-additive approximation for APSP for pairs of nodes at distance at most d from each other. The expected total update time is bounded by O~(m1/2n3/2d), and the query time is constant.

To get rid of the d term in the complexity, we can combine our approach with Theorem 2.6. This would lead to a (1+ϵ,2)-approximation and replace the d term in the complexity by an O(1/ϵ)O(logn) term (which simplifies to no(1) for constant ϵ. We will provide full details of the approach when we describe our general algorithm in the next section (see in particular Sect. 6.2.4). The high-level idea is to use our algorithm with a parameter d=O(1/ϵ)O(logn), and combine it with Theorem 2.6 for computing (1+ϵ,β)-approximation for large distances. For an appropriate choice of the parameters, we will get a (1+ϵ)-approximation for the distances between pairs of nodes at distance greater than d from each other, and a +2 approximation for pairs of nodes at distance at most d from each other.

(1+ϵ,2k-2)-APSP

With this warm-up we can move on to the more general algorithm based on [24] that leads to a larger stretch but a smaller update time. Our goal is to obtain a (1+ϵ,2k-2)-approximation in O~(n2-1/km1/k(1/ε)O(logn)) time. The algorithm works in unweighted undirected graphs. As before, we start by describing a data structure that maintains the approximate distances for pairs of nodes at distance at most d from each other, and then in Sect. 6.2.4 we combine it with Theorem 2.6 to handle the general case.

Dynamic Data Structure

The algorithm is summarized as follows.

  1. Node sets Ai. We define a series of sets A1,A2,...,Ak such that for i=1,...,k-1, the set Ai is a random set obtained by sampling each node with probability pi=clnnsi, for si=(mn)1-i/k(lnn)i/k, and a constant c≥2 for our choice. If a node is sampled to several different sets we keep it only in the set with minimum index i among them. Finally, we define Ak=V\⋃i=1k-1Ai. Note that by definition, each node is in exactly one set Ai.

  2. Indices iv for all v∈V. For a node v∈V, we denote by iv the minimum index i such that v has a neighbor in Ai.

  3. Edge set E∗. For each node v, we add one edge {v,x} to E∗, where x is an arbitrary neighbor of v in Aiv.

  4. Edge sets Ei. The edges Ei are all the edges {u,v} where max{iu,iv}≥i. In other words, it is all the edges adjacent to nodes that do not have a neighbor in Ai′ for i′<i.

  5. Maintaining monotone ES-trees. The algorithm maintains monotone ES-trees as follows.
    • For every u∈A1, we maintain an ES-tree rooted at u up to distance d+3k in the graph G.
    For i=2 to k:
    • For every u∈Ai, we maintain a monotone ES-tree rooted at u up to distance d+3k in the graph Hui=(V,Ei∪E∗∪Eui), where Eui are all the edges {u,v}, where v∈Ai′ for i′<i. The weight of the edge {u,v} is equal to the value ℓv(u) in the monotone ES-tree rooted at v.

Note that we maintain the monotone ES-trees up to distance d+3k. As we show in the stretch analysis, this is needed in order to guarantee that we maintain correct estimates for any pair of nodes at distance at most d from each other. Intuitively, as the distance estimate we maintain is at most d(u,v)+2k, we would like to maintain correct estimates for pairs of nodes at distance d+2k from each other. Another k term comes from the inductive argument of the stretch analysis. For more details, see Sect. 6.2.2.

In Sect. 6.2.3, we explain in detail how to maintain the data structures efficiently. When we maintain the graphs Hui we make sure that the following holds (for a proof, see Sect. 6.2.3).

Claim 6.8

Let u∈Ai,v∈V. Throughout the updates, it always holds that v either has an edge {v,w}∈Hui, where w∈Ai′ for i′<i, or all the edges adjacent to v are in Hui.

We are in the first case of the claim when iv<i, and we are in the second case when iv≥i.

Stretch Analysis

We need the following claims. First, from part (1) of Lemma 2.4 we have the following.

Claim 6.9

At the beginning of the algorithm, for any u∈Ai, and any v at distance at most d+3k from u in Hui, we have ℓu(v)=dHui(u,v).

We next show the following.

Claim 6.10

Let u∈Ai,w∈Aj such that j<i, then ℓu(w)≤ℓw(u).

Proof

The claim follows as we always have an edge {u,w} with weight ℓw(u) in the graph Hui, and the value ℓw(u) is monotonically increasing during the algorithm. Hence, and from part (4) of Lemma 2.4, every time that the estimate ℓu(w) changes it always changes to a value that is at most ℓw(u). □

We next prove the stretch guarantee of the algorithm.

Lemma 6.11

For any node u∈Ai, and any node v∈V where dG(u,v)≤d+(k-i), throughout the updates we have dG(u,v)≤ℓu(v)≤dG(u,v)+2(i-1).

Proof

First, the left inequality holds since dG(u,v)≤dHui(u,v)≤ℓu(v), where the first inequality follows from the definition of Hui, and the second follows from part (2) of Lemma 2.4. We prove the right inequality by triple-induction, on the value i, on the time in the algorithm, and on the distance dG(u,v). For i=1, the claim follows as we maintain ES-trees up to distance d+3k from the nodes of A1 in the graph G. We next assume that it holds for any i′<i, and prove that it holds for i. The proof is by induction on the time in the algorithm and on the distance dG(u,v).

Base Case. We first show that the claim holds at the beginning of the algorithm. From Claim 6.9, at the beginning of the algorithm, for any u, v where dHui(u,v)≤d+3k, we have that ℓu(v)=dHui(u,v). Hence, our goal is to show that dHui(u,v)≤dG(u,v)+2(i-1). Note that if this holds, then since dG(u,v)≤d+(k-i), we get that dHui(u,v)≤d+3k, hence the distance is maintained in the monotone ES-tree as needed. The proof is by induction on dG(u,v).

  1. iv<i. In this case, there is an edge {v,w}∈E∗⊆Hui such that w∈Ai′ for i′<i. Note that since dG(u,v)≤d+(k-i), and w is a neighbor of v, then we have dG(u,w)≤d+(k-i)+1=d+(k-(i-1))≤d+(k-i′). Hence, we can use the induction hypothesis on w and u. From the induction hypothesis and Claim 6.9, we have ℓw(u)=dHui(w,u)≤dG(w,u)+2(i-2) (note that this value is smaller than d+3k, so we can indeed use Claim 6.9). Hence, we get that
    dHui(u,v)≤dHui(u,w)+dHui(w,v)≤dG(w,u)+2(i-2)+1.
    We have, dG(w,u)≤dG(w,v)+dG(v,u)=dG(u,v)+1. Hence, we get, dHui(u,v)≤dG(u,v)+2(i-1), as needed.
  2. iv≥i. In this case, by definition, all the edges adjacent to v are in Ei⊆Hui. Let w be the neighbor of v on the shortest u-v path. From the induction hypothesis, dHui(u,w)≤dG(u,w)+2(i-1). So we have
    dHui(u,v)≤dHui(u,w)+dHui(w,v)≤dG(u,w)+1+2(i-1)=dG(u,v)+2(i-1).

Induction Step. We assume that the claim holds after t-1 edge deletions, and show that it holds after t edge deletions. The proof is by induction on the distance dG(u,v). If u=v, the claim trivially holds. If the estimate ℓu(v) did not change after the t’th edge deletion, then the claim holds from the induction hypothesis. Note that an edge deletion can potentially lead to several changes of the value ℓu(v). It is enough to prove that the stretch guarantee holds in the last time the value ℓu(v) increases, as the value stays the same afterwards. We divide into cases based on Claim 6.8.

  1. When the value ℓu(v) increases in the last time, there is an edge {v,w}∈Hui such that w∈Ai′ for i′<i. From part (4) of Lemma 2.4, when ℓu(v) changes, it gets the value minx∈N(v){ℓu(x)+wHui(x,v)}, assuming this value is at most d+3k, and we will show that this is indeed the case. Hence,
    ℓu(v)≤ℓu(w)+wHui(w,v)≤ℓw(u)+1≤dG(u,w)+2(i-2)+1.
    Here we use Claim 6.10 and the fact that w∈Ai′ for i′<i (note that since dG(u,v)≤d+(k-i), and w is a neighbor of v, it follows that dG(u,w)≤d+(k-i′), so we can indeed use the induction hypothesis). It also holds that dG(u,w)≤dG(u,v)+dG(v,w)=dG(u,v)+1. Hence, overall, we have ℓu(v)≤dG(u,v)+2(i-2)+2=dG(u,v)+2(i-1), as needed. Note that this value is indeed smaller than d+3k, hence we maintain the correct estimate in the monotone ES-tree.
  2. When the value ℓu(v) increases in the last time, all the adjacent edges to v are in the graph Hui. Let w be the neighbor of v on the shortest u-v path. When the distance estimate of v changes we have
    ℓu(v)≤ℓu(w)+dHui(w,v)≤dG(u,w)+2(i-1)+1=dG(u,v)+2(i-1),
    where we use the induction hypothesis on w and part (4) of Lemma 2.4. Note that it follows that the values ℓu(v),ℓu(w) are smaller than d+3k, hence they are maintained correctly in the monotone ES-tree.

□

Time Complexity

We next analyze the time complexity of the algorithm. We start by showing that the first steps of the algorithm can be maintained efficiently.

Claim 6.12

The first 4 steps of the algorithms can be maintained in O((m+n)k) time.

Proof

Step 1. Computing the sets Ai takes O(kn) time, by just sampling each node to the set Ai with probability pi. For each node v, we can stop the sampling after the first time v is sampled to one of the sets. This is only done once at the beginning of the algorithm. For each node v, we keep the index i such that v∈Ai. For each i, we create a list of all the nodes in the set Ai. Creating all these lists takes O(n) time by scanning the nodes.

Steps 2 and 3. The indices iv and the set E∗ are maintained dynamically in the algorithm, as follows. At the beginning, each node v scans its neighbors to find the minimum index i such that v has a neighbor in Ai, it also saves the name of an edge {v,u} to the first neighbor of v in Aiv, this edge is added to set E∗. In the algorithm, if the edge {v,u} is deleted, then v goes over its next neighbors, and finds the next neighbor w∈Aiv if exists. If such a neighbor exists, then {v,w} is added to E∗. Otherwise, the value iv increases, and v scans its neighbors again to determine the new index iv and adds the first edge {v,w} from v to a neighbor in Aiv to E∗. Note that overall in the algorithm each node needs to scan its neighbors O(k) times, because as long as the value iv stays the same, we just need to go over the neighbors once during the whole algorithm to determine all the edges added to E∗. Overall these steps take O(mk) time.

Step 4. Maintaining the sets Ei is done as follows. Initially, we add to Ei all the edges adjacent to nodes v where iv≥i. During the algorithm, every time that the value iv of a node v changes, say from j to j′, then for all j<i≤j′, we add the edges adjacent to v to the set Ei. We also keep a list of all the newly added edges in Ei after a deletion of an edge, so that we can update them in all the relevant monotone ES-trees. The time complexity for maintaining the set Ei is proportional to the number of edges added to Ei during the algorithm, which can trivially be bounded by O(m), hence this step takes at most O(mk) time. □

Maintaining the monotone ES-trees. The main challenge in the algorithm is maintaining the monotone ES-trees in Step 5 of the algorithm. Before analyzing the time complexity of the algorithm, we start by describing the algorithm in more detail. Note that each time an edge is deleted it can lead to many changes, including edge insertions and weight changes in all the trees we maintain. We next explain in detail in which order we make these changes in order to maintain the correctness of the algorithm. We use the algorithms for ES trees and monotone ES trees described in Sect. 2.4.

ES-trees rooted at nodes of A1. First, for any node u∈A1, we start by creating an ES-tree rooted at u in the graph G, maintained up to distance d+3k. After creating this tree, for any v∈Ai for i>1, we add an edge {u,v} with weight ℓu(v) to the set of edges Evi. During the algorithm, every time an edge is deleted, we delete it from the ES-tree and update it accordingly. For any v where ℓu(v) has increased after the deletion and where v∈Ai for i>1, we update the corresponding edge in Evi, and save it in a list of edges in Evi that were updated after the deletion. This completes the description for u∈A1.

Monotone ES-trees rooted at nodes of Ai. For u∈Ai for larger values of i, we maintain the monotone ES-trees according to the order of the index i, from 2 to k. We work as follows. Initially, we create a monotone ES-tree rooted at u up to distance d+3k in the graph Hui=(V,Ei∪E∗∪Eui), with the edges Ei,E∗ at the beginning of the algorithm, and with the edges Eui that were obtained when creating the monotone ES-trees in previous levels. Note that all these edges of Eui are of the form {u,v} where v∈Ai′ for i′<i, so we indeed already created the monotone ES-tree rooted at the relevant nodes v. After creating the tree, for any node v∈Ai′ for i′>i, we add a new edge to the set Ev′ with weight ℓu(v). During the algorithm, when an edge e is deleted, we update the monotone ES-trees in several steps as follows, again we work according to the order of the index i.

  • First step: adding the new edges of E∗ and Ei to Hui. The deletion of the edge e can lead to adding new edges to E∗ or Ei in steps 3 and 4 of the algorithm. As explained in these steps, we maintain the newly added edges, and can add them to a list of newly added edges (to E∗ and to Ei separately). When we update the monotone ES-tree rooted at u∈Ai, we start by adding all these newly added edges that were added to E∗ and Ei to Hui.

  • Second step: updating the edges in Eui. Next, there are possibly edges in {u,v}∈Eui that their weight is increased after the deletion. This is already observed when we update the monotone ES-tree rooted at v, and if it happens, we add the edge {u,v} with new weight ℓv(u) to a list of edges that were updated in Eui. When we update the monotone ES-tree rooted at u, we update the weights of all these edges (we already have their list after we finish maintaining the ES-trees in previous levels).

  • Third step: deleting the edge e. Lastly, we delete the edge e that was deleted in this step from the monotone ES-tree.

Note that the weight increases and deletion can increase the levels ℓu(v) of some nodes in the tree. For any v in Aj for j>i such that ℓu(v) increases, when the value increases, we add an edge {v,u} with the new weight ℓu(v) to the list of newly updated edges in Evj. This completes the description of the algorithm. From the above description, we can now prove Claim 6.8.

Proof of Claim 6.8

Let u∈Ai,v∈V. At the beginning of the algorithm, if iv<i, then there exists an edge {v,w}∈E∗⊆Hui where w∈Ai′ for i′<i. Otherwise, iv≥i, and all the edges adjacent to v are in Ei⊆Hui. During the algorithm, every time an edge e of the form {v,w}∈E∗ is deleted, then if iv<i after the deletion, we add a new edge {v,w′} to E∗ for w′∈Ai′ for i′<i, and if iv≥i, we add all the edges adjacent to v to Ei⊆Hui. In the algorithm, we first add these new edges to Hui, and only then delete the edge e, which proves the claim. □

To bound the time complexity, we need the following useful claims that bound the total number of edges added to the sets Ei and E∗ during the algorithm.

Claim 6.13

For i≥2, the total number of edges added to Ei during the algorithm is bounded by O(nsi-1) with high probability.

Proof

The edges Ei are all the edges adjacent to nodes v where iv≥i. We show that at the first time in the algorithm that iv≥i, the degree of v is at most si-1 with high probability. This implies that each node v adds at most si-1 edges to the set Ei, proving the claim. To bound the degree of v, note that by definition the set Ai-1 is obtained by sampling each node with probability clnnsi-1, all these nodes are added to the set Ai-1, unless they are already part of a set Ai′ for i′<i-1. As long as the degree of v is at least si-1, the probability that none of the neighbors of v is sampled to Ai-1 is at most (1-clnnsi-1)si-1≤e-clnn=1nc. Hence, with high probability v has a neighbor sampled to Ai-1, implying that iv≤i-1 as long as deg(v)≥si-1. From union bound, this holds for all nodes with high probability. This proves that the total number of edges added to Ei in the algorithm is bounded by O(nsi-1). Note that the proof assumes that we have an oblivious adversary and that the order in which edges are deleted does not depend on the random choices of the algorithm. □

Claim 6.14

In expectation, the total number of edges added to the set E∗ in the algorithm is bounded by

O(kn1-1/km1/k(logn)1-1/k).
Proof

We analyze the number of edges v adds to the set E∗ when iv=i for all i. First, when iv=1, then in the worst case v adds to E∗ edges to all its neighbors in A1. By the definition of A1, each node is added to A1 with probability clnns1. Hence, in expectation v has O(deg(v)logns1) neighbors in A1, where deg(v) is the degree of v at the beginning of the algorithm. When we sum up over all v, this adds at most O(mlogns1)=O(n1-1/km1/k(logn)1-1/k) edges in expectation, where the last equality follows from the definition of s1.

When iv=i for i>1, as we proved in Claim 6.13, with high probability the degree of v is at most si-1. Note that each one of the neighbors of v is added to Ai with probability clnnsi. Hence, in expectation, v has O(si-1·lnnsi) neighbors in Ai. In the worst case, it adds edges to all of them during the algorithm. In total, the expected number of edges added by all nodes to E∗ in the case that iv≥2 is bounded by ∑i=2kO(nlognsi-1si). By the definition of si, we have that si-1si=(mn)1/k(lnn)-1/k. Hence, in total the expected number of edges added is bounded by O(kn1-1/km1/k(logn)1-1/k). □

Next, we prove the complexity of the algorithm.

Lemma 6.15

Maintaining the ES-trees takes O(kn2-1/km1/k(logn)1-1/kd) time in expectation.

Proof

Maintaining the ES-trees rooted at nodes in A1 takes O(|A1|(md+n)) time by Lemma 2.3. Since |A1|=O(nlogns1) in expectation, and by the choice of s1, this adds O(n2-1/km1/k(logn)1-1/kd) term to the complexity, when m=Ω(n).

From Lemma 2.5, maintaining a monotone ES-tree rooted at u∈Ai takes O(E(Hui)·d+W(Hui)+n) time, where E(Hui) is the total number of edges ever contained in Hui and W(Hui) is the total number of updates to Hui. To complete the proof, we should analyze these values. Recall that Hui=(V,Ei∪E∗∪Eui). Note that Eui has at most n-1 edges, that are updated O(d) times during the algorithm, as we maintain distances up to distance d+3k, hence these edges add O(nd) term to the complexity of maintaining one tree, and O(n2d) for all n trees. The edges in E∗ and Ei are only added and removed once from a tree during the algorithm. From Claim 6.13, the total number of edges added to Ei during the algorithm is bounded by O(nsi-1) with high probability. Since these edges are part of all the ES-trees rooted at nodes in Ai, maintaining these edges adds O(|Ai|nsi-1d) term to the complexity. This equals

Onlognsi·nsi-1·d=O(n2-1/km1/k(logn)1-1/kd),

following the same calculations done in Claim 6.14 (but with an extra nd term). Summing over all k adds another multiplicative k term to the complexity. From Claim 6.14, the total number of edges added to E∗ is bounded by O(kn1-1/km1/k(logn)1-1/k) in expectation. Summing over all n trees, it adds another O(kn2-1/km1/k(logn)1-1/kd) term to the complexity, completing the proof. □

Claim 6.16

The query complexity of the algorithm is constant.

Proof

To answer a distance query for a pair of nodes u, v, we work as follows. If u∈Ai,v∈Aj, and i<j, our distance estimate is ℓu(v), otherwise our distance estimate is ℓv(u). Note that it is easy to maintain the values ℓu(v) in a way that the query time is constant. For example, we can maintain for each node u an array with the values ℓu(v), and update the value in constant time each time it was changed in the algorithm. □

Putting Everything Together

In the last sections we showed an algorithm that for any pair of nodes at distance at most d maintains a +2(k-1)-additive approximation in O~(n2-1/km1/kd) time. To get our final result, we combine it with Theorem 2.6 to handle large distances, proving the following.

Theorem 1.4Given an undirected unweighted graph G, a constant 0<ϵ<1 and an integer 2≤k≤logn, there is a decremental data structure that maintains (1+ϵ,2(k-1))-approximation for APSP with constant query time. The algorithm works against an oblivious adversary. The expected total update time is bounded by min{O(n2-1/k+o(1)m1/k),O~((n2-1/km1/k)O(1/ϵ)k/ρ)} where m=n1+ρ.

Note that for small values of k and if m=n1+ρ for a constant ρ>0, we get a complexity of O~(n2-1/km1/k), where in the general case we have an extra no(1) term.

Proof

We maintain simultaneously our dynamic data structure to handle short distances of at most d, and the data structure from Theorem 2.6 to handle large distances of more than d, for a parameter d which we specify next. We run the algorithm from Theorem 2.6 with parameters ϵ′=ϵ/2, and k′ to be specified later. Recall that this algorithm gives a (1+ϵ′,β)-approximation for β=2(1+2/ϵ′)k′-2. We define d=β/ϵ′.

To answer a distance query for a pair of nodes u, v, we return the minimum between the values obtained in both algorithms. As in both algorithms the query time is constant, we get a constant query time.

For the stretch analysis, if d(u,v)≤d, then by Lemma 6.11, we get an additive stretch of at most +2(k-1). If d(u,v)≥d=β/ϵ′, then the distance estimate we get from the (1+ϵ′,β)-approximation algorithm is at most

(1+ϵ′)d(u,v)+β≤(1+ϵ′)d(u,v)+ϵ′d(u,v)=(1+2ϵ′)d(u,v)=(1+ϵ)d(u,v).

Hence, overall we get a (1+ϵ,2(k-1))-approximation, as needed.

We now analyze the time complexity. From Lemma 6.15, the time complexity of our algorithm (for small distances) is O(kn2-1/km1/k(logn)1-1/kd), and from Theorem 2.6 the time complexity of the near-additive approximation algorithm is O~(n2+1/k′(37/ϵ)k′-1). We distinguish between two choices for the value k′. First we choose k′=k/ρ, where m=n1+ρ. In this case, the complexity of both expressions is bounded by O~((n2-1/km1/k)O(1/ϵ)k/ρ), as d=β/ϵ′,β=2(1+2/ϵ′)k′-2, and O(n2-1/km1/k)=O(n2-1/kn(1+ρ)/k)=O(n2+ρ/k)=O(n2+1/k′).

Second, we choose k′=logn. In this case, O~(n2+1/k′(37/ϵ)k′-1)=O(n2+o(1)). Similarly, d=β/ϵ′=O(1/ϵ′)k-1=O(1/ϵ)O(logn)=no(1), where the last equality follows since we assume ϵ to be a constant. Hence, in total we get a complexity of O(n2-1/k+o(1)m1/k), when m=Ω(n). □

Conclusion

We presented new tradeoffs for decremental approximate APSP in undirected graphs. For weighted graphs, we obtained a (2+ε)-approximation with total update time O~(m1/2n3/2) and a faster (2+ε,Wu,v)-approximation with total update time O~(nm3/4). For unweighted graphs, we obtained a (2+ε)-approximation with total update time O~(m7/4), yielding the first subquadratic algorithm for sufficiently sparse graphs, as well as a family of (1+ε,2(k-1))-approximation algorithms with total update time O~(n2-1/km1/k). These results demonstrate that approximation guarantees between 1+ε and 3, which have been extensively studied in the static setting [26–28, 35, 37, 45, 46], can also be exploited to obtain substantially faster decremental APSP algorithms.

Despite this progress, the landscape of decremental APSP remains far from fully understood. One of the central open questions is to characterize for which approximation guarantees the total update time of a decremental APSP algorithm can match, up to subpolynomial factors, the running time of the best corresponding static algorithm. For single-source shortest paths, a remarkably complete picture has emerged through a long line of work culminating in near-linear update times for a wide range of approximation guarantees [1, 7, 8, 14, 18, 20, 74]. In contrast, for APSP there remain substantial gaps. For example, our (2+ε)-approximate weighted algorithm achieves total update time O~(m1/2n3/2), matching the classical static construction of Cohen and Zwick [27] up to polylogarithmic factors. However, since then faster static 2-approximations have been developed: Baswana and Kavitha [28] give an algorithm for 2-APSP taking O~(mn+n2) time. For dense graphs, Dory et al. [37] give (2+ϵ)-APSP in O(n2.214) time and a distance oracle for 2-APSP taking O~(mn2/3) time. Determining whether these gaps between decremental and static can be closed, or whether they reflect inherent barriers, remains an open question.

A second major direction concerns robustness against stronger adversaries and deterministic computation. Most of the fastest decremental APSP algorithms, including ours, rely on randomization and are analyzed against an oblivious adversary [2, 4, 13]. On the other hand, substantial progress has been made in the deterministic setting for large-stretch approximations and related shortest-path problems [16–18, 21, 50, 73, 77, 89].

Nevertheless, no deterministic or adaptive-adversary decremental APSP algorithms are known with update times comparable to those achieved in the oblivious-adversary setting for approximation guarantees around 2+ε. Closing these gaps would represent a major advance in dynamic graph algorithms.

Finally, the fully dynamic setting remains largely unexplored in the approximation regime considered in this paper. Fully dynamic APSP has a long history, beginning with exact algorithms [48, 57, 58, 75, 76] and continuing with approximate algorithms [5, 12, 22]. However, the best known fully dynamic (2+ε)-approximate APSP algorithms still require roughly m1+o(1) amortized update time per operation [5], and there has been comparatively little progress toward achieving the kinds of improvements that are now known in the decremental setting. It remains open whether approximation guarantees between 2 and 3 admit substantially faster fully dynamic algorithms and whether techniques such as approximate bunches or hopsets can be extended to support insertions efficiently.

We hope that the techniques introduced in this work—particularly the dynamic maintenance of approximate bunches and the use of bunch-overlap thresholds—provide useful tools for addressing these questions and for further narrowing the gap between static, decremental, and fully dynamic shortest-path algorithms.

Monotone ES-tree

Algorithm 4 provides pseudocode for the monotone ES-tree algorithm, this is taken from [8].

Algorithm 3.

Algorithm 3

Monotone ES-tree

Maintaining Bunches and Clusters

In this section we give a sketch of the algorithm of Łącki and Nazari [20] that allows us to maintain bunches and clusters needed for the decremental algorithm in Sect. 4. One tool used is a decremental algorithm by Roditty and Zwick [4] that maintains Thorup-Zwick clusters up to a bounded depth. This result can be summarized as follows:

Lemma B.1

([4]). Let 0<p≤1 and d≥1 be parameters. Given a dynamic graph G=(V,E,w), that has edge deletions, weight increases, and edge insertions that do not decrease distances, we can maintain clusters (with sampling probability p) and bunches up to depth d in total update time O~(|E(G)|d/p). Moreover, we maintain distances from each node to its cluster and its bunch, and these distances are monotone (non-decreasing).

This time dependence on d is too expensive for many applications, and thus [20] improve the time for maintaining approximate bunches and clusters by maintaining a hopset, combined with a well-known scaling tool.

Hopsets. Hopsets, originally introduced by Cohen and Zwick [27] in the context of parallel algorithms, are widely used in faster algorithms in decremental settings. We briefly define this concept and sketch its application.

Definition 2

Let G=(V,E,w) be a weighted undirected graph, and let 0<ϵ<1 be a parameter. A (β,1+ϵ)-hopset is a graph H=(V,E(H),wH) such that for each u,v∈V we have dG(u,v)≤dG∪H(β)(u,v)≤(1+ϵ)dG(u,v), where dG∪H(β)(u,v) denotes the length of the shortest path between u and v in G∪H that uses at most β hops. We say β is the hopbound of the hopset and 1+ϵ is the stretch of the hopset.

Theorem B.2

([20]) Let 0<ρ<1/2,0<ϵ<1 be parameters. We can maintain a (β,1+ϵ)-hopset H for G=(V,E,w) with hopbound β=O(log(nW)ϵ)2/ρ+1 in total update time O~(βlog2(nW)ϵmnρ). Moreover, we can assume that the distances incurred by the additional edges of the hopset are monotone. Further we have that H is of size O~(n1+ρ).

By setting ρ=loglognlogn, we can maintain a hopset with hopbound 2O~(logn) in 2O~(logn) amortized time. We often choose this parameter setting when the graph is sparse for balancing the hopset maintenance time with the shortest path computation time. By setting ρ to a constant, we can maintain a hopset of polylogarithmic hopbound in time O(mnρ). We often use this parameter setting when we are maintaining distances from many sources and the graph is slightly denser (e.g. m=n1+Ω(1)).

Scaling. The following scaling technique of Klein and Subramanian [90] changes a bounded hop distance problem into a bounded depth distance problem on a scaled graph. Similar ideas have been widely used in dynamic algorithms, see e.g., [5, 6, 8, 20]. As we will see, the bounded depth works well together with the cluster and bunch maintaining algorithm of Roditty and Zwick [4]

Lemma B.3

([90]) Let G=(V,E,w) be a weighted undirected graph. Let R≥0, d≥1, ϵ>0 be parameters. We define a scaled graph to be a graph SCALE(G,R,ϵ,d) :=(V,E,w^), such that w^(e)=⌈w(e)dRϵ⌉. Then for any path π in G such that π has at most d hops and weight R≤w(π)≤2R we have: 1) w^(π)≤⌈2d/ϵ⌉, and 2) w(π)≤ϵRd·w^(π)≤(1+ϵ)w(π).

Hence given a hopset, we can ‘cover’ the entire graph by scaled graphs, by considering separate scaled graphs Gi for the distance scale [2i,2i+1] for i=1,⋯,log(nW). In order to combine this with a hopset algorithm, we need to scale the graph after adding edges corresponding to a sequence of 2i-restricted hopsets, i.e. a graph that satisfies the hopset condition only for pairs within distance at most 2i. Slightly more formally, we define a scaled graph as follows: Gj:=SCALEG∪⋃r=0jHr,2j,ϵ,O(β), where Hr is a 2r-restricted hopset. The final hopsets of [20] are the union of all these restricted hopsetes, however for maintaining distances efficiently we need to run the algorithm in Lemma B.1 on all these scaled graphs simultaneously and take the minimum estimate over all the scales. Importantly, to handle edge insertions they use monotone ES trees which implies that the distances obtained from this algorithm is monotone. This is important for us in bounding the running time of our decremental data structures.

The following lemma shows that using the specific hopsets by [20], we can maintain approximate single-source distances.

Lemma 2.1Let G=(V,E,w) be a decremental graph, and let 0<ϵ<1 and 0<ρ<1/2 be parameters, let 0<p<1 be a sampling probability, and let A⊆V be a set of sampled nodes, where each element of V is sampled uniformly at random with probability p. There exists an algorithm that maintains for each v∈V: (i) an approximate pivot p~(v)∈A; (ii) an approximate bunch B~(v) ; and (iii) distance estimates δB~(v,u) for every u∈B~(v). These objects satisfy:

  • dG(v,p(v))≤δB~(v,p~(v))≤(1+ϵ)dG(v,p(v));

  • {w∈V:(1+ϵ)dG(v,w)<dG(v,p(v))}⊆B~(v);

  • δB~ is monotone (non-decreasing over updates);

  • for any u∈B~(v): dG(u,v)≤δB~(u,v)≤(1+ϵ)dG(u,v); and

  • with high probability, |B~(v)|=OlognlognWp.

The algorithm has total update time O~(mnρp·log2(nW))·O(1ρϵ)1+2/ρ.

Proof sketch

First, using the algorithm of [20], we can maintain a (β,1+ϵ)-hopset H of size O~(m+n1+ρ) in update time O~(mnρβ) with hopbound β=O~(1ρϵ)2ρ, which consists of a sequence of 2i-restricted hopsets H1,...,HlognW. We then use the framework of [20] to maintain approximate clusters and hence approximate bunches on the scaled graphs. Since for all u,v∈V in G∪H there is a path with β-hops that with length at most (1+ϵ)dG(u,v), they show that it is enough to maintain O(β/ϵ)-hop bounded bunches/clusters on scaled graphs G1,...,GlognW. We consider (4β/ϵ)-bounded bunches BGi(v)={w:dGi(w,v)<dGi(v,pi(v))} where pi(v) is the closest sampled node in Gi and dGi(v,pi(v))≤4β/ϵ. The scaling ensures that for each node v there exists 1≤i≤lognW such that pi(v) satisfies the property dGi(v,pi(v))≤4β/ϵ. Let d be the distances obtained by scaling back the estimates corresponding to BGi(v)∪pi(v). There exists i such that p~(v)=pi(v) satisfies dG(v,p(v))≤d(v,p~(v))≤(1+ϵ)dG(v,p(v)). Also by choosing the appropriate error parameters (to account for the scaling and hopset errors) in Theorem 14 of [20] we can ensure that for any u∈B~(v) we have dG(u,v)≤d(u,v)≤(1+ϵ)dG(u,v). Consider any u∈B^(v). We have d(u,v)≤(1+ϵ)dG(u,v)≤dG(v,p(v))≤d(v,p~(v)). Hence we can see that the bunch BGi(v)⊆B^(v) and thus B~(v):=⋃1≤i≤lognWBGi(v) contains all the nodes in B^(v).

Finally since the algorithm of [20] (that is based on [4]) maintains bunches of size O(logn/p) on O(lognW) scaled graphs, we also have the bound on the size of the bunch. □

Author Contributions

All authors contributed equally.

Funding

Open access funding provided by Graz University of Technology. This work was supported by The Israel Science Foundation (Grant No. 2829/25). This work was supported in part by funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 853109), and the Swiss National Foundation (project grant 200021-184735). This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 947702). This research was funded in whole or in part by the Austrian Science Fund (FWF) https://doi.org/10.55776/P36280, https://doi.org/10.55776/P32863, and https://doi.org/10.55776/I6915. For open access purposes, the author has applied a CC BY public copyright license to any author-accepted manuscript version arising from this submission.

Data Availability

No datasets were generated or analysed during the current study.

Declarations

Conflict of interest

The authors have no conflict of interest to declare.

Consent to Publication

Consent to Publish declaration: not applicable.

Ethical Approval

Ethics and Consent to Participate declarations: not applicable.

Footnotes

1

In the introduction, we make two simplifying assumptions: (a) ϵ is a constant and (b) the ratio W between the maximum and minimum weight is polynomial in n. Unless otherwise noted, the cited algorithms have constant or polylogarithmic query time. Throughout we use O~(·) notation to omit factors that are polylogarithmic in n.

2

Note that the algorithms of Roditty and Zwick [4] for unweighted, undirected graphs precede the more general algorithm of Bernstein [11] for weighted, directed graphs.

3

Although the picture implies B(u) and B(v) are disjoint, this also includes the case where they overlap, or even where u∈B(v) or v∈B(u).

4

The actual pivot only matters when a distance is queried, where we can use our explicitly maintained approximate pivots. See Sect. 4 for details.

5

We write each approximation with its own ϵi. In the end, we set ϵi=ϵ/3 for all i, which gives us (2+ϵ)-APSP.

6

In the high-level overview B(v) has been used for the exact bunches. Since exact bunches do not occur in our actual algorithm, B(v) will denote these approximate bunches from here on, following conventions in prior work [1, 8, 88]

7

Recall that we denote w~ for (1+ϵ3)⌈log1+ϵ3w⌉.

8

If w becomes heavy we remove all the corresponding estimates.

9

In Sect. 4 and 5.1 we needed the distance between nodes v and their closest node in A1, called the pivot. In this section, we only need an edge between v and an arbitrary neighbor u∈A1.

This work was partially conducted while Michal Dory was a postdoc at ETH Zurich.

This work was partially conducted while Yasamin Nazari was a postdoc at University of Salzburg.

This work was partially conducted while Tijn de Vos was a PhD student at the University of Salzburg.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Bernstein, A., Chechik, S.: Deterministic decremental single source shortest paths: beyond the bound. In Daniel Wichs and Yishay Mansour, editors, Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing (STOC 2016), pages 389–397, (2016)
  • 2.Henzinger, M., Krinninger, S., Nanongkai, D.: Dynamic approximate all-pairs shortest paths: breaking the barrier and derandomization. SIAM J. Comput. 45(3), 947–1006 (2016). (Announced at FOCS 2013) [Google Scholar]
  • 3.Baswana, S., Hariharan, R., Sen, S.: Improved decremental algorithms for maintaining transitive closure and all-pairs shortest paths. J. Algorithms 62(2), 74–92 (2007). (Announced at STOC 2002) [Google Scholar]
  • 4.Roditty, L., Zwick, U.: Dynamic approximate all-pairs shortest paths in undirected graphs. SIAM J. Comput. 41(3), 670–683 (2012). (Announced at FOCS 2004) [Google Scholar]
  • 5.Bernstein, A.: Fully dynamic approximate all-pairs shortest paths with fast query and close to linear update time. In Proceedings of the 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2009, pages 693–702. IEEE Computer Society, (2009)
  • 6.Bernstein, A., Roditty, L.: Improved dynamic algorithms for maintaining approximate shortest paths under deletions. In Dana Randall, editor, Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2011, pages 1355–1365. SIAM, (2011)
  • 7.Henzinger, M., Krinninger, S., Nanongkai, D.: A subquadratic-time algorithm for decremental single-source shortest paths. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, pages 1053–1072. SIAM, (2014)
  • 8.Henzinger, M., Krinninger, S., Nanongkai, D.: Decremental single-source shortest paths on undirected graphs in near-linear total update time. J. ACM 65(6), 36:1-36:40 (2018). (Announced at FOCS 2014) [Google Scholar]
  • 9.Abboud, A., Williams, V. V.: Popular conjectures imply strong lower bounds for dynamic problems. In Proceedings of the 55th IEEE Annual Symposium on Foundations of Computer Science (FOCS 2014), pages 434–443 (2014)
  • 10.Henzinger, M., Krinninger, S., Nanongkai, D., Saranurak, T.: Unifying and strengthening hardness for dynamic problems via the online matrix-vector multiplication conjecture. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing (STOC 2015), pages 21–30, (2015)
  • 11.Bernstein, A.: Maintaining shortest paths under deletions in weighted directed graphs. SIAM J. Comput. 45(2), 548–574 (2016). (Announced at STOC 2013) [Google Scholar]
  • 12.Abraham, I., Chechik, S., Talwar, K.: Fully dynamic all-pairs shortest paths: Breaking the o(n) barrier. In Proceedings of the 17th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems (APPROX 2014) and the 18th International Workshop on Randomization and Computation (APPROX/RANDOM 2014), pages 1–16 (2014)
  • 13.Chechik, S.: Near-optimal approximate decremental all pairs shortest paths. In Mikkel Thorup, editor, Proceedings of the 59th IEEE Annual Symposium on Foundations of Computer Science (FOCS 2018), pages 170–181, (2018)
  • 14.Bernstein, A.: Deterministic partially dynamic single source shortest paths in weighted graphs. In Proceedings of the 44th International Colloquium on Automata, Languages, and Programming, (ICALP 2017), pages 44:1–44:14, (2017)
  • 15.Karczmarz, A., Łącki, J.: Reliable hubs for partially-dynamic all-pairs shortest paths in directed graphs. In Proceedings of the 27th Annual European Symposium on Algorithms (ESA 2019), pages 65:1–65:15, (2019)
  • 16.Karczmarz, A., Łącki, J.: Simple label-correcting algorithms for partially dynamic approximate shortest paths in directed graphs. In Proceedings of the 3rd Symposium on Simplicity in Algorithms (SOSA 2020), pages 106–120, (2020)
  • 17.Chuzhoy, J.: Decremental all-pairs shortest paths in deterministic near-linear time. In Samir Khuller and Virginia Vassilevska Williams, editors, Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC 2021), pages 626–639. ACM, (2021)
  • 18.Bernstein, A., Gutenberg, M. P., Saranurak, T.: Deterministic decremental SSSP and approximate min-cost flow in almost-linear time. In Proceedings of the 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS 2021), pages 1000–1008, (2021)
  • 19.Evald, J., Fredslund-Hansen, V., Gutenberg, M. P., Wulff-Nilsen, C.: Decremental APSP in unweighted digraphs versus an adaptive adversary. In Proc. of the 48th International Colloquium on Automata, Languages, and Programming, (ICALP 2021), pages 64:1–64:20, (2021)
  • 20.Łącki, J., Nazari, Y.: Near-Optimal Decremental Hopsets with Applications. In: 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, (2022)
  • 21.Chuzhoy, J., Saranurak, T.: Deterministic algorithms for decremental shortest paths via layered core decomposition. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA 2021), pages 2478–2496, (2021)
  • 22.Forster, S., Goranci, G.: Bootstrapping dynamic distance oracles. In: Proceedings of the 31th Annual European Symposium on Algorithms (ESA 2023), (2023). (Yasamin Nazari, and Antonis Skarlatos)
  • 23.Roditty, L., Zwick, U.: On dynamic shortest paths problems. Algorithmica 61(2), 389–401 (2011). (Announced at ESA 2004) [Google Scholar]
  • 24.Dor, D., Halperin, S., Zwick, U.: All-pairs almost shortest paths. SIAM J. Comput. 29(5), 1740–1759 (2000). (Announced at FOCS 1996) [Google Scholar]
  • 25.Abraham, I., Chechik, S.: Dynamic decremental approximate distance oracles with (, ) stretch. CoRR, arXiv:abs/1307.1516, (2013)
  • 26.Aingworth, D., Chekuri, C., Indyk, P., Motwani, R.: Fast estimation of diameter and shortest paths (without matrix multiplication). SIAM J. Comput. 28(4), 1167–1181 (1999). (Announced at SODA (1996)) [Google Scholar]
  • 27.Cohen, E., Zwick, U.: All-pairs small-stretch paths. J. Algorithms 38(2), 335–353 (2001). (Announced at SODA 1997) [Google Scholar]
  • 28.Baswana, S., Kavitha, T.: Faster algorithms for all-pairs approximate shortest paths in undirected graphs. SIAM J. Comput. 39(7), 2865–2896 (2010). (Announced at FOCS 2006) [Google Scholar]
  • 29.Berman, P., Kasiviswanathan, S. P.: Faster approximation of distances in graphs. In Frank K. H. A. Dehne, Jörg-Rüdiger Sack, and Norbert Zeh, editors, Proceedings of the 10th International Workshop on Algorithms and Data Structures (WADS 2007, pages 541–552, (2007)
  • 30.Kavitha, T.: Faster algorithms for all-pairs small stretch distances in weighted graphs. Algorithmica 63(1–2), 224–245 (2012). (Announced at FSTTCS 2007) [Google Scholar]
  • 31.Baswana, S., Goyal, V., Sen, S.: All-pairs nearly 2-approximate shortest paths in time. Theoret. Comput. Sci. 410(1), 84–93 (2009). (Announced at STACS 2005) [Google Scholar]
  • 32.Patrascu, M., Roditty, L.: Distance oracles beyond the thorup-zwick bound. SIAM J. Comput. 43(1), 300–311 (2014). (Announced at FOCS 2010) [Google Scholar]
  • 33.Sommer, C.: All-pairs approximate shortest paths and distance oracle preprocessing. In Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming, (ICALP 2016), volume 55, pages 55:1–55:13, (2016)
  • 34.Knudsen, M. B. T.: Additive spanners and distance oracles in quadratic time. In Proceedings of the 44th International Colloquium on Automata, Languages, and Programming, (ICALP 2017), pages 64:1–64:12, (2017)
  • 35.Akav, M., Roditty, L.: An almost 2-approximation for all-pairs of shortest paths in subquadratic time. In Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, (SODA 2020), pages 1–11, (2020)
  • 36.Akav, M., Roditty, L.: A unified approach for all pairs approximate shortest paths in weighted undirected graphs. In Proceedings of the 29th Annual European Symposium on Algorithms (ESA 2021), volume 204, pages 4:1–4:18, (2021)
  • 37.Dory, M., Forster, S., Kirkpatrick, Y., Nazari, Y., Williams, V. V., de Vos, T.: Fast 2-approximate all-pairs shortest paths. In Proc. of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4728–4757. SIAM (2024)
  • 38.Patrascu, M., Roditty, L., Thorup, M.: A new infinity of distance oracles for sparse graphs. In: Proc. of the 53rd Annual IEEE Symposium on Foundations of Computer Science (FOCS 2012), pages 738–747. IEEE Computer Society, (2012)
  • 39.Abboud, A., Bringmann, K., Fischer, N.: Stronger 3-sum lower bounds for approximate distance oracles via additive combinatorics. In: Proc. of the 55th Annual ACM Symposium on Theory of Computing, (2023). (STOC 2023)
  • 40.Zwick, U.: Exact and approximate distances in graphs - A survey. In: Proceedings of the 9th Annual European Symposium on Algorithms (ESA 2001), volume 2161, pages 33–48, (2001)
  • 41.Ryan Williams, R.: Faster all-pairs shortest paths via circuit complexity. SIAM J. Comput. 47(5), 1965–1985 (2018). (Announced at STOC 2014) [Google Scholar]
  • 42.Thorup, M., Zwick, U.: Approximate distance oracles. J. ACM (JACM) 52(1), 1–24 (2005) [Google Scholar]
  • 43.Deng, M., Kirkpatrick, Y., Rong, V., Williams, V. V., Zhong, Z.: New additive approximations for shortest paths and cycles. In Mikolaj Bojanczyk, Emanuela Merelli, and David P. Woodruff, editors, 49th International Colloquium on Automata, Languages, and Programming, ICALP 2022, July 4-8, 2022, Paris, France, volume 229 of LIPIcs, pages 50:1–50:10. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, (2022)
  • 44.DüDürr, A.: Improved bounds for rectangular monotone min-plus product and applications. Inf. Process. Lett. 181, 106358 (2023) [Google Scholar]
  • 45.Saha, B., Ye, C.: Faster approximate all pairs shortest paths. In: Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4758–4827. SIAM (2024)
  • 46.Roditty, L.: New algorithms for all pairs approximate shortest paths. In Barna Saha and Rocco A. Servedio, editors, Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC 2023, Orlando, FL, USA, June 20-23, 2023, pages 309–320. ACM, (2023)
  • 47.Chechik, S., Zhang, T.: Nearly 2-approximate distance oracles in subquadratic time. In Proc. of the 2022 ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, pages 551–580. SIAM, (2022)
  • 48.Demetrescu, C., Italiano, G.F.: Fully dynamic all pairs shortest paths with real edge weights. J. Comput. Syst. Sci. 72(5), 813–837 (2006). (Announced at FOCS 2001) [Google Scholar]
  • 49.Baswana, S., Hariharan, R., Sen, S.: Maintaining all-pairs approximate shortest paths under deletion of edges. In Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2003), pages 394–403, (2003)
  • 50.Haeupler, B., Long, Y., Saranurak, T.: In 65th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2024, Chicago, IL, USA, October 27-30, 2024, pages 2033–2044. IEEE, (2024)
  • 51.Mądry, A.: Faster approximation schemes for fractional multicommodity flow problems via dynamic graph algorithms. In: Proceedings of the 42nd ACM Symposium on Theory of Computing (STOC 2010), pages 121–130, (2010)
  • 52.Garg, N., Könemann, J.: Faster and simpler algorithms for multicommodity flow and other fractional packing problems. SIAM J. Comput. 37(2), 630–652 (2007). (Announced at FOCS 1998) [Google Scholar]
  • 53.Fleischer, L.: Approximating fractional multicommodity flow independent of the number of commodities. SIAM J. Discrete Math. 13(4), 505–520 (2000). (Announced at FOCS 1999) [Google Scholar]
  • 54.Chen, L., Kyng, R., Liu, Y. P., Peng, R., Gutenberg, M. P., Sachdeva, S.: Maximum flow and minimum-cost flow in almost-linear time. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2022, pages 612–623. IEEE, (2022)
  • 55.van den Brand, J., Chen, L., Peng, R., Kyng, R., Liu, Y. P., Gutenberg, M. P., Sachdeva, S., Sidford, A.: A deterministic almost-linear time algorithm for minimum-cost flow. In 64th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2023, Santa Cruz, CA, USA, November 6-9, 2023, pages 503–514. IEEE, (2023)
  • 56.Abboud, A., Bringmann, K., Khoury, S., Zamirm, O.: Hardness of approximation in P via short cycle removal: cycle detection, distance oracles, and beyond. In Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing (STOC 2022), pages 1487–1500, (2022)
  • 57.Demetrescu, C., Italiano, G.F.: A new approach to dynamic all pairs shortest paths. J. ACM 51(6), 968–992 (2004). (Announced at STOC 2003) [Google Scholar]
  • 58.Thorup, M.: Fully-dynamic all-pairs shortest paths: Faster and allowing negative cycles. In: Proceedings of the 9th Scandinavian Workshop on Algorithm Theory (SWAT 2004), pages 384–396, (2004)
  • 59.Thorup, M.: Worst-case update times for fully-dynamic all-pairs shortest paths. In Proc. of the 37th Annual ACM Symposium on Theory of Computing (STOC 2005), pages 112–119, (2005)
  • 60.Abraham, I., Chechik, S., Krinninger, S.: Fully dynamic all-pairs shortest paths with worst-case update-time revisited. In Proc. of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2017), pages 440–452, (2017)
  • 61.Gutenberg, M. P., Wulff-Nilsen, C.: Fully-dynamic all-pairs shortest paths: Improved worst-case time and space bounds. In Proc. of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020, pages 2562–2574, (2020)
  • 62.Chechik, S., Zhang, T.: Faster deterministic worst-case fully dynamic all-pairs shortest paths via decremental hop-restricted shortest paths. In Nikhil Bansal and Viswanath Nagarajan, editors, Proceedings of the 2023 ACM-SIAM Symposium on Discrete Algorithms, SODA 2023, Florence, Italy, January 22-25, 2023, pages 87–99. SIAM, (2023)
  • 63.Sankowski, P.: Subquadratic algorithm for dynamic shortest distances. In: COCOON, volume 3595 of Lecture Notes in Computer Science, pages 461–470. Springer, (2005)
  • 64.van den Brand, J., Nanongkai, D., Saranurak, T.: Dynamic matrix inverse: Improved algorithms and matching conditional lower bounds. In FOCS, pages 456–480. IEEE Computer Society, (2019)
  • 65.Karczmarz, A., Sankowski, P.: Fully dynamic shortest paths and reachability in sparse digraphs. In Kousha Etessami, Uriel Feige, and Gabriele Puppis, editors, 50th International Colloquium on Automata, Languages, and Programming, ICALP 2023, Paderborn, Germany, July 10-14, 2023, volume 261 of LIPIcs, pages 84:1–84:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, (2023)
  • 66.Henzinger, M., Krinninger, S., Nanongkai, D.: Dynamic approximate all-pairs shortest paths: Breaking the barrier and derandomization. SIAM J. Comput. 45(3), 947–1006 (2016). (Announced at FOCS 2013) [Google Scholar]
  • 67.Bernstein, A., Probst, M., Wulff-Nilsen, C.: Decremental strongly-connected components and single-source reachability in near-linear time. In Proc. of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC 2019), pages 365–376, (2019)
  • 68.van den Brand, J., Nanongkai, D.: Dynamic approximate shortest paths and beyond: Subquadratic and worst-case update time. In FOCS, pages 436–455. IEEE Computer Society, (2019)
  • 69.Van Den Brand, J., Forster, S., Nazari, Y.: Fast deterministic fully dynamic distance approximation. In 2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS), pages 1011–1022, (2022)
  • 70.van den Brand, J., Karczmarz, A.: Deterministic fully dynamic SSSP and more. In: 64th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2023, Santa Cruz, CA, USA, November 6-9, 2023, pages 2312–2321. IEEE, (2023)
  • 71.Forster, S., Goranci, G., Henzinger, M.: Dynamic maintenance of low-stretch probabilistic tree embeddings with applications. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, (SODA 2021), pages 1226–1245, (2021)
  • 72.Baswana, S., Khurana, S., Sarkar, S.: Fully dynamic randomized algorithms for graph spanners. ACM Trans. Algorithms 8(4), 35:1-35:51 (2012) [Google Scholar]
  • 73.Kyng, R., Meierhans, S., Gutenberg, M. P.: A dynamic shortest paths toolbox: Low-congestion vertex sparsifiers and their applications. In Bojan Mohar, Igor Shinkar, and Ryan O’Donnell, editors, Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, Vancouver, BC, Canada, June 24-28, 2024, pages 1174–1183. ACM, (2024)
  • 74.Even, S., Shiloach, Y.: An on-line edge-deletion problem. J. ACM 28(1), 1–4 (1981) [Google Scholar]
  • 75.Henzinger, M. R., King, V.: Fully dynamic biconnectivity and transitive closure. In Proceedings of IEEE 36th Annual Foundations of Computer Science, pages 664–672. IEEE, (1995)
  • 76.King, V.: Fully dynamic algorithms for maintaining all-pairs shortest paths and transitive closure in digraphs. In 40th Annual Symposium on Foundations of Computer Science (Cat. No. 99CB37039), pages 81–89. IEEE, (1999)
  • 77.Gutenberg, M. P., Wulff-Nilsen, C.: Deterministic algorithms for decremental approximate shortest paths: Faster and simpler. In Shuchi Chawla, editor, Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020, pages 2522–2541. SIAM, (2020)
  • 78.Thorup, M., Zwick, U.: Compact routing schemes. In Arnold L. Rosenberg, editor, Proceedings of the Thirteenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA 2001, pages 1–10. ACM, (2001)
  • 79.Elkin, M., Neiman, O.: Linear-size hopsets with small hopbound, and constant-hopbound hopsets in RNC. Distrib. Comput. 35(5), 419–437 (2022) [Google Scholar]
  • 80.Censor-Hillel, K., Dory, M., Janne, H., Korhonen, D.: Leitersdorf: Fast approximate shortest paths in the congested clique. Distrib. Comput. 34(6), 463–487 (2021) [Google Scholar]
  • 81.Dory, M., Parter, M.: Exponentially faster shortest paths in the congested clique. ACM J. ACM (JACM) 69(4), 1–42 (2022) [Google Scholar]
  • 82.Backurs, A., Roditty, L., Segal, G., Williams, V.V., Wein, N.: Toward tight approximation bounds for graph diameter and eccentricities. SIAM J. Comput. (SICOMP) 50(4), 1155–1199 (2021) [Google Scholar]
  • 83.Abboud, A., Bodwin, G.: The 4/3 additive spanner exponent is tight. J. ACM (JACM) 64(4), 1–20 (2017) [Google Scholar]
  • 84.Elkin, M., Peleg, D.: (,)-spanner constructions for general graphs. SIAM J. Comput. 33(3), 608–631 (2004) [Google Scholar]
  • 85.Thorup, M., Zwick, U.: Spanners and emulators with sublinear distance errors. In: Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm, pages 802–809, (2006)
  • 86.Abboud, A., Bodwin, G., Pettie, S.: A hierarchy of lower bounds for sublinear additive spanners. SIAM J. Comput. 47(6), 2203–2236 (2018) [Google Scholar]
  • 87.Elkin, M., Neiman, O.: Near-additive spanners and near-exact hopsets, a unified view. Bulletin of EATCS 1(130), (2020)
  • 88.Łącki, J., Nazari, Y.: Near-Optimal Decremental Hopsets with Applications. In: 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, (2022)
  • 89.Chuzhoy, J., Zhang, R.: A new deterministic algorithm for fully dynamic all-pairs shortest paths. In Proceedings of the 55th ACM Annual Symposium on Theory of Computing (STOC 2023), (2023)
  • 90.Klein, P.N., Subramanian, S.: A randomized parallel algorithm for single-source shortest paths. J. Algorithms 25(2), 205–220 (1997) [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

No datasets were generated or analysed during the current study.


Articles from Algorithmica are provided here courtesy of Springer

RESOURCES