make_maximal_planar.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <HTML>
  2. <!-- Copyright 2007 Aaron Windsor
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. -->
  7. <Head>
  8. <Title>Boost Graph Library: make_maximal_planar</Title>
  9. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  10. ALINK="#ff0000">
  11. <IMG SRC="../../../boost.png"
  12. ALT="C++ Boost" width="277" height="86">
  13. <BR Clear>
  14. <H1><tt>make_maximal_planar</tt></H1>
  15. <p>
  16. <pre>
  17. template &lt;typename Graph, typename PlanarEmbedding, typename VertexIndexMap, typename EdgeIndexMap, typename AddEdgeVisitor&gt;
  18. void make_maximal_planar(Graph& g, PlanarEmbedding embedding, VertexIndexMap vm, EdgeIndexMap em, AddEdgeVisitor vis);
  19. </pre>
  20. <p>
  21. A <a href="planar_graphs.html">planar graph</a> <i>G</i> is
  22. <i>maximal planar</i> if no additional edges (except parallel edges and
  23. self-loops) can be added to <i>G</i> without creating a non-planar graph. By
  24. <a href="planar_graphs.html#EulersFormula">Euler's formula</a>, a maximal
  25. planar graph on <i>n</i> vertices (<i>n > 2</i>) always has <i>3n - 6</i> edges
  26. and
  27. <i>2n - 4</i> faces. The input graph to <tt>make_maximal_planar</tt> must be a
  28. <a href="make_biconnected_planar.html">biconnected</a> planar graph with at
  29. least 3 vertices.
  30. <p>
  31. The default behavior of <tt>make_maximal_planar</tt> is to modify the graph
  32. <tt>g</tt> by calling <tt>add_edge(u,v,g)</tt> for every pair of vertices
  33. <i>(u,v)</i> where an edge needs to be added to make <tt>g</tt> maximal planar.
  34. This behavior can be overriden by providing a vistor as the
  35. <tt>AddEdgeVisitor</tt> parameter. The only requirement for an
  36. <tt>AddEdgeVisitor</tt> is that it define a member function with the following
  37. signature:
  38. <pre>
  39. template &lt;typename Graph, typename Vertex&gt;
  40. void visit_vertex_pair(Vertex u, Vertex v, Graph& g);
  41. </pre>
  42. This event point can also be used as a hook to update the underlying edge
  43. index map automatically as edges are added. See the
  44. documentation for the <a href="./AddEdgeVisitor.html">AddEdgeVisitor</a>
  45. concept for more information.
  46. <H3>Where Defined</H3>
  47. <P>
  48. <a href="../../../boost/graph/make_maximal_planar.hpp">
  49. <TT>boost/graph/make_maximal_planar.hpp</TT>
  50. </a>
  51. <h3>Parameters</h3>
  52. IN/OUT: <tt>Graph&amp; g</tt>
  53. <blockquote>
  54. An undirected graph. The graph type must be a model of <a
  55. href="VertexListGraph.html">Vertex List Graph</a>, <a
  56. href="IncidenceGraph.html">Incidence Graph</a>, and
  57. a <a href="MutableGraph.html">Mutable Graph</a><br>
  58. </blockquote>
  59. IN: <tt>PlanarEmbedding embedding</tt>
  60. <blockquote>
  61. A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
  62. </a> that models the <a href="PlanarEmbedding.html">PlanarEmbedding</a>
  63. concept.
  64. </blockquote>
  65. IN: <tt>VertexIndexMap vm</tt>
  66. <blockquote>
  67. A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
  68. </a> that maps vertices from <tt>g</tt> to distinct integers in the range
  69. <tt>[0, num_vertices(g) )</tt><br>
  70. <b>Default</b>: <tt>get(vertex_index,g)</tt><br>
  71. </blockquote>
  72. IN: <tt>EdgeIndexMap vm</tt>
  73. <blockquote>
  74. A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
  75. </a> that maps edges from <tt>g</tt> to distinct integers in the range
  76. <tt>[0, num_edges(g) )</tt><br>
  77. <b>Default</b>: <tt>get(edge_index,g)</tt><br>
  78. </blockquote>
  79. IN: <tt>AddEdgeVisitor vis</tt>
  80. <blockquote>
  81. A model of <a href="AddEdgeVisitor.html">AddEdgeVisitor</a>.<br>
  82. <b>Default</b>: <tt>default_add_edge_visitor</tt>, a class defines
  83. <tt>visit_vertex_pair</tt> to dispatch its calls to <tt>add_edge</tt>.
  84. </blockquote>
  85. <h3>Complexity</h3>
  86. On a graph with <i>n</i> vertices and <i>m</i> edges,
  87. <tt>make_maximal_planar</tt> runs in time <i>O(n + m)</i>
  88. <H3>Example</H3>
  89. <P>
  90. <a href="../example/make_maximal_planar.cpp">
  91. <TT>examples/make_maximal_planar.cpp</TT>
  92. </a>
  93. <h3>See Also</h3>
  94. <a href="planar_graphs.html">Planar Graphs in the Boost Graph Library</a>
  95. <br>
  96. <HR>
  97. Copyright &copy; 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
  98. aaron.windsor@gmail.com</a>)
  99. </BODY>
  100. </HTML>