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.
- 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 Scholar
- B. Awerbuch and Y. Shiloach. New connectivity and MSF algorithms for Ultracomputer and PRAM. In ICPP, pages 177--187, 1983.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- D. S. Banerjee and K. Kothapalli. Hybrid algorithms for list ranking and graph connected components. In High Performance Computing, pages 1--10, 2011. Google ScholarDigital Library
- Y. Bartal. Graph decomposition lemmas and their role in metric embedding methods. In ESA, pages 89--97. 2004.Google ScholarCross Ref
- S. Beamer, K. Asanović, and D. Patterson. Direction-optimizing breadth-first search. In Supercomputing, pages 12:1--12:10, 2012. Google ScholarDigital Library
- G. E. Blelloch. NESL. In Encyclopedia of Parallel Computing, pages 1278--1283. 2011.Google ScholarCross Ref
- 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 ScholarDigital Library
- G. E. Blelloch and B. M. Maggs. Parallel algorithms. In The Computer Science and Engineering Handbook, pages 277--315. 1997.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- D. Chakrabarti, Y. Zhan, and C. Faloutsos. R-MAT: A recursive model for graph mining. In SDM, pages 442--446, 2004.Google ScholarCross Ref
- F. Y. Chin, J. Lam, and I.-N. Chen. Efficient parallel algorithms for some graph problems. Commun. ACM, pages 659--665, 1982. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- H. Gazit. An optimal randomized parallel algorithm for finding connected components in a graph. SIAM J. Comput., 20(6):1046--1067, Dec. 1991. Google ScholarDigital Library
- J. Gil, Y. Matias, and U. Vishkin. Towards a theory of nearly constant time parallel algorithms. In FOCS, pages 698--710, 1991. Google ScholarDigital Library
- 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 Scholar
- J. Greiner. A comparison of parallel algorithms for connected components. In SPAA, pages 16--25, 1994. Google ScholarDigital Library
- 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 ScholarDigital Library
- S. Halperin and U. Zwick. Optimal randomized EREW PRAM algorithms for finding spanning forests. In J. Algorithms, pages 1740--1759, 2000. Google ScholarDigital Library
- S. Hambrusch and L. TeWinkel. A study of connected component labeling algorithms on the MPP. In Supercomputing, pages 477--483, 1988.Google Scholar
- Y. Han and R. A. Wagner. An efficient and fast parallel-connected component algorithm. J. ACM, 37(3):626--642, July 1990. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- T.-S. Hsu, V. Ramachandran, and N. Dean. Parallel implementation of algorithms for finding connected components in graphs, 1997.Google Scholar
- K. Iwama and Y. Kambayashi. A simpler parallel algorithm for graph connectivity. J. Algorithms, 16(2):190--217, Mar. 1994. Google ScholarDigital Library
- 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 ScholarDigital Library
- U. Kang, C. E. Tsourakakis, and C. Faloutsos. PEGASUS: mining peta-scale graphs. Knowl. Inf. Syst., 27(2):303--325, 2011. Google ScholarDigital Library
- 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 ScholarDigital Library
- V. Koubek and J. Krsnakova. Parallel algorithms for connected components in a graph. In Fundamentals of Computation Theory, pages 208--217. 1985. Google ScholarDigital Library
- 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 Scholar
- C. Kruskal, L. Rudolph, and M. Snir. Efficient parallel algorithms for graph problems. Algorithmica, 5(1--4), 1990.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- C. E. Leiserson. The Cilk++ concurrency platform. The Journal of Supercomputing, 51(3):244--257, 2010. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- N. Linial and M. Saks. Low diameter graph decompositions. Combinatorica, 13(4):441--454, 1993.Google ScholarCross Ref
- Y. Matias and U. Vishkin. On parallel hashing and integer sorting. Journal of Algorithms, 12(4):573--606, 1991. Google ScholarDigital Library
- G. L. Miller, R. Peng, and S. C. Xu. Parallel graph decomposition using random shifts. In SPAA, pages 196--203, 2013. Google ScholarDigital Library
- 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 ScholarCross Ref
- D. Nguyen, A. Lenharth, and K. Pingali. A lightweight infrastructure for graph analytics. In Symposium on Operating Systems Principles, pages 456--471, 2013. Google ScholarDigital Library
- N. Nisan, E. Szemeredi, and A. Wigderson. Undirected connectivity in O(log1:5 n) space. In FOCS, pages 24--29, 1992. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- C. A. Phillips. Parallel graph contraction. In SPAA, pages 148--157, 1989. Google ScholarDigital Library
- 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 ScholarDigital Library
- J. Reif. Optimal parallel algorithms for integer sorting and graph connectivity. TR-08--85, Harvard University, 1985.Google Scholar
- Y. Shiloach and U. Vishkin. An O(log n) parallel connectivity algorithm. J. Algorithms, 3(1):57--67, 1982.Google ScholarCross Ref
- 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 ScholarDigital Library
- J. Shun and G. E. Blelloch. Phase-concurrent hash tables for determinism. In SPAA, 2014. Google ScholarDigital Library
- J. Shun, G. E. Blelloch, J. T. Fineman, and P. B. Gibbons. Reducing contention through priority updates. In SPAA, pages 152--163, 2013. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- J. Soman, K. Kishore, and P. J. Narayanan. A fast GPU algorithm for graph connectivity. In IPDPS, pages 1--8, 2010.Google ScholarCross Ref
- U. Vishkin. An optimal parallel connectivity algorithm. Discrete Applied Mathematics, 9(2):197--207, 1984.Google ScholarCross Ref
Index Terms
- A simple and practical linear-work parallel algorithm for connectivity
Recommendations
Parallel Planar Subgraph Isomorphism and Vertex Connectivity
SPAA '20: Proceedings of the 32nd ACM Symposium on Parallelism in Algorithms and ArchitecturesWe present the first parallel fixed-parameter algorithm for subgraph isomorphism in planar graphs, bounded-genus graphs, and, more generally, all minor-closed graphs of locally bounded treewidth. Our randomized low depth algorithm has a near-linear work ...
An optimal parallel algorithm for graph planarity
SFCS '89: Proceedings of the 30th Annual Symposium on Foundations of Computer ScienceThe authors present a parallel algorithm based on open ear decomposition which, given a graph G on n vertices, constructs an embedding of G onto the plane or reports that G is nonplanar. This parallel algorithm runs on a concurrent-read, concurrent-...
Efficient parallel algorithms for testing connectivity and finding disjoint s-t paths in graphs
SFCS '89: Proceedings of the 30th Annual Symposium on Foundations of Computer ScienceAn efficient parallel algorithm for testing whether a graph G is K-vertex connected, for any fixed k, is presented. The algorithm runs in O(log n) time and uses nC(n,m) processors on a concurrent-read, concurrent-write parallel random-access machine (...
Comments