Skip to main content
Log in

Incremental Algorithm for Maintaining a DFS Tree for Undirected Graphs

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

Depth First Search (DFS) tree is a fundamental data structure for graphs used in solving various algorithmic problems. However, very few results are known for maintaining DFS tree in a dynamic environment—insertion or deletion of edges. We present the first algorithm for maintaining a DFS tree for an undirected graph under insertion of edges. For processing any arbitrary online sequence of edge insertions, this algorithm takes total \(O(n^2)\) time.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  1. Alstrup, S., Holm, J.: Improved algorithms for finding level ancestors in dynamic trees. In: Proceedings of Automata, Languages and Programming, 27th International Colloquium, ICALP 2000, Geneva, Switzerland, 9–15 July 2000, pp. 73–84 (2000)

  2. Baswana, S., Choudhary, K.: On dynamic DFS tree in directed graphs. In: Proceedings of Part II Mathematical Foundations of Computer Science 2015—40th International Symposium, MFCS 2015, Milan, Italy, 24–28 Aug 2015, pp. 102–114 (2015)

  3. Baswana, S., Khan, S.: Incremental algorithm for maintaining DFS tree for undirected graphs. In: Proceedings of Part I Automata, Languages, and Programming—41st International Colloquium, ICALP 2014, Copenhagen, Denmark, 8–11 July 2014, , pp. 138–149 (2014)

  4. Baswana, S., Khurana, S., Sarkar, S.: Fully dynamic randomized algorithms for graph spanners. ACM Trans. Algorithms 8(4), 35 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  5. Cole, R., Hariharan, R.: Dynamic lca queries on trees. SIAM J. Comput. 34(4), 894–923 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  6. Demetrescu, C., Italiano, G.F.: A new approach to dynamic all pairs shortest paths. J. ACM 51(6), 968–992 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  7. Eppstein, D., Galil, Z., Italiano, G.F., Nissenzweig, A.: Sparsification—a technique for speeding up dynamic graph algorithms. J. ACM 44(5), 669–696 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  8. Erdős, P., Rényi, A.: On the evolution of random graphs. In: Publications of the Mathematical Institute of the Hungarian Academy of Sciences, vol. 5, pp. 17–61 (1960)

  9. Franciosa, P.G., Gambosi, G., Nanni, U.: The incremental maintenance of a depth-first-search tree in directed acyclic graphs. Inf. Process. Lett. 61(2), 113–120 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  10. Gottlieb, L., Roditty, L.: Improved algorithms for fully dynamic geometric spanners and geometric routing. In: Proceedings of the Nineteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA, vol. 2008 2008, pp. 591–600 (2008)

  11. Henzinger, M.R., King, V.: Randomized fully dynamic graph algorithms with polylogarithmic time per operation. J. ACM 46(4), 502–516 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  12. Holm, J., de Lichtenberg, K., Thorup, M.: Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity. J. ACM 48(4), 723–760 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  13. Kapron, B.M., King, V., Mountjoy, B.: Dynamic graph connectivity in polylogarithmic worst case time. In: Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, 6–8 January 2013, pp. 1131–1142 (2013)

  14. Krivelevich, M., Sudakov, B.: The phase transition in random graphs: a simple proof. Random Struct. Algorithms 43(2), 131–138 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  15. Miltersen, P.B., Subramanian, S., Vitter, J.S., Tamassia, R.: Complexity models for incremental computation. Theor. Comput. Sci. 130(1), 203–236 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  16. Reif, J.H.: Depth-first search is inherently sequential. Inf. Process. Lett. 20(5), 229–234 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  17. Reif, J.H.: A topological approach to dynamic graph connectivity. Inf. Process. Lett. 25(1), 65–70 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  18. Roditty, L.: Fully dynamic geometric spanners. Algorithmica 62(3–4), 1073–1087 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  19. Roditty, L., Zwick, U.: Improved dynamic reachability algorithms for directed graphs. SIAM J. Comput. 37(5), 1455–1471 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  20. Roditty, L., Zwick, U.: Dynamic approximate all-pairs shortest paths in undirected graphs. SIAM J. Comput. 41(3), 670–683 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  21. Sankowski, P.: Dynamic transitive closure via dynamic matrix inverse (extended abstract). In: Proceedings of 45th Symposium on Foundations of Computer Science (FOCS 2004), pp. 509–517 (2004)

  22. Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM J. Comput. 1(2), 146–160 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  23. Thorup, M.: Fully-dynamic min-cut. Combinatorica 27(1), 91–127 (2007)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shahbaz Khan.

Additional information

A preliminary version of this result appeared in ICALP 2014 [3].

This research work was partially supported by UGC-ISF (the University Grants Commission of India and Israel Science Foundation), IMPECS (the Indo-German Max Planck Center for Computer Science), and Google India under the Google India PhD Fellowship Award.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Baswana, S., Khan, S. Incremental Algorithm for Maintaining a DFS Tree for Undirected Graphs. Algorithmica 79, 466–483 (2017). https://doi.org/10.1007/s00453-016-0204-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-016-0204-1

Keywords

Navigation