Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
CconnectClusterPlanarEmbed.h
Go to the documentation of this file.
1
34#pragma once
35
37#include <ogdf/basic/Graph.h>
38#include <ogdf/basic/SList.h>
39#include <ogdf/basic/basic.h>
43
44namespace ogdf {
45template<class E>
46class ListPure;
47
49
53public:
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
69
71 virtual bool embed(ClusterGraph& C, Graph& G);
72
73private:
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
92
93
94 void constructWheelGraph(ClusterGraph& C, Graph& G, cluster& parent, cluster& origCl,
95 EmbedPQTree* T, EdgeArray<node>& outgoingTable, node superSink);
96
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}
Declaration and implementation of ArrayBuffer class.
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Declaration of ClusterPQContainer.
Declaration of the class EmbedPQTree.
Includes declaration of graph class.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:64
C-planarity test and embedding by Cohen, Feng and Eades.
void copyEmbedding(ClusterGraph &Ccopy, Graph &Gcopy, ClusterGraph &C, Graph &G)
ClusterArray< EdgeArray< ArrayBuffer< edge > * > * > m_clusterOutgoingEdgesAnker
bool preparation(Graph &subGraph, const cluster origCluster, node superSink)
EdgeArray< ListPure< edge > > m_parallelEdges
bool doEmbed(Graph *biconComp, NodeArray< int > &numbering, const cluster origCluster, node superSink, Graph &subGraph, EdgeArray< edge > &tableEdgesBiComp2SubGraph, EdgeArray< edge > &tableEdgesSubGraph2BiComp, NodeArray< node > &tableNodesBiComp2SubGraph)
void hubControl(Graph &G, NodeArray< bool > &hubs)
virtual bool embed(ClusterGraph &C, Graph &G)
Tests if a clustered graph (C, G) is C-planar and embeds it.
void constructWheelGraph(ClusterGraph &C, Graph &G, cluster &parent, cluster &origCl, EmbedPQTree *T, EdgeArray< node > &outgoingTable, node superSink)
void nonPlanarCleanup(ClusterGraph &Ccopy, Graph &Gcopy)
EdgeArray< ArrayBuffer< edge > * > m_outgoingEdgesAnker
ClusterArray< NodeArray< bool > * > m_clusterSubgraphHubs
bool planarityTest(ClusterGraph &C, const cluster act, Graph &G)
ClusterArray< cluster_planarity::ClusterPQContainer > m_clusterPQContainer
ClusterArray< EmbedPQTree * > m_clusterPQTree
ClusterArray< NodeArray< SListPure< adjEntry > > * > m_clusterEmbedding
bool preProcess(ClusterGraph &Ccopy, Graph &Gcopy)
CconnectClusterPlanarEmbed()
Constructor.
ClusterArray< ClusterGraph * > m_clusterClusterGraph
ClusterArray< NodeArray< node > * > m_clusterNodeTableNew2Orig
void entireEmbed(Graph &biconComp, NodeArray< SListPure< adjEntry > > &entireEmbedding, NodeArray< SListIterator< adjEntry > > &adjMarker, NodeArray< bool > &mark, node v)
void recursiveEmbed(ClusterGraph &Ccopy, Graph &Gcopy)
virtual ~CconnectClusterPlanarEmbed()
Destructor.
ClusterArray< ClusterArray< cluster > * > m_clusterClusterTableOrig2New
ClusterArray< NodeArray< cluster > * > m_clusterSubgraphWheelGraph
RegisteredArray for labeling the clusters of a ClusterGraph.
Representation of clusters in a clustered graph.
Representation of clustered graphs.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Class for the representation of nodes.
Definition Graph_d.h:241
Encapsulates a pointer to an ogdf::SList element.
Definition SList.h:104
Singly linked lists.
Definition SList.h:191
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.