Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ExtractKuratowskis.h
Go to the documentation of this file.
1
33#pragma once
34
37
38namespace ogdf {
39
42public:
45
47 inline bool isK33() const { return subdivisionType != SubdivisionType::E5; }
48
50 inline bool isK5() const { return subdivisionType == SubdivisionType::E5; }
51
53 enum class SubdivisionType {
54 A = 0,
55 AB = 1,
56 AC = 2,
57 AD = 3,
58 AE1 = 4,
59 AE2 = 5,
60 AE3 = 6,
61 AE4 = 7,
62 B = 8,
63 C = 9,
64 D = 10,
65 E1 = 11,
66 E2 = 12,
67 E3 = 13,
68 E4 = 14,
69 E5 = 15
70 };
73
76
79};
80
81OGDF_EXPORT std::ostream& operator<<(std::ostream& os, const KuratowskiWrapper::SubdivisionType& obj);
82
84
90public:
93
96
98 void extract(const SListPure<KuratowskiStructure>& allKuratowskis,
100
104
106 enum class KuratowskiType {
107 none = 0,
108 K33 = 1,
109 K5 = 2
110 };
111
113
120 const SListPure<edge>& list);
121
123
131#if 0
132 const NodeArray<int>& m_dfi,
133#endif
135
137 static bool isANewKuratowski(const Graph& g, const SListPure<edge>& kuratowski,
138 const SList<KuratowskiWrapper>& output);
140
142 static bool isANewKuratowski(
143#if 0
144 const Graph& g,
145#endif
146 const EdgeArray<int>& test, const SList<KuratowskiWrapper>& output);
147
148 // avoid automatic creation of assignment operator
151
152protected:
155
157 const Graph& m_g;
158
162 const bool m_avoidE2Minors;
163
165
170
173
176
179
183 for (itExtern = externPath.begin(); itExtern.valid(); ++itExtern) {
184 list.pushBack((*itExtern)->theEdge());
185 }
186 }
187
189
191 inline adjEntry adjToLowestNodeBelow(node high, int low);
192
194
196 inline void addDFSPath(SListPure<edge>& list, node bottom, node top);
198
200 inline void addDFSPathReverse(SListPure<edge>& list, node bottom, node top);
201
204
207#if 0
208 const WInfo& info,
209#endif
211 const node endnodeY, const SListPure<edge>& pathW);
214 //NodeArray<int>& nodeflags,
215 //const int nodemarker,
216 const KuratowskiStructure& k, const WInfo& info, const SListPure<edge>& pathX,
217 const node endnodeX, const SListPure<edge>& pathY, const node endnodeY,
218 const SListPure<edge>& pathW);
221 const int nodemarker, const KuratowskiStructure& k, EdgeArray<int>& flags,
222 const WInfo& info, const SListPure<edge>& pathX, const node endnodeX,
226 const WInfo& info, const SListPure<edge>& pathX, const node endnodeX,
230 const WInfo& info, const SListPure<edge>& pathX, const node endnodeX,
235 const WInfo& info, const SListPure<edge>& pathX, const node endnodeX,
240 const int nodemarker, const KuratowskiStructure& k, EdgeArray<int>& flags,
241 const WInfo& info, const SListPure<edge>& pathX, const node endnodeX,
243
245 inline bool isMinorE1(int before, bool firstXPath, bool firstYPath) const {
246 return (before == -1 && firstXPath) || (before == 1 && firstYPath);
247 }
248
251#if 0
252 const node z,
253#endif
254 const node px, const node py, const KuratowskiStructure& k, const WInfo& info,
257 const node endnodeZ);
259 inline bool checkMinorE2(bool firstWPath, bool firstWOnHighestXY) const {
261 }
262
264 inline bool isMinorE2(const node endnodeX, const node endnodeY, const node endnodeZ) const {
266 }
267
270#if 0
271 int before,
272 const node z,
273 const node px,
274 const node py,
275#endif
276 const KuratowskiStructure& k, const WInfo& info, const SListPure<edge>& pathX,
277 const node endnodeX, const SListPure<edge>& pathY, const node endnodeY,
278#if 0
279 const SListPure<edge>& pathW,
280#endif
282#if 0
283 , const node endnodeZ
284#endif
285 );
287 inline bool isMinorE3(const node endnodeX, const node endnodeY, const node endnodeZ) const {
288 return endnodeX != endnodeY
290 }
291
293 void extractMinorE3(SList<KuratowskiWrapper>& output, int before, const node z, const node px,
294 const node py, const KuratowskiStructure& k, const WInfo& info,
297 const node endnodeZ);
298
300 inline bool isMinorE4(const node px, const node py, const KuratowskiStructure& k,
301 const WInfo& info) const {
302 return (px != k.stopX && !info.pxAboveStopX) || (py != k.stopY && !info.pyAboveStopY);
303 }
304
306 void extractMinorE4(SList<KuratowskiWrapper>& output, int before, const node z, const node px,
307 const node py, const KuratowskiStructure& k, const WInfo& info,
310 const node endnodeZ);
311
313 inline bool isMinorE5(const node px, const node py, const KuratowskiStructure& k,
314 const node endnodeX, const node endnodeY, const node endnodeZ) const {
315 return px == k.stopX && py == k.stopY && k.V == k.RReal
318 || (endnodeY == endnodeZ && m_dfi[endnodeX] <= m_dfi[endnodeY]));
319 }
320
323#if 0
324 int before,
325 const node z,
326 const node px,
327 const node py,
328#endif
329 const KuratowskiStructure& k, const WInfo& info, const SListPure<edge>& pathX,
330 const node endnodeX, const SListPure<edge>& pathY, const node endnodeY,
332};
333
334}
Declaration of the class BoyerMyrvoldPlanar.
Declaration of the class FindKuratowskis.
Class for adjacency list elements.
Definition Graph_d.h:79
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
This class implements the extended BoyerMyrvold planarity embedding algorithm.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Extracts multiple Kuratowski Subdivisions.
void extractMinorA(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype A and adds it to list output.
void extractMinorEBundles(SList< KuratowskiWrapper > &output, bool firstXPath, bool firstPath, bool firstWPath, bool firstWOnHighestXY, NodeArray< int > &nodeflags, const int nodemarker, const KuratowskiStructure &k, EdgeArray< int > &flags, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype E and adds it to list output (bundles)
int m_embeddingGrade
Some parameters, see BoyerMyrvold for further instructions.
void extractMinorE1(SList< KuratowskiWrapper > &output, int before, const node px, const node py, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW, const SListPure< edge > &pathZ, const node endnodeZ)
Extracts minorsubtype E1 and adds it to list output.
void addDFSPathReverse(SListPure< edge > &list, node bottom, node top)
Adds DFS-path from node top to node bottom to list.
bool isMinorE3(const node endnodeX, const node endnodeY, const node endnodeZ) const
Checks for minortype E3.
const Array< node > & m_nodeFromDFI
Returns appropriate node from given DFI.
void extract(const SListPure< KuratowskiStructure > &allKuratowskis, SList< KuratowskiWrapper > &output)
Extracts all Kuratowski Subdivisions and adds them to output (without bundles)
BoyerMyrvoldPlanar & BMP
Link to class BoyerMyrvoldPlanar.
void extractMinorBBundles(SList< KuratowskiWrapper > &output, NodeArray< int > &nodeflags, const int nodemarker, const KuratowskiStructure &k, EdgeArray< int > &flags, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype B and adds it to list output (with bundles)
bool isMinorE4(const node px, const node py, const KuratowskiStructure &k, const WInfo &info) const
Checks for minortype E4.
ExtractKuratowskis & operator=(const ExtractKuratowskis &)
Assignment operator is undefined!
KuratowskiType
Enumeration over Kuratowski Type none, K33, K5.
@ none
no kuratowski subdivision exists
@ K33
a K3,3 subdivision exists
static bool isANewKuratowski(const Graph &g, const SListPure< edge > &kuratowski, const SList< KuratowskiWrapper > &output)
Returns true, iff the Kuratowski is not already contained in output.
void extractMinorB(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype B and adds it to list output (no bundles)
adjEntry adjToLowestNodeBelow(node high, int low)
Returns adjEntry of the edge between node high and a special node.
void extractMinorE4(SList< KuratowskiWrapper > &output, int before, const node z, const node px, const node py, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW, const SListPure< edge > &pathZ, const node endnodeZ)
Extracts minorsubtype E4 and adds it to list output.
bool isMinorE5(const node px, const node py, const KuratowskiStructure &k, const node endnodeX, const node endnodeY, const node endnodeZ) const
Checks for minortype E5 (K5)
void extractMinorD(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype D and adds it to list output.
static KuratowskiType whichKuratowski(const Graph &m_g, const NodeArray< int > &dfi, const SListPure< edge > &list)
Checks, if list forms a valid Kuratowski Subdivision and returns the type.
int m_nodeMarker
Value used as marker for visited nodes etc.
void extractBundles(const SListPure< KuratowskiStructure > &allKuratowskis, SList< KuratowskiWrapper > &output)
Extracts all Kuratowski Subdivisions and adds them to output (with bundles)
bool isMinorE1(int before, bool firstXPath, bool firstYPath) const
Checks for minortype E1.
ExtractKuratowskis(BoyerMyrvoldPlanar &bm)
Constructor.
bool checkMinorE2(bool firstWPath, bool firstWOnHighestXY) const
Checks for minortype E2 preconditions.
const NodeArray< adjEntry > & m_adjParent
The adjEntry which goes from DFS-parent to current vertex.
static KuratowskiType whichKuratowskiArray(const Graph &g, EdgeArray< int > &edgenumber)
Checks, if edges in Array edgenumber form a valid Kuratowski Subdivision and returns the type.
void extractMinorE2(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathZ)
Extracts minorsubtype E2 and adds it to list output.
const Graph & m_g
Input graph.
void addDFSPath(SListPure< edge > &list, node bottom, node top)
Adds DFS-path from node bottom to node top to list.
NodeArray< int > m_wasHere
Array maintaining visited bits on each node.
void extractMinorE5(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW, const SListPure< edge > &pathZ, const node endnodeZ)
Extracts minorsubtype E5 and adds it to list output.
const NodeArray< int > & m_dfi
The one and only DFI-NodeArray.
bool isMinorE2(const node endnodeX, const node endnodeY, const node endnodeZ) const
Checks for minortype E2.
static bool isANewKuratowski(const EdgeArray< int > &test, const SList< KuratowskiWrapper > &output)
Returns true, iff the Kuratowski is not already contained in output.
void truncateEdgelist(SListPure< edge > &list1, const SListPure< edge > &list2)
Separates list1 from edges already contained in list2.
void extractMinorE3(SList< KuratowskiWrapper > &output, int before, const node z, const node px, const node py, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW, const SListPure< edge > &pathZ, const node endnodeZ)
Extracts minorsubtype E3 and adds it to list output.
const bool m_avoidE2Minors
Some parameters, see BoyerMyrvold for further instructions.
void extractMinorE(SList< KuratowskiWrapper > &output, bool firstXPath, bool firstPath, bool firstWPath, bool firstWOnHighestXY, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype E and adds it to list output (no bundles)
void addExternalFacePath(SListPure< edge > &list, const SListPure< adjEntry > &externPath)
Adds external face edges to list.
void extractMinorC(SList< KuratowskiWrapper > &output, const KuratowskiStructure &k, const WInfo &info, const SListPure< edge > &pathX, const node endnodeX, const SListPure< edge > &pathY, const node endnodeY, const SListPure< edge > &pathW)
Extracts minortype C and adds it to list output.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
A Kuratowski Structure is a special graph structure containing severals subdivisions.
node stopX
First stopping node.
node stopY
Second stopping node.
node RReal
Real node of virtual node R.
node V
The current node to embed.
Wrapper-class for Kuratowski Subdivisions containing the minortype and edgelist.
node V
The node which was embedded while the Kuratowski Subdivision was found.
SubdivisionType
Possible minortypes of a Kuratowski Subdivision.
SubdivisionType subdivisionType
Minortype of the Kuratowski Subdivision.
bool isK33() const
Returns true, iff subdivision is a K3,3-minor.
bool isK5() const
Returns true, iff subdivision is a K5-minor.
SListPure< edge > edgeList
Contains the edges of the Kuratowski Subdivision.
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
Singly linked lists (maintaining the length of the list).
Definition SList.h:833
Encapsulates a pointer to an ogdf::SList element.
Definition SList.h:92
Singly linked lists.
Definition SList.h:179
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition SList.h:469
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Definition Array.h:978
Saves information about a pertinent node w between two stopping vertices.