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/Graph.h>
36 #include <ogdf/basic/GraphCopy.h>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/basic.h>
42 
43 namespace ogdf {
44 class KuratowskiSubdivision;
45 
47 
140 protected:
143 
145  void clear() {
146  delete pBMP;
147  pBMP = nullptr;
148  }
149 
152 
153 public:
156  pBMP = nullptr;
157  nOfStructures = 0;
158  }
159 
161  ~BoyerMyrvold() { clear(); }
162 
164  int numberOfStructures() { return nOfStructures; }
165 
167 
170  virtual bool isPlanarDestructive(Graph& g) override;
171 
173 
175  virtual bool isPlanar(const Graph& g) override;
176 
178  virtual bool planarEmbed(Graph& G) override {
180  return planarEmbed(G, list);
181  }
182 
184 
192  virtual bool planarEmbedPlanarGraph(Graph& G) override {
194  return planarEmbedDestructive(G, list);
195  }
196 
198  void transform(const KuratowskiWrapper& source, KuratowskiSubdivision& target,
199  NodeArray<int>& count, EdgeArray<int>& countEdge);
200 
202 
205  void transform(const SList<KuratowskiWrapper>& sourceList,
206  SList<KuratowskiSubdivision>& targetList, const Graph& g,
207  const bool onlyDifferent = false);
208 
210 
213  void transform(const SList<KuratowskiWrapper>& sourceList,
214  SList<KuratowskiSubdivision>& targetList, const GraphCopySimple& h,
215  const bool onlyDifferent = false) {
216  transform(sourceList, targetList, h.original(), onlyDifferent);
217  }
218 
220 
230  bool planarEmbedDestructive(Graph& g, SList<KuratowskiWrapper>& output, int embeddingGrade,
231  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
232  bool avoidE2Minors = true);
233 
236  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
238  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
239  bool avoidE2Minors = true) {
240  return planarEmbedDestructive(g, output, static_cast<int>(embeddingGrade), bundles,
241  limitStructures, randomDFSTree, avoidE2Minors);
242  }
243 
245 
256  bool planarEmbed(Graph& g, SList<KuratowskiWrapper>& output, int embeddingGrade,
257  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
258  bool avoidE2Minors = true);
259 
262  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
264  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
265  bool avoidE2Minors = true) {
266  return planarEmbed(g, output, static_cast<int>(embeddingGrade), bundles, limitStructures,
267  randomDFSTree, avoidE2Minors);
268  }
269 
271 
281  bool planarEmbed(GraphCopySimple& h, SList<KuratowskiWrapper>& output, int embeddingGrade,
282  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
283  bool avoidE2Minors = true);
284 
287  BoyerMyrvoldPlanar::EmbeddingGrade embeddingGrade =
289  bool bundles = false, bool limitStructures = false, bool randomDFSTree = false,
290  bool avoidE2Minors = true) {
291  return planarEmbed(h, output, static_cast<int>(embeddingGrade), bundles, limitStructures,
292  randomDFSTree, avoidE2Minors);
293  }
294 };
295 
296 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
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:178
Graph.h
Includes declaration of graph class.
BoyerMyrvoldPlanar.h
Declaration of the class BoyerMyrvoldPlanar.
ogdf::KuratowskiWrapper
Wrapper-class for Kuratowski Subdivisions containing the minortype and edgelist.
Definition: ExtractKuratowskis.h:47
ogdf::BoyerMyrvold::planarEmbedPlanarGraph
virtual bool planarEmbedPlanarGraph(Graph &G) override
Constructs a planar embedding of G. G has to be planar!
Definition: BoyerMyrvold.h:192
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:845
ogdf::BoyerMyrvold::pBMP
BoyerMyrvoldPlanar * pBMP
Class BoyerMyrvoldPlanar on heap.
Definition: BoyerMyrvold.h:142
ogdf::isPlanar
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
Definition: extended_graph_alg.h:284
ogdf::BoyerMyrvold::BoyerMyrvold
BoyerMyrvold()
Constructor.
Definition: BoyerMyrvold.h:155
ogdf::GraphCopySimple
Copies of graphs with mapping between nodes and edges.
Definition: GraphCopy.h:261
ExtractKuratowskis.h
Declaration of the class ExtractKuratowskis.
ogdf::KuratowskiSubdivision
Definition: KuratowskiSubdivision.h:41
ogdf::BoyerMyrvold::clear
void clear()
Deletes BoyerMyrvoldPlanar on heap.
Definition: BoyerMyrvold.h:145
PlanarityModule.h
Declaration of PlanarityModule.
ogdf::BoyerMyrvoldPlanar::EmbeddingGrade
EmbeddingGrade
Denotes the different embedding options.
Definition: BoyerMyrvoldPlanar.h:80
SList.h
Declaration of singly linked lists and iterators.
ogdf::BoyerMyrvold::numberOfStructures
int numberOfStructures()
The number of extracted Structures for statistical purposes.
Definition: BoyerMyrvold.h:164
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:318
ogdf::BoyerMyrvold::~BoyerMyrvold
~BoyerMyrvold()
Destructor.
Definition: BoyerMyrvold.h:161
GraphCopy.h
Declaration of graph copy classes.
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::BoyerMyrvold
Wrapper class used for preprocessing and valid invocation of the planarity test.
Definition: BoyerMyrvold.h:139
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:213
basic.h
Basic declarations, included by all source files.
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:66
ogdf::PlanarityModule
Module for planarity testing and planar embeddings.
Definition: PlanarityModule.h:47
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:235
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:286
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:261
ogdf::GraphCopyBase::original
const Graph & original() const
Returns a reference to the original graph.
Definition: GraphCopy.h:105
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::BoyerMyrvold::nOfStructures
int nOfStructures
The number of extracted Structures for statistical purposes.
Definition: BoyerMyrvold.h:151