Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
FaceSinkGraph.h
Go to the documentation of this file.
1
32#pragma once
33
35#include <ogdf/basic/Graph.h>
36#include <ogdf/basic/basic.h>
37
38namespace ogdf {
39template<class E>
40class List;
41template<class E>
42class SList;
43
45public:
48
50 FaceSinkGraph() : m_pE(nullptr) { }
51
53
55 const Graph& originalGraph() const { return *m_pE; }
56
58 const ConstCombinatorialEmbedding& originalEmbedding() const { return *m_pE; }
59
62 node originalNode(node v) const { return m_originalNode[v]; }
63
66 face originalFace(node v) const { return m_originalFace[v]; }
67
68 // returns true iff node v in the face-sink graph corresponds to a
69 // face in E containing the source
70 bool containsSource(node v) const { return m_containsSource[v]; }
71
76 node v_T = checkForest();
77 if (v_T != nullptr) {
78 gatherExternalFaces(m_T, nullptr, externalFaces);
79 }
80 return v_T;
81 }
82
84 return dfsFaceNodeOf(m_T, nullptr, m_pE->rightFace(e->adjSource()),
85 m_pE->rightFace(e->adjTarget()));
86 }
87
88 node faceNodeOf(face f) { return dfsFaceNodeOf(m_T, nullptr, f, nullptr); }
89
91
93 void stAugmentation(node h, // node corresponding to external face
94 Graph& G, // original graph (not const)
95 SList<node>& augmentedNodes, // list of augmented nodes
96 SList<edge>& augmentedEdges); // list of augmented edges
97
99
101 void stAugmentation(node h, // node corresponding to external face
102 Graph& G, // original graph (not const)
103 node& superSink, // super sink
104 SList<edge>& augmentedEdges); // list of augmented edges
105
107 // the ext. face muss be set
109
110private:
112 void doInit();
113
115 bool dfsCheckForest(node v, // current node
116 node parent, // its parent in tree
117 NodeArray<bool>& visited, // not already visited ?
118 // number of internal vertices of G in current tree
119 int& nInternalVertices);
120
122
125 void gatherExternalFaces(node v, // current node
126 node parent, // its parent
127 SList<face>& externalFaces); // returns list of possible external faces
128
129 node dfsFaceNodeOf(node v, node parent, face f1, face f2);
130
131 node dfsStAugmentation(node v, // current node
132 node parent, // its parent
133 Graph& G, // original graph (not const)
134 SList<node>& augmentedNodes, // list of augmented nodes
135 SList<edge>& augmentedEdges); // list of augmented edges
136
137 node dfsStAugmentation(node v, // current node
138 node parent, // its parent
139 Graph& G, // original graph (not const)
140 SList<edge>& augmentedEdges); // list of augmented edges
141
142
147
151
152#if 0
154 void dfsFST(node v, //current node
155 node parent, //parent of v
156 FaceArray< List<adjEntry> > &faceSwitches,
157 NodeArray<bool> &visited);
158#endif
159
165};
166
167}
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Basic declarations, included by all source files.
Combinatorial embeddings of planar graphs.
Class for the representation of edges.
Definition Graph_d.h:364
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition Graph_d.h:408
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition Graph_d.h:411
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Faces in a combinatorial embedding.
void init(const ConstCombinatorialEmbedding &E, node s)
node faceNodeOf(face f)
void stAugmentation(node h, Graph &G, SList< node > &augmentedNodes, SList< edge > &augmentedEdges)
augments G to an st-planar graph (original implementation)
const Graph & originalGraph() const
return a reference to the original graph G
node dfsStAugmentation(node v, node parent, Graph &G, SList< node > &augmentedNodes, SList< edge > &augmentedEdges)
bool dfsCheckForest(node v, node parent, NodeArray< bool > &visited, int &nInternalVertices)
performs dfs-traversal and checks for backwards edges
void stAugmentation(node h, Graph &G, node &superSink, SList< edge > &augmentedEdges)
augments G to an st-planar graph
const ConstCombinatorialEmbedding & originalEmbedding() const
returns a reference to the embedding E of the original graph G
node faceNodeOf(edge e)
node checkForest()
checks if the face-sink graph is a forest with 1) there is exactly one tree T containing no internal ...
node dfsFaceNodeOf(node v, node parent, face f1, face f2)
FaceSinkGraph(const ConstCombinatorialEmbedding &E, node s)
constructor (we assume that the original graph is connected!)
node m_source
the single source
node possibleExternalFaces(SList< face > &externalFaces)
returns the list of faces f in E such that there exists an upward-planar drawing realizing E with f a...
FaceSinkGraph()
default constructor (dummy)
NodeArray< face > m_originalFace
original face in E
void sinkSwitches(FaceArray< List< adjEntry > > &faceSwitches)
compute the sink switches of all faces.
void doInit()
constructs face-sink graph
NodeArray< node > m_originalNode
original node in G
void gatherExternalFaces(node v, node parent, SList< face > &externalFaces)
builds list of possible external faces
node m_T
representative of unique tree T
node dfsStAugmentation(node v, node parent, Graph &G, SList< edge > &augmentedEdges)
node originalNode(node v) const
returns the sink-switch in G corresponding to node v in the face-sink graph, 0 if v corresponds to a ...
const ConstCombinatorialEmbedding * m_pE
associated embedding of graph G
NodeArray< bool > m_containsSource
contains face node the source ?
bool containsSource(node v) const
face originalFace(node v) const
returns the face in E corresponding to node v in the face-sink graph, 0 if v corresponds to a sink-sw...
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
Singly linked lists (maintaining the length of the list).
Definition SList.h:845
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.