Abstract
We provide algorithms performing Depth-First Search (DFS) on a directed or undirected graph with \(n\) vertices and \(m\) edges using only \(O(n)\) bits. One algorithm uses \(O(n)\) bits and runs in \(O(m \log n)\) time. Another algorithm uses \(n+o(n)\) bits and runs in polynomial time. Furthermore, we show that DFS on a directed acyclic graph can be done in space \(n/2^{\varOmega (\sqrt{\log n})}\) and in polynomial time, and we also give a simple linear-time \(O(\log n)\)-space algorithm for the depth-first traversal of an undirected tree. Finally, we also show that for a graph having an \(O(1)\)-size feedback set, DFS can be done in \(O(\log n)\) space. Our algorithms are based on the analysis of properties of DFS and applications of the \(s\)-\(t\) connectivity algorithms due to Reingold and Barnes et al., both of which run in sublinear space.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aggarwal, A., Anderson, R.: A Random NC Algorithm for Depth-First Search. Combinatorica 8(1), 1–12 (1988)
Anderson, R., Mayr, E.: Parallelism and the Maximal Path Problem. Information Processing Letters 24(2), 121–126 (1987)
Asano, T., Elmasry, A., Katajainen, J.: Priority Queues and Sorting for Read-Only Data. In: Chan, T.-H.H., Lau, L.C., Trevisan, L. (eds.) TAMC 2013. LNCS, vol. 7876, pp. 32–41. Springer, Heidelberg (2013)
Asano, T., Kirkpatrick, D.: Time-Space Tradeoffs for All-Nearest-Larger-Neighbors Problems. In: Dehne, F., Solis-Oba, R., Sack, J.-R. (eds.) WADS 2013. LNCS, vol. 8037, pp. 61–72. Springer, Heidelberg (2013)
Asano, T., Kirkpatrick, D., Nakagawa, K., Watanabe, O.: \(\tilde{O}(\sqrt{n})\)-Space and Polynomial-time Algorithm for the Planar Directed Graph Reachability Problem. ECCC Report 71 (2014); also. In: Ésik, Z., Csuhaj-Varjú, E., Dietzfelbinger, M. (eds.) MFCS 2014, Part II. LNCS, vol. 8635, pp. 45–56. Springer, Heidelberg (2014)
Barnes, G., Buss, J., Ruzzo, W., Schieber, B.: A Sublinear Space, Polynomial Time Algorithm for Directed \(s\)-\(t\) Connectivity. SIAM Journal of Computing 27(5), 1273–1282 (1998)
Elberfeld, M. Jakoby, A., Tantau, T.: Logspace Versions of the Theorems of Bodlaender and Courcelle. In: Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS 2010), pp. 143–152 (2010)
Elberfeld, M., Kawarabayashi, K.: Embedding and Canonizing Graphs of Bounded Genus in Logspace. In: Proceedings of the 46th Annual ACM Symposium on the Theory of Computing (STOC 2014), pp. 383–392 (2014)
Imai, T.: Polynomial-Time Memory Constrained Shortest Path Algorithms for Directed Graphs. In: Proceedings of the 12th Forum on Information Technology, vol. 1, pp. 9–16 (2013) (in Japanese)
Imai, T., Nakagawa, K., Pavan, A., Vinodchandran, N., Watanabe, O.: An \(O(n^{1/2+\epsilon })\)-Space and Polynomial-Time Algorithm for Directed Planar Reachability. In: Proceedings of 2013 IEEE Conference on Computational Complexity, pp. 277–286 (2013)
Konagaya, M., Asano, T.: Reporting All Segment Intersections Using an Arbitrary Sized Work Space. IEICE Transactions 96-A(6), 1066–1071 (2013)
Papadimitriou, C.: Computational complexity. Addison-Wesley (1994)
Reif, J.: Depth-First Search Is Inherently Sequential. Information Processing Letters 20(5), 229–234 (1985)
Reingold, O.: Undirected Connectivity in Log-Space. Journal of the ACM 55(4), 17:1–17:24 (2008)
Tarjan, R.: Depth-First Search and Linear Graph Algorithms. SIAM Journal on Computing 1(2), 146–160 (1972)
de la Tore, P., Kruskal, C.: Fast Parallel Algorithms for Lexicographic Search and Path-Algebra Problems. Journal of Algorithms 19, 1–24 (1995)
de la Tore, P., Kruskal, C.: Polynomially Improved Efficiency for Fast Parallel Single-Source Lexicographic Depth-First Search, Breadth-First Search, and Topological-First Search. Theory of Computing Systems 34, 275–298 (2001)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Asano, T. et al. (2014). Depth-First Search Using \(O(n)\) Bits. In: Ahn, HK., Shin, CS. (eds) Algorithms and Computation. ISAAC 2014. Lecture Notes in Computer Science(), vol 8889. Springer, Cham. https://doi.org/10.1007/978-3-319-13075-0_44
Download citation
DOI: https://doi.org/10.1007/978-3-319-13075-0_44
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-13074-3
Online ISBN: 978-3-319-13075-0
eBook Packages: Computer ScienceComputer Science (R0)