Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

FaceSinkGraph.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/NodeArray.h>
36 #include <ogdf/basic/FaceArray.h>
37 #include <ogdf/basic/SList.h>
38 
39 
40 namespace ogdf {
41 
42 
44 {
45 public:
48 
50  FaceSinkGraph() : m_pE(nullptr) { }
51 
52 
53  void init(const ConstCombinatorialEmbedding &E, node s);
54 
55 
57  const Graph &originalGraph() const {
58  return *m_pE;
59  }
60 
63  return *m_pE;
64  }
65 
68  node originalNode(node v) const {
69  return m_originalNode[v];
70  }
71 
74  face originalFace(node v) const {
75  return m_originalFace[v];
76  }
77 
78  // returns true iff node v in the face-sink graph corresponds to a
79  // face in E containing the source
80  bool containsSource(node v) const {
81  return m_containsSource[v];
82  }
83 
84 
85 
86 
91  node v_T = checkForest();
92  if (v_T != nullptr)
93  gatherExternalFaces(m_T,nullptr,externalFaces);
94  return v_T;
95  }
96 
97 
99  return dfsFaceNodeOf(m_T,nullptr,
100  m_pE->rightFace(e->adjSource()),m_pE->rightFace(e->adjTarget()));
101  }
102 
103 
105  return dfsFaceNodeOf(m_T,nullptr,f,nullptr);
106  }
107 
108 
110 
112  void stAugmentation(
113  node h, // node corresponding to external face
114  Graph &G, // original graph (not const)
115  SList<node> &augmentedNodes, // list of augmented nodes
116  SList<edge> &augmentedEdges); // list of augmented edges
117 
119 
121  void stAugmentation(
122  node h, // node corresponding to external face
123  Graph &G, // original graph (not const)
124  node &superSink, // super sink
125  SList<edge> &augmentedEdges); // list of augmented edges
126 
128  // the ext. face muss be set
129  void sinkSwitches(FaceArray< List<adjEntry> > &faceSwitches);
130 
131 
132 
133 private:
135  void doInit();
136 
138  bool dfsCheckForest(
139  node v, // current node
140  node parent, // its parent in tree
141  NodeArray<bool> &visited, // not already visited ?
142  // number of internal vertices of G in current tree
143  int &nInternalVertices);
144 
146 
149  void gatherExternalFaces(
150  node v, // current node
151  node parent, // its parent
152  SList<face> &externalFaces); // returns list of possible external faces
153 
154  node dfsFaceNodeOf(node v, node parent,face f1, face f2);
155 
156  node dfsStAugmentation(
157  node v, // current node
158  node parent, // its parent
159  Graph &G, // original graph (not const)
160  SList<node> &augmentedNodes, // list of augmented nodes
161  SList<edge> &augmentedEdges); // list of augmented edges
162 
163  node dfsStAugmentation(
164  node v, // current node
165  node parent, // its parent
166  Graph &G, // original graph (not const)
167  SList<edge> &augmentedEdges); // list of augmented edges
168 
169 
174 
178 
179 #if 0
180  void dfsFST(node v, //current node
182  node parent, //parent of v
183  FaceArray< List<adjEntry> > &faceSwitches,
184  NodeArray<bool> &visited);
185 #endif
186 
191  node checkForest();
192 
193 
194 }; // class FaceSinkGraph
195 
196 
197 } // end namespace ogdf
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:74
Declaration of singly linked lists and iterators.
FaceSinkGraph()
default constructor (dummy)
Definition: FaceSinkGraph.h:50
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:330
bool containsSource(node v) const
Definition: FaceSinkGraph.h:80
Combinatorial embeddings of planar graphs.
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:68
node m_T
representative of unique tree T
const Graph & originalGraph() const
return a reference to the original graph G
Definition: FaceSinkGraph.h:57
declaration and implementation of FaceArray class
Declaration of CombinatorialEmbedding and face.
Singly linked lists (maintaining the length of the list).
Definition: SList.h:777
const ConstCombinatorialEmbedding & originalEmbedding() const
returns a reference to the embedding E of the original graph G
Definition: FaceSinkGraph.h:62
node faceNodeOf(face f)
Dynamic arrays indexed with faces of a combinatorial embedding.
NodeArray< bool > m_containsSource
contains face node the source ?
node faceNodeOf(edge e)
Definition: FaceSinkGraph.h:98
node m_source
the single source
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
Faces in a combinatorial embedding.
Class for the representation of edges.
Definition: Graph_d.h:291
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration and implementation of NodeArray class.
const ConstCombinatorialEmbedding * m_pE
associated embedding of graph G
NodeArray< face > m_originalFace
original face in E
NodeArray< node > m_originalNode
original node in G
The namespace for all OGDF objects.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:332
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:90