Information ProcessingLetters 25 (1987) 65-70 20 April 1987 North-Holland A TOPOLOGICAL APPROACH TO DYNAMIC GRAPH CONNECTIVITY * John H. REIF * * Aiken Computation Laboratory, Division of Applied Sciences, Harvard Unioersity, Cambridge, MA 02138, U.S.A, Communicated by M.A. Harrison Received 4 April 1985 Revised 2 July 1985 and 14 May 1986 A dynamic connectivityproblem consists of an initial graph, and a sequence of operations consisting of graph modifications and graph connectivity tests. The size n of the problem is the sum of the maximum number of vertices and edges of the derived graph, plus the number of operations to be executed. Each graph modification is a deletion of either an edge or an isolated vertex. Each graph connectivity test is to determine if there exists a path in the current graph between two given vertices (the vertices can vary for distinct tests). The best previouslyknown time for this dynamic connectivity problem was ~(n2). Our main result is an O(ng+ n log n) time algorithm for the dynamic connectivity problem in the case of the maximum genus of the derived graph being g. Keywords: Graph algorithm~connectivity,dynamic algorithm~planar graph 1. Introduction 1.1. Previous graph connectioity algorithms Tarjan [15] and Hopcroft and Tarjan [10] have given linear time depth-first search algorithms for graph connectivity and biconnectivity, and di- rected graph strong connectivity. Although these algorithms are asymptotically optimal for a given single input graph, they may be inefficient to apply in the case of dynamic connectivity prob- lems where the graph undergoes repeated modifi- cations, and we require connectivity tests on each of the derived graphs. Dynamic graph connectiv- ity in the case of only edge additions can be * This work was supported by the National ScienceFounda- tion under Grant No. MCS-82-000269and by the Office of Naval Research.under Contract No. N00014-80-C-0647. ** Present affiliation: Department of Computer Science,Duke University, Durham, NC 27706, U.S.A. solved in O(na(n, n)) time for any graph by use of the disjoint set union algorithm [16]. The al- gorithm of Frederickson [6] can be used to solve the dynamic graph connectivity problem for planar graphs with edge insertions and deletions in O((log n):) time per update. However, there was previously no efficient solution to the dynamic connectivity problem, in the case of general graphs, except to execute the known depth-first search algorithms on each of the derived graphs. This requires quadratic time. 1.2. Dynamic depth-first search One approach to dynamic connectivity prob- lems is to develop a dynamic algorithm for updat- ing depth-first trees. However, Section 4 gives evidence that this cannot be done efficiently (i.e., in less than linear time per update in the worst case) since this would imply an efficient solution of a number of other complete dynamical prob- lems. 0020-0190/87/$3.50 © 1987, Elsevier SciencePublishers B.V. (North-HoUand) 65