Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

EmbedderMinDepthPiTa.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/ArrayBuffer.h>
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/List.h>
38 #include <ogdf/basic/Observer.h>
39 #include <ogdf/basic/basic.h>
42 
43 namespace ogdf {
44 class BCTree;
45 
47 
53 public:
54  //constructor
55  EmbedderMinDepthPiTa() : m_useExtendedDepthDefinition(true), pm_blockCutfaceTree(nullptr) { }
56 
57  /* needs to be deleted explicitly for MSVC<=16 and classes containing a NodeArrayP */
59 
60 
66  virtual void doCall(Graph& G, adjEntry& adjExternal) override;
67 
68  bool useExtendedDepthDefinition() const { return m_useExtendedDepthDefinition; }
69 
70  void useExtendedDepthDefinition(bool b) { m_useExtendedDepthDefinition = b; }
71 
72 protected:
73  adjEntry trivialInit(Graph& G) override {
74  planarEmbed(G);
76  adjEntry result = CE.chooseFace()->firstAdj();
77  deleteDummyNodes(G, result);
78 
79  return result;
80  }
81 
82 private:
84 
92  void embedBlocks(const node& bT, const node& cH);
93 
100  void embedCutVertex(const node& vT, bool root = false);
101 
108  void embedBlockVertex(const node& bT, const node& parent_cT);
109 
116  int computeBlockCutfaceTreeEdgeLengths(const node& n);
117 
123  void computeTdiam(const node& n);
124 
133  void invertPath(Graph& G, const node& n, const edge& e);
134 
145  node computeBlockMapping(const node& bDG, const node& parent, List<node>& blocksNodes,
146  List<node>& childBlocks);
147 
155  int eccentricityBottomUp(const node& nT);
156 
163  void eccentricityTopDown(const node& nT);
164 
170  int depthBlock(const node& bT);
171 
177  int depthCutvertex(const node& cT);
178 
186  void deleteDummyNodes(Graph& G, adjEntry& adjExternal);
187 
188 private:
191 
194 
197 
200 
203 
206 
209 
212 
215 
218 
224 
227 
230 
233 
236 
239 
242 
245 
251 
254 
257 
260 
263 
266 
269 
272 
275 
278 
281 
287 
293 
296 
302 
305 
308 
311 
314 
317 };
318 
319 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::EmbedderMinDepthPiTa::pm_blockCutfaceTree
BCTree * pm_blockCutfaceTree
the block-cutface tree of G (the BC-tree of the dual graph)
Definition: EmbedderMinDepthPiTa.h:262
ogdf::EmbedderMinDepthPiTa
Embedder that minimizes block-nesting depth for given embedded blocks.
Definition: EmbedderMinDepthPiTa.h:52
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
ogdf::EmbedderMinDepthPiTa::fPG_to_nDG
ArrayBuffer< node > fPG_to_nDG
mapping faces (by ID) in G to nodes in DG
Definition: EmbedderMinDepthPiTa.h:253
ogdf::BCTree
Static BC-trees.
Definition: BCTree.h:60
Graph.h
Includes declaration of graph class.
ogdf::EmbedderMinDepthPiTa::nBlockCutfaceTree_to_nm_blockCutfaceTree
NodeArray< node > nBlockCutfaceTree_to_nm_blockCutfaceTree
mapping of nodes from the graph blockCutfaceTree to the BC-tree m_blockCutfaceTree
Definition: EmbedderMinDepthPiTa.h:265
ogdf::EmbedderMinDepthPiTa::G_nT
NodeArrayP< Graph > G_nT
given a node nT (cutvertex or block), G_nT is the subgraph of G associated with the subtree of the BC...
Definition: EmbedderMinDepthPiTa.h:301
ogdf::EmbedderMinDepthPiTa::eG_nT_to_ePG
NodeArray< EdgeArray< edge > > eG_nT_to_ePG
a mapping of edges in G_nT to edges in G
Definition: EmbedderMinDepthPiTa.h:310
ogdf::EmbedderMinDepthPiTa::Tdiam_initialized
bool Tdiam_initialized
Needed in computeTdiam function to know if first vertex was already inserted.
Definition: EmbedderMinDepthPiTa.h:232
ogdf::EmbedderMinDepthPiTa::edgeLength_blockCutfaceTree
EdgeArray< int > edgeLength_blockCutfaceTree
Saving edge lengths for the block-cutface tree.
Definition: EmbedderMinDepthPiTa.h:226
extended_graph_alg.h
Declaration of extended graph algorithms.
ogdf::EmbedderMinDepthPiTa::m_useExtendedDepthDefinition
bool m_useExtendedDepthDefinition
Definition: EmbedderMinDepthPiTa.h:83
Observer.h
Simple, safe base classes for C++ observables and observers.
ogdf::EmbedderMinDepthPiTa::eH_to_eBlockEmbedding
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
Definition: EmbedderMinDepthPiTa.h:205
ogdf::EmbedderMinDepthPiTa::eccentricity
NodeArray< int > eccentricity
saving eccentricity for every node of the block-cutface tree
Definition: EmbedderMinDepthPiTa.h:280
ogdf::embedder::EmbedderBCTreeBase
Common base for embedder algorithms based on BC trees.
Definition: EmbedderBCTreeBase.h:49
ogdf::EmbedderMinDepthPiTa::nBlockEmbedding_to_nH
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
Definition: EmbedderMinDepthPiTa.h:208
ogdf::EmbedderMinDepthPiTa::tmpAdjExtFace
adjEntry tmpAdjExtFace
adjacency entry of the external face of the embedding of G
Definition: EmbedderMinDepthPiTa.h:244
ogdf::EmbedderMinDepthPiTa::bcTreePG
Graph bcTreePG
the tree of pBCTree rooted at a cutface.
Definition: EmbedderMinDepthPiTa.h:190
ogdf::EmbedderMinDepthPiTa::nodeLength
NodeArray< NodeArray< int > > nodeLength
saving for each node in the block graphs its length
Definition: EmbedderMinDepthPiTa.h:214
ogdf::EmbedderMinDepthPiTa::M_B
NodeArray< List< node > > M_B
M_B = {cH in B | m_B(cH) = m_B} with m_B = max{m_B(c) : c in B} and m_B(c) = max( {0} cup {m_{c,...
Definition: EmbedderMinDepthPiTa.h:223
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::FaceElement::firstAdj
adjEntry firstAdj() const
Returns the first adjacency element in the face.
Definition: CombinatorialEmbedding.h:148
ogdf::EmbedderMinDepthPiTa::Tdiam
Graph Tdiam
The diametrical tree of the block-cutface tree.
Definition: EmbedderMinDepthPiTa.h:229
ogdf::EmbedderMinDepthPiTa::nBlockCutfaceTree_to_nTdiam
NodeArray< node > nBlockCutfaceTree_to_nTdiam
Mapping nodes from block-cutvertex tree to the diametrical tree.
Definition: EmbedderMinDepthPiTa.h:235
ogdf::EmbedderMinDepthPiTa::Gamma_adjExt_nT
NodeArray< adjEntry > Gamma_adjExt_nT
adjacency entry of the external face of G_nT[nT]
Definition: EmbedderMinDepthPiTa.h:316
ogdf::EmbedderMinDepthPiTa::nG_nT_to_nPG
NodeArray< NodeArray< node > > nG_nT_to_nPG
a mapping of nodes in G_nT to nodes in G
Definition: EmbedderMinDepthPiTa.h:304
ogdf::EmbedderMinDepthPiTa::eBlockEmbedding_to_eH
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
Definition: EmbedderMinDepthPiTa.h:211
ogdf::EmbedderMinDepthPiTa::bDG_to_bPG
NodeArray< node > bDG_to_bPG
a mapping of blocks of the dual graph DG to its original graph G
Definition: EmbedderMinDepthPiTa.h:274
ogdf::EmbedderMinDepthPiTa::nTdiam_to_nBlockCutfaceTree
NodeArray< node > nTdiam_to_nBlockCutfaceTree
Mapping nodes from the diametrical tree to block-cutvertex tree.
Definition: EmbedderMinDepthPiTa.h:238
OGDF_NO_COPY
#define OGDF_NO_COPY(cls)
Explicitly disables (deletes) copy construction and assignment for class cls.
Definition: copy_move.h:37
ogdf::planarEmbed
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
Definition: extended_graph_alg.h:318
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::EmbedderMinDepthPiTa::useExtendedDepthDefinition
bool useExtendedDepthDefinition() const
Definition: EmbedderMinDepthPiTa.h:68
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::ConstCombinatorialEmbedding::chooseFace
face chooseFace(std::function< bool(face)> includeFace=[](face) { return true;}, bool isFastTest=true) const
Returns a random face.
ogdf::EmbedderMinDepthPiTa::dummyNodes
List< node > dummyNodes
this list is saving the dummy nodes which were inserted to produce a face in one-edge-blocks
Definition: EmbedderMinDepthPiTa.h:292
ogdf::EmbedderMinDepthPiTa::m_cB
EdgeArray< int > m_cB
an array saving the length for each edge in the BC-tree
Definition: EmbedderMinDepthPiTa.h:217
ogdf::EmbedderMinDepthPiTa::nPG_to_nG_nT
NodeArray< NodeArray< node > > nPG_to_nG_nT
a mapping of nodes in G to nodes in G_nT
Definition: EmbedderMinDepthPiTa.h:307
ogdf::EmbedderMinDepthPiTa::nm_blockCutfaceTree_to_nBlockCutfaceTree
NodeArray< node > nm_blockCutfaceTree_to_nBlockCutfaceTree
mapping of nodes from the BC-tree m_blockCutfaceTree to the graph blockCutfaceTree
Definition: EmbedderMinDepthPiTa.h:268
EmbedderBCTreeBase.h
Definition of ogdf::EmbedderBCTreeBase.
basic.h
Basic declarations, included by all source files.
ogdf::EmbedderMinDepthPiTa::ePG_to_eG_nT
NodeArray< EdgeArray< edge > > ePG_to_eG_nT
a mapping of edges in G to edges in G_nT
Definition: EmbedderMinDepthPiTa.h:313
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
ogdf::EmbedderMinDepthPiTa::nDG_to_fPG
NodeArray< int > nDG_to_fPG
mapping nodes in DG to faces in DG
Definition: EmbedderMinDepthPiTa.h:256
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::EmbedderMinDepthPiTa::npBCTree_to_nBCTree
NodeArray< node > npBCTree_to_nBCTree
a mapping of nodes in pBCTree->bcTree() to nodes in bcTreePG
Definition: EmbedderMinDepthPiTa.h:196
ogdf::CombinatorialEmbedding
Combinatorial embeddings of planar graphs with modification functionality.
Definition: CombinatorialEmbedding.h:406
ogdf::EmbedderMinDepthPiTa::useExtendedDepthDefinition
void useExtendedDepthDefinition(bool b)
Definition: EmbedderMinDepthPiTa.h:70
ogdf::EmbedderMinDepthPiTa::nH_to_nBlockEmbedding
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
Definition: EmbedderMinDepthPiTa.h:202
ogdf::EmbedderMinDepthPiTa::knotTdiam
node knotTdiam
The knot of the diametrical tree.
Definition: EmbedderMinDepthPiTa.h:241
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::EmbedderMinDepthPiTa::EmbedderMinDepthPiTa
EmbedderMinDepthPiTa()
Definition: EmbedderMinDepthPiTa.h:55
List.h
Declaration of doubly linked lists and iterators.
ogdf::EmbedderMinDepthPiTa::nBCTree_to_npBCTree
NodeArray< node > nBCTree_to_npBCTree
a mapping of nodes in bcTreePG to nodes in pBCTree->bcTree()
Definition: EmbedderMinDepthPiTa.h:193
ogdf::EmbedderMinDepthPiTa::newOrder
NodeArray< List< adjEntry > > newOrder
saves for every node of G the new adjacency list
Definition: EmbedderMinDepthPiTa.h:295
ogdf::EmbedderMinDepthPiTa::blockCutfaceTree
Graph blockCutfaceTree
the block-cutface tree of G (only the graph, rooted at the external face
Definition: EmbedderMinDepthPiTa.h:259
ogdf::EmbedderMinDepthPiTa::bPG_to_bDG
NodeArray< node > bPG_to_bDG
a mapping of blocks of the graph G to its dual graph DG
Definition: EmbedderMinDepthPiTa.h:271
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::EmbedderMinDepthPiTa::oneEdgeBlockNodes
List< node > oneEdgeBlockNodes
list of nodes which are only in one block which exists of extactly this node plus a cutvertex
Definition: EmbedderMinDepthPiTa.h:286
ogdf::EmbedderMinDepthPiTa::trivialInit
adjEntry trivialInit(Graph &G) override
Initialization code for biconnected input. Returns an adjacency entry that lies on the external face.
Definition: EmbedderMinDepthPiTa.h:73
ogdf::EmbedderMinDepthPiTa::blockG
NodeArrayP< Graph > blockG
all blocks
Definition: EmbedderMinDepthPiTa.h:199
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::EmbedderMinDepthPiTa::eccentricity_alt
NodeArray< int > eccentricity_alt
saving second highest eccentricity for every node of the block-cutface tree
Definition: EmbedderMinDepthPiTa.h:277
ogdf::EmbedderMinDepthPiTa::faces
List< List< adjEntry > > faces
a list of all faces in G, a face in this list is containing a list of all adjacency entries
Definition: EmbedderMinDepthPiTa.h:250