Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
EmbedderMinDepthPiTa.h
Go to the documentation of this file.
1
32#pragma once
33
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
43namespace ogdf {
44class BCTree;
45
47
53public:
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
72protected:
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
82private:
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
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
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
188private:
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}
Declaration and implementation of ArrayBuffer class.
Declaration of CombinatorialEmbedding and face.
Definition of ogdf::EmbedderBCTreeBase.
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Simple, safe base classes for C++ observables and observers.
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition ArrayBuffer.h:64
Static BC-trees.
Definition BCTree.h:60
Combinatorial embeddings of planar graphs with modification functionality.
face chooseFace(std::function< bool(face)> includeFace=[](face) { return true;}, bool isFastTest=true) const
Returns a random face.
Class for the representation of edges.
Definition Graph_d.h:364
Embedder that minimizes block-nesting depth for given embedded blocks.
Graph bcTreePG
the tree of pBCTree rooted at a cutface.
EdgeArray< int > m_cB
an array saving the length for each edge in the BC-tree
Graph blockCutfaceTree
the block-cutface tree of G (only the graph, rooted at the external face
NodeArray< node > nBlockCutfaceTree_to_nTdiam
Mapping nodes from block-cutvertex tree to the diametrical tree.
ArrayBuffer< node > fPG_to_nDG
mapping faces (by ID) in G to nodes in DG
NodeArray< node > nTdiam_to_nBlockCutfaceTree
Mapping nodes from the diametrical tree to block-cutvertex tree.
NodeArray< node > bDG_to_bPG
a mapping of blocks of the dual graph DG to its original graph G
int eccentricityBottomUp(const node &nT)
Computes the eccentricity of a node nT in the block-cutface tree to all nodes further down in the tre...
int depthCutvertex(const node &cT)
Computes the depth of an embedding Gamma(c).
NodeArray< adjEntry > Gamma_adjExt_nT
adjacency entry of the external face of G_nT[nT]
void deleteDummyNodes(Graph &G, adjEntry &adjExternal)
Deletes inserted dummy nodes.
NodeArray< node > nm_blockCutfaceTree_to_nBlockCutfaceTree
mapping of nodes from the BC-tree m_blockCutfaceTree to the graph blockCutfaceTree
List< node > dummyNodes
this list is saving the dummy nodes which were inserted to produce a face in one-edge-blocks
NodeArray< int > eccentricity_alt
saving second highest eccentricity for every node of the block-cutface tree
List< node > oneEdgeBlockNodes
list of nodes which are only in one block which exists of extactly this node plus a cutvertex
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
void embedCutVertex(const node &vT, bool root=false)
Computes entry in newOrder for a cutvertex.
int computeBlockCutfaceTreeEdgeLengths(const node &n)
Computes recursively edge lengths for the block-cutface tree.
adjEntry trivialInit(Graph &G) override
Initialization code for biconnected input. Returns an adjacency entry that lies on the external face.
int depthBlock(const node &bT)
Computes the depth of an embedding Gamma(B).
NodeArray< int > nDG_to_fPG
mapping nodes in DG to faces in DG
BCTree * pm_blockCutfaceTree
the block-cutface tree of G (the BC-tree of the dual graph)
NodeArray< node > bPG_to_bDG
a mapping of blocks of the graph G to its dual graph DG
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
EdgeArray< int > edgeLength_blockCutfaceTree
Saving edge lengths for the block-cutface tree.
void eccentricityTopDown(const node &nT)
Computes the eccentricity of a node nT in the block-cutface tree and recursively the eccentricity of ...
NodeArray< int > eccentricity
saving eccentricity for every node of the block-cutface tree
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...
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
NodeArray< node > nBCTree_to_npBCTree
a mapping of nodes in bcTreePG to nodes in pBCTree->bcTree()
NodeArrayP< Graph > blockG
all blocks
NodeArray< EdgeArray< edge > > ePG_to_eG_nT
a mapping of edges in G to edges in G_nT
node knotTdiam
The knot of the diametrical tree.
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
bool Tdiam_initialized
Needed in computeTdiam function to know if first vertex was already inserted.
NodeArray< NodeArray< int > > nodeLength
saving for each node in the block graphs its length
NodeArray< NodeArray< node > > nPG_to_nG_nT
a mapping of nodes in G to nodes in G_nT
NodeArray< node > npBCTree_to_nBCTree
a mapping of nodes in pBCTree->bcTree() to nodes in bcTreePG
NodeArray< node > nBlockCutfaceTree_to_nm_blockCutfaceTree
mapping of nodes from the graph blockCutfaceTree to the BC-tree m_blockCutfaceTree
void invertPath(Graph &G, const node &n, const edge &e)
Directs all edges to n and recursively all edges of its children - except the edge to n - to the chil...
void embedBlockVertex(const node &bT, const node &parent_cT)
Computes entries in newOrder for nodes in a block.
NodeArray< NodeArray< node > > nG_nT_to_nPG
a mapping of nodes in G_nT to nodes in G
void embedBlocks(const node &bT, const node &cH)
Computes recursively an embedding for every block by using the planarEmbed function.
Graph Tdiam
The diametrical tree of the block-cutface tree.
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,...
void computeTdiam(const node &n)
Computes recursively the diametral tree.
NodeArray< EdgeArray< edge > > eG_nT_to_ePG
a mapping of edges in G_nT to edges in G
List< List< adjEntry > > faces
a list of all faces in G, a face in this list is containing a list of all adjacency entries
NodeArray< List< adjEntry > > newOrder
saves for every node of G the new adjacency list
node computeBlockMapping(const node &bDG, const node &parent, List< node > &blocksNodes, List< node > &childBlocks)
Computes for a block bDG of the dual graph the associated block in the original graph.
adjEntry tmpAdjExtFace
adjacency entry of the external face of the embedding of G
adjEntry firstAdj() const
Returns the first adjacency element in the face.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
Common base for embedder algorithms based on BC trees.
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
#define OGDF_NO_COPY(cls)
Explicitly disables (deletes) copy construction and assignment for class cls.
Definition copy_move.h:37
Declaration of extended graph algorithms.
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
The namespace for all OGDF objects.