Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00042 #ifdef _MSC_VER
00043 #pragma once
00044 #endif
00045
00046 #ifndef OGDF_FACE_SINK_GRAPH_H
00047 #define OGDF_FACE_SINK_GRAPH_H
00048
00049
00050 #include <ogdf/basic/CombinatorialEmbedding.h>
00051 #include <ogdf/basic/NodeArray.h>
00052 #include <ogdf/basic/FaceArray.h>
00053 #include <ogdf/basic/SList.h>
00054
00055
00056 namespace ogdf {
00057
00058
00059 class OGDF_EXPORT FaceSinkGraph : public Graph
00060 {
00061 public:
00063 FaceSinkGraph(const ConstCombinatorialEmbedding &E, node s);
00064
00066 FaceSinkGraph() : m_pE(0) { }
00067
00068
00069 void init(const ConstCombinatorialEmbedding &E, node s);
00070
00071
00073 const Graph &originalGraph() const {
00074 return *m_pE;
00075 }
00076
00078 const ConstCombinatorialEmbedding &originalEmbedding() const {
00079 return *m_pE;
00080 }
00081
00084 node originalNode(node v) const {
00085 return m_originalNode[v];
00086 }
00087
00090 face originalFace(node v) const {
00091 return m_originalFace[v];
00092 }
00093
00094
00095
00096 bool containsSource(node v) const {
00097 return m_containsSource[v];
00098 }
00099
00100
00101
00102
00106 node possibleExternalFaces(SList<face> &externalFaces) {
00107 node v_T = checkForest();
00108 if (v_T != 0)
00109 gatherExternalFaces(m_T,0,externalFaces);
00110 return v_T;
00111 }
00112
00113
00114 node faceNodeOf(edge e) {
00115 return dfsFaceNodeOf(m_T,0,
00116 m_pE->rightFace(e->adjSource()),m_pE->rightFace(e->adjTarget()));
00117 }
00118
00119
00120 node faceNodeOf(face f) {
00121 return dfsFaceNodeOf(m_T,0,f,0);
00122 }
00123
00124
00126
00128 void stAugmentation(
00129 node h,
00130 Graph &G,
00131 SList<node> &augmentedNodes,
00132 SList<edge> &augmentedEdges);
00133
00135
00137 void stAugmentation(
00138 node h,
00139 Graph &G,
00140 node &superSink,
00141 SList<edge> &augmentedEdges);
00142
00144
00145 void sinkSwitches(FaceArray< List<adjEntry> > &faceSwitches);
00146
00147
00148
00149 private:
00151 void doInit();
00152
00154 bool dfsCheckForest(
00155 node v,
00156 node parent,
00157 NodeArray<bool> &visited,
00158
00159 int &nInternalVertices);
00160
00162
00165 void gatherExternalFaces(
00166 node v,
00167 node parent,
00168 SList<face> &externalFaces);
00169
00170 node dfsFaceNodeOf(node v, node parent,face f1, face f2);
00171
00172 node dfsStAugmentation(
00173 node v,
00174 node parent,
00175 Graph &G,
00176 SList<node> &augmentedNodes,
00177 SList<edge> &augmentedEdges);
00178
00179 node dfsStAugmentation(
00180 node v,
00181 node parent,
00182 Graph &G,
00183 SList<edge> &augmentedEdges);
00184
00185
00187 const ConstCombinatorialEmbedding *m_pE;
00188 node m_source;
00189 node m_T;
00190
00191 NodeArray<node> m_originalNode;
00192 NodeArray<face> m_originalFace;
00193 NodeArray<bool> m_containsSource;
00194
00195
00197
00198
00199
00200
00201
00202
00207 node checkForest();
00208
00209
00211 adjEntry getAdjEntry(node v, face f);
00212
00213
00214 };
00215
00216
00217 }
00218
00219
00220 #endif