Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

BoyerMyrvold.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/GraphCopy.h>
40 
41 namespace ogdf {
42 
43 class KuratowskiWrapper;
44 
46 
139 protected:
142 
144  void clear() {
145  delete pBMP;
146  pBMP = nullptr;
147  }
148 
151 
152 public:
155  pBMP = nullptr;
156  nOfStructures = 0;
157  }
158 
160  ~BoyerMyrvold() { clear(); }
161 
163  int numberOfStructures() { return nOfStructures; }
164 
166 
169  virtual bool isPlanarDestructive(Graph& g) override;
170 
172 
174  virtual bool isPlanar(const Graph& g) override;
175 
177  virtual bool planarEmbed(Graph& G) override {
179  return planarEmbed(G, list);
180  }
181 
183 
191  virtual bool planarEmbedPlanarGraph(Graph& G) override {
193  return planarEmbedDestructive(G, list);
194  }
195 
197  void transform(const KuratowskiWrapper& source, KuratowskiSubdivision& target,
198  NodeArray<int>& count, EdgeArray<int>& countEdge);
199 
201 
204  void transform(const SList<KuratowskiWrapper>& sourceList,
205  SList<KuratowskiSubdivision>& targetList, const Graph& g,
206  const bool onlyDifferent = false);
207 
209 
212  void transform(const SList<KuratowskiWrapper>& sourceList,
213  SList<KuratowskiSubdivision>& targetList, const GraphCopySimple& h,
214  const bool onlyDifferent = false) {
215  transform(sourceList, targetList, h.original(), onlyDifferent);
216  }
217 
219 
229  bool planarEmbedDestructive(Graph& g, SList<KuratowskiWrapper>& output, int embeddingGrade,
230  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
231  bool avoidE2Minors = true);
232 
235  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
237  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
238  bool avoidE2Minors = true) {
239  return planarEmbedDestructive(g, output, static_cast<int>(embeddingGrade), bundles,
240  limitStructures, randomDFSTree, avoidE2Minors);
241  }
242 
244 
255  bool planarEmbed(Graph& g, SList<KuratowskiWrapper>& output, int embeddingGrade,
256  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
257  bool avoidE2Minors = true);
258 
261  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
263  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
264  bool avoidE2Minors = true) {
265  return planarEmbed(g, output, static_cast<int>(embeddingGrade), bundles, limitStructures,
266  randomDFSTree, avoidE2Minors);
267  }
268 
270 
280  bool planarEmbed(GraphCopySimple& h, SList<KuratowskiWrapper>& output, int embeddingGrade,
281  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
282  bool avoidE2Minors = true);
283 
286  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
288  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
289  bool avoidE2Minors = true) {
290  return planarEmbed(h, output, static_cast<int>(embeddingGrade), bundles, limitStructures,
291  randomDFSTree, avoidE2Minors);
292  }
293 };
294 
295 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::BoyerMyrvold::planarEmbed
virtual bool planarEmbed(Graph &G) override
Returns true, if G is planar, false otherwise. If true, G contains a planar embedding.
Definition: BoyerMyrvold.h:177
BoyerMyrvoldPlanar.h
Declaration of the class BoyerMyrvoldPlanar.
ogdf::KuratowskiWrapper
Wrapper-class for Kuratowski Subdivisions containing the minortype and edgelist.
Definition: ExtractKuratowskis.h:41
ogdf::BoyerMyrvold::planarEmbedPlanarGraph
virtual bool planarEmbedPlanarGraph(Graph &G) override
Constructs a planar embedding of G. G has to be planar!
Definition: BoyerMyrvold.h:191
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:833
ogdf::BoyerMyrvold::pBMP
BoyerMyrvoldPlanar * pBMP
Class BoyerMyrvoldPlanar on heap.
Definition: BoyerMyrvold.h:141
ogdf::isPlanar
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
Definition: extended_graph_alg.h:274
ogdf::BoyerMyrvold::BoyerMyrvold
BoyerMyrvold()
Constructor.
Definition: BoyerMyrvold.h:154
ogdf::GraphCopySimple
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:254
ExtractKuratowskis.h
Declaration of the class ExtractKuratowskis.
ogdf::KuratowskiSubdivision
Definition: KuratowskiSubdivision.h:39
ogdf::BoyerMyrvold::clear
void clear()
Deletes BoyerMyrvoldPlanar on heap.
Definition: BoyerMyrvold.h:144
PlanarityModule.h
Declaration of PlanarityModule.
ogdf::BoyerMyrvoldPlanar::EmbeddingGrade
EmbeddingGrade
Denotes the different embedding options.
Definition: BoyerMyrvoldPlanar.h:76
ogdf::BoyerMyrvold::numberOfStructures
int numberOfStructures()
The number of extracted Structures for statistical purposes.
Definition: BoyerMyrvold.h:163
ogdf::planarEmbed
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
Definition: extended_graph_alg.h:308
ogdf::BoyerMyrvold::~BoyerMyrvold
~BoyerMyrvold()
Destructor.
Definition: BoyerMyrvold.h:160
GraphCopy.h
Declaration of graph copy classes.
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::BoyerMyrvold
Wrapper class used for preprocessing and valid invocation of the planarity test.
Definition: BoyerMyrvold.h:138
ogdf::BoyerMyrvold::transform
void transform(const SList< KuratowskiWrapper > &sourceList, SList< KuratowskiSubdivision > &targetList, const GraphCopySimple &h, const bool onlyDifferent=false)
Transforms KuratowskiWrapper-List in KuratowskiSubdivision-List with respect to sieving constraints.
Definition: BoyerMyrvold.h:212
KuratowskiSubdivision.h
Declaration of KuratowskiSubdivion class.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::BoyerMyrvoldPlanar::EmbeddingGrade::doNotFind
@ doNotFind
ogdf::BoyerMyrvoldPlanar
This class implements the extended BoyerMyrvold planarity embedding algorithm.
Definition: BoyerMyrvoldPlanar.h:62
ogdf::PlanarityModule
Module for planarity testing and planar embeddings.
Definition: PlanarityModule.h:48
ogdf::BoyerMyrvold::planarEmbedDestructive
bool planarEmbedDestructive(Graph &g, SList< KuratowskiWrapper > &output, BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade=BoyerMyrvoldPlanar::EmbeddingGrade::doNotFind, bool bundles=false, bool limitStructures=false, bool randomDFSTree=false, bool avoidE2Minors=true)
Returns an embedding, if g is planar and Kuratowski Subdivisions otherwise.
Definition: BoyerMyrvold.h:234
ogdf::BoyerMyrvold::planarEmbed
bool planarEmbed(GraphCopySimple &h, SList< KuratowskiWrapper > &output, BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade=BoyerMyrvoldPlanar::EmbeddingGrade::doNotFind, bool bundles=false, bool limitStructures=false, bool randomDFSTree=false, bool avoidE2Minors=true)
Returns an embedding, if graph copy h is planar and Kuratowski Subdivisions otherwise.
Definition: BoyerMyrvold.h:285
ogdf::BoyerMyrvold::planarEmbed
bool planarEmbed(Graph &g, SList< KuratowskiWrapper > &output, BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade=BoyerMyrvoldPlanar::EmbeddingGrade::doNotFind, bool bundles=false, bool limitStructures=false, bool randomDFSTree=false, bool avoidE2Minors=true)
Returns an embedding, if g is planar and Kuratowski Subdivisions otherwise.
Definition: BoyerMyrvold.h:260
ogdf::GraphCopyBase::original
const Graph & original() const
Returns a reference to the original graph.
Definition: GraphCopy.h:98
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709
ogdf::BoyerMyrvold::nOfStructures
int nOfStructures
The number of extracted Structures for statistical purposes.
Definition: BoyerMyrvold.h:150