Dynamic BC-trees. More...
#include <ogdf/decomposition/DynamicBCTree.h>
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< node > | m_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 |
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 78 of file DynamicBCTree.h.
| 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()).
| G | is the original graph. |
Definition at line 166 of file DynamicBCTree.h.
A constructor.
This constructor does only call BCTree::BCTree() and DynamicBCTree::init().
| G | is the original graph. | |
| vG | is the vertex of the original graph which the DFS algorithm starts with. |
Definition at line 175 of file DynamicBCTree.h.
returns the BC-tree-vertex representing the B-component which two given vertices of the original graph are belonging to.
| uG | is a vertex of the original graph. | |
| vG | is a vertex of the original graph. |
The difference between BCTree::bComponent() and DynamicBCTree::bComponent() is, that the latter one considers the UNION/FIND-tree structures.
Reimplemented from ogdf::BCTree.
returns a BC-tree-vertex representing a biconnected component which a given vertex of the original graph is belonging to.
| vG | is a vertex of the original graph. |
The difference between BCTree::bcproper() and DynamicBCTree::bcproper() is, that the latter one considers the UNION/FIND-tree structures.
Reimplemented from ogdf::BCTree.
returns the BC-tree-vertex representing the biconnected component which a given edge of the original graph is belonging to.
| eG | is an edge of the original graph. |
The difference between BCTree::bcproper() and DynamicBCTree::bcproper() is, that the latter one considers the UNION/FIND-tree structures.
Reimplemented from ogdf::BCTree.
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().
| sG | is a vertex of the original graph. | |
| tG | is a vertex of the original graph. |
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.
| uB | is any vertex of m_B. | |
| vB | is any vertex of m_B. |
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 254 of file DynamicBCTree.h.
The FIND function of the UNION/FIND structure.
| vB | is any vertex of m_B. |
| void ogdf::DynamicBCTree::init | ( | ) | [protected] |
Initialization of m_bNode_owner and m_bNode_degree.
Reimplemented in ogdf::DynamicSPQRForest.
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().
| sG | is a vertex of the original graph. | |
| tG | is a vertex of the original graph. |
Definition at line 301 of file DynamicBCTree.h.
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().
| eG | is an edge of the original graph. |
Definition at line 310 of file DynamicBCTree.h.
returns the parent of a given BC-tree-vertex.
| vB | is any vertex of m_B or NULL. |
Reimplemented from ogdf::BCTree.
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.
| uG | is a vertex of the original graph. | |
| vB | is any vertex of m_B. |
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 221 of file DynamicBCTree.h.
The UNION function of the UNION/FIND structure.
| 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. |
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.
| 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
amortized time and the coponents graph in
amortized time per insertEdge() operation, where k is the number of such operations.
Reimplemented in ogdf::DynamicSPQRForest, and ogdf::DynamicSPQRTree.
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.
| 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
time.
Reimplemented in ogdf::DynamicSPQRForest, and ogdf::DynamicSPQRTree.
friend class PlanarAugmentation [friend] |
Definition at line 80 of file DynamicBCTree.h.
friend class PlanarAugmentationFix [friend] |
Definition at line 81 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 109 of file DynamicBCTree.h.
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 96 of file DynamicBCTree.h.