Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::EmbedderMinDepthPiTa Class Reference

Embedder that minimizes block-nesting depth for given embedded blocks. More...

#include <ogdf/planarity/EmbedderMinDepthPiTa.h>

+ Inheritance diagram for ogdf::EmbedderMinDepthPiTa:

Public Member Functions

 EmbedderMinDepthPiTa ()
 
virtual void doCall (Graph &G, adjEntry &adjExternal) override
 Computes an embedding of G.
 
bool useExtendedDepthDefinition () const
 
void useExtendedDepthDefinition (bool b)
 
- Public Member Functions inherited from ogdf::EmbedderModule
 EmbedderModule ()
 Initializes an embedder module.
 
virtual ~EmbedderModule ()
 
void call (Graph &G, adjEntry &adjExternal)
 Calls the embedder algorithm for graph G.
 
void operator() (Graph &G, adjEntry &adjExternal)
 Calls the embedder algorithm for graph G.
 
- Public Member Functions inherited from ogdf::Module
 Module ()
 Initializes a module.
 
virtual ~Module ()
 
- Public Member Functions inherited from ogdf::Timeouter
 Timeouter ()
 timeout is turned of by default
 
 Timeouter (bool t)
 timeout is turned off (false) or on (true) (with 0 second)
 
 Timeouter (const Timeouter &t)
 
 Timeouter (double t)
 timeout is set to the given value (seconds)
 
 ~Timeouter ()
 
bool isTimeLimit () const
 returns whether any time limit is set or not
 
Timeouteroperator= (const Timeouter &t)
 
double timeLimit () const
 returns the current time limit for the call
 
void timeLimit (bool t)
 shorthand to turn timelimit off or on (with 0 seconds)
 
void timeLimit (double t)
 sets the time limit for the call (in seconds); <0 means no limit.
 

Protected Member Functions

adjEntry trivialInit (Graph &G) override
 Initialization code for biconnected input. Returns an adjacency entry that lies on the external face.
 
- Protected Member Functions inherited from ogdf::embedder::EmbedderBCTreeBase< false >
node initBCTree (Graph &G)
 Initializes pBCTree and returns the root node of this tree or nullptr if G is biconnected.
 

Private Member Functions

int computeBlockCutfaceTreeEdgeLengths (const node &n)
 Computes recursively edge lengths for the block-cutface tree.
 
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.
 
void computeTdiam (const node &n)
 Computes recursively the diametral tree.
 
void deleteDummyNodes (Graph &G, adjEntry &adjExternal)
 Deletes inserted dummy nodes.
 
int depthBlock (const node &bT)
 Computes the depth of an embedding Gamma(B).
 
int depthCutvertex (const node &cT)
 Computes the depth of an embedding Gamma(c).
 
int eccentricityBottomUp (const node &nT)
 Computes the eccentricity of a node nT in the block-cutface tree to all nodes further down in the tree and recursively the eccentricity to all nodes yet further down its children.
 
void eccentricityTopDown (const node &nT)
 Computes the eccentricity of a node nT in the block-cutface tree and recursively the eccentricity of its children.
 
void embedBlocks (const node &bT, const node &cH)
 Computes recursively an embedding for every block by using the planarEmbed function.
 
void embedBlockVertex (const node &bT, const node &parent_cT)
 Computes entries in newOrder for nodes in a block.
 
void embedCutVertex (const node &vT, bool root=false)
 Computes entry in newOrder for a cutvertex.
 
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 child.
 

Private Attributes

Graph bcTreePG
 the tree of pBCTree rooted at a cutface.
 
NodeArray< nodebDG_to_bPG
 a mapping of blocks of the dual graph DG to its original graph G
 
