Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FaceSinkGraph.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/FaceArray.h>
36 #include <ogdf/basic/NodeArray.h>
37 #include <ogdf/basic/SList.h>
38 
39 namespace ogdf {
40 
41 
43 public:
46 
48  FaceSinkGraph() : m_pE(nullptr) { }
49 
50  void init(const ConstCombinatorialEmbedding& E, node s);
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
106  void sinkSwitches(FaceArray<List<adjEntry>>& faceSwitches);
107 
108 private:
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 
127  node dfsFaceNodeOf(node v, node parent, face f1, face f2);
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
151  void dfsFST(node v, //current node
153  node parent, //parent of v
154  FaceArray< List<adjEntry> > &faceSwitches,
155  NodeArray<bool> &visited);
156 #endif
157 
162  node checkForest();
163 };
164 
165 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::FaceSinkGraph::originalGraph
const Graph & originalGraph() const
return a reference to the original graph G
Definition: FaceSinkGraph.h:53
ogdf::FaceSinkGraph::m_T
node m_T
representative of unique tree T
Definition: FaceSinkGraph.h:144
ogdf::FaceSinkGraph::originalFace
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...
Definition: FaceSinkGraph.h:64
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:833
FaceArray.h
declaration and implementation of FaceArray class
ogdf::FaceSinkGraph::faceNodeOf
node faceNodeOf(edge e)
Definition: FaceSinkGraph.h:81
ogdf::FaceSinkGraph::m_originalNode
NodeArray< node > m_originalNode
original node in G
Definition: FaceSinkGraph.h:146
ogdf::FaceSinkGraph::m_containsSource
NodeArray< bool > m_containsSource
contains face node the source ?
Definition: FaceSinkGraph.h:148
ogdf::FaceSinkGraph::possibleExternalFaces
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...
Definition: FaceSinkGraph.h:73
SList.h
Declaration of singly linked lists and iterators.
ogdf::FaceSinkGraph::m_source
node m_source
the single source
Definition: FaceSinkGraph.h:143
ogdf::FaceSinkGraph::m_originalFace
NodeArray< face > m_originalFace
original face in E
Definition: FaceSinkGraph.h:147
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::EdgeElement::adjSource
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:400
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:172
ogdf::FaceSinkGraph::m_pE
const ConstCombinatorialEmbedding * m_pE
associated embedding of graph G
Definition: FaceSinkGraph.h:142
NodeArray.h
Declaration and implementation of NodeArray class.
ogdf::ConstCombinatorialEmbedding
Combinatorial embeddings of planar graphs.
Definition: CombinatorialEmbedding.h:207
ogdf::EdgeElement::adjTarget
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:403
ogdf::graphics::init
void init()
Definition: graphics.h:446
ogdf::FaceSinkGraph::originalNode
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 ...
Definition: FaceSinkGraph.h:60
ogdf::FaceSinkGraph
Definition: FaceSinkGraph.h:42
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::FaceSinkGraph::containsSource
bool containsSource(node v) const
Definition: FaceSinkGraph.h:68
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::FaceSinkGraph::originalEmbedding
const ConstCombinatorialEmbedding & originalEmbedding() const
returns a reference to the embedding E of the original graph G
Definition: FaceSinkGraph.h:56
ogdf::FaceSinkGraph::faceNodeOf
node faceNodeOf(face f)
Definition: FaceSinkGraph.h:86
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::FaceElement
Faces in a combinatorial embedding.
Definition: CombinatorialEmbedding.h:109
ogdf::FaceSinkGraph::FaceSinkGraph
FaceSinkGraph()
default constructor (dummy)
Definition: FaceSinkGraph.h:48