Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

CconnectClusterPlanarEmbed.h
Go to the documentation of this file.
1 
34 #pragma once
35 
38 #include <ogdf/basic/Stack.h>
40 
41 namespace ogdf {
42 
44 
48 {
49 public:
50  enum class ErrorCode {
51  none = 0,
52  nonConnected = 1,
53  nonCConnected = 2,
54  nonPlanar = 3,
55  nonCPlanar = 4
56  };
57 
58  ErrorCode errCode() { return m_errorCode; }
59 
62 
64  virtual ~CconnectClusterPlanarEmbed();
65 
67  virtual bool embed(ClusterGraph &C,Graph &G);
68 
69 private:
71 
72  bool planarityTest(ClusterGraph &C, cluster &act, Graph &G);
73 
74  bool preProcess(ClusterGraph &Ccopy,Graph &Gcopy);
75 
76  bool preparation(Graph &subGraph,cluster &origCluster,node superSink);
77 
78  bool doEmbed(
79  Graph *biconComp,
80  NodeArray<int> &numbering,
81  cluster &origCluster,
82  node superSink,
83  Graph &subGraph,
84  EdgeArray<edge> &tableEdgesBiComp2SubGraph,
85  EdgeArray<edge> &tableEdgesSubGraph2BiComp,
86  NodeArray<node> &tableNodesBiComp2SubGraph);
87 
88  void entireEmbed(
89  Graph &biconComp,
90  NodeArray<SListPure<adjEntry> > &entireEmbedding,
92  NodeArray<bool> &mark,
93  node v);
94 
95  void recursiveEmbed(ClusterGraph &Ccopy,Graph &Gcopy);
96 
97  void prepareParallelEdges(Graph &G);
98 
99 
100  void constructWheelGraph(
101  ClusterGraph &C,
102  Graph &G,
103  cluster &parent,
104  cluster &origCl,
105  EmbedPQTree* T,
106  EdgeArray<node> &outgoingTable,
107  node superSink);
108 
109  void hubControl(Graph &G,NodeArray<bool> &hubs);
110 
111  void nonPlanarCleanup(ClusterGraph &Ccopy,Graph &Gcopy);
112 
113  void copyEmbedding(ClusterGraph &Ccopy,Graph &Gcopy,ClusterGraph &C,Graph &G);
114 
117 
118  // Stores for every cluster the PQTree corresponding
119  // to the biconnected component containing the outgoing
120  // edges of the cluster.
122 
123  //save errorcode for postprocessing if not c-planar
125 
132 
136 
137  ClusterGraph *m_instance; //The graph that has to be embedded
138 
139 
140  // Stores for every cluster the (partial) embedding of the
141  // biconnected components not having outgoing
142  // edges of the cluster.
143  // The NodeArrays are associated with the subgraphs.
144  // The ClusterArray is associtated with the original graph.
146 
147  // Stores for every cluster the subgraph constructed to test
148  // the planarity of the cluster
149  // The ClusterArray is associated with the original graph.
151 
152  // Marks for every subgraph of a cluster the nodes that are
153  // hubs as true.
154  // The NodeArrays are associated with the subgraphs.
155  // The ClusterArray is associated with the original graph.
157 
158 
159  // Stores for every node of every subgraph of a cluster
160  // if this node belongs to a wheel graph, corresponding to
161  // a child cluster
162  // The NodeArrays are associated with the subgraphs.
163  // The ClusterArray is associated with the original graph.
165 
166 
167  // Stores for every mode of every subgraph of a cluster its
168  // corresponding node on the original graph G, if there exists one.
170 
171 
174 
175  // When constructing a wheel graph, we store here for
176  // every wheel graph node the corresponding cluster
177  // Array is associated with the cluster graph copy.
179 
180  // Stores for every node in the current graph, if
181  // it is a hub.
182  // Array is associated with the cluster graph copy.
184 
185 
186  // Stores for every cluster of Ccopy the corresponding cluster
187  // in the original graph. A key variable, since we track
188  // all information via the original clusters.
190 
191  // Needed to construct the ClusterArray m_clusterTableCopy2Orig.
193 
194  // Stores for every subgraph the super sink of the subgraph.
196 
197 
198  // Stores for every node in Gcopy its corresponding node
199  // in the original graph unless the node belongs to
200  // a wheel graph.
201  // The NodeArray is associated with Gcopy.
203 
204  // Needed to construct the NodeArray m_nodeTableCopy2Orig.
206 
207 
210 
211  // Stores for every original cluster all information on
212  // the PQ-Tree that is necessary to construct the embedding.
214 
215  // Stores the clusters in calling order of the testing algorithm
216  // The stack stores the clusters of the original graph.
217  // Needed for recursive embed.
219 
220  // Is true for every original cluster, if the cluster does not
221  // have a correspondand in the copy of the cluster graph.
222  // This is the case if:
223  // a. cluster is son of root cluster and does have exactly one
224  // childcluster and no nodes;
225  // b. recursive version of a;
226  // c. cluster does have no child clusters and no nodes;
227  // d. recursive version of c.
229 
231 };
232 
233 } // end namespace ogdf
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
ClusterArray< NodeArray< bool > * > m_clusterSubgraphHubs
ClusterArray< NodeArray< SListPure< adjEntry > > * > m_clusterEmbedding
Singly linked lists.
Definition: SList.h:38
EdgeArray< Stack< edge > * > m_outgoingEdgesAnker
Encapsulates a pointer to an ogdf::SList element.
Definition: SList.h:40
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
ClusterArray< ClusterGraph * > m_clusterClusterGraph
Dynamic arrays indexed with clusters.
Definition: ClusterArray.h:110
ClusterArray< ClusterArray< cluster > * > m_clusterClusterTableOrig2New
ClusterArray< EdgeArray< Stack< edge > * > * > m_clusterOutgoingEdgesAnker
Class for the representation of nodes.
Definition: Graph_d.h:167
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:53
C-planarity test and embedding by Cohen, Feng and Eades.
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
The parameterized class Stack<E> implements list-based stacks.
Definition: Stack.h:192
Declaration and implementation of list-based stacks (StackPure<E> and Stack<E>).
Declaration of the class EmbedPQTree.