# DFS tree construction: Algorithms and characterizations

Preliminary version
• Ephraim Korach
• Zvi Ostfeld
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 344)

## Abstract

The Depth First Search (DFS) algorithm is one of the basic techniques which is used in a very large variety of graph algorithms. Every application of the DFS involves, beside traversing the graph, constructing a special structured tree, called a DFS tree. In this paper, we give a complete characterization of all the graphs in which every spanning tree is a DFS tree. These graphs are called Total-DFS-Graphs. The characterization we present shows that a large variety of graphs are not Total-DFS-Graphs, and therefore the following question is naturally raised: Given an undirected graph G=(V,E) and an undirected spanning tree T, is T a DFS tree of G? We give an algorithm to answer this question in linear (O(|E|)) time.

## References

1. [AA]
A. Aggarwal and R.J. Anderson, A random NC algorithm for depth-first search, In Proc. of the 19th ACM Symposium on Theory of Computation, 325–334, (1987). To appear in Combinatorica.Google Scholar
2. [Aw]
B. Awerbuch, A new distributed depth-first-search algorithm, Information Processing Letters, 20 (3), 147–150, (1985).Google Scholar
3. [BLW]
N.L. Biggs, E.K. Lyod and R.J. Wilson, Graph Theory 1736–1936, Clarendon Press, Oxford, (1977).Google Scholar
4. [Ev]
S. Even, Graph Algorithms, Computer Science Press, Potomac, MD, (1979).Google Scholar
5. [HN]
T. Hagerup and M. Nowak, Recognition of Spanning Trees Defined by Graph Searches, Technical Report A 85/08, Universität des Saarlandes, Saarbrücken, West Germany, June 1985.Google Scholar
6. [HT a]
J.E. Hopcroft and R.E. Tarjan, Dividing a graph into triconnected components, SIAM Journal on Computing, 2(3), (1973).Google Scholar
7. [HT b]
J.E. Hopcroft and R.E. Tarjan, Efficient algorithms for graph manipulation, Comm. ACM, 16(6), 372–378, (1973).Google Scholar
8. [HT c]
J.E. Hopcroft and R.E. Tarjan, Efficient planarity testing, J. ACM, 21, 549–568, (1974).Google Scholar
9. [KO]
E. Korach and Z. Ostfeld, On the Possibilities of DFS Tree Constructions: Sequential and Parallel Algorithms, Technical Report no. 508, CS Dept. Technion, May 1988.Google Scholar
10. [LMT]
K.B. Lakshmanan, N. Meenakshi and K. Thulasiraman, A time-optimal message-efficient distributed algorithm for Depth-first-Search, Information Processing Letters, 25, 103–109, (1987).Google Scholar
11. [LP]
A. LaPaugh and C.H. Papadimitriou, The even-path problem for graphs and digraphs, Networks, 14, 507–513, (1984).Google Scholar
12. [Re]
J.H. Reif, Depth-first search is inherently sequential, Information Processing Letters, 20, 229–234, (1985).Google Scholar
13. [Sy]
M.M. Syslo, Series-parallel graphs and depth-first search trees, IEEE Transactions on Circuits and Systems, 31(12), 1029–1033, (1984).Google Scholar
14. [TV]
R.E. Tarjan and U. Vishkin, An efficient parallel biconnectivity algorithm, SIAM Journal on Computing, 14(4), 862–874, (1985).Google Scholar
15. [Ta]
R.E. Tarjan, Depth-first search and linear graph algorithms, SIAM Journal on Computing, 1, 146–160, (1972).Google Scholar
16. [Ti]
P. Tiwari An Efficient Parallel Algorithm for Shifting the Root of a Depth First Spanning Tree, Journal of Algorithms, 7, 105–119, (1986).Google Scholar
17. [Tu]
W.T. Tutte, Lectures on matroids, J. Res. Nat. Bur. Stand. 69B, 1–48, (1965).Google Scholar