2018-01-12 21:47:58 +01:00
|
|
|
|
<html><head><!-- Copyright 2007 Aaron Windsor
|
2021-10-05 21:37:46 +02:00
|
|
|
|
|
2018-01-12 21:47:58 +01:00
|
|
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
|
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
|
http://www.boost.org/LICENSE_1_0.txt)
|
2021-10-05 21:37:46 +02:00
|
|
|
|
|
2018-01-12 21:47:58 +01:00
|
|
|
|
-->
|
|
|
|
|
<title>Planar Embedding Concept</title>
|
|
|
|
|
</head>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<body alink="#ff0000"
|
|
|
|
|
bgcolor="#ffffff"
|
|
|
|
|
link="#0000ee"
|
|
|
|
|
text="#000000"
|
|
|
|
|
vlink="#551a8b">
|
|
|
|
|
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
2018-01-12 21:47:58 +01:00
|
|
|
|
|
|
|
|
|
<br clear="">
|
|
|
|
|
|
|
|
|
|
<h1>Planar Embedding Concept</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A planar embedding is an important intermediate representation of a drawing
|
|
|
|
|
of a planar graph. Instead of specifying the absolute positions of the vertices
|
2021-10-05 21:37:46 +02:00
|
|
|
|
and edges in the plane, a planar embedding specifies their positions relative
|
|
|
|
|
to one another. A planar embedding consists of a sequence, for each vertex in
|
|
|
|
|
the graph, of all of the edges incident on that vertex in the order in which
|
2018-01-12 21:47:58 +01:00
|
|
|
|
they are to be drawn around that vertex.
|
|
|
|
|
<p>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
A planar embedding is a refinement of
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<a href="../../property_map/doc/LvaluePropertyMap.html">LValuePropertyMap</a> that
|
|
|
|
|
places additional restrictions the <tt>value_type</tt> used in the property
|
|
|
|
|
map.
|
|
|
|
|
|
|
|
|
|
</p><h3>Notation</h3>
|
|
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
<tbody>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
|
|
|
|
<td> <tt>Embedding</tt> </td>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> is a type that models the Planar Embedding concept.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> <tt>embedding</tt> </td>
|
|
|
|
|
<td> is an object of type <tt>Embedding</tt>. </td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
|
|
|
|
<td> <tt>Graph</tt> </td>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> is the type of the underlying graph.</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
|
|
|
|
<td> <tt>e</tt> </td>
|
|
|
|
|
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>.
|
2018-01-12 21:47:58 +01:00
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td> <tt>v</tt> </td>
|
|
|
|
|
<td> is an object of type <tt>graph_traits<Graph>::vertex_descriptor
|
|
|
|
|
</tt>.</td>
|
|
|
|
|
|
|
|
|
|
</tr><tr>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<td>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
|
|
|
|
|
</td></tr></tbody></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Associated Types</h3>
|
|
|
|
|
|
|
|
|
|
<table border="1">
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tbody><tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> Const Iterator </td>
|
|
|
|
|
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
|
|
|
|
</tt>
|
|
|
|
|
</td>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<td> The iterator type used to iterate over the ordering of the edges in the
|
2018-01-12 21:47:58 +01:00
|
|
|
|
planar embedding of a particular vertex
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</tbody></table>
|
|
|
|
|
|
|
|
|
|
<h3>Valid Expressions</h3>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
|
|
<table border="1">
|
|
|
|
|
|
|
|
|
|
<tbody><tr><th>Expression</th><th>Return Type</th><th>Description</th>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
</tr><tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> <tt>embedding[v].begin()</tt> </td>
|
|
|
|
|
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
|
|
|
|
</tt></td>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<td> Returns an iterator to the beginning of the range of edges in the
|
2018-01-12 21:47:58 +01:00
|
|
|
|
embedding around vertex v</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> <tt>embedding[v].end()</tt> </td>
|
|
|
|
|
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
|
|
|
|
</tt></td>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<td> Returns an iterator to the end of the range of edges in the
|
2018-01-12 21:47:58 +01:00
|
|
|
|
embedding around vertex v</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> <tt>embedding[v].clear()</tt> </td>
|
|
|
|
|
<td> <tt>void</tt></td>
|
|
|
|
|
<td> Clears all edges in the embedding around a vertex <tt>v</tt></td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<tr>
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<td> <tt>embedding[v].push_back(e)</tt> </td>
|
|
|
|
|
<td> <tt>void</tt></td>
|
2021-10-05 21:37:46 +02:00
|
|
|
|
<td> Adds an edge <tt>e</tt> to the end of the sequence of embedded edges
|
2018-01-12 21:47:58 +01:00
|
|
|
|
around the vertex <tt>v</tt> </td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
</tbody></table>
|
|
|
|
|
|
|
|
|
|
</p><h3>Complexity Guarantees</h3>
|
|
|
|
|
|
|
|
|
|
Starting with an empty embedding, any mixed sequence of <i>n</i> calls to a
|
2021-10-05 21:37:46 +02:00
|
|
|
|
particular vertex's <tt>push_back</tt> and <tt>clear</tt> should take
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<i>O(n)</i> time.
|
|
|
|
|
|
|
|
|
|
<h3>Models</h3>
|
|
|
|
|
|
2021-10-05 21:37:46 +02:00
|
|
|
|
Any LValue property map that maps vertices to a <tt>std::vector</tt>,
|
2018-01-12 21:47:58 +01:00
|
|
|
|
<tt>std::list</tt>, or <tt>std::deque</tt> models this
|
|
|
|
|
concept. Below is an example of using this approach to create a model of
|
|
|
|
|
PlanarEmbedding:
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
#include <boost/property_map/property_map.hpp>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
// Assume a graph type "Graph" defined somewhere above and
|
|
|
|
|
// an instance of Graph in a variable g.
|
|
|
|
|
|
|
|
|
|
// A typedef for the storage - a vector of vectors of edge descriptors
|
2021-10-05 21:37:46 +02:00
|
|
|
|
typedef
|
2018-01-12 21:47:58 +01:00
|
|
|
|
std::vector< std::vector< graph_traits<Graph>::edge_descriptor > >
|
|
|
|
|
planar_embedding_storage_t;
|
|
|
|
|
|
|
|
|
|
// A typedef for the iterator property map, assuming the graph has
|
|
|
|
|
// an interior vertex index map
|
|
|
|
|
typedef
|
|
|
|
|
boost::iterator_property_map< planar_embedding_storage_t::iterator,
|
|
|
|
|
property_map<Graph, vertex_index_t>::type
|
|
|
|
|
>
|
|
|
|
|
planar_embedding_t;
|
|
|
|
|
|
|
|
|
|
// Create an instance of the storage and the property map
|
|
|
|
|
planar_embedding_storage_t planar_embedding_storage(num_vertices(g));
|
|
|
|
|
planar_embedding_t planar_embedding(planar_embedding_storage.begin(),
|
|
|
|
|
get(vertex_index, g)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// planar_embedding can now be passed to any function expecting a model
|
|
|
|
|
// of PlanarEmbedding.
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
</p><hr>
|
|
|
|
|
Copyright <20> 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
2021-10-05 21:37:46 +02:00
|
|
|
|
aaron.windsor@gmail.com</a>)
|
2018-01-12 21:47:58 +01:00
|
|
|
|
|
|
|
|
|
</body></html>
|