Decremental Single-Source Reachability and Strongly Connected Components in √ O(M N) Total Update Time
Total Page:16
File Type:pdf, Size:1020Kb
2016 IEEE 57th Annual Symposium on Foundations of Computer Science Decremental Single-Source Reachability and Strongly Connected Components in √ O(m n) Total Update Time Shiri Chechik∗, Thomas Dueholm Hansen†, Giuseppe F. Italiano‡, Jakub Ł ˛acki§, Nikos Parotsidis¶ ∗Tel Aviv University, Tel Aviv, Israel. Email: [email protected] †Aarhus University, Aarhus, Denmark. Email: [email protected] ‡University of Rome Tor Vergata, Rome, Italy. Email: [email protected] §Sapienza University of Rome, Rome, Italy. Email: [email protected] ¶University of Rome Tor Vergata, Rome, Italy. Email: [email protected] Abstract—We present√ randomized algorithms with a total goal is to maintain the set of nodes that are reachable from update time of O˜(m n) for the problems of decremental single- s, subject to edge deletions. source reachability and decremental strongly connected compo- In this paper we present an improved randomized decre- nents on directed graphs. This improves recent breakthrough results of Henzinger, Krinninger and Nanongkai [STOC 14, mental single-source reachability√ algorithm with an improved ICALP 15]. In addition, our algorithms are arguably simpler. running time of O(m n log n). In addition, our algorithm is arguably simpler. Keywords-dynamic algorithm; single-source reachability; Previous Results: A naive approach to decremental strongly connected components single-source reachability (SSR) is to simply recompute from scratch all the vertices that are reachable from the source after every deletion. This can be done in O(m + n) I. INTRODUCTION time per update, and gives a total update time of O(m2) Dynamic graph algorithms are designed to answer queries over all deletions. Even and Shiloach [9] were the first to on graphs subject to updates, such as adding or removing a beat this naive approach, with a decremental algorithm that vertex or an edge. Typically, one is interested in a very small runs in O(mn) total update time. (A similar scheme was query time (either constant or poly-log), while minimizing the independently found by Dinitz [10].) Although the algorithm update time as much as possible. A dynamic algorithm is said of Even and Shiloach solves a more general problem than to be incremental if it handles only insertions, decremental decremental single-source reachability, it was still the best if it handles only deletions, and fully dynamic if it handles known for the problem and the O(mn) barrier stood for both insertions and deletions. Dynamic graph algorithms have more than three decades. Only in the special case of directed been extensively studied in the last four decades, and efficient acyclic graphs, decremental SSR could be solved faster, i.e, dynamic algorithms with poly-log update times are known in O(m) total update time [11]. for many basic problems on undirected graphs, including A closely related problem is the decremental maintenance dynamic connectivity, dynamic 2-edge connectivity, dynamic of strongly connected components (SCC), where we are 2-vertex connectivity, and dynamic minimum spanning tree required answer queries of the form: “Given two vertices u (see, e.g., [1]–[6]). and v,dou and v belong to the same SCC?”. This problem is Dealing with directed graphs seems much more chal- almost equivalent to the decremental SSR problem: A solution lenging. In fact, up until very recently, even for very for decremental SCC trivially implies a decremental SSR basic reachability problems (e.g., decrementally maintaining algorithm with the same running time, while a decremental whether a fixed node s can reach a fixed node t), no sublinear SSR algorithm with running time O(mnβ), with β =Ω(1), (in the number of vertices) update time algorithms were implies a decremental SCC algorithm with essentially the known for general graphs. Very recently, in an important same expected total update time (see [7], [12]). This justifies breakthrough, Henzinger, Krinninger and Nanongkai [7], why for many years the best known upper bound for a managed to circumvent this barrier, by presenting a ran- decremental SCC algorithm was also O(mn) [12]–[14]. The domized decremental single-source reachability algorithm lack of improvement made researchers in the field wonder with total update time O(mn0.984+o(1)) (that is with n1− whether O(mn1−) was possible [12], [13], [15]. In a recent amortized update time for some fixed ). They later improved breakthrough, Henzinger, Krinninger and Nanongkai [7] the running time to O(mn0.9+o(1)) [8]. Both these algorithms showed that this is indeed possible and presented algorithms are quite involved and solve the more general problem of for decremental SCC and SSR with O(mn0.984+o(1)) total single-source decremental reachability. In this problem we update time. They later [8] improved this to O(mn0.9+o(1)). are given a directed graph G and a source node s and the Both these results are Las Vegas randomized. 0272-5428/16 $31.00 © 2016 IEEE 314315 DOI 10.1109/FOCS.2016.42 Our Results: We present improved randomized decre- (resp., an edge uv) from G. Additionally, we let G[S] be the mental SSR√ and SCC algorithms with total update time subgraph of G induced by the set of vertices S. Let H be of O(m n log n). This matches the best known result for a strongly connected graph. We say that deleting an edge planar graphs [13], up to logarithmic factors. In addition to the uv breaks H,ifH \ uv is not strongly connected. Let u, v substantially improved bounds, our algorithms are arguably be two vertices of G. We denote by dist(u, v) the distance simpler than the algorithms in [7], [8]. Our single-source from u to v. If there is no path from u to v, dist(u, v)=∞. reachability algorithm can be generalized to an algorithm for The diameter of G is the largest distance in G.IfG is not maintaining reachability from k fixed vertices, at the cost strongly connected, its diameter is equal to ∞. of increasing the running time by an additive O(km log n) For a given initial graph G, the decremental SCC problem term. (Due to lack of space, the details are deferred to the asks us to maintain a data structure that allows edge deletions full version of the paper.) We focus our attention on giving and that can answer whether (arbitrary) pairs of vertices are a faster decremental SCC algorithm, as a decremental SSR in the same SCC. The goal is to update the data structure as algorithm follows from it quite easily. Our decremental SCC quickly as possible while still answering queries in constant algorithm uses two existing decremental SCC algorithms. time. The decremental single-source reachability (SSR) One is the O(mn) total expected time algorithm by Roditty problem similarly asks us to maintain a data structure that and Zwick [12] and the other is the O(mn) total worst-case allows edge deletions and that can answer whether (arbitrary) time algorithm by Łacki ˛ [13]. What is crucial for our result, vertices are reachable from a fixed given source v ∈ V (G). is that in some special cases the running time bounds of both Our algorithm for maintaining SCCs under edge deletions is these algorithms can be improved. The algorithm by Roditty obtained by combining two previous data structures: Even- and Zwick uses Even-Shiloach trees (in short ES-trees) to Shiloach trees [9] and Ł ˛acki’s SCC-decomposition [13]. We maintain BFS trees under edge deletions. This data structure next briefly describe these two data structures. requires O(mn) total time in the general case, but only O(mδ) time, if the diameter of the graph does not exceed A. ES-tree δ. On the other hand, the performance of Ł ˛acki’s algorithm can be improved if the graph contains a small separator, i.e. Even and Shiloach [9] introduced a data structure, com- a small set of vertices, whose removal considerably reduces monly referred to as an Even-Shiloach tree (ES-tree), to the sizes of the SCCs. maintain a breadth-first search (BFS) tree from a given source We show that each graph has one of the two afore- vertex under edge deletions. Let G be a graph and r ∈ V (G). mentioned properties. Namely, we prove that in a graph Clearly, G is strongly connected iff the BFS trees from r in of diameter Ω(q log n) there exists a set of k vertices (a G and G both contain all vertices of G. Checking whether separator), whose removal results in the largest SCC having G remains strongly connected when edges are deleted can size at most n − kq. This allows us to combine the algorithm therefore be done by maintaining two ES-trees F and F for of Roditty and Zwick with the algorithm by Ł ˛acki.We use G and G, respectively. Our algorithm uses such a pair of ES- the former as long as the graph has small diameter (as it uses trees from a shared source r to detect when an edge deletion ES-trees internally it can also measure the diameter up to a breaks a strongly connected subgraph. An ES-tree can also constant factor), and√ once the diameter exceeds a predefined be modified such that it maintains a set of vertices, whose threshold δ =Θ( n), we switch to the algorithm by Ł ˛acki. distance from the root is at most δ, where δ is a parameter At this point the graph has a separator of small size, which specified when the ES-tree is built. The data structure may we can use to make the algorithm by Ł ˛ackirun efficiently.