Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

CconnectClusterPlanarEmbed.h
Go to the documentation of this file.
1 
34 #pragma once
35 
39 
40 namespace ogdf {
41 
43 
47 {
48 public:
49  enum class ErrorCode {
50  none = 0,
51  nonConnected = 1,
52  nonCConnected = 2,
53  nonPlanar = 3,
54  nonCPlanar = 4
55  };
56 
57  ErrorCode errCode() { return m_errorCode; }
58 
61 
63  virtual ~CconnectClusterPlanarEmbed();
64 
66  virtual bool embed(ClusterGraph &C,Graph &G);
67 
68 private:
70 
71  bool planarityTest(ClusterGraph &C, const cluster act, Graph &G);
72 
73  bool preProcess(ClusterGraph &Ccopy,Graph &Gcopy);
74 
75  bool preparation(Graph &subGraph, const cluster origCluster, node superSink);
76 
77  bool doEmbed(
78  Graph *biconComp,
79  NodeArray<int> &numbering,
80  const cluster origCluster,
81  node superSink,
82  Graph &subGraph,
83  EdgeArray<edge> &tableEdgesBiComp2SubGraph,
84  EdgeArray<edge> &tableEdgesSubGraph2BiComp,
85  NodeArray<node> &tableNodesBiComp2SubGraph);
86 
87  void entireEmbed(
88  Graph &biconComp,
89  NodeArray<SListPure<adjEntry> > &entireEmbedding,
91  NodeArray<bool> &mark,
92  node v);
93 
94  void recursiveEmbed(ClusterGraph &Ccopy,Graph &Gcopy);
95 
96  void prepareParallelEdges(Graph &G);
97 
98 
99  void constructWheelGraph(
100  ClusterGraph &C,
101  Graph &G,
102  cluster &parent,
103  cluster &origCl,
104  EmbedPQTree* T,
105  EdgeArray<node> &outgoingTable,
106  node superSink);
107 
108  void hubControl(Graph &G,NodeArray<bool> &hubs);
109 
110  void nonPlanarCleanup(ClusterGraph &Ccopy,Graph &Gcopy);
111 
112  void copyEmbedding(ClusterGraph &Ccopy,Graph &Gcopy,ClusterGraph &C,Graph &G);
113 
116 
117  // Stores for every cluster the PQTree corresponding
118  // to the biconnected component containing the outgoing
119  // edges of the cluster.
121 
122  //save errorcode for postprocessing if not c-planar
124 
131 
135 
136  ClusterGraph *m_instance; //The graph that has to be embedded
137 
138 
139  // Stores for every cluster the (partial) embedding of the
140  // biconnected components not having outgoing
141  // edges of the cluster.
142  // The NodeArrays are associated with the subgraphs.
143  // The ClusterArray is associtated with the original graph.
145 
146  // Stores for every cluster the subgraph constructed to test
147  // the planarity of the cluster
148  // The ClusterArray is associated with the original graph.
150 
151  // Marks for every subgraph of a cluster the nodes that are
152  // hubs as true.
153  // The NodeArrays are associated with the subgraphs.
154  // The ClusterArray is associated with the original graph.
156 
157 
158  // Stores for every node of every subgraph of a cluster
159  // if this node belongs to a wheel graph, corresponding to
160  // a child cluster
161  // The NodeArrays are associated with the subgraphs.
162  // The ClusterArray is associated with the original graph.
164 
165 
166  // Stores for every mode of every subgraph of a cluster its
167  // corresponding node on the original graph G, if there exists one.
169 
170 
173 
174  // When constructing a wheel graph, we store here for
175  // every wheel graph node the corresponding cluster
176  // Array is associated with the cluster graph copy.
178 
179  // Stores for every node in the current graph, if
180  // it is a hub.
181  // Array is associated with the cluster graph copy.
183 
184 
185  // Stores for every cluster of Ccopy the corresponding cluster
186  // in the original graph. A key variable, since we track
187  // all information via the original clusters.
189 
190  // Needed to construct the ClusterArray m_clusterTableCopy2Orig.
192 
193  // Stores for every subgraph the super sink of the subgraph.
195 
196 
197  // Stores for every node in Gcopy its corresponding node
198  // in the original graph unless the node belongs to
199  // a wheel graph.
200  // The NodeArray is associated with Gcopy.
202 
203  // Needed to construct the NodeArray m_nodeTableCopy2Orig.
205 
206 
209 
210  // Stores for every original cluster all information on
211  // the PQ-Tree that is necessary to construct the embedding.
213 
214  // Stores the clusters in calling order of the testing algorithm
215  // The stack stores the clusters of the original graph.
216  // Needed for recursive embed.
218 
219  // Is true for every original cluster, if the cluster does not
220  // have a correspondand in the copy of the cluster graph.
221  // This is the case if:
222  // a. cluster is son of root cluster and does have exactly one
223  // childcluster and no nodes;
224  // b. recursive version of a;
225  // c. cluster does have no child clusters and no nodes;
226  // d. recursive version of c.
228 
230 };
231 
232 }
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
ClusterArray< NodeArray< bool > * > m_clusterSubgraphHubs
ClusterArray< NodeArray< SListPure< adjEntry > > * > m_clusterEmbedding
Singly linked lists.
Definition: SList.h:38
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
Definition: Array.h:45
Encapsulates a pointer to an ogdf::SList element.
Definition: SList.h:39
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
EdgeArray< ListPure< edge > > m_parallelEdges
ClusterArray< EmbedPQTree * > m_clusterPQTree
ClusterArray< NodeArray< node > * > m_clusterNodeTableNew2Orig
Representation of clustered graphs.
Definition: ClusterGraph.h:291
EdgeArray< ArrayBuffer< edge > * > m_outgoingEdgesAnker
ClusterArray< ClusterGraph * > m_clusterClusterGraph
Dynamic arrays indexed with clusters.
Definition: ClusterArray.h:110
ClusterArray< ClusterArray< cluster > * > m_clusterClusterTableOrig2New
Class for the representation of nodes.
Definition: Graph_d.h:169
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:53
C-planarity test and embedding by Cohen, Feng and Eades.
ClusterArray< EdgeArray< ArrayBuffer< edge > * > * > m_clusterOutgoingEdgesAnker
Declaration of ClusterPQContainer.
Declaration and implementation of ClusterArray class.
The namespace for all OGDF objects.
ClusterArray< cluster_planarity::ClusterPQContainer > m_clusterPQContainer
ClusterArray< NodeArray< cluster > * > m_clusterSubgraphWheelGraph
Declaration of the class EmbedPQTree.