Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00044 #ifdef _MSC_VER
00045 #pragma once
00046 #endif
00047
00048 #ifndef OGDF_CCONNECT_CLUSTER_PLANAR_EMBED_H
00049 #define OGDF_CCONNECT_CLUSTER_PLANAR_EMBED_H
00050
00051
00052 #include <ogdf/internal/planarity/EmbedPQTree.h>
00053 #include <ogdf/cluster/ClusterArray.h>
00054 #include <ogdf/basic/Stack.h>
00055 #include <ogdf/internal/cluster/ClusterPQContainer.h>
00056
00057 namespace ogdf {
00058
00059 class OGDF_EXPORT CconnectClusterPlanarEmbed {
00060
00061
00062 public:
00063
00064
00065 enum ccErrorCode {none = 0,
00066 nonConnected = 1,
00067 nonCConnected = 2,
00068 nonPlanar = 3,
00069 nonCPlanar = 4
00070 };
00071 ccErrorCode errCode() {return m_errorCode;}
00072
00073
00074
00075
00076 CconnectClusterPlanarEmbed();
00077
00078
00079 virtual ~CconnectClusterPlanarEmbed();
00080
00081
00082 virtual bool embed(ClusterGraph &C,Graph &G);
00083
00084
00085
00086 virtual bool embed(ClusterGraph &C,Graph &G, char (&code)[124]);
00087
00088
00089 private:
00090
00091 bool planarityTest(ClusterGraph &C,
00092 cluster &act,
00093 Graph &G);
00094
00095 bool preProcess(ClusterGraph &Ccopy,Graph &Gcopy);
00096
00097 bool preparation(Graph &subGraph,cluster &origCluster,node superSink);
00098
00099 bool doEmbed(Graph *biconComp,
00100 NodeArray<int> &numbering,
00101 cluster &origCluster,
00102 node superSink,
00103 Graph &subGraph,
00104 EdgeArray<edge> &tableEdgesBiComp2SubGraph,
00105 EdgeArray<edge> &tableEdgesSubGraph2BiComp,
00106 NodeArray<node> &tableNodesBiComp2SubGraph);
00107
00108
00109
00110
00111 void entireEmbed(Graph &biconComp,
00112 NodeArray<SListPure<adjEntry> > &entireEmbedding,
00113 NodeArray<SListIterator<adjEntry> > &adjMarker,
00114 NodeArray<bool> &mark,
00115 node v);
00116
00117 void recursiveEmbed(ClusterGraph &Ccopy,Graph &Gcopy);
00118
00119 void prepareParallelEdges(Graph &G);
00120
00121
00122 void constructWheelGraph(ClusterGraph &C,
00123 Graph &G,
00124 cluster &parent,
00125 cluster &origCl,
00126 EmbedPQTree* T,
00127 EdgeArray<node> &outgoingTable,
00128 node superSink);
00129
00130 void hubControl(Graph &G,NodeArray<bool> &hubs);
00131
00132 void nonPlanarCleanup(ClusterGraph &Ccopy,Graph &Gcopy);
00133
00134 void copyEmbedding(ClusterGraph &Ccopy,Graph &Gcopy,ClusterGraph &C,Graph &G);
00135
00136
00137
00138
00139
00140
00141
00142
00143 ClusterArray<EmbedPQTree*> m_clusterPQTree;
00144
00145
00146 ccErrorCode m_errorCode;
00147
00148
00149 char errorCode[124];
00150
00151
00152
00153 EdgeArray<ListPure<edge> > m_parallelEdges;
00154 EdgeArray<bool> m_isParallel;
00155 int m_parallelCount;
00156
00157
00158
00159
00160
00161
00162
00163 ClusterGraph *m_instance;
00164
00165
00166
00167
00168
00169
00170
00171 ClusterArray<NodeArray<SListPure<adjEntry> >*> m_clusterEmbedding;
00172
00173
00174
00175
00176 ClusterArray<Graph*> m_clusterSubgraph;
00177
00178
00179
00180
00181
00182 ClusterArray<NodeArray<bool> *> m_clusterSubgraphHubs;
00183
00184
00185
00186
00187
00188
00189
00190 ClusterArray<NodeArray<cluster> *> m_clusterSubgraphWheelGraph;
00191
00192
00193
00194
00195 ClusterArray<NodeArray<node> *> m_clusterNodeTableNew2Orig;
00196
00197
00198 ClusterArray<ClusterGraph*> m_clusterClusterGraph;
00199 ClusterArray<ClusterArray<cluster>*>m_clusterClusterTableOrig2New;
00200
00201
00202
00203
00204 NodeArray<cluster> m_wheelGraphNodes;
00205
00206
00207
00208
00209 NodeArray<bool> m_currentHubs;
00210
00211
00212
00213
00214
00215 ClusterArray<cluster> m_clusterTableCopy2Orig;
00216
00217
00218 ClusterArray<cluster> m_clusterTableOrig2Copy;
00219
00220
00221 ClusterArray<node> m_clusterSuperSink;
00222
00223
00224
00225
00226
00227
00228 NodeArray<node> m_nodeTableCopy2Orig;
00229
00230
00231 NodeArray<node> m_nodeTableOrig2Copy;
00232
00233
00234 EdgeArray<Stack<edge>*> m_outgoingEdgesAnker;
00235 ClusterArray<EdgeArray<Stack<edge>*>*> m_clusterOutgoingEdgesAnker;
00236
00237
00238
00239 ClusterArray<ClusterPQContainer> m_clusterPQContainer;
00240
00241
00242
00243
00244 Stack<cluster> m_callStack;
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 ClusterArray<bool> m_unsatisfiedCluster;
00255
00256
00257 };
00258
00259 }
00260
00261
00262 #endif