Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FindKuratowskis.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/ArrayBuffer.h>
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/basic.h>
39 
40 namespace ogdf {
41 class BoyerMyrvoldPlanar;
42 enum class BoyerMyrvoldEdgeType;
43 template<class E>
44 class ListPure;
45 
52 struct ExternE {
57 };
58 
60 
62 struct WInfo {
64 
66  enum class MinorType {
67  A = 0x0001, // minor A
68  B = 0x0002, // minor B
69  C = 0x0004, // minor C
70  D = 0x0008, // minor D
71  E = 0x0010 // minor E
72  };
73  int minorType;
74 
77 
80 
82 
86 };
87 
88 inline int operator&(int lhs, WInfo::MinorType rhs) { return lhs & static_cast<int>(rhs); }
89 
90 inline int operator|=(int& lhs, WInfo::MinorType rhs) {
91  lhs |= static_cast<int>(rhs);
92  return lhs;
93 }
94 
97  friend class FindKuratowskis;
98  friend class ExtractKuratowskis;
99 
100 public:
103 
106 
109 
112  copy(orig);
113  return *this;
114  }
115 
117  void clear();
118 
122  int V_DFI;
123 
127 
134 
135 protected:
137 
141 
143 
148 
151 
154 
157 
160 
162 
165 
168 
177 
179  void copy(const KuratowskiStructure& orig);
181  void copyPointer(const KuratowskiStructure& orig, SListPure<WInfo>& list);
182 };
183 
185 
188 public:
190  explicit FindKuratowskis(BoyerMyrvoldPlanar* bm);
191 
194 
196  void addKuratowskiStructure(const node currentNode, const node root, const node stopx,
197  const node stopy);
198 
201 
204  return allKuratowskis;
205  }
206 
207  FindKuratowskis& operator=(const FindKuratowskis&) = delete;
208 
209 protected:
212 
215 
217  const int& m_embeddingGrade;
218 
220  const bool m_bundles;
221 
224 
227 
230 
232 
237 
239 
242 
245 
248 
250 
252  const NodeArray<adjEntry> (&m_link)[2];
253 
256 
258 
261 
264 
267 
270 
272 
275 
278 
285 
287 
291 
294 
296  node findRoot(node stopX) const;
297 
299  void extractHighestFacePath(ArrayBuffer<adjEntry>& highestFacePath, int marker);
300 
302  void extractExternalFacePath(SListPure<adjEntry>& externalFacePath,
303  const ArrayBuffer<adjEntry>& highestFacePath, int marker, int highMarker);
304 
306  void splitInMinorTypes(const SListPure<adjEntry>& externalFacePath, int marker);
307 
309  void extractExternalSubgraph(const node stop, int root, SListPure<int>& externalStartnodes,
310  SListPure<node>& externalEndnodes);
312  void extractExternalSubgraphBundles(const node stop, int root,
313  SListPure<edge>& externalSubgraph, int nodeMarker);
314 
316 #if 1
318 #else
319  void extractPertinentSubgraph(SListPure<WInfo>& W_All, const node V);
320 #endif
321 
323  void extractPertinentSubgraphBundles(const SListPure<WInfo>& W_All, const node V,
324  SListPure<edge>& pertinentSubgraph, int nodeMarker);
325 };
326 
327 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::KuratowskiStructure
A Kuratowski Structure is a special graph structure containing severals subdivisions.
Definition: FindKuratowskis.h:96
ogdf::WInfo::minorType
int minorType
Definition: FindKuratowskis.h:73
ogdf::FindKuratowskis::findRoot
node findRoot(node stopX) const
Finds root node of the bicomp containing the stopping node stopX.
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
Graph.h
Includes declaration of graph class.
ogdf::WInfo::externEEnd
SListIterator< ExternE > externEEnd
Definition: FindKuratowskis.h:84
ogdf::FindKuratowskis::extractPertinentSubgraphBundles
void extractPertinentSubgraphBundles(const SListPure< WInfo > &W_All, const node V, SListPure< edge > &pertinentSubgraph, int nodeMarker)
Extracts pertinent subgraph from all wNodes to V (with bundles)
ogdf::FindKuratowskis::extractHighestFacePath
void extractHighestFacePath(ArrayBuffer< adjEntry > &highestFacePath, int marker)
Extracts the highestFace Path of the bicomp containing both stopping nodes.
ogdf::FindKuratowskis::~FindKuratowskis
~FindKuratowskis()
Destructor.
Definition: FindKuratowskis.h:193
ogdf::FindKuratowskis::m_getWInfo
NodeArray< WInfo * > m_getWInfo
Links appropriate WInfo to node.
Definition: FindKuratowskis.h:223
ogdf::KuratowskiStructure::externE
SListPure< ExternE > externE
List of externally active nodes strictly between x and y for minortypes B and E.
Definition: FindKuratowskis.h:167
ogdf::KuratowskiStructure::stopY
node stopY
Second stopping node.
Definition: FindKuratowskis.h:133
ogdf::FindKuratowskis::m_leastAncestor
const NodeArray< int > & m_leastAncestor
The DFI of the least ancestor node over all backedges.
Definition: FindKuratowskis.h:260
ogdf::KuratowskiStructure::stopX
node stopX
First stopping node.
Definition: FindKuratowskis.h:131
ogdf::WInfo::pertinentPaths
SListPure< SListPure< edge > > pertinentPaths
Definition: FindKuratowskis.h:81
ogdf::FindKuratowskis::operator=
FindKuratowskis & operator=(const FindKuratowskis &)=delete
ogdf::FindKuratowskis::m_adjParent
const NodeArray< adjEntry > & m_adjParent
The adjEntry which goes from DFS-parent to current vertex.
Definition: FindKuratowskis.h:255
ogdf::KuratowskiStructure::zPaths
SListPure< ArrayBuffer< adjEntry > > zPaths
A path from the zNode in minortype D to node V for each highest XY-Path.
Definition: FindKuratowskis.h:164
ogdf::KuratowskiStructure::operator=
KuratowskiStructure & operator=(const KuratowskiStructure &orig)
Assignment.
Definition: FindKuratowskis.h:111
ogdf::FindKuratowskis::splitInMinorTypes
void splitInMinorTypes(const SListPure< adjEntry > &externalFacePath, int marker)
Assign pertinent nodes to the different minortypes and extracts inner externalPaths.
ogdf::KuratowskiStructure::stopXEndnodes
SListPure< node > stopXEndnodes
List of all endnodes of paths starting at stopX (only without bundles)
Definition: FindKuratowskis.h:174
ogdf::WInfo::MinorType::B
@ B
ogdf::SListIteratorBase
Encapsulates a pointer to an ogdf::SList element.
Definition: SList.h:50
ogdf::WInfo::MinorType::A
@ A
ogdf::ExternE::endnodes
SListPure< node > endnodes
Definition: FindKuratowskis.h:55
ogdf::WInfo::pxAboveStopX
bool pxAboveStopX
Definition: FindKuratowskis.h:78
ogdf::FindKuratowskis::extractExternalSubgraph
void extractExternalSubgraph(const node stop, int root, SListPure< int > &externalStartnodes, SListPure< node > &externalEndnodes)
Extracts external subgraph from node stop to ancestors of node with DFI root (without bundles)
ogdf::operator&
int operator&(int lhs, UMLOpt rhs)
Definition: OrthoRep.h:65
ogdf::KuratowskiStructure::wNodes
SListPure< WInfo > wNodes
Holds information about all pertinent nodes w of the bicomp containing V.
Definition: FindKuratowskis.h:140
ogdf::WInfo::pyAboveStopY
bool pyAboveStopY
Definition: FindKuratowskis.h:79
ogdf::WInfo::MinorType
MinorType
All possible base minortypes on w.
Definition: FindKuratowskis.h:66
ogdf::FindKuratowskis::m_bundles
const bool m_bundles
If true, bundles are extracted, otherwise single paths?
Definition: FindKuratowskis.h:220
ogdf::FindKuratowskis::getAllKuratowskis
SListPure< KuratowskiStructure > & getAllKuratowskis()
Get-method for the list of all KuratowskiStructures.
Definition: FindKuratowskis.h:200
ogdf::WInfo::highestXYPath
ArrayBuffer< adjEntry > * highestXYPath
Definition: FindKuratowskis.h:75
ogdf::ExternE::theNode
node theNode
Definition: FindKuratowskis.h:53
ogdf::WInfo::firstExternEAfterW
node firstExternEAfterW
Definition: FindKuratowskis.h:85
ogdf::WInfo::w
node w
Definition: FindKuratowskis.h:63
ogdf::FindKuratowskis::pBM
BoyerMyrvoldPlanar * pBM
Link to class BoyerMyrvoldPlanar.
Definition: FindKuratowskis.h:211
ogdf::KuratowskiStructure::V_DFI
int V_DFI
DFI of the current node to embed.
Definition: FindKuratowskis.h:122
ogdf::WInfo::MinorType::C
@ C
ogdf::FindKuratowskis::m_nodeMarker
int m_nodeMarker
Value used as marker for visited nodes etc.
Definition: FindKuratowskis.h:234
ogdf::KuratowskiStructure::externalSubgraph
SListPure< edge > externalSubgraph
A list of all edges in all externally active paths (bundles only)
Definition: FindKuratowskis.h:156
ogdf::KuratowskiStructure::highestFacePath
ArrayBuffer< adjEntry > highestFacePath
The whole highestFacePath of the bicomp containing V.
Definition: FindKuratowskis.h:147
Minisat::Internal::copy
static void copy(const T &from, T &to)
Definition: Alg.h:61
ogdf::KuratowskiStructure::stopYStartnodes
SListPure< int > stopYStartnodes
List of all virtual startnodes of paths starting at stopY (only without bundles)
Definition: FindKuratowskis.h:172
ogdf::operator|=
unsigned int operator|=(unsigned int &i, CPUFeatureMask fm)
ogdf::FindKuratowskis::m_nodeFromDFI
const Array< node > & m_nodeFromDFI
Returns appropriate node from given DFI.
Definition: FindKuratowskis.h:247
SList.h
Declaration of singly linked lists and iterators.
ogdf::FindKuratowskis::extractExternalFacePath
void extractExternalFacePath(SListPure< adjEntry > &externalFacePath, const ArrayBuffer< adjEntry > &highestFacePath, int marker, int highMarker)
Extracts externalFacePath in direction CCW and splits highestFacePath in highestXYPaths.
ogdf::Array< node >
ogdf::ExternE
List of externally active nodes strictly between x and y for minortypes B and E
Definition: FindKuratowskis.h:52
ogdf::FindKuratowskis::m_highestSubtreeDFI
const NodeArray< int > & m_highestSubtreeDFI
The highest DFI in a subtree with node as root.
Definition: FindKuratowskis.h:269
ogdf::KuratowskiStructure::~KuratowskiStructure
~KuratowskiStructure()
Destructor.
Definition: FindKuratowskis.h:105
ogdf::FindKuratowskis::k
KuratowskiStructure k
Current Kuratowski Structure.
Definition: FindKuratowskis.h:229
ogdf::FindKuratowskis::m_pertinentRoots
NodeArray< SListPure< node > > & m_pertinentRoots
List of virtual bicomp roots, that are pertinent to the current embedded node.
Definition: FindKuratowskis.h:293
ogdf::FindKuratowskis::m_dfi
const NodeArray< int > & m_dfi
The one and only DFI-NodeArray.
Definition: FindKuratowskis.h:244
ogdf::FindKuratowskis::addKuratowskiStructure
void addKuratowskiStructure(const node currentNode, const node root, const node stopx, const node stopy)
Adds Kuratowski Structure on current node with root root and stopping nodes stopx and stopy.
ogdf::SListPure< int >
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::FindKuratowskis::allKuratowskis
SListPure< KuratowskiStructure > allKuratowskis
List of all Kuratowski Structures.
Definition: FindKuratowskis.h:226
ogdf::FindKuratowskis::m_lowPoint
NodeArray< int > & m_lowPoint
The lowpoint of each node.
Definition: FindKuratowskis.h:266
ogdf::FindKuratowskis::extractPertinentSubgraph
void extractPertinentSubgraph(SListPure< WInfo > &W_All)
Extracts pertinent subgraph from all wNodes to V (without bundles)
ogdf::KuratowskiStructure::highestXYPaths
SListPure< ArrayBuffer< adjEntry > > highestXYPaths
The appropriate paths of the highestFacePath for each wNode.
Definition: FindKuratowskis.h:150
ogdf::FindKuratowskis::m_embeddingGrade
const int & m_embeddingGrade
The embedding grade.
Definition: FindKuratowskis.h:217
ogdf::KuratowskiStructure::R
node R
The root of the bicomp containing stopX and stopY.
Definition: FindKuratowskis.h:125
ogdf::FindKuratowskis::getAllKuratowskis
const SListPure< KuratowskiStructure > & getAllKuratowskis() const
Constant get-method for the list of all KuratowskiStructures.
Definition: FindKuratowskis.h:203
basic.h
Basic declarations, included by all source files.
ogdf::KuratowskiStructure::KuratowskiStructure
KuratowskiStructure(const KuratowskiStructure &orig)
Copy constructor.
Definition: FindKuratowskis.h:108
ogdf::FindKuratowskis::m_backedgeFlags
NodeArray< SListPure< adjEntry > > & m_backedgeFlags
Holds information, if node is the source of a backedge.
Definition: FindKuratowskis.h:290
ogdf::KuratowskiStructure::stopXStartnodes
SListPure< int > stopXStartnodes
List of all virtual startnodes of paths starting at stopX (only without bundles)
Definition: FindKuratowskis.h:170
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::FindKuratowskis::m_g
Graph & m_g
Input graph.
Definition: FindKuratowskis.h:214
ogdf::FindKuratowskis::FindKuratowskis
FindKuratowskis(BoyerMyrvoldPlanar *bm)
Constructor.
ogdf::FindKuratowskis::m_wasHere
NodeArray< int > m_wasHere
Array maintaining visited bits on each node.
Definition: FindKuratowskis.h:236
ogdf::WInfo::MinorType::D
@ D
ogdf::FindKuratowskis
This class collects information about Kuratowski Subdivisions which is used for extraction later.
Definition: FindKuratowskis.h:187
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::BoyerMyrvoldPlanar
This class implements the extended BoyerMyrvold planarity embedding algorithm.
Definition: BoyerMyrvoldPlanar.h:66
ogdf::FindKuratowskis::m_separatedDFSChildList
const NodeArray< ListPure< node > > & m_separatedDFSChildList
A list to all separated DFS-children of node.
Definition: FindKuratowskis.h:274
ogdf::KuratowskiStructure::RReal
node RReal
Real node of virtual node R.
Definition: FindKuratowskis.h:129
ogdf::KuratowskiStructure::pertinentSubgraph
SListPure< edge > pertinentSubgraph
A list of all edges in pertinent paths (bundles only)
Definition: FindKuratowskis.h:159
ogdf::FindKuratowskis::m_pointsToRoot
const EdgeArray< node > & m_pointsToRoot
Identifies the rootnode of the child bicomp the given backedge points to.
Definition: FindKuratowskis.h:277
ogdf::BoyerMyrvoldEdgeType
BoyerMyrvoldEdgeType
Type of edge.
Definition: BoyerMyrvoldPlanar.h:49
ogdf::KuratowskiStructure::stopYEndnodes
SListPure< node > stopYEndnodes
List of all endnodes of paths starting at stopY (only without bundles)
Definition: FindKuratowskis.h:176
ogdf::KuratowskiStructure::V
node V
The current node to embed.
Definition: FindKuratowskis.h:120
ogdf::FindKuratowskis::m_numUnembeddedBackedgesInBicomp
NodeArray< int > & m_numUnembeddedBackedgesInBicomp
Stores for each (virtual) bicomp root how many backedges to its bicomp still have to be embedded.
Definition: FindKuratowskis.h:284
ogdf::FindKuratowskis::m_realVertex
const NodeArray< node > & m_realVertex
Link to non-virtual vertex of a virtual Vertex.
Definition: FindKuratowskis.h:241
ogdf::KuratowskiStructure::externalFacePath
SListPure< adjEntry > externalFacePath
External face path of bicomp containing V in direction CCW.
Definition: FindKuratowskis.h:153
ogdf::WInfo::zPath
ArrayBuffer< adjEntry > * zPath
Definition: FindKuratowskis.h:76
ogdf::WInfo::MinorType::E
@ E
ogdf::WInfo::externEStart
SListIterator< ExternE > externEStart
Definition: FindKuratowskis.h:83
ogdf::ExtractKuratowskis
Extracts multiple Kuratowski Subdivisions.
Definition: ExtractKuratowskis.h:95
ogdf::FindKuratowskis::extractExternalSubgraphBundles
void extractExternalSubgraphBundles(const node stop, int root, SListPure< edge > &externalSubgraph, int nodeMarker)
Extracts external subgraph from node stop to ancestors of node with DFI root (with bundles)
ogdf::ExternE::startnodes
SListPure< int > startnodes
Definition: FindKuratowskis.h:54
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::WInfo
Saves information about a pertinent node w between two stopping vertices.
Definition: FindKuratowskis.h:62
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::ExternE::externalPaths
SListPure< SListPure< edge > > externalPaths
Definition: FindKuratowskis.h:56
ogdf::KuratowskiStructure::KuratowskiStructure
KuratowskiStructure()
Constructor.
Definition: FindKuratowskis.h:102
ogdf::FindKuratowskis::m_edgeType
EdgeArray< BoyerMyrvoldEdgeType > & m_edgeType
Contains the type of each edge.
Definition: FindKuratowskis.h:263