Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::DynamicBCTree Class Reference

Dynamic BC-trees. More...

#include <DynamicBCTree.h>

Inheritance diagram for ogdf::DynamicBCTree:

ogdf::BCTree ogdf::DynamicSPQRForest ogdf::DynamicSPQRTree ogdf::DynamicPlanarSPQRTree

List of all members.

Public Member Functions

 DynamicBCTree (Graph &G, bool callInitConnected=false)
 A constructor.
 DynamicBCTree (Graph &G, node vG, bool callInitConnected=false)
 A constructor.
node bcproper (node vG) const
 returns a BC-tree-vertex representing a biconnected component which a given vertex of the original graph is belonging to.
node bcproper (edge eG) const
 returns the BC-tree-vertex representing the biconnected component which a given edge of the original graph is belonging to.
node repVertex (node uG, node vB) const
 returns a vertex of the biconnected components graph corresponding to a given vertex of the original graph and belonging to the representation of a certain biconnected component given by a vertex of the BC-tree.
node cutVertex (node uB, node vB) const
 returns the copy of a cut-vertex in the biconnected components graph which belongs to a certain B-component and leads to another B-component.
virtual edge updateInsertedEdge (edge eG)
 Update of the dynamic BC-tree after edge insertion into the original graph.
virtual node updateInsertedNode (edge eG, edge fG)
 Update of the dynamic BC-tree after vertex insertion into the original graph.
edge insertEdge (node sG, node tG)
 inserts a new edge into the original graph and updates the BC-tree.
node insertNode (edge eG)
 inserts a new vertex into the original graph and updates the BC-tree.
node bComponent (node uG, node vG) const
 returns the BC-tree-vertex representing the B-component which two given vertices of the original graph are belonging to.

Protected Member Functions

void init ()
 Initialization of m_bNode_owner and m_bNode_degree.
node unite (node uB, node vB, node wB)
 The UNION function of the UNION/FIND structure.
node find (node vB) const
 The FIND function of the UNION/FIND structure.
node parent (node vB) const
 returns the parent of a given BC-tree-vertex.
node condensePath (node sG, node tG)
 performs path condensation.

Protected Attributes

NodeArray< nodem_bNode_owner
 Array that contains for each BC-tree-vertex its parent in its UNION/FIND-tree structure.
NodeArray< int > m_bNode_degree
 Array that contains for each proper BC-tree-vertex its degree.

Friends

class PlanarAugmentation
class PlanarAugmentationFix


Detailed Description

Dynamic BC-trees.

This class provides dynamic BC-trees.
The main difference of the dynamic BC-tree structure compared to the static one implemented by the class BCTree is, that B- and C-components are not any longer represented by single vertices of a BC-tree graph structure but by root vertices of UNION/FIND-trees. This allows path condensation within the BC-tree, when edges are inserted into the original graph. Path condensation is done by gathering BC-tree-vertices into a UNION/FIND-tree. However, the original vertices of the BC-tree remain in the m_B graph, but only those being the roots of their respective UNION/FIND-tree are proper representants of the biconnected components of the original graph.

Definition at line 76 of file DynamicBCTree.h.


Constructor & Destructor Documentation

ogdf::DynamicBCTree::DynamicBCTree ( Graph G,
bool  callInitConnected = false 
) [inline]

A constructor.

This constructor does only call BCTree::BCTree() and DynamicBCTree::init(). DynamicBCTree(G) is equivalent to DynamicBCTree(G, G.firstNode()).

Parameters:
G is the original graph.

Definition at line 164 of file DynamicBCTree.h.

ogdf::DynamicBCTree::DynamicBCTree ( Graph G,
node  vG,
bool  callInitConnected = false 
) [inline]

A constructor.

This constructor does only call BCTree::BCTree() and DynamicBCTree::init().

Parameters:
G is the original graph.
vG is the vertex of the original graph which the DFS algorithm starts with.

Definition at line 173 of file DynamicBCTree.h.


Member Function Documentation

void ogdf::DynamicBCTree::init (  )  [protected]

Initialization of m_bNode_owner and m_bNode_degree.

Reimplemented in ogdf::DynamicSPQRForest.

node ogdf::DynamicBCTree::unite ( node  uB,
node  vB,
node  wB 
) [protected]

The UNION function of the UNION/FIND structure.

Parameters:
uB is a vertex of the BC-tree representing a B-component.
vB is a vertex of the BC-tree representing a C-component.
wB is a vertex of the BC-tree representing a B-component.
Precondition:
uB and vB and wB have to be proper representants of their B-components, i.e. they have to be the root vertices of their respective UNION/FIND-trees.

uB and wB have to be adjacent to vB.

Returns:
the vertex properly representing the condensed B-component.

node ogdf::DynamicBCTree::find ( node  vB  )  const [protected]

The FIND function of the UNION/FIND structure.

Parameters:
vB is any vertex of m_B.
Returns:
the owner of vB properly representing a biconnected component, i.e. the root of the UNION/FIND-tree of vB.

node ogdf::DynamicBCTree::parent ( node  vB  )  const [protected, virtual]

returns the parent of a given BC-tree-vertex.

Parameters:
vB is any vertex of m_B or NULL.
Returns:
the parent of vB in the BC-tree structure, if vB is not the root of the BC-tree, and NULL, if vB is NULL or the root of the BC-tree. The UNION/FIND-tree structures are considered.

Reimplemented from ogdf::BCTree.

node ogdf::DynamicBCTree::condensePath ( node  sG,
node  tG 
) [protected]

performs path condensation.

This member function condenses the path from bcproper(sG) to bcproper(tG) in the BC-tree into one single B-component by calling findPath() and subsequently unite().

Parameters:
sG is a vertex of the original graph.
tG is a vertex of the original graph.
Returns:
the proper representant of the resulting B-component.

node ogdf::DynamicBCTree::bcproper ( node  vG  )  const [virtual]

returns a BC-tree-vertex representing a biconnected component which a given vertex of the original graph is belonging to.

Parameters:
vG is a vertex of the original graph.
Returns:
a vertex of the BC-tree:
  • If vG is not a cut-vertex, then typeOfGNode(vG) returns the very vertex of the BC-tree representing the unambiguous B-component which vG is belonging to.
  • If vG is a cut-vertex, then typeOfGNode(vG) returns the very vertex of the BC-tree representing the unambiguous C-component which vG is belonging to.
The difference between BCTree::bcproper() and DynamicBCTree::bcproper() is, that the latter one considers the UNION/FIND-tree structures.

Reimplemented from ogdf::BCTree.

node ogdf::DynamicBCTree::bcproper ( edge  eG  )  const [virtual]

returns the BC-tree-vertex representing the biconnected component which a given edge of the original graph is belonging to.

Parameters:
eG is an edge of the original graph.
Returns:
the vertex of the BC-tree representing the B-component which eG is belonging to.
The difference between BCTree::bcproper() and DynamicBCTree::bcproper() is, that the latter one considers the UNION/FIND-tree structures.

Reimplemented from ogdf::BCTree.

node ogdf::DynamicBCTree::repVertex ( node  uG,
node  vB 
) const [inline, virtual]

returns a vertex of the biconnected components graph corresponding to a given vertex of the original graph and belonging to the representation of a certain biconnected component given by a vertex of the BC-tree.

Parameters:
uG is a vertex of the original graph.
vB is any vertex of m_B.
Returns:
a vertex of the biconnected components graph:
  • If uG is belonging to the biconnected component represented by vB, then rep(uG,vB) returns the very vertex of the biconnected components graph corresponding to uG within the representation of vB.
  • Otherwise, NULL is returned.
The difference between BCTree::repVertex() and DynamicBCTree::repVertex() is, that the latter one considers the UNION/FIND-tree structures.

Reimplemented from ogdf::BCTree.

Definition at line 219 of file DynamicBCTree.h.

node ogdf::DynamicBCTree::cutVertex ( node  uB,
node  vB 
) const [inline, virtual]

returns the copy of a cut-vertex in the biconnected components graph which belongs to a certain B-component and leads to another B-component.

If two BC-tree-vertices are neighbours, then the biconnected components represented by them have exactly one cut-vertex in common. But there are several copies of this cut-vertex in the biconnected components graph, namely one copy for each biconnected component which the cut-vertex is belonging to. The member function rep() had been designed for returning the very copy of the cut-vertex belonging to the copy of the unambiguous C-component which it is belonging to, whereas this member function is designed to return the very copy of the cut-vertex connecting two biconnected components which belongs to the copy of the second one.

Parameters:
uB is any vertex of m_B.
vB is any vertex of m_B.
Returns:
a vertex of the biconnected components graph:
  • If uB == vB and they are representing a B-component, then cutVertex(uB,vB) returns NULL.
  • If uB == vB and they are representing a C-component, then cutVertex(uB,vB) returns the single isolated vertex in the biconnected components graph which is the copy of the C-component.
  • If uB and vB are neighbours in the BC-tree, then there exists a cut-vertex leading from the biconnected component represented by vB to the biconnected component represented by uB. cutVertex(uB,vB) returns the very copy of this vertex within the biconnected components graph which belongs to the copy of the biconnected component represented by vB.
  • Otherwise, cutVertex(uB,vB) returns NULL.
The difference between BCTree::cutVertex() and DynamicBCTree::cutVertex() is, that the latter one considers the UNION/FIND-tree structures.

Reimplemented from ogdf::BCTree.

Definition at line 252 of file DynamicBCTree.h.

virtual edge ogdf::DynamicBCTree::updateInsertedEdge ( edge  eG  )  [virtual]

Update of the dynamic BC-tree after edge insertion into the original graph.

This member function performs on-line maintenance of the dynamic BC-tree according to J. Westbrook and R. E. Tarjan, Maintaining Bridge-Connected and Biconnected Components On-Line, Algorithmica (1992) 7:433-464.

Parameters:
eG is a newly inserted edge of the original graph.
After a new edge has been inserted into the original graph by calling Graph::newEdge(), this member function updates the corresponding BC-tree in $O(\alpha(k,n))$ amortized time and the coponents graph in $O(1 + n/k)$ amortized time per insertEdge() operation, where k is the number of such operations.
Returns:
the new edge of the original graph.

Reimplemented in ogdf::DynamicSPQRForest, and ogdf::DynamicSPQRTree.

virtual node ogdf::DynamicBCTree::updateInsertedNode ( edge  eG,
edge  fG 
) [virtual]

Update of the dynamic BC-tree after vertex insertion into the original graph.

This member function performs on-line maintenance of the dynamic BC-tree according to J. Westbrook and R. E. Tarjan, Maintaining Bridge-Connected and Biconnected Components On-Line, Algorithmica (1992) 7:433-464.

Parameters:
eG is the incoming edge of the newly inserted vertex which has been generated by a Graph::split() operation.
fG is the outgoing edge of the newly inserted vertex which has been generated by a Graph::split() operation.
After a new vertex has been inserted into an edge of the original graph by splitting the edge, all data structures of the DynamicBCTree class are updated by this member funtion. It takes $O(1)$ time.
Returns:
the new vertex of the original graph.

Reimplemented in ogdf::DynamicSPQRForest, and ogdf::DynamicSPQRTree.

edge ogdf::DynamicBCTree::insertEdge ( node  sG,
node  tG 
) [inline]

inserts a new edge into the original graph and updates the BC-tree.

This member function inserts a new edge between sG and tG into the original graph and then calls updateInsertedEdge().

Parameters:
sG is a vertex of the original graph.
tG is a vertex of the original graph.
Returns:
the new edge of the original graph.

Definition at line 299 of file DynamicBCTree.h.

node ogdf::DynamicBCTree::insertNode ( edge  eG  )  [inline]

inserts a new vertex into the original graph and updates the BC-tree.

This member function inserts a new vertex into the original graph by splitting the edge eG and then calls updateInsertedNode().

Parameters:
eG is an edge of the original graph.
Returns:
the new vertex of the original graph.

Definition at line 308 of file DynamicBCTree.h.

node ogdf::DynamicBCTree::bComponent ( node  uG,
node  vG 
) const

returns the BC-tree-vertex representing the B-component which two given vertices of the original graph are belonging to.

Parameters:
uG is a vertex of the original graph.
vG is a vertex of the original graph.
Returns:
If uG and vG are belonging to the same B-component, the very vertex of the BC-tree representing this B-component is returned. Otherwise, NULL is returned. This member function returns the representant of the correct B-component even if uG or vG or either are cut-vertices and are therefore belonging to C-components, too.
The difference between BCTree::bComponent() and DynamicBCTree::bComponent() is, that the latter one considers the UNION/FIND-tree structures.

Reimplemented from ogdf::BCTree.


Friends And Related Function Documentation

friend class PlanarAugmentation [friend]

Definition at line 78 of file DynamicBCTree.h.

friend class PlanarAugmentationFix [friend]

Definition at line 79 of file DynamicBCTree.h.


Member Data Documentation

NodeArray<node> ogdf::DynamicBCTree::m_bNode_owner [mutable, protected]

Array that contains for each BC-tree-vertex its parent in its UNION/FIND-tree structure.

For each vertex vB of the BC-tree structure:

Definition at line 94 of file DynamicBCTree.h.

NodeArray<int> ogdf::DynamicBCTree::m_bNode_degree [protected]

Array that contains for each proper BC-tree-vertex its degree.

For each vertex vB of the BC-tree structure:

Definition at line 107 of file DynamicBCTree.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:09 2007 by doxygen 1.5.4.