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
37#include <ogdf/basic/SList.h>
38
39namespace ogdf {
40
41
43public:
46
48 FaceSinkGraph() : m_pE(nullptr) { }
49
51
53 const Graph& originalGraph() const { return *m_pE; }
54
56 const ConstCombinatorialEmbedding& originalEmbedding() const { return *m_pE; }
57
60 node originalNode(node v) const { return m_originalNode[v]; }
61
64 face originalFace(node v) const { return m_originalFace[v]; }
65
66 // returns true iff node v in the face-sink graph corresponds to a
67 // face in E containing the source
68 bool containsSource(node v) const { return m_containsSource[v]; }
69
74 node v_T = checkForest();
75 if (v_T != nullptr) {
76 gatherExternalFaces(m_T, nullptr, externalFaces);
77 }
78 return v_T;
79 }
80
82 return dfsFaceNodeOf(m_T, nullptr, m_pE->rightFace(e->adjSource()),
83 m_pE->rightFace(e->adjTarget()));
84 }
85
86 node faceNodeOf(face f) { return dfsFaceNodeOf(m_T, nullptr, f, nullptr); }
87
89
91 void stAugmentation(node h, // node corresponding to external face
92 Graph& G, // original graph (not const)
93 SList<node>& augmentedNodes, // list of augmented nodes
94 SList<edge>& augmentedEdges); // list of augmented edges
95
97
99 void stAugmentation(node h, // node corresponding to external face
100 Graph& G, // original graph (not const)
101 node& superSink, // super sink
102 SList<edge>& augmentedEdges); // list of augmented edges
103
105 // the ext. face muss be set
107
108private:
110 void doInit();
111
113 bool dfsCheckForest(node v, // current node
114 node parent, // its parent in tree
115 NodeArray<bool>& visited, // not already visited ?
116 // number of internal vertices of G in current tree
117 int& nInternalVertices);
118
120
123 void gatherExternalFaces(node v, // current node
124 node parent, // its parent
125 SList<face>& externalFaces); // returns list of possible external faces
126
128
129 node dfsStAugmentation(node v, // current node
130 node parent, // its parent
131 Graph& G, // original graph (not const)
132 SList<node>& augmentedNodes, // list of augmented nodes
133 SList<edge>& augmentedEdges); // list of augmented edges
134
135 node dfsStAugmentation(node v, // current node
136 node parent, // its parent
137 Graph& G, // original graph (not const)
138 SList<edge>& augmentedEdges); // list of augmented edges
139
140
145
149
150#if 0
152 void dfsFST(node v, //current node
153 node parent, //parent of v
155 NodeArray<bool> &visited);
156#endif
157
163};
164
165}
Declaration of CombinatorialEmbedding and face.
declaration and implementation of FaceArray class
Declaration and implementation of NodeArray class.
Declaration of singly linked lists and iterators.
Combinatorial embeddings of planar graphs.
Class for the representation of edges.
Definition Graph_d.h:300
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition Graph_d.h:344
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition Graph_d.h:347
Dynamic arrays indexed with faces of a combinatorial embedding.
Definition FaceArray.h:126
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:521
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
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
#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.