Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

CconnectClusterPlanarEmbed.h
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include <ogdf/basic/ArrayBuffer.h>
37 #include <ogdf/basic/Graph.h>
38 #include <ogdf/basic/SList.h>
39 #include <ogdf/basic/basic.h>
43 
44 namespace ogdf {
45 template<class E>
46 class ListPure;
47 
49 
53 public:
54  enum class ErrorCode {
55  none = 0,
56  nonConnected = 1,
57  nonCConnected = 2,
58  nonPlanar = 3,
59  nonCPlanar = 4
60  };
61 
62  ErrorCode errCode() { return m_errorCode; }
63 
66 
68  virtual ~CconnectClusterPlanarEmbed();
69 
71  virtual bool embed(ClusterGraph& C, Graph& G);
72 
73 private:
75 
76  bool planarityTest(ClusterGraph& C, const cluster act, Graph& G);
77 
78  bool preProcess(ClusterGraph& Ccopy, Graph& Gcopy);
79 
80  bool preparation(Graph& subGraph, const cluster origCluster, node superSink);
81 
82  bool doEmbed(Graph* biconComp, NodeArray<int>& numbering, const cluster origCluster,
83  node superSink, Graph& subGraph, EdgeArray<edge>& tableEdgesBiComp2SubGraph,
84  EdgeArray<edge>& tableEdgesSubGraph2BiComp, NodeArray<node>& tableNodesBiComp2SubGraph);
85 
86  void entireEmbed(Graph& biconComp, NodeArray<SListPure<adjEntry>>& entireEmbedding,
88 
89  void recursiveEmbed(ClusterGraph& Ccopy, Graph& Gcopy);
90 
91  void prepareParallelEdges(Graph& G);
92 
93 
94  void constructWheelGraph(ClusterGraph& C, Graph& G, cluster& parent, cluster& origCl,
95  EmbedPQTree* T, EdgeArray<node>& outgoingTable, node superSink);
96 
97  void hubControl(Graph& G, NodeArray<bool>& hubs);
98 
99  void nonPlanarCleanup(ClusterGraph& Ccopy, Graph& Gcopy);
100 
101  void copyEmbedding(ClusterGraph& Ccopy, Graph& Gcopy, ClusterGraph& C, Graph& G);
102 
105 
106  // Stores for every cluster the PQTree corresponding
107  // to the biconnected component containing the outgoing
108  // edges of the cluster.
110 
111  //save errorcode for postprocessing if not c-planar
113 
120 
124 
125  ClusterGraph* m_instance; //The graph that has to be embedded
126 
127 
128  // Stores for every cluster the (partial) embedding of the
129  // biconnected components not having outgoing
130  // edges of the cluster.
131  // The NodeArrays are associated with the subgraphs.
132  // The ClusterArray is associtated with the original graph.
134 
135  // Stores for every cluster the subgraph constructed to test
136  // the planarity of the cluster
137  // The ClusterArray is associated with the original graph.
139 
140  // Marks for every subgraph of a cluster the nodes that are
141  // hubs as true.
142  // The NodeArrays are associated with the subgraphs.
143  // The ClusterArray is associated with the original graph.
145 
146 
147  // Stores for every node of every subgraph of a cluster
148  // if this node belongs to a wheel graph, corresponding to
149  // a child cluster
150  // The NodeArrays are associated with the subgraphs.
151  // The ClusterArray is associated with the original graph.
153 
154 
155  // Stores for every mode of every subgraph of a cluster its
156  // corresponding node on the original graph G, if there exists one.
158 
159 
162 
163  // When constructing a wheel graph, we store here for
164  // every wheel graph node the corresponding cluster
165  // Array is associated with the cluster graph copy.
167 
168  // Stores for every node in the current graph, if
169  // it is a hub.
170  // Array is associated with the cluster graph copy.
172 
173 
174  // Stores for every cluster of Ccopy the corresponding cluster
175  // in the original graph. A key variable, since we track
176  // all information via the original clusters.
178 
179  // Needed to construct the ClusterArray m_clusterTableCopy2Orig.
181 
182  // Stores for every subgraph the super sink of the subgraph.
184 
185 
186  // Stores for every node in Gcopy its corresponding node
187  // in the original graph unless the node belongs to
188  // a wheel graph.
189  // The NodeArray is associated with Gcopy.
191 
192  // Needed to construct the NodeArray m_nodeTableCopy2Orig.
194 
195 
198 
199  // Stores for every original cluster all information on
200  // the PQ-Tree that is necessary to construct the embedding.
202 
203  // Stores the clusters in calling order of the testing algorithm
204  // The stack stores the clusters of the original graph.
205  // Needed for recursive embed.
207 
208  // Is true for every original cluster, if the cluster does not
209  // have a correspondand in the copy of the cluster graph.
210  // This is the case if:
211  // a. cluster is son of root cluster and does have exactly one
212  // childcluster and no nodes;
213  // b. recursive version of a;
214  // c. cluster does have no child clusters and no nodes;
215  // d. recursive version of c.
217 
219 };
220 
221 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
ogdf::CconnectClusterPlanarEmbed::m_wheelGraphNodes
NodeArray< cluster > m_wheelGraphNodes
Definition: CconnectClusterPlanarEmbed.h:166
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::CconnectClusterPlanarEmbed::m_clusterTableOrig2Copy
ClusterArray< cluster > m_clusterTableOrig2Copy
Definition: CconnectClusterPlanarEmbed.h:180
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
Graph.h
Includes declaration of graph class.
ogdf::CconnectClusterPlanarEmbed::m_currentHubs
NodeArray< bool > m_currentHubs
Definition: CconnectClusterPlanarEmbed.h:171
ogdf::CconnectClusterPlanarEmbed::m_clusterClusterGraph
ClusterArray< ClusterGraph * > m_clusterClusterGraph
Definition: CconnectClusterPlanarEmbed.h:160
ogdf::CconnectClusterPlanarEmbed::m_callStack
ArrayBuffer< cluster > m_callStack
Definition: CconnectClusterPlanarEmbed.h:206
ogdf::CconnectClusterPlanarEmbed::m_clusterSubgraphHubs
ClusterArray< NodeArray< bool > * > m_clusterSubgraphHubs
Definition: CconnectClusterPlanarEmbed.h:144
ogdf::CconnectClusterPlanarEmbed::m_clusterClusterTableOrig2New
ClusterArray< ClusterArray< cluster > * > m_clusterClusterTableOrig2New
Definition: CconnectClusterPlanarEmbed.h:161
ogdf::CconnectClusterPlanarEmbed
C-planarity test and embedding by Cohen, Feng and Eades.
Definition: CconnectClusterPlanarEmbed.h:52
ogdf::CconnectClusterPlanarEmbed::m_clusterSuperSink
ClusterArray< node > m_clusterSuperSink
Definition: CconnectClusterPlanarEmbed.h:183
ogdf::CconnectClusterPlanarEmbed::m_nodeTableCopy2Orig
NodeArray< node > m_nodeTableCopy2Orig
Definition: CconnectClusterPlanarEmbed.h:190
ogdf::ClusterArrayBase
RegisteredArray for labeling the clusters of a ClusterGraph.
Definition: ClusterGraph.h:311
ogdf::SListIteratorBase
Encapsulates a pointer to an ogdf::SList element.
Definition: SList.h:50
ogdf::CconnectClusterPlanarEmbed::m_instance
ClusterGraph * m_instance
Definition: CconnectClusterPlanarEmbed.h:125
ogdf::CconnectClusterPlanarEmbed::m_isParallel
EdgeArray< bool > m_isParallel
Definition: CconnectClusterPlanarEmbed.h:118
ogdf::CconnectClusterPlanarEmbed::m_clusterSubgraph
ClusterArray< Graph * > m_clusterSubgraph
Definition: CconnectClusterPlanarEmbed.h:138
ogdf::ClusterElement
Representation of clusters in a clustered graph.
Definition: ClusterGraph.h:62
ogdf::CconnectClusterPlanarEmbed::m_clusterPQTree
ClusterArray< EmbedPQTree * > m_clusterPQTree
Definition: CconnectClusterPlanarEmbed.h:109
ogdf::CconnectClusterPlanarEmbed::m_unsatisfiedCluster
ClusterArray< bool > m_unsatisfiedCluster
Definition: CconnectClusterPlanarEmbed.h:216
ClusterPQContainer.h
Declaration of ClusterPQContainer.
ogdf::CconnectClusterPlanarEmbed::m_clusterNodeTableNew2Orig
ClusterArray< NodeArray< node > * > m_clusterNodeTableNew2Orig
Definition: CconnectClusterPlanarEmbed.h:157
SList.h
Declaration of singly linked lists and iterators.
ogdf::booth_lueker::EmbedPQTree
Definition: EmbedPQTree.h:55
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
ogdf::CconnectClusterPlanarEmbed::m_clusterEmbedding
ClusterArray< NodeArray< SListPure< adjEntry > > * > m_clusterEmbedding
Definition: CconnectClusterPlanarEmbed.h:133
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::CconnectClusterPlanarEmbed::m_clusterOutgoingEdgesAnker
ClusterArray< EdgeArray< ArrayBuffer< edge > * > * > m_clusterOutgoingEdgesAnker
Definition: CconnectClusterPlanarEmbed.h:197
ogdf::CconnectClusterPlanarEmbed::m_clusterSubgraphWheelGraph
ClusterArray< NodeArray< cluster > * > m_clusterSubgraphWheelGraph
Definition: CconnectClusterPlanarEmbed.h:152
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::CconnectClusterPlanarEmbed::ErrorCode
ErrorCode
Definition: CconnectClusterPlanarEmbed.h:54
ogdf::CconnectClusterPlanarEmbed::m_parallelEdges
EdgeArray< ListPure< edge > > m_parallelEdges
Definition: CconnectClusterPlanarEmbed.h:117
ClusterGraph.h
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
ogdf::CconnectClusterPlanarEmbed::m_clusterPQContainer
ClusterArray< cluster_planarity::ClusterPQContainer > m_clusterPQContainer
Definition: CconnectClusterPlanarEmbed.h:201
EmbedPQTree.h
Declaration of the class EmbedPQTree.
ogdf::CconnectClusterPlanarEmbed::m_nodeTableOrig2Copy
NodeArray< node > m_nodeTableOrig2Copy
Definition: CconnectClusterPlanarEmbed.h:193
ogdf::CconnectClusterPlanarEmbed::m_parallelCount
int m_parallelCount
Definition: CconnectClusterPlanarEmbed.h:119
ogdf::CconnectClusterPlanarEmbed::m_clusterTableCopy2Orig
ClusterArray< cluster > m_clusterTableCopy2Orig
Definition: CconnectClusterPlanarEmbed.h:177
ogdf::CconnectClusterPlanarEmbed::m_outgoingEdgesAnker
EdgeArray< ArrayBuffer< edge > * > m_outgoingEdgesAnker
Definition: CconnectClusterPlanarEmbed.h:196
ogdf::copyEmbedding
void copyEmbedding(const Graph &from, Graph &to, std::function< adjEntry(adjEntry)> adjMapFromTo)
ogdf::ClusterGraph
Representation of clustered graphs.
Definition: ClusterGraph.h:346
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::CconnectClusterPlanarEmbed::m_errorCode
ErrorCode m_errorCode
Definition: CconnectClusterPlanarEmbed.h:112
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::CconnectClusterPlanarEmbed::errCode
ErrorCode errCode()
Definition: CconnectClusterPlanarEmbed.h:62