Graph blockCutfaceTree
 the block-cutface tree of G (only the graph, rooted at the external face
 
NodeArray< GraphblockG
 all blocks
 
NodeArray< nodebPG_to_bDG
 a mapping of blocks of the graph G to its dual graph DG
 
List< nodedummyNodes
 this list is saving the dummy nodes which were inserted to produce a face in one-edge-blocks
 
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
 a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
 
NodeArray< inteccentricity
 saving eccentricity for every node of the block-cutface tree
 
NodeArray< inteccentricity_alt
 saving second highest eccentricity for every node of the block-cutface tree
 
EdgeArray< intedgeLength_blockCutfaceTree
 Saving edge lengths for the block-cutface tree.
 
NodeArray< EdgeArray< edge > > eG_nT_to_ePG
 a mapping of edges in G_nT to edges in G
 
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
 a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
 
NodeArray< EdgeArray< edge > > ePG_to_eG_nT
 a mapping of edges in G to edges in G_nT
 
List< List< adjEntry > > faces
 a list of all faces in G, a face in this list is containing a list of all adjacency entries
 
ArrayBuffer< nodefPG_to_nDG
 mapping faces (by ID) in G to nodes in DG
 
NodeArray< GraphG_nT
 given a node nT (cutvertex or block), G_nT is the subgraph of G associated with the subtree of the BC-tree T rooted at nT
 
NodeArray< adjEntryGamma_adjExt_nT
 adjacency entry of the external face of G_nT[nT]
 
node knotTdiam
 The knot of the diametrical 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, B'} | c in B', B' != B}).
 
EdgeArray< intm_cB
 an array saving the length for each edge in the BC-tree
 
bool m_useExtendedDepthDefinition
 
NodeArray< nodenBCTree_to_npBCTree
 a mapping of nodes in bcTreePG to nodes in pBCTree->bcTree()
 
NodeArray< nodenBlockCutfaceTree_to_nm_blockCutfaceTree
 mapping of nodes from the graph blockCutfaceTree to the BC-tree m_blockCutfaceTree
 
NodeArray< nodenBlockCutfaceTree_to_nTdiam
 Mapping nodes from block-cutvertex tree to the diametrical tree.
 
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
 a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
 
NodeArray< intnDG_to_fPG
 mapping nodes in DG to faces in DG
 
NodeArray< List< adjEntry > > newOrder
 saves for every node of G the new adjacency list
 
NodeArray< NodeArray< node > > nG_nT_to_nPG
 a mapping of nodes in G_nT to nodes in G
 
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
 a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
 
NodeArray< nodenm_blockCutfaceTree_to_nBlockCutfaceTree
 mapping of nodes from the BC-tree m_blockCutfaceTree to the graph blockCutfaceTree
 
NodeArray< NodeArray< int > > nodeLength
 saving for each node in the block graphs its length
 
NodeArray< nodenpBCTree_to_nBCTree
 a mapping of nodes in pBCTree->bcTree() to nodes in bcTreePG
 
NodeArray< NodeArray< node > > nPG_to_nG_nT
 a mapping of nodes in G to nodes in G_nT
 
NodeArray< nodenTdiam_to_nBlockCutfaceTree
 Mapping nodes from the diametrical tree to block-cutvertex tree.
 
List< nodeoneEdgeBlockNodes
 list of nodes which are only in one block which exists of extactly this node plus a cutvertex
 
BCTreepm_blockCutfaceTree
 the block-cutface tree of G (the BC-tree of the dual graph)
 
Graph Tdiam
 The diametrical tree of the block-cutface tree.
 
bool Tdiam_initialized
 Needed in computeTdiam function to know if first vertex was already inserted.
 
adjEntry tmpAdjExtFace
 adjacency entry of the external face of the embedding of G
 

Additional Inherited Members

- Public Types inherited from ogdf::Module
enum class  ReturnType { Feasible , Optimal , NoFeasibleSolution , TimeoutFeasible , TimeoutInfeasible , Error }
 The return type of a module. More...
 
- Static Public Member Functions inherited from ogdf::Module
static bool isSolution (ReturnType ret)
 Returns true iff ret indicates that the module returned a feasible solution.
 
- Protected Attributes inherited from ogdf::embedder::EmbedderBCTreeBase< false >
adjEntrypAdjExternal
 an adjacency entry on the external face
 
BCTreepBCTree
 BC-tree of the original graph.
 
- Protected Attributes inherited from ogdf::Timeouter
double m_timeLimit
 Time limit for module calls (< 0 means no limit).
 

Detailed Description

Embedder that minimizes block-nesting depth for given embedded blocks.

For details see the paper "Minimum Depth Graph Drawing" by M. Pizzonia and R. Tamassia.

Definition at line 45 of file EmbedderMinDepthPiTa.h.

Constructor & Destructor Documentation

◆ EmbedderMinDepthPiTa()

ogdf::EmbedderMinDepthPiTa::EmbedderMinDepthPiTa ( )
inline

Definition at line 48 of file EmbedderMinDepthPiTa.h.

Member Function Documentation

◆ computeBlockCutfaceTreeEdgeLengths()

int ogdf::EmbedderMinDepthPiTa::computeBlockCutfaceTreeEdgeLengths ( const node n)
private

Computes recursively edge lengths for the block-cutface tree.

The length of an edge from n to a leaf is 1, from n' to n 2 etc.

Parameters
nis a node in the block-cutface tree.

◆ computeBlockMapping()

node ogdf::EmbedderMinDepthPiTa::computeBlockMapping ( const node bDG,
const node parent,
List< node > &  blocksNodes,
List< node > &  childBlocks 
)
private

Computes for a block bDG of the dual graph the associated block in the original graph.

Parameters
bDGis a node in the block-cutface tree.
parentis the parent of bDG in the block-cutface tree.
blocksNodesis assigned a list containing all nodes of the original graph of the associated block of bDG.
childBlocks

◆ computeTdiam()

void ogdf::EmbedderMinDepthPiTa::computeTdiam ( const node n)
private

Computes recursively the diametral tree.

Parameters
nis a node in the block-cutface tree.

◆ deleteDummyNodes()

void ogdf::EmbedderMinDepthPiTa::deleteDummyNodes ( Graph G,
adjEntry adjExternal 
)
private

Deletes inserted dummy nodes.

If adjExternal is an adjacency entry of a dummy edge it is reset.

Parameters
Gis the graph.
adjExternalis an adjacency entry on the external face.

◆ depthBlock()

int ogdf::EmbedderMinDepthPiTa::depthBlock ( const node bT)
private

Computes the depth of an embedding Gamma(B).

Parameters
bTis a block-node of the BC-tree.

◆ depthCutvertex()

int ogdf::EmbedderMinDepthPiTa::depthCutvertex ( const node cT)
private

Computes the depth of an embedding Gamma(c).

Parameters
cTis a cutvertex-node of the BC-tree.

◆ doCall()

virtual void ogdf::EmbedderMinDepthPiTa::doCall ( Graph G,
adjEntry adjExternal 
)
overridevirtual

Computes an embedding of G.

Parameters
Gis the original graph.
adjExternalis assigned an adjacency entry on the external face.

Implements ogdf::EmbedderModule.

◆ eccentricityBottomUp()

int ogdf::EmbedderMinDepthPiTa::eccentricityBottomUp ( const node nT)
private

Computes the eccentricity of a node nT in the block-cutface tree to all nodes further down in the tree and recursively the eccentricity to all nodes yet further down its children.

Parameters
nTis a node in the block-cutface tree.

◆ eccentricityTopDown()

void ogdf::EmbedderMinDepthPiTa::eccentricityTopDown ( const node nT)
private

Computes the eccentricity of a node nT in the block-cutface tree and recursively the eccentricity of its children.

Parameters
nTis a node in the block-cutface tree.

◆ embedBlocks()

void ogdf::EmbedderMinDepthPiTa::embedBlocks ( const node bT,
const node cH 
)
private

Computes recursively an embedding for every block by using the planarEmbed function.

Parameters
bTis a block node in the BC-tree.
cHis a node of bT in the auxiliary graph.

◆ embedBlockVertex()

void ogdf::EmbedderMinDepthPiTa::embedBlockVertex ( const node bT,
const node parent_cT 
)
private

Computes entries in newOrder for nodes in a block.

Parameters
bTis a node in the BC-tree.
parent_cTis a node in the BC-tree.

◆ embedCutVertex()

void ogdf::EmbedderMinDepthPiTa::embedCutVertex ( const node vT,
bool  root = false 
)
private

Computes entry in newOrder for a cutvertex.

Parameters
vTis a cut vertex node in the BC-tree.
rootis true if vT is the root node of the block-cutface tree.

◆ invertPath()

void ogdf::EmbedderMinDepthPiTa::invertPath ( Graph G,
const node n,
const edge e 
)
private

Directs all edges to n and recursively all edges of its children - except the edge to n - to the child.

Parameters
Gis the tree with the inverted edges.
nis a node in the original tree.
eis an edge in the original tree.

◆ trivialInit()

adjEntry ogdf::EmbedderMinDepthPiTa::trivialInit ( Graph G)
inlineoverrideprotectedvirtual

Initialization code for biconnected input. Returns an adjacency entry that lies on the external face.

Reimplemented from ogdf::embedder::EmbedderBCTreeBase< false >.

Definition at line 63 of file EmbedderMinDepthPiTa.h.

◆ useExtendedDepthDefinition() [1/2]

bool ogdf::EmbedderMinDepthPiTa::useExtendedDepthDefinition ( ) const
inline

Definition at line 58 of file EmbedderMinDepthPiTa.h.

◆ useExtendedDepthDefinition() [2/2]

void ogdf::EmbedderMinDepthPiTa::useExtendedDepthDefinition ( bool  b)
inline

Definition at line 60 of file EmbedderMinDepthPiTa.h.

Member Data Documentation

◆ bcTreePG

Graph ogdf::EmbedderMinDepthPiTa::bcTreePG
private

the tree of pBCTree rooted at a cutface.

Definition at line 180 of file EmbedderMinDepthPiTa.h.

◆ bDG_to_bPG

NodeArray<node> ogdf::EmbedderMinDepthPiTa::bDG_to_bPG
private

a mapping of blocks of the dual graph DG to its original graph G

Definition at line 264 of file EmbedderMinDepthPiTa.h.

◆ blockCutfaceTree

Graph ogdf::EmbedderMinDepthPiTa::blockCutfaceTree
private

the block-cutface tree of G (only the graph, rooted at the external face

Definition at line 249 of file EmbedderMinDepthPiTa.h.

◆ blockG

NodeArray<Graph> ogdf::EmbedderMinDepthPiTa::blockG
private

all blocks

Definition at line 189 of file EmbedderMinDepthPiTa.h.

◆ bPG_to_bDG

NodeArray<node> ogdf::EmbedderMinDepthPiTa::bPG_to_bDG
private

a mapping of blocks of the graph G to its dual graph DG

Definition at line 261 of file EmbedderMinDepthPiTa.h.

◆ dummyNodes

List<node> ogdf::EmbedderMinDepthPiTa::dummyNodes
private

this list is saving the dummy nodes which were inserted to produce a face in one-edge-blocks

Definition at line 282 of file EmbedderMinDepthPiTa.h.

◆ eBlockEmbedding_to_eH

NodeArray<EdgeArray<edge> > ogdf::EmbedderMinDepthPiTa::eBlockEmbedding_to_eH
private

a mapping of edges in blockG to the auxiliaryGraph of the BC-tree

Definition at line 201 of file EmbedderMinDepthPiTa.h.

◆ eccentricity

NodeArray<int> ogdf::EmbedderMinDepthPiTa::eccentricity
private

saving eccentricity for every node of the block-cutface tree

Definition at line 270 of file EmbedderMinDepthPiTa.h.

◆ eccentricity_alt

NodeArray<int> ogdf::EmbedderMinDepthPiTa::eccentricity_alt
private

saving second highest eccentricity for every node of the block-cutface tree

Definition at line 267 of file EmbedderMinDepthPiTa.h.

◆ edgeLength_blockCutfaceTree

EdgeArray<int> ogdf::EmbedderMinDepthPiTa::edgeLength_blockCutfaceTree
private

Saving edge lengths for the block-cutface tree.

Definition at line 216 of file EmbedderMinDepthPiTa.h.

◆ eG_nT_to_ePG

NodeArray<EdgeArray<edge> > ogdf::EmbedderMinDepthPiTa::eG_nT_to_ePG
private

a mapping of edges in G_nT to edges in G

Definition at line 300 of file EmbedderMinDepthPiTa.h.

◆ eH_to_eBlockEmbedding

NodeArray<EdgeArray<edge> > ogdf::EmbedderMinDepthPiTa::eH_to_eBlockEmbedding
private

a mapping of edges in the auxiliaryGraph of the BC-tree to blockG

Definition at line 195 of file EmbedderMinDepthPiTa.h.

◆ ePG_to_eG_nT

NodeArray<EdgeArray<edge> > ogdf::EmbedderMinDepthPiTa::ePG_to_eG_nT
private

a mapping of edges in G to edges in G_nT

Definition at line 303 of file EmbedderMinDepthPiTa.h.

◆ faces

List<List<adjEntry> > ogdf::EmbedderMinDepthPiTa::faces
private

a list of all faces in G, a face in this list is containing a list of all adjacency entries

Definition at line 240 of file EmbedderMinDepthPiTa.h.

◆ fPG_to_nDG

ArrayBuffer<node> ogdf::EmbedderMinDepthPiTa::fPG_to_nDG
private

mapping faces (by ID) in G to nodes in DG

Definition at line 243 of file EmbedderMinDepthPiTa.h.

◆ G_nT

NodeArray<Graph> ogdf::EmbedderMinDepthPiTa::G_nT
private

given a node nT (cutvertex or block), G_nT is the subgraph of G associated with the subtree of the BC-tree T rooted at nT

Definition at line 291 of file EmbedderMinDepthPiTa.h.

◆ Gamma_adjExt_nT

NodeArray<adjEntry> ogdf::EmbedderMinDepthPiTa::Gamma_adjExt_nT
private

adjacency entry of the external face of G_nT[nT]

Definition at line 306 of file EmbedderMinDepthPiTa.h.

◆ knotTdiam

node ogdf::EmbedderMinDepthPiTa::knotTdiam
private

The knot of the diametrical tree.

Definition at line 231 of file EmbedderMinDepthPiTa.h.

◆ M_B

NodeArray<List<node> > ogdf::EmbedderMinDepthPiTa::M_B
private

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, B'} | c in B', B' != B}).

Definition at line 213 of file EmbedderMinDepthPiTa.h.

◆ m_cB

EdgeArray<int> ogdf::EmbedderMinDepthPiTa::m_cB
private

an array saving the length for each edge in the BC-tree

Definition at line 207 of file EmbedderMinDepthPiTa.h.

◆ m_useExtendedDepthDefinition

bool ogdf::EmbedderMinDepthPiTa::m_useExtendedDepthDefinition
private

Definition at line 73 of file EmbedderMinDepthPiTa.h.

◆ nBCTree_to_npBCTree

NodeArray<node> ogdf::EmbedderMinDepthPiTa::nBCTree_to_npBCTree
private

a mapping of nodes in bcTreePG to nodes in pBCTree->bcTree()

Definition at line 183 of file EmbedderMinDepthPiTa.h.

◆ nBlockCutfaceTree_to_nm_blockCutfaceTree

NodeArray<node> ogdf::EmbedderMinDepthPiTa::nBlockCutfaceTree_to_nm_blockCutfaceTree
private

mapping of nodes from the graph blockCutfaceTree to the BC-tree m_blockCutfaceTree

Definition at line 255 of file EmbedderMinDepthPiTa.h.

◆ nBlockCutfaceTree_to_nTdiam

NodeArray<node> ogdf::EmbedderMinDepthPiTa::nBlockCutfaceTree_to_nTdiam
private

Mapping nodes from block-cutvertex tree to the diametrical tree.

Definition at line 225 of file EmbedderMinDepthPiTa.h.

◆ nBlockEmbedding_to_nH

NodeArray<NodeArray<node> > ogdf::EmbedderMinDepthPiTa::nBlockEmbedding_to_nH
private

a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree

Definition at line 198 of file EmbedderMinDepthPiTa.h.

◆ nDG_to_fPG

NodeArray<int> ogdf::EmbedderMinDepthPiTa::nDG_to_fPG
private

mapping nodes in DG to faces in DG

Definition at line 246 of file EmbedderMinDepthPiTa.h.

◆ newOrder

NodeArray<List<adjEntry> > ogdf::EmbedderMinDepthPiTa::newOrder
private

saves for every node of G the new adjacency list

Definition at line 285 of file EmbedderMinDepthPiTa.h.

◆ nG_nT_to_nPG

NodeArray<NodeArray<node> > ogdf::EmbedderMinDepthPiTa::nG_nT_to_nPG
private

a mapping of nodes in G_nT to nodes in G

Definition at line 294 of file EmbedderMinDepthPiTa.h.

◆ nH_to_nBlockEmbedding

NodeArray<NodeArray<node> > ogdf::EmbedderMinDepthPiTa::nH_to_nBlockEmbedding
private

a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG

Definition at line 192 of file EmbedderMinDepthPiTa.h.

◆ nm_blockCutfaceTree_to_nBlockCutfaceTree

NodeArray<node> ogdf::EmbedderMinDepthPiTa::nm_blockCutfaceTree_to_nBlockCutfaceTree
private

mapping of nodes from the BC-tree m_blockCutfaceTree to the graph blockCutfaceTree

Definition at line 258 of file EmbedderMinDepthPiTa.h.

◆ nodeLength

NodeArray<NodeArray<int> > ogdf::EmbedderMinDepthPiTa::nodeLength
private

saving for each node in the block graphs its length

Definition at line 204 of file EmbedderMinDepthPiTa.h.

◆ npBCTree_to_nBCTree

NodeArray<node> ogdf::EmbedderMinDepthPiTa::npBCTree_to_nBCTree
private

a mapping of nodes in pBCTree->bcTree() to nodes in bcTreePG

Definition at line 186 of file EmbedderMinDepthPiTa.h.

◆ nPG_to_nG_nT

NodeArray<NodeArray<node> > ogdf::EmbedderMinDepthPiTa::nPG_to_nG_nT
private

a mapping of nodes in G to nodes in G_nT

Definition at line 297 of file EmbedderMinDepthPiTa.h.

◆ nTdiam_to_nBlockCutfaceTree

NodeArray<node> ogdf::EmbedderMinDepthPiTa::nTdiam_to_nBlockCutfaceTree
private

Mapping nodes from the diametrical tree to block-cutvertex tree.

Definition at line 228 of file EmbedderMinDepthPiTa.h.

◆ oneEdgeBlockNodes

List<node> ogdf::EmbedderMinDepthPiTa::oneEdgeBlockNodes
private

list of nodes which are only in one block which exists of extactly this node plus a cutvertex

Definition at line 276 of file EmbedderMinDepthPiTa.h.

◆ pm_blockCutfaceTree

BCTree* ogdf::EmbedderMinDepthPiTa::pm_blockCutfaceTree
private

the block-cutface tree of G (the BC-tree of the dual graph)

Definition at line 252 of file EmbedderMinDepthPiTa.h.

◆ Tdiam

Graph ogdf::EmbedderMinDepthPiTa::Tdiam
private

The diametrical tree of the block-cutface tree.

Definition at line 219 of file EmbedderMinDepthPiTa.h.

◆ Tdiam_initialized

bool ogdf::EmbedderMinDepthPiTa::Tdiam_initialized
private

Needed in computeTdiam function to know if first vertex was already inserted.

Definition at line 222 of file EmbedderMinDepthPiTa.h.

◆ tmpAdjExtFace

adjEntry ogdf::EmbedderMinDepthPiTa::tmpAdjExtFace
private

adjacency entry of the external face of the embedding of G

Definition at line 234 of file EmbedderMinDepthPiTa.h.


The documentation for this class was generated from the following file: