computational complexity

, Volume 6, Issue 1, pp 1–28 | Cite as

Undirecteds-t connectivity in polynomial time and sublinear space

  • Greg Barnes
  • Walter L. Ruzzo


Thes-t connectivity problem for undirected graphs is to decide whether two designated vertices,s andt, are in the same connected component. This paper presents the first known deterministic algorithms solving undirecteds-t connectivity using sublinear space and polynomial time. Our algorithms provide a nearly smooth time-space tradeoff between depth-first search and Savitch's algorithm. Forn vertex,m edge graphs, the simplest of our algorithms uses spaceO(s),n1/2log2nsnlog2n, and timeO(((m+n)n 2 log2n)/s). We give a variant of this method that is faster at the higher end of the space spectrum. For example, with space θ(nlogn), its time bound isO((m+n)logn), close to the optimal time for the problem. Another generalization uses less space, but more time: spaceOn1/λlogn), for 2≤λ≤log2n, and timenO(λ). For constant λ the time remains polynomial.

Key words

undirected connectivity time-space tradeoff 

Subject classifications

05C40 05C85 68Q05 68Q10 68Q15 68Q20 68Q25 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. R. Aleliunas, R. M. Karp, R. J. Lipton, L. Lovász, and C. W. Rackoff, Random walks, universal traversal sequences, and the complexity of maze problems. InProc. 20th Ann. IEEE Symp. Found. Comput. Sci., San Juan, Puerto Rico, 1979, IEEE, 218–223.Google Scholar
  2. N. Alon, Y. Azar, andY. Ravid, Universal sequences for complete graphs.Disc. Appl. Math. 27 (1990), 25–28.Google Scholar
  3. L. Babai, N. Nisan, andM. Szegedy, Multiparty protocols, pseudorandom generators for logspace, and time-space trade-offs.J. Comput. System Sci.,45 (2) (1992), 204–232.Google Scholar
  4. A. Bar-Noy, A. Borodin, M. Karchmer, N. Linial, andM. Werman, Bounds on universal sequences.SIAM J. Comput. 18 (2) (1989), 268–277.Google Scholar
  5. G. Barnes, J. F. Buss, W. L. Ruzzo, and B. Schieber, A sublinear space, polynomial time algorithm for directeds-t connectivity. InProc., Structure in Complexity Theory, Seventh Ann. Conf., Boston, MA, 1992, IEEE, 27–33. To appear,SIAM J. Comput. Google Scholar
  6. G. Barnes andU. Feige, Short random walks on graphs.SIAM J. Disc. Math. 9(1) (1996), 19–28.Google Scholar
  7. G. Barnes and W. L. Ruzzo, Deterministic algorithms for undirecteds-t connectivity using polynomial time and sublinear space. InProc. Twenty-third Ann. ACM Symp. Theor. Comput., New Orleans, LA, 1991, 43–53. Also Dept. of Computer Science and Engineering, Univ. of Washington TR 91-06-02.Google Scholar
  8. P. W. Beame, A. Borodin, P. Raghavan, W. L. Ruzzo, and M. Tompa, Time-space tradeoffs for undirected graph traversal. Technical Report 93-02-01, Dept. of Computer Science and Engineering, Univ. of Washington, 1993.Google Scholar
  9. A. Borodin, S. A. Cook, P. W. Dymond, W. L. Ruzzo, andM. Tompa, Two applications of inductive counting for complementation problems.SIAM J. Comput. 18(3) (1989), 559–578. See also 18(6): 1283, December 1989.Google Scholar
  10. A. Borodin, W. L. Ruzzo, andM. Topma, Lower bounds on the length of universal traversal sequences.J. Comput. System Sci. 45(2) (1992), 180–203.Google Scholar
  11. M. F. Bridgland, Universal traversal sequences for paths and cycles.J. Algorithms 8(3) (1987), 395–404.Google Scholar
  12. A. Z. Broder, A. R. Karlin, P. Raghavan, andE. Upfal, Trading space for time in undirecteds-t connectivity.SIAM J. Comput. 23(2) (1994), 324–334.Google Scholar
  13. S. A. Cook andC. W. Rackoff, Space lower bounds for maze threadability on restricted machines.SIAM J. Comput. 9(3) (1980), 636–652.Google Scholar
  14. J. A. Edmonds, Time-space trade-offs for undirectedST-connectivity on a JAG. InProc. Twenty-fifth Ann. ACM Symp. Theor. Comput., San Diego, CA, 1993, 718–727.Google Scholar
  15. U. Feige, A randomized time-space tradeoff ofÕ(mŘ) for USTCON. InProc. 34th Ann. Symp. Found. Comput. Sci., Palo Alto, CA, 1993, IEEE, 238–246.Google Scholar
  16. S. Hoory andA. Wigderson, Universal traversal sequences for expander graphs.Inform. Process. Lett. 46(2) (1993), 67–69.Google Scholar
  17. S. Istrail, Polynomial universal traversing sequences for cycles are constructible. InProc. Twentieth ACM Symp. Theor. Comput., Chicago, IL, 1988, 491–503.Google Scholar
  18. S. Istrail, Constructing generalized universal traversing sequences of polynomial size for graphs with small diameter. InProc. 31st Ann. Symp. Found. Comput. Sci., St. Louis, MO, 1990, IEEE, 439–448.Google Scholar
  19. H. J. Karloff, R. Paturi andJ. Simon, Universal traversal sequences of lengthn O(logn) for cliques.Inform. Process. Lett. 28 (1988), 241–243.Google Scholar
  20. D. E. Knuth,Sorting and Searching, vol. 3 ofThe Art of Computer Programming. Addison-Wesley, 1973.Google Scholar
  21. K. Kriegel, The space complexity of the accessibility problem for undirected graphs of logn bounded genus. InMath. Found. Comput. Sci.: Proc. 12th Symp., ed.J. Gruska, B. Rovan, andJ. Wiederman, vol. 233 ofLecture Notes in Computer Science, Bratislava, Czechoslovakia, 1986, Springer-Verlag, 484–492.Google Scholar
  22. H. R. Lewis andC. H. Papadimitriou, Symmetric space-bounded computation.Theoret. Comput. Sci. 19(2) (1982), 161–187.Google Scholar
  23. N. Nisan, Pseudorandom generators for space-bounded computation. InProc. Twenty-second Ann. ACM Symp. Theor. Comput., Baltimore, MD, 1990, 204–212.Google Scholar
  24. N. Nisan,RL⫅SC. Comput. complexity 4(1) (1994), 1–11.Google Scholar
  25. N. Nisan, E. Szemerédi, and A. Wigderson, Undirected connectivity inO(log1.5 n) space. InProc. 33rd Ann. Symp. Found. Comput. Sci., Pittsburgh, PA, 1992, IEEE, 24–29.Google Scholar
  26. N. J. Pippenger, Pebbling. InProceedings of the Fifth IBM Symposium on Mathematical Foundations of Computer Science. IBM Japan, 1980.Google Scholar
  27. W. J. Savitch, Relationships between nondeterministic and deterministic tape complexities.J. Comput. System Sci. 4(2) (1970), 177–192.Google Scholar
  28. R. E. Tarjan, On the efficiency of a good but not linear set merging algorithm.J. Assoc. Comput. Mach. 22(2) (1975), 215–225.Google Scholar
  29. M. Tompa, Lower bounds on universal traversal sequences for cycles and other low degree graphs.SIAM J. Comput. 21(6) (1992), 1153–1160.Google Scholar

Copyright information

© Birkhäuser Verlag 1997

Authors and Affiliations

  • Greg Barnes
    • 1
  • Walter L. Ruzzo
    • 1
  1. 1.Department of Computer Science and Engineering, FR-35University of WashingtonSeattleUSA

Personalised recommendations