planar_canonical_ordering.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <html><head><!-- Copyright 2007 Aaron Windsor
  2. Distributed under the Boost Software License, Version 1.0.
  3. (See accompanying file LICENSE_1_0.txt or copy at
  4. http://www.boost.org/LICENSE_1_0.txt)
  5. --><title>Boost Graph Library: Planar Canonical Ordering</title>
  6. </head>
  7. <body alink="#ff0000"
  8. bgcolor="#ffffff"
  9. link="#0000ee"
  10. text="#000000"
  11. vlink="#551a8b">
  12. <img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
  13. <br clear="">
  14. <h1>Planar Canonical Ordering</h1>
  15. <pre>template &lt;typename Graph, typename PlanarEmbedding, typename OutputIterator, typename VertexIndexMap&gt;
  16. void planar_canonical_ordering(const Graph&amp; g, PlanarEmbedding embedding, OutputIterator ordering, VertexIndexMap vm);
  17. </pre>
  18. <p>
  19. A <i>planar canonical ordering</i> is an ordering <i>v<sub>1</sub>,
  20. v<sub>2</sub>, ..., v<sub>n</sub></i> of the vertices of a
  21. <a href="make_maximal_planar.html">maximal</a>
  22. <a href="planar_graphs.html">planar</a> graph having the property that, for
  23. each <i>k</i>, <i>3 &lt;= k &lt; n</i>, the graph induced by
  24. <i>v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>k</sub></i>
  25. </p><ul>
  26. <li>is biconnected and contains the edge <i>{v<sub>1</sub>, v<sub>2</sub>}</i>
  27. on its outer face.
  28. </li><li>has any vertices in the range <i>v<sub>1</sub>, v<sub>2</sub>, ...,
  29. v<sub>k</sub></i> that are adjacent to <i>v<sub>(k+1)</sub></i> on its outer
  30. face, and these vertices form a path along the outer face.
  31. </li></ul>
  32. Let <i>G<sub>k</sub></i> be the graph induced by the first <i>k</i> vertices in
  33. the canonical ordering, along with all edges between any of the first <i>k</i>
  34. vertices. After <i>G<sub>k</sub></i> has been drawn, the <i>(k+1)</i>st vertex
  35. can be drawn easily without edge crossings, since it's adjacent only to a
  36. consecutive sequence of vertices on the outer face of <i>G<sub>k</sub></i>.
  37. <p>
  38. </p><blockquote>
  39. <center>
  40. <img src="./figs/canonical_ordering.png">
  41. </center>
  42. </blockquote>
  43. A planar canonical ordering exists for every maximal planar graph with at
  44. least 2 vertices. <tt>planar_canonical_ordering</tt> expects the input graph
  45. to have at least 2 vertices.
  46. <p>
  47. The planar canonical ordering is used as an input in some planar graph drawing
  48. algorithms, particularly those that create a straight line embedding.
  49. de Fraysseix, Pach, and Pollack
  50. [<a href="./bibliography.html#defraysseixpachpollack90">72</a>]
  51. first proved the
  52. existence of such an ordering and showed how to compute one in time
  53. <i>O(n)</i> on a maximal planar graph with <i>n</i> vertices.
  54. <h3>Complexity</h3>
  55. If the vertex index map provides constant-time access to indices, this
  56. function takes time <i>O(n + m)</i> for a planar graph with <i>n</i> vertices
  57. and <i>m</i> edges. Note that
  58. in a simple planar graph with <i>f</i> faces, <i>m</i> edges, and <i>n</i>
  59. vertices, both <i>f</i> and <i>m</i> are <i>O(n)</i>.
  60. <h3>Where Defined</h3>
  61. <p>
  62. <a href="../../../boost/graph/planar_canonical_ordering.hpp">
  63. <tt>boost/graph/planar_canonical_ordering.hpp</tt></a>
  64. </p><h3>Parameters</h3>
  65. IN: <tt>Graph&amp; g</tt>
  66. <blockquote>
  67. An undirected graph. The graph type must be a model of
  68. <a href="VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>.
  69. The graph must:
  70. <ul>
  71. <li>Be maximal planar.</li>
  72. <li>Have at least two vertices.</li>
  73. </ul>
  74. </blockquote>
  75. IN: <tt>PlanarEmbedding</tt>
  76. <blockquote>
  77. A model of <a href="PlanarEmbedding.html">PlanarEmbedding</a>.
  78. </blockquote>
  79. IN: <tt>OutputIterator</tt>
  80. <blockquote>
  81. An OutputIterator with <tt>value_type</tt> equal to
  82. <tt>graph_traits&lt;Graph&gt;::vertex_descriptor</tt>. The canonical ordering
  83. will be written to this iterator.
  84. </blockquote>
  85. IN: <tt>VertexIndexMap vm</tt>
  86. <blockquote>
  87. A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
  88. </a> that maps vertices from <tt>g</tt> to distinct integers in the range
  89. <tt>[0, num_vertices(g) )</tt><br>
  90. <b>Default</b>: <tt>get(vertex_index,g)</tt><br>
  91. </blockquote>
  92. <h3>Example</h3>
  93. <p>
  94. <a href="../example/canonical_ordering.cpp">
  95. <tt>examples/canonical_ordering.cpp</tt></a>
  96. </p><h3>See Also</h3>
  97. <p>
  98. <a href="planar_graphs.html">Planar Graphs in the Boost Graph Library</a>
  99. <br>
  100. </p><hr>
  101. Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
  102. aaron.windsor@gmail.com</a>)
  103. </body></html>