connected_components_parallel_search.html 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
  7. <title>Parallel BGL Connected Components Parallel Search</title>
  8. <link rel="stylesheet" href="../../../../rst.css" type="text/css" />
  9. </head>
  10. <body>
  11. <div class="document" id="logo-connected-components-parallel-search">
  12. <h1 class="title"><a class="reference external" href="http://www.osl.iu.edu/research/pbgl"><img align="middle" alt="Parallel BGL" class="align-middle" src="pbgl-logo.png" /></a> Connected Components Parallel Search</h1>
  13. <!-- Copyright (C) 2004-2009 The Trustees of Indiana University.
  14. Use, modification and distribution is subject to the Boost Software
  15. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  16. http://www.boost.org/LICENSE_1_0.txt) -->
  17. <pre class="literal-block">
  18. namespace graph { namespace distributed {
  19. template&lt;typename Graph, typename ComponentMap&gt;
  20. typename property_traits&lt;ComponentMap&gt;::value_type
  21. connected_components_ps(const Graph&amp; g, ComponentMap c)
  22. } }
  23. </pre>
  24. <p>The <tt class="docutils literal"><span class="pre">connected_components_ps()</span></tt> function computes the connected
  25. components of a graph by performing a breadth-first search from
  26. several sources in parallel while recording and eventually resolving
  27. the collisions.</p>
  28. <div class="contents topic" id="contents">
  29. <p class="topic-title first">Contents</p>
  30. <ul class="simple">
  31. <li><a class="reference internal" href="#where-defined" id="id1">Where Defined</a></li>
  32. <li><a class="reference internal" href="#parameters" id="id2">Parameters</a></li>
  33. <li><a class="reference internal" href="#complexity" id="id3">Complexity</a></li>
  34. <li><a class="reference internal" href="#algorithm-description" id="id4">Algorithm Description</a></li>
  35. </ul>
  36. </div>
  37. <div class="section" id="where-defined">
  38. <h1><a class="toc-backref" href="#id1">Where Defined</a></h1>
  39. <p>&lt;<tt class="docutils literal"><span class="pre">boost/graph/distributed/connected_components_parallel_search.hpp</span></tt>&gt;</p>
  40. </div>
  41. <div class="section" id="parameters">
  42. <h1><a class="toc-backref" href="#id2">Parameters</a></h1>
  43. <dl class="docutils">
  44. <dt>IN: <tt class="docutils literal"><span class="pre">const</span> <span class="pre">Graph&amp;</span> <span class="pre">g</span></tt></dt>
  45. <dd>The graph type must be a model of <a class="reference external" href="DistributedGraph.html">Distributed Graph</a>. The graph
  46. type must also model the <a class="reference external" href="http://www.boost.org/libs/graph/doc/IncidenceGraph.html">Incidence Graph</a> and be directed.</dd>
  47. <dt>OUT: <tt class="docutils literal"><span class="pre">ComponentMap</span> <span class="pre">c</span></tt></dt>
  48. <dd>The algorithm computes how many connected components are in the
  49. graph, and assigns each component an integer label. The algorithm
  50. then records to which component each vertex in the graph belongs by
  51. recording the component number in the component property map. The
  52. <tt class="docutils literal"><span class="pre">ComponentMap</span></tt> type must be a <a class="reference external" href="distributed_property_map.html">Distributed Property Map</a>. The
  53. value type must be the <tt class="docutils literal"><span class="pre">vertices_size_type</span></tt> of the graph. The key
  54. type must be the graph's vertex descriptor type.</dd>
  55. </dl>
  56. </div>
  57. <div class="section" id="complexity">
  58. <h1><a class="toc-backref" href="#id3">Complexity</a></h1>
  59. <p><em>O(PN^2 + VNP)</em> work, in <em>O(N + V)</em> time, where N is the
  60. number of mappings and V is the number of local vertices.</p>
  61. </div>
  62. <div class="section" id="algorithm-description">
  63. <h1><a class="toc-backref" href="#id4">Algorithm Description</a></h1>
  64. <p>Every <em>N</em> th nodes starts a parallel search from the first vertex in
  65. their local vertex list during the first superstep (the other nodes
  66. remain idle during the first superstep to reduce the number of
  67. conflicts in numbering the components). At each superstep, all new
  68. component mappings from remote nodes are handled. If there is no work
  69. from remote updates, a new vertex is removed from the local list and
  70. added to the work queue.</p>
  71. <p>Components are allocated from the <tt class="docutils literal"><span class="pre">component_value_allocator</span></tt>
  72. object, which ensures that a given component number is unique in the
  73. system, currently by using the rank and number of processes to stride
  74. allocations.</p>
  75. <p>When two components are discovered to actually be the same component,
  76. a collision is recorded. The lower component number is prefered in
  77. the resolution, so component numbering resolution is consistent.
  78. After the search has exhausted all vertices in the graph, the mapping
  79. is shared with all processes and they independently resolve the
  80. comonent mapping. This phase can likely be significantly sped up if a
  81. clever algorithm for the reduction can be found.</p>
  82. <hr class="docutils" />
  83. <p>Copyright (C) 2009 The Trustees of Indiana University.</p>
  84. <p>Authors: Brian Barrett, Douglas Gregor, and Andrew Lumsdaine</p>
  85. </div>
  86. </div>
  87. <div class="footer">
  88. <hr class="footer" />
  89. Generated on: 2009-05-31 00:21 UTC.
  90. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
  91. </div>
  92. </body>
  93. </html>