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/Graph.h>
36 #include <ogdf/basic/basic.h>
37 
38 namespace ogdf {
39 template<class E>
40 class List;
41 template<class E>
42 class SList;
43 
45 public:
48 
50  FaceSinkGraph() : m_pE(nullptr) { }
51 
52  void init(const ConstCombinatorialEmbedding& E, node s);
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
108  void sinkSwitches(FaceArray<List<adjEntry>>& faceSwitches);
109 
110 private:
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
153  void dfsFST(node v, //current node
155  node parent, //parent of v
156  FaceArray< List<adjEntry> > &faceSwitches,
157  NodeArray<bool> &visited);
158 #endif
159 
164  node checkForest();
165 };
166 
167 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::FaceSinkGraph::originalGraph
const Graph & originalGraph() const
return a reference to the original graph G
Definition: FaceSinkGraph.h:55
ogdf::FaceSinkGraph::m_T
node m_T
representative of unique tree T
Definition: FaceSinkGraph.h:146
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:66
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:845
ogdf::FaceSinkGraph::faceNodeOf
node faceNodeOf(edge e)
Definition: FaceSinkGraph.h:83
ogdf::FaceSinkGraph::m_originalNode
NodeArray< node > m_originalNode
original node in G
Definition: FaceSinkGraph.h:148
ogdf::FaceSinkGraph::m_containsSource
NodeArray< bool > m_containsSource
contains face node the source ?
Definition: FaceSinkGraph.h:150
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:75
ogdf::FaceSinkGraph::m_source
node m_source
the single source
Definition: FaceSinkGraph.h:145
ogdf::FaceSinkGraph::m_originalFace
NodeArray< face > m_originalFace
original face in E
Definition: FaceSinkGraph.h:149
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::EdgeElement::adjSource
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:407
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::FaceArrayBase
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
Definition: CombinatorialEmbedding.h:181
ogdf::FaceSinkGraph::m_pE
const ConstCombinatorialEmbedding * m_pE
associated embedding of graph G
Definition: FaceSinkGraph.h:144
ogdf::ConstCombinatorialEmbedding
Combinatorial embeddings of planar graphs.
Definition: CombinatorialEmbedding.h:216
ogdf::EdgeElement::adjTarget
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:410
ogdf::graphics::init
void init()
Definition: graphics.h:450
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:62
basic.h
Basic declarations, included by all source files.
ogdf::FaceSinkGraph
Definition: FaceSinkGraph.h:44
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:70
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::FaceSinkGraph::originalEmbedding
const ConstCombinatorialEmbedding & originalEmbedding() const
returns a reference to the embedding E of the original graph G
Definition: FaceSinkGraph.h:58
ogdf::FaceSinkGraph::faceNodeOf
node faceNodeOf(face f)
Definition: FaceSinkGraph.h:88
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::FaceElement
Faces in a combinatorial embedding.
Definition: CombinatorialEmbedding.h:118
ogdf::FaceSinkGraph::FaceSinkGraph
FaceSinkGraph()
default constructor (dummy)
Definition: FaceSinkGraph.h:50