skip to main content
10.1145/2612669.2612692acmconferencesArticle/Chapter ViewAbstractPublication PagesspaaConference Proceedingsconference-collections
research-article

A simple and practical linear-work parallel algorithm for connectivity

Published:21 June 2014Publication History

ABSTRACT

Graph connectivity is a fundamental problem in computer science with many important applications. Sequentially, connectivity can be done in linear work easily using breadth-first search or depth-first search. There have been many parallel algorithms for connectivity, however the simpler parallel algorithms require super-linear work, and the linear-work polylogarithmic-depth parallel algorithms are very complicated and not amenable to implementation. In this work, we address this gap by describing a simple and practical expected linear-work, polylogarithmic depth parallel algorithm for graph connectivity. Our algorithm is based on a recent parallel algorithm for generating low-diameter graph decompositions by Miller et al., which uses parallel breadth-first searches. We discuss a (modest) variant of their decomposition algorithm which preserves the theoretical complexity while leading to simpler and faster implementations. We experimentally compare the connectivity algorithms using both the original decomposition algorithm and our modified decomposition algorithm. We also experimentally compare against the fastest existing parallel connectivity implementations (which are not theoretically linear-work and polylogarithmic-depth) and show that our implementations are competitive for various input graphs. In addition, we compare our implementations to sequential connectivity algorithms and show that on 40 cores we achieve good speedup relative to the sequential implementations for many input graphs. We discuss the various optimizations used in our implementations and present an extensive experimental analysis of the performance. Our algorithm is the first parallel connectivity algorithm that is both theoretically and practically efficient.

References

  1. A. Agrawal, L. Nekludova, and W. Lim. A parallel O(logN) algorithm for finding connected components in planar images. In ICPP, pages 783--786, 1987.Google ScholarGoogle Scholar
  2. B. Awerbuch and Y. Shiloach. New connectivity and MSF algorithms for Ultracomputer and PRAM. In ICPP, pages 177--187, 1983.Google ScholarGoogle Scholar
  3. D. A. Bader and G. Cong. A fast, parallel spanning tree algorithm for symmetric multiprocessors (SMPs). Journal of Parallel and Distrib. Comput., 65(9):994--1006, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. A. Bader, G. Cong, and J. Feo. On the architectural requirements for efficient execution of graph algorithms. In ICPP, pages 547--556, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. A. Bader and J. JaJa. Parallel algorithms for image histogramming and connected components with an experimental study. J. Parallel Distrib. Comput., 35(2):173--190, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. S. Banerjee and K. Kothapalli. Hybrid algorithms for list ranking and graph connected components. In High Performance Computing, pages 1--10, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Y. Bartal. Graph decomposition lemmas and their role in metric embedding methods. In ESA, pages 89--97. 2004.Google ScholarGoogle ScholarCross RefCross Ref
  8. S. Beamer, K. Asanović, and D. Patterson. Direction-optimizing breadth-first search. In Supercomputing, pages 12:1--12:10, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. E. Blelloch. NESL. In Encyclopedia of Parallel Computing, pages 1278--1283. 2011.Google ScholarGoogle ScholarCross RefCross Ref
  10. G. E. Blelloch, A. Gupta, I. Koutis, G. L. Miller, R. Peng, and K. Tangwongsan. Near linear-work parallel SDD solvers, low-diameter decomposition, and low-stretch subgraphs. In SPAA, pages 13--22, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. G. E. Blelloch and B. M. Maggs. Parallel algorithms. In The Computer Science and Engineering Handbook, pages 277--315. 1997.Google ScholarGoogle Scholar
  12. L. Bus and P. Tvrdik. A parallel algorithm for connected components on distributed memory machines. In Recent Advances in Parallel Virtual Machine and Message Passing Interface, pages 280--287. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Caceres, H. Mongelli, C. Nishibe, and S. W. Song. Experimental results of a coarse-grained parallel algorithm for spanning tree and connected components. In High Performance Computing & Simulation, pages 631--637, 2010.Google ScholarGoogle Scholar
  14. D. Chakrabarti, Y. Zhan, and C. Faloutsos. R-MAT: A recursive model for graph mining. In SDM, pages 442--446, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  15. F. Y. Chin, J. Lam, and I.-N. Chen. Efficient parallel algorithms for some graph problems. Commun. ACM, pages 659--665, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. Chong and T. Lam. Finding connected components in O(log n log log n) time on the EREW PRAM. Journal of Algorithms, 18(3):378--402, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. Cole, P. N. Klein, and R. E. Tarjan. Finding minimum spanning forests in logarithmic time and linear work using random sampling. In SPAA, pages 243--250, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Cole and U. Vishkin. Approximate parallel scheduling. II. applications to logarithmic-time optimal parallel graph algorithms. Information and Computation, 92(1):1--47, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. H. Gazit. An optimal randomized parallel algorithm for finding connected components in a graph. SIAM J. Comput., 20(6):1046--1067, Dec. 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Gil, Y. Matias, and U. Vishkin. Towards a theory of nearly constant time parallel algorithms. In FOCS, pages 698--710, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. S. Goddard, S. Kumar, and J. F. Prins. Connected components algorithms for mesh-connected parallel computers. In Parallel Algorithms: 3rd DIMACS Implementation Challenge, pages 43--58, 1995.Google ScholarGoogle Scholar
  22. J. Greiner. A comparison of parallel algorithms for connected components. In SPAA, pages 16--25, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Halperin and U. Zwick. An optimal randomized logarithmic time connectivity algorithm for the EREW PRAM. J. Comput. Syst. Sci., 53(3):395--416, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Halperin and U. Zwick. Optimal randomized EREW PRAM algorithms for finding spanning forests. In J. Algorithms, pages 1740--1759, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Hambrusch and L. TeWinkel. A study of connected component labeling algorithms on the MPP. In Supercomputing, pages 477--483, 1988.Google ScholarGoogle Scholar
  26. Y. Han and R. A. Wagner. An efficient and fast parallel-connected component algorithm. J. ACM, 37(3):626--642, July 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. A. Hawick, A. Leist, and D. P. Playne. Parallel graph component labelling with GPUs and CUDA. Parallel Comput., 36(12):655--678, Dec. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. D. S. Hirschberg, A. K. Chandra, and D. V. Sarwate. Computing connected components on parallel computers. Commun. ACM, 22(8):461--464, Aug. 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. T.-S. Hsu, V. Ramachandran, and N. Dean. Parallel implementation of algorithms for finding connected components in graphs, 1997.Google ScholarGoogle Scholar
  30. K. Iwama and Y. Kambayashi. A simpler parallel algorithm for graph connectivity. J. Algorithms, 16(2):190--217, Mar. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. B. Johnson and P. Metaxas. Connected components in O(log3/2 n) parallel time for the CREW PRAM. Journal of Computer and System Sciences, 54(2):227--242, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. U. Kang, C. E. Tsourakakis, and C. Faloutsos. PEGASUS: mining peta-scale graphs. Knowl. Inf. Syst., 27(2):303--325, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. D. R. Karger, N. Nisan, and M. Parnas. Fast connected components algorithms for the EREW PRAM. SIAM J. Comput., 28(3):1021--1034, Feb. 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. V. Koubek and J. Krsnakova. Parallel algorithms for connected components in a graph. In Fundamentals of Computation Theory, pages 208--217. 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Krishnamurthy, S. S. Lumetta, D. E. Culler, and K. Yelick. Connected components on distributed memory machines. In Parallel Algorithms: 3rd DIMACS Implementation Challenge, pages 1--21, 1994.Google ScholarGoogle Scholar
  36. C. Kruskal, L. Rudolph, and M. Snir. Efficient parallel algorithms for graph problems. Algorithmica, 5(1--4), 1990.Google ScholarGoogle Scholar
  37. A. Kyrola, G. E. Blelloch, and C. Guestrin. GraphChi: Large-scale graph computation on just a PC. In Operating System Design and Implementation, pages 31--46, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. A. Kyrola, J. Shun, and G. E. Blelloch. Beyond synchronous computation: New techniques for external memory graph algorithms. In Symposium on Experimental Algorithms, 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. C. E. Leiserson. The Cilk++ concurrency platform. The Journal of Supercomputing, 51(3):244--257, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. C. E. Leiserson and T. B. Schardl. A work-efficient parallel breadth-first search algorithm (or how to cope with the nondeterminism of reducers). In SPAA, pages 303--314, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. W. Lim, A. Agrawal, and L. Nekludova. A fast parallel algorithm for labeling connected components in image arrays. In Tech. Report NA86--2, Thinking Machines Corporation, 1986.Google ScholarGoogle Scholar
  42. N. Linial and M. Saks. Low diameter graph decompositions. Combinatorica, 13(4):441--454, 1993.Google ScholarGoogle ScholarCross RefCross Ref
  43. Y. Matias and U. Vishkin. On parallel hashing and integer sorting. Journal of Algorithms, 12(4):573--606, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. G. L. Miller, R. Peng, and S. C. Xu. Parallel graph decomposition using random shifts. In SPAA, pages 196--203, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. D. Nath and S. N. Maheshwari. Parallel algorithms for the connected components and minimal spanning tree problems. Inf. Process. Lett., 14(1):7--11, 1982.Google ScholarGoogle ScholarCross RefCross Ref
  46. D. Nguyen, A. Lenharth, and K. Pingali. A lightweight infrastructure for graph analytics. In Symposium on Operating Systems Principles, pages 456--471, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. N. Nisan, E. Szemeredi, and A. Wigderson. Undirected connectivity in O(log1:5 n) space. In FOCS, pages 24--29, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. M. Patwary, P. Refsnes, and F. Manne. Multi-core spanning forest algorithms using the disjoint-set data structure. In IPDPS, pages 827--835, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. S. Pettie and V. Ramachandran. A randomized time-work optimal parallel algorithm for finding a minimum spanning forest. SIAM J. Comput., 31(6):1879--1895, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. C. A. Phillips. Parallel graph contraction. In SPAA, pages 148--157, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. C. K. Poon and V. Ramachandran. A randomized linear work EREW PRAM algorithm to find a minimum spanning forest. In ISAAC, pages 212--222, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. J. Reif. Optimal parallel algorithms for integer sorting and graph connectivity. TR-08--85, Harvard University, 1985.Google ScholarGoogle Scholar
  53. Y. Shiloach and U. Vishkin. An O(log n) parallel connectivity algorithm. J. Algorithms, 3(1):57--67, 1982.Google ScholarGoogle ScholarCross RefCross Ref
  54. J. Shun and G. E. Blelloch. Ligra: A lightweight graph processing framework for shared memory. In Principles and Practice of Parallel Programming, pages 135--146, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. J. Shun and G. E. Blelloch. Phase-concurrent hash tables for determinism. In SPAA, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. J. Shun, G. E. Blelloch, J. T. Fineman, and P. B. Gibbons. Reducing contention through priority updates. In SPAA, pages 152--163, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. J. Shun, G. E. Blelloch, J. T. Fineman, P. B. Gibbons, A. Kyrola, H. V. Simhadri, and K. Tangwongsan. Brief announcement: the Problem Based Benchmark Suite. In SPAA, pages 68--70, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. G. M. Slota, S. Rajamanickam, and K. Madduri. BFS and coloring-based parallel algorithms for strongly connected components and related problems. In IPDPS, 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. J. Soman, K. Kishore, and P. J. Narayanan. A fast GPU algorithm for graph connectivity. In IPDPS, pages 1--8, 2010.Google ScholarGoogle ScholarCross RefCross Ref
  60. U. Vishkin. An optimal parallel connectivity algorithm. Discrete Applied Mathematics, 9(2):197--207, 1984.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. A simple and practical linear-work parallel algorithm for connectivity

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      SPAA '14: Proceedings of the 26th ACM symposium on Parallelism in algorithms and architectures
      June 2014
      356 pages
      ISBN:9781450328210
      DOI:10.1145/2612669
      • General Chair:
      • Guy Blelloch,
      • Program Chair:
      • Peter Sanders

      Copyright © 2014 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 21 June 2014

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      SPAA '14 Paper Acceptance Rate30of122submissions,25%Overall Acceptance Rate447of1,461submissions,31%

      Upcoming Conference

      SPAA '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader