gursoy_atun_layout.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <HTML>
  2. <!--
  3. Copyright (c) 2004 Trustees of Indiana University
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Boost Graph Library: G&uuml;rsoy-Atun Layout</Title>
  10. <script language="JavaScript" type="text/JavaScript">
  11. <!--
  12. function address(host, user) {
  13. var atchar = '@';
  14. var thingy = user+atchar+host;
  15. thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
  16. document.write(thingy);
  17. }
  18. //-->
  19. </script>
  20. </head>
  21. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  22. ALINK="#ff0000">
  23. <IMG SRC="../../../boost.png"
  24. ALT="C++ Boost" width="277" height="86">
  25. <BR Clear>
  26. <H1>
  27. <TT>gursoy_atun_layout</TT>
  28. </H1>
  29. <P>
  30. <h3>Synopsis</h3>
  31. <PRE>
  32. <em>// Non-named parameter version</em>
  33. template&lt;typename VertexListAndIncidenceGraph, typename Topology,
  34. typename PositionMap, typename VertexIndexMap,
  35. typename EdgeWeightMap&gt;
  36. void
  37. gursoy_atun_layout(const VertexListAndIncidenceGraph&amp; g,
  38. const Topology&amp; space,
  39. PositionMap position,
  40. int nsteps = num_vertices(g),
  41. double diameter_initial = sqrt((double)num_vertices(g)),
  42. double diameter_final = 1,
  43. double learning_constant_initial = 0.8,
  44. double learning_constant_final = 0.2,
  45. VertexIndexMap vertex_index_map = get(vertex_index, g),
  46. EdgeWeightMap weight = dummy_property_map());
  47. <em>// Named parameter version</em>
  48. template&lt;typename VertexListAndIncidenceGraph, typename Topology,
  49. typename PositionMap, typename P, typename T, typename R&gt;
  50. void
  51. gursoy_atun_layout(const VertexListAndIncidenceGraph&amp; g,
  52. const Topology&amp; space,
  53. PositionMap position,
  54. const bgl_named_params&lt;P,T,R&gt;&amp; params = <em>all defaults</em>);
  55. </PRE>
  56. <h3>Description</h3>
  57. <P> This algorithm&nbsp;[<A HREF="bibliography.html#gursoy00">60</A>]
  58. performs layout of directed graphs, either weighted or unweighted. This
  59. algorithm is very different from the <a
  60. href="kamada_kawai_spring_layout.html">Kamada-Kawai</a> and <a
  61. href="fruchterman_reingold.html">Fruchterman-Reingold</a> algorithms,
  62. because it does not explicitly strive to layout graphs in a visually
  63. pleasing manner. Instead, it attempts to distribute the vertices
  64. uniformly within a <em>topology</em> (e.g., rectangle, sphere, heart shape),
  65. keeping vertices close to their neighbors; <a href="topology.html">various
  66. topologies</a> are provided by BGL, and users can also create their own. The
  67. algorithm itself is
  68. based on <a
  69. href="http://davis.wpi.edu/~matt/courses/soms/">Self-Organizing
  70. Maps</a>.
  71. <p>
  72. <a href="topology.html#square_topology"><img src="figs/ga-square.png"></a>
  73. <a href="topology.html#heart_topology"><img src="figs/ga-heart.png"></a>
  74. <a href="topology.html#circle_topology"><img src="figs/ga-circle.png"></a>
  75. </p>
  76. <h3>Where Defined</h3>
  77. <a href="../../../boost/graph/gursoy_atun_layout.hpp"><tt>boost/graph/gursoy_atun_layout.hpp</tt></a>
  78. <h3>Parameters</h3>
  79. IN: <tt>const Graph&amp; g</tt>
  80. <blockquote>
  81. The graph object on which the algorithm will be applied. The type
  82. <tt>Graph</tt> must be a model of <a
  83. href="./VertexAndEdgeListGraph.html">Vertex List Graph</a> and <a
  84. href="IncidenceGraph.html">Incidence Graph</a>.
  85. </blockquote>
  86. IN: <tt>const Topology&amp; space</tt>
  87. <blockquote>
  88. The topology on which the graph will be laid out. The type must
  89. model the <a href="topology.html#topology-concept">Topology</a> concept.
  90. </blockquote>
  91. OUT: <tt>PositionMap position</tt>
  92. <blockquote>
  93. The property map that stores the position of each vertex. The type
  94. <tt>PositionMap</tt> must be a model of <a
  95. href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property
  96. Map</a> such that the vertex descriptor type of <tt>Graph</tt> is
  97. convertible to its key type. Its value type must be
  98. <tt>Topology::point_type</tt>.
  99. </blockquote>
  100. IN: <tt>int nsteps</tt>
  101. <blockquote>
  102. The number of iterations to perform.<br>
  103. <b>Default</b>: <tt>num_vertices(g)</tt>
  104. </blockquote>
  105. IN: <tt>double diameter_initial</tt>
  106. <blockquote>
  107. When a vertex is selected to be updated, all vertices that are
  108. reachable from that vertex within a certain diameter (in graph
  109. terms) will also be updated. This diameter begins at
  110. <tt>diameter_initial</tt> in the first iteration and ends at
  111. <tt>diameter_final</tt> in the last iteration, progressing
  112. exponentially. Generally the diameter decreases, in a manner similar to
  113. the cooling schedule in <a
  114. href="fruchterman_reingold.html">Fruchterman-Reingold</a>. The
  115. diameter should typically decrease in later iterations, so this value
  116. should not be less than <tt>diameter_final</tt>.<br>
  117. <b>Default</b>: <tt>sqrt((double)num_vertices(g))</tt>
  118. </blockquote>
  119. IN: <tt>double diameter_final</tt>
  120. <blockquote>
  121. The final value of the diameter.<br>
  122. <b>Default</b>: 1.0
  123. </blockquote>
  124. IN: <tt>double learning_constant_initial</tt>
  125. <blockquote>
  126. The learning rate affects how far vertices can moved to rearrange
  127. themselves in a given iteration. The learning rate progresses
  128. linearly from the initial value to the final value, both of which
  129. should be between 0 and 1. The learning rate should typically
  130. decrease, so the initial value should not exceed the final
  131. value.<br> <b>Default</b>: 0.8
  132. </blockquote>
  133. IN: <tt>double learning_constant_final</tt>
  134. <blockquote>
  135. The final learning rate constant.<br>
  136. <b>Default</b>: 0.2
  137. </blockquote>
  138. IN: <tt>VertexIndexMap vertex_index_map</tt>
  139. <blockquote>
  140. This maps each vertex to an integer in the range <tt>[0,
  141. num_vertices(g))</tt>. This is only necessary when no
  142. displacement map is provided.
  143. The type <tt>VertexIndexMap</tt> must be a model of <a
  144. href="../../property_map/doc/ReadablePropertyMap.html">Readable Property
  145. Map</a>. The value type of the map must be an integer type. The
  146. vertex descriptor type of the graph needs to be usable as the key
  147. type of the map.<br>
  148. <b>Default:</b> <tt>get(vertex_index, g)</tt>
  149. Note: if you use this default, make sure your graph has
  150. an internal <tt>vertex_index</tt> property. For example,
  151. <tt>adjacency_list</tt> with <tt>VertexList=listS</tt> does
  152. not have an internal <tt>vertex_index</tt> property.
  153. </blockquote>
  154. IN: <tt>EdgeWeightMap weight</tt>
  155. <blockquote>
  156. This maps each edge to a weight.
  157. The type <tt>EdgeWeightMap</tt> must be a model of <a
  158. href="../../property_map/doc/ReadablePropertyMap.html">Readable Property
  159. Map</a>. The value type of the map must be an floating-point type
  160. compatible with <tt>double</tt>. The edge descriptor type of the
  161. graph needs to be usable as the key type of the map. When this map
  162. is a <tt>dummy_property_map</tt>, the algorithm assumes the graph is
  163. unweighted.<br>
  164. <b>Default:</b> <tt>dummy_property_map()</tt>
  165. </blockquote>
  166. <h3>Named Parameters</h3>
  167. IN: <tt>iterations(int n)</tt>
  168. <blockquote>
  169. Executes the algorithm for <em>n</em> iterations.<br>
  170. <b>Default:</b> <tt>num_vertices(g)</tt>
  171. </blockquote>
  172. IN: <tt>diameter_range(std::pair<T, T> range)</tt>
  173. <blockquote>
  174. Range specifying the parameters (<tt>diameter_initial</tt>, <tt>diameter_final</tt>). <br>
  175. <b>Default:</b> <tt>std::make_pair(sqrt((double)num_vertices(g)), 1.0)</tt>
  176. </blockquote>
  177. IN: <tt>learning_constant_range(std::pair<T, T> range)</tt>
  178. <blockquote>
  179. Range specifying the parameters (<tt>learning_constant_initial</tt>, <tt>learning_constant_final</tt>). <br>
  180. <b>Default:</b> <tt>std::make_pair(0.8, 0.2)</tt>
  181. </blockquote>
  182. IN: <tt>edge_weight(EdgeWeightMap weight)</tt>
  183. <blockquote>
  184. Equivalent to the non-named <tt>weight</tt> parameter.<br>
  185. <b>Default:</b> <tt>dummy_property_map()</tt>
  186. </blockquote>
  187. IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
  188. <blockquote>
  189. Equivalent to the non-named <tt>vertex_index_map</tt> parameter.<br>
  190. <b>Default:</b> <tt>get(vertex_index, g)</tt>
  191. Note: if you use this default, make sure your graph has
  192. an internal <tt>vertex_index</tt> property. For example,
  193. <tt>adjacency_list</tt> with <tt>VertexList=listS</tt> does
  194. not have an internal <tt>vertex_index</tt> property.
  195. </blockquote>
  196. <br>
  197. <HR>
  198. <TABLE>
  199. <TR valign=top>
  200. <TD nowrap>Copyright &copy; 2004 Trustees of Indiana University</TD><TD>
  201. Jeremiah Willcock, Indiana University (<script language="Javascript">address("osl.iu.edu", "jewillco")</script>)<br>
  202. <A HREF="http://www.boost.org/people/doug_gregor.html">Doug Gregor</A>, Indiana University (<script language="Javascript">address("cs.indiana.edu", "dgregor")</script>)<br>
  203. <A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
  204. Indiana University (<script language="Javascript">address("osl.iu.edu", "lums")</script>)
  205. </TD></TR></TABLE>
  206. </BODY>
  207. </HTML>