Abstract
Depth first search (DFS) tree is a fundamental data structure for solving various graph problems. The classical algorithm [54] for building a DFS tree requires O(m+n) time for a given undirected graph G having n vertices and m edges. Recently, Baswana et al. [5] presented a simple algorithm for updating the DFS tree of an undirected graph after an edge/vertex update in Õ(n)1 time. However, their algorithm is strictly sequential. We present an algorithm achieving similar bounds that can be easily adopted to the parallel environment.
In the parallel environment, a DFS tree can be computed from scratch in expected Õ(1) time [2] on an EREW PRAM, whereas the best deterministic algorithm takes Õ(√ n) time [2, 27] on a CRCW PRAM. Our algorithm can be used to develop optimal time (to poly log n factors) deterministic parallel algorithms for maintaining fully dynamic DFS and fault tolerant DFS of an undirected graph.
(1) Parallel Fully Dynamic DFS: Given an arbitrary online sequence of vertex or edge updates, we can maintain a DFS tree of an undirected graph in Õ(1) time per update using m processors on an EREW PRAM.
(2) Parallel Fault tolerant DFS: An undirected graph can be preprocessed to build a data structure of size O(m), such that for any set of k updates (where k is constant) in the graph, a DFS tree of the updated graph can be computed in Õ(1) time using n processors on an EREW PRAM. For constant k, this is also work optimal (to poly log n factors).
Moreover, our fully dynamic DFS algorithm provides, in a seamless manner, nearly optimal (to poly log n factors) algorithms for maintaining a DFS tree in the semi-streaming environment and a restricted distributed model. These are the first parallel, semi-streaming, and distributed algorithms for maintaining a DFS tree in the dynamic setting.
- Alok Aggarwal and Richard J. Anderson. 1988. A random NC algorithm for depth first search. Combinatorica 8, 1 (1988), 1--12.Google ScholarCross Ref
- Alok Aggarwal, Richard J. Anderson, and Ming-Yang Kao. 1990. Parallel depth-first search in general directed graphs. SIAM J. Comput. 19, 2 (1990), 397--409.Google ScholarDigital Library
- Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. 2012. Analyzing graph structure via linear measurements. In Proceedings of the 23rd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’12). 459--467.Google ScholarCross Ref
- Baruch Awerbuch, Israel Cidon, and Shay Kutten. 2008. Optimal maintenance of a spanning tree. J. ACM 55, 4 (2008).Google ScholarDigital Library
- Surender Baswana, Shreejit Ray Chaudhury, Keerti Choudhary, and Shahbaz Khan. 2015. Dynamic DFS tree in undirected graphs: Breaking the O(m) barrier. SIAM J. Comput. 48, 4 (2019), 1335--1363.Google ScholarCross Ref
- Surender Baswana, Shreejit Ray Chaudhury, Keerti Choudhary, and Shahbaz Khan. 2016. Dynamic DFS in undirected graphs: Breaking the O(m) barrier. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA’16). 730--739.Google ScholarCross Ref
- Surender Baswana and Keerti Choudhary. 2015. On dynamic DFS tree in directed graphs. In Proceedings of the International Symposium on Mathematical Foundations of Computer Science (MFCS’15). 102--114.Google ScholarCross Ref
- Surender Baswana and Shahbaz Khan. 2014. Incremental algorithm for maintaining DFS tree for undirected graphs. In Proceedings of the International Colloquium on Automata, Languages and Programming (ICALP’14). 138--149.Google ScholarCross Ref
- Surender Baswana, Sumeet Khurana, and Soumojit Sarkar. 2012. Fully dynamic randomized algorithms for graph spanners. ACM Trans. Algor. 8, 4 (2012), 35.Google Scholar
- Sayan Bhattacharya, Monika Henzinger, Danupon Nanongkai, and Charalampos Tsourakakis. 2015. Space-and time-efficient algorithm for maintaining dense subgraphs on one-pass dynamic streams. In Proceedings of the 47th Annual ACM Symposium on Theory of Computing. ACM, 173--182.Google ScholarDigital Library
- P. Chaudhuri. 1990. Finding and updating depth-first spanning trees of acyclic digraphs in parallel. Comput. J. 33, 3 (1990), 247--251.Google ScholarDigital Library
- Israel Cidon. 1988. Yet another distributed depth-first-search algorithm. Inf. Process. Lett. 26, 6 (1988), 301--305.Google ScholarDigital Library
- Richard Cole. 1988. Parallel merge sort. SIAM J. Comput. 17, 4 (1988), 770--785.Google ScholarDigital Library
- Richard Cole. 1993. Correction: Parallel merge sort. SIAM J. Comput. 22, 6 (1993), 1349.Google ScholarCross Ref
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms, 3rd ed. MIT Press.Google Scholar
- Sajal K. Das and Paolo Ferragina. 1999. An EREW PRAM algorithm for updating minimum spanning trees. Parallel Process. Lett. 9, 1 (1999), 111--122.Google ScholarCross Ref
- Martin E. Dyer and Alan M. Frieze. 1991. Probabilistic analysis of a parallel algorithm for finding the lexicographically first depth first search tree in a dense random graph. Rand. Struct. Algor. 2, 2 (1991), 233--240.Google ScholarCross Ref
- Michael Elkin. 2007. A near-optimal distributed fully dynamic algorithm for maintaining sparse spanners. In Proceedings of the 26th Annual ACM Symposium on Principles of Distributed Computing (PODC’07). 185--194.Google ScholarDigital Library
- Paul Erdős and Alfréd Rényi. 1959. On random graphs I.Publ. Math. (Debrecen) 6 (1959), 290--297.Google ScholarCross Ref
- Shimon Even and Robert Endre Tarjan. 1975. Network flow and testing graph connectivity. SIAM J. Comput. 4, 4 (1975), 507--518.Google ScholarDigital Library
- Martin Farach-Colton, Tsan-sheng Hsu, Meng Li, and Meng-Tsung Tsai. 2015. Finding articulation points of large graphs in linear time. In Proceedings of the Conference on Algorithms and Data Structures (WADS’15). 363--372.Google ScholarCross Ref
- Paolo Ferragina and Fabrizio Luccio. 1996. Three techniques for parallel maintenance of a minimum spanning tree under batch of updates. Parallel Process. Lett. 6, 2 (1996), 213--222.Google ScholarCross Ref
- Paolo Giulio Franciosa, Giorgio Gambosi, and Umberto Nanni. 1997. The incremental maintenance of a depth-first-search tree in directed acyclic graphs. Inf. Process. Lett. 61, 2 (1997), 113--120.Google ScholarDigital Library
- Jon Freeman. October 1991. Parallel algorithms for depth-first search. Technical Report, University of Pennsylvania (October 1991).Google Scholar
- Mohsen Ghaffari and Merav Parter. 2016. Near-optimal distributed algorithms for fault-tolerant tree structures. In Proceedings of the 28th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA’16). 387--396.Google ScholarDigital Library
- Ratan K. Ghosh and G. P. Bhattacharjee. 1984. A parallel search algorithm for directed acyclic graphs. BIT Numerical Mathematics 24, 2 (1984), 134--150.Google ScholarCross Ref
- Andrew V. Goldberg, Serge A. Plotkin, and Pravin M. Vaidya. 1993. Sublinear-time parallel algorithms for matching and related problems. J. Algor. 14, 2 (1993), 180--213.Google ScholarDigital Library
- Torben Hagerup. 1990. Planar depth-first search in O(log n) parallel time. SIAM J. Comput. 19, 4 (1990), 678--704.Google ScholarDigital Library
- Monika Henzinger, Sebastian Krinninger, and Danupon Nanongkai. 2013. Sublinear-time maintenance of breadth-first spanning tree in partially dynamic networks. In Proceedings of the International Colloquium on Automata, Languages and Programming (ICALP’13). 607--619.Google ScholarDigital Library
- Giuseppe F. Italiano. 1991. Distributed algorithms for updating shortest paths (extended abstract). In Proceedings of the 5th International Workshop on Distributed Algorithms (WDAG’91). 200--211.Google Scholar
- Joseph JáJá. 1992. An Introduction to Parallel Algorithms. Addison-Wesley.Google Scholar
- Ming-Yang Kao. 1988. All graphs have cycle separators and planar directed depth-first search is in DNC. In Proceedings of the 3rd Aegean Workshop on Computing, VLSI Algorithms and Architectures (AWOC’88). 53--63.Google ScholarDigital Library
- Michael Kapralov, Yin Tat Lee, Cameron Musco, Christopher Musco, and Aaron Sidford. 2017. Single pass spectral sparsification in dynamic streams. SIAM J. Comput. 46, 1 (2017), 456--477.Google ScholarDigital Library
- Shahbaz Khan. 2017. Near optimal parallel algorithms for dynamic DFS in undirected graphs. In Proceedings of the 29th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA’17). 283--292.Google ScholarDigital Library
- Shahbaz Khan and Shashank K. Mehta. 2019. Depth first search in the semi-streaming model. In Proceedings of the 36th International Symposium on Theoretical Aspects of Computer Science (STACS’19). 42:1--42:16.Google Scholar
- Taenam Kim and Kyungyong Chwa. 1986. Parallel algorithms for a depth first search and a breadth first search. Int. J. Comput. Math. 19, 1 (1986), 39--54.Google ScholarCross Ref
- Valerie King, Shay Kutten, and Mikkel Thorup. 2015. Construction and impromptu repair of an MST in a distributed network with o(m) communication. In Proceedings of the 2015 ACM Symposium on Principles of Distributed Computing (PODC’15). 71--80.Google ScholarDigital Library
- Devendra Kumar, S. Sitharama Iyengar, and Mohan B. Sharma. 1990. Corrigenda: Corrections to a distributed depth-first search algorithm. Inf. Process. Lett. 35, 1 (1990), 55--56.Google ScholarCross Ref
- K. B. Lakshmanan, N. Meenakshi, and Krishnaiyan Thulasiraman. 1987. A time-optimal message-efficient distributed algorithm for depth-first-search. Inf. Process. Lett. 25, 2 (1987), 103--109.Google ScholarDigital Library
- Weifa Liang, Brendan D. McKay, and Hong Shen. 1996. NC algorithms for dynamically solving the all pairs shortest paths problem and related problems. Inf. Process. Lett. 58, 3 (1996), 149--155.Google ScholarDigital Library
- S. A. M. Makki and George Havas. 1996. Distributed algorithms for depth-first search. Inf. Process. Lett. 60, 1 (1996), 7--12.Google ScholarDigital Library
- Andrew McGregor. 2014. Graph stream algorithms: A survey. SIGMOD Rec. 43, 1 (May 2014), 9--20.Google ScholarDigital Library
- Andrew McGregor. 2017. Graph sketching and streaming: New approaches for analyzing massive graphs. In Proceedings of the 12th International Computer Science Symposium on Computer Science, Theory and Applications. 20--24.Google ScholarCross Ref
- Thomas C. O’Connell. 2009. A survey of graph algorithms under extended streaming models of computation. In Fundamental Problems in Computing: Essays in Honor of Professor Daniel J. Rosenkrantz. 455--476.Google Scholar
- Chao-Wei Ou and Sanjay Ranka. 1997. Parallel incremental graph partitioning. IEEE Trans. Parallel Distrib. Syst. 8, 8 (1997), 884--896.Google ScholarDigital Library
- Shaunak Pawagi and I. V. Ramakrishnan. 1986. An O(log n) algorithm for parallel update of minimum spanning trees. Inf. Process. Lett. 22, 5 (1986), 223--229.Google ScholarDigital Library
- David Peleg. 2000. Distributed Computing: A Locality-sensitive Approach. Society for Industrial and Applied Mathematics, Philadelphia, PA.Google ScholarCross Ref
- K. V. S. Ramarao and S. Venkatesan. 1992. On finding and updating shortest paths distributively. J. Algor. 13, 2 (1992), 235--257.Google ScholarDigital Library
- John H. Reif. 1985. Depth-first search is inherently sequential. Inf. Process. Lett. 20, 5 (1985), 229--234.Google ScholarCross Ref
- Jan Matthias Ruhl. 2003. Efficient Algorithms for New Computational Models. Ph.D. Dissertation, Department of Computer Science, MIT, Cambridge, MA (2003).Google Scholar
- Baruch Schieber and Uzi Vishkin. 1988. On finding lowest common ancestors: Simplification and parallelization. SIAM J. Comput. 17, 6 (1988), 1253--1262.Google ScholarDigital Library
- Mohan B. Sharma and S. Sitharama Iyengar. 1989. An efficient distributed depth-first-search algorithm. Inf. Process. Lett. 32, 4 (1989), 183--186.Google ScholarDigital Library
- Justin R. Smith. 1986. Parallel algorithms for depth-first searches I. planar graphs. SIAM J. Comput. 15, 3 (1986), 814--830.Google ScholarDigital Library
- Robert Endre Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM J. Comput. 1, 2 (1972), 146--160.Google ScholarDigital Library
- Robert Endre Tarjan. 1974. Finding dominators in directed graphs. SIAM J. Comput. 3, 1 (1974), 62--89.Google ScholarDigital Library
- Robert Endre Tarjan. 1976. Edge-disjoint spanning trees and depth-first search. Acta Inf. 6, 2 (1976), 171--185.Google ScholarDigital Library
- Robert Endre Tarjan and Uzi Vishkin. 1984. Finding biconnected components and computing tree functions in logarithmic parallel time (extended summary). In Proceedings of the 25th Annual Symposium on Foundations of Computer Science. 12--20.Google Scholar
- Yung H. Tsin. 2002. Some remarks on distributed depth-first search. Inf. Process. Lett. 82, 4 (2002), 173--178.Google ScholarDigital Library
- Y. Zhang. 1986. Parallel Algorithms for Problems Involving Directed Graphs. Ph.D. Dissertation, Drexel University, Philadelphia, PA (1986).Google Scholar
Index Terms
- Near Optimal Parallel Algorithms for Dynamic DFS in Undirected Graphs
Recommendations
Near Optimal Parallel Algorithms for Dynamic DFS in Undirected Graphs
SPAA '17: Proceedings of the 29th ACM Symposium on Parallelism in Algorithms and ArchitecturesDepth first search (DFS) tree is a fundamental data structure for solving various graph problems. The classical algorithm [SIAMCOMP74] for building a DFS tree requires O(m+n) time for a given undirected graph G having n vertices and m edges. Recently, ...
Dynamic DFS in Undirected Graphs: Breaking the $O(m)$ Barrier
Depth first search (DFS) tree is a fundamental data structure for solving various problems in graphs. It is well known that it takes $O(m+n)$ time to build a DFS tree for a given undirected graph $G=(V,E)$ on $n$ vertices and $m$ edges. We address the ...
Algorithms for dense graphs and networks on the random access computer
We improve upon the running time of several graph and network algorithms when applied to dense graphs. In particular, we show how to compute on a machine with word size ź=Ω (logn) a maximal matching in ann-vertex bipartite graph in timeO(n2+n2.5/ź)=O(...
Comments