#include <DynamicSPQRForest.h>

Public Types | |
| enum | TNodeType { SComp, PComp, RComp } |
| Enumeration type for characterizing the SPQR-tree-vertices. More... | |
Public Member Functions | |
| DynamicSPQRForest (Graph &G) | |
| A constructor. | |
| node | spqrproper (edge eH) const |
| finds the proper representant of the SPQR-tree-vertex which a given real or virtual edge is belonging to. | |
| edge | twinEdge (edge eH) const |
| returns the twin edge of a given edge of m_H, if it is virtual, or NULL, if it is real. | |
| TNodeType | typeOfTNode (node vT) const |
| returns the type of the triconnected component represented by a given SPQR-tree-vertex. | |
| const List< edge > & | hEdgesSPQR (node vT) const |
| returns a linear list of the edges in m_H belonging to the triconnected component represented by a given SPQR-tree-vertex. | |
| SList< node > & | findPathSPQR (node sH, node tH) const |
| finds the shortest path between the two sets of SPQR-tree-vertices which sH and tH are belonging to. | |
| edge | virtualEdge (node vT, node wT) const |
| returns the virtual edge which leads from one vertex of an SPQR-tree to another one. | |
| edge | updateInsertedEdge (edge eG) |
| updates the whole data structure after a new edge has been inserted into the original graph. | |
| node | updateInsertedNode (edge eG, edge fG) |
| updates the whole data structure after a new vertex has been inserted into the original graph by splitting an edge into eG and fG. | |
Protected Member Functions | |
| void | init () |
| Initialization. | |
| void | createSPQR (node vB) const |
| creates the SPQR-tree for a given B-component of the BC-tree. | |
| node | uniteSPQR (node vB, node sT, node tT) |
| unites two SPQR-tree-vertices (UNION part of UNION/FIND). | |
| node | findSPQR (node vT) const |
| finds the proper representant of an SPQR-tree-vertex (FIND part of UNION/FIND). | |
| node | findNCASPQR (node sT, node tT) const |
| finds the nearest common ancestor of sT and tT. | |
| SList< node > & | findPathSPQR (node sH, node tH, node &rT) const |
| finds the shortest path between the two sets of SPQR-tree-vertices which sH and tH are belonging to. | |
| edge | updateInsertedEdgeSPQR (node vB, edge eG) |
| updates an SPQR-tree after a new edge has been inserted into the original graph. | |
| node | updateInsertedNodeSPQR (node vB, edge eG, edge fG) |
| updates an SPQR-tree after a new vertex has been inserted into the original graph by splitting an edge into eG and fG. | |
Protected Attributes | |
| Graph | m_T |
| A Graph structure containing all SPQR-trees. | |
| NodeArray< node > | m_bNode_SPQR |
| The root vertices of the SPQR-trees. | |
| NodeArray< int > | m_bNode_numS |
| The numbers of S-components. | |
| NodeArray< int > | m_bNode_numP |
| The numbers of P-components. | |
| NodeArray< int > | m_bNode_numR |
| The numbers of R-components. | |
| NodeArray< TNodeType > | m_tNode_type |
| The types of the SPQR-tree-vertices. | |
| NodeArray< node > | m_tNode_owner |
| The owners of the SPQR-tree-vertices in the UNION/FIND structure. | |
| NodeArray< edge > | m_tNode_hRefEdge |
| The virtual edges leading to the parents of the SPQR-tree-vertices. | |
| NodeArray< List< edge > > | m_tNode_hEdges |
| Lists of real and virtual edges belonging to SPQR-tree-vertices. | |
| EdgeArray< ListIterator< edge > > | m_hEdge_position |
| The positions of real and virtual edges in their m_tNode_hEdges lists. | |
| EdgeArray< node > | m_hEdge_tNode |
| The SPQR-tree-vertices which the real and virtual edges are belonging to. | |
| EdgeArray< edge > | m_hEdge_twinEdge |
| The partners of virtual edges (NULL if real). | |
| NodeArray< node > | m_htogc |
| Auxiliary array used by createSPQR(). | |
| NodeArray< bool > | m_tNode_isMarked |
| Auxiliary array used by findNCASPQR(). | |
This class is an extension of DynamicBCTree.
It provides a set of SPQR-trees for each B-component of a BC-tree. These SPQR-trees are dynamic, i.e. there are member functions for dynamic updates (edge insertion and node insertion).
Definition at line 70 of file DynamicSPQRForest.h.
Enumeration type for characterizing the SPQR-tree-vertices.
| SComp | denotes a vertex representing an S-component. |
| PComp | denotes a vertex representing a P-component. |
| RComp | denotes a vertex representing an R-component. |
Definition at line 86 of file DynamicSPQRForest.h.
| ogdf::DynamicSPQRForest::DynamicSPQRForest | ( | Graph & | G | ) | [inline] |
A constructor.
This constructor does only create the dynamic BC-tree rooted at the first edge of G. The data structure is prepared for dealing with SPQR-trees, but they will only be created on demand. Cf. member functions findPathSPQR() and updateInsertedEdge().
| G | is the original graph. |
Definition at line 286 of file DynamicSPQRForest.h.
| void ogdf::DynamicSPQRForest::init | ( | ) | [protected] |
| void ogdf::DynamicSPQRForest::createSPQR | ( | node | vB | ) | const [protected] |
creates the SPQR-tree for a given B-component of the BC-tree.
An SPQR-tree belonging to a B-component of the BC-tree is only created on demand, i.e. this member function is only called by findSPQRTree() and - under certain circumstances - by updateInsertedEdge().
| vB | is a vertex of the BC-tree representing a B-component. |
The B-component represented by vB must contain at least 3 edges.
unites two SPQR-tree-vertices (UNION part of UNION/FIND).
| vB | is a vertex of the BC-tree representing a B-component. | |
| sT | is a vertex of the SPQR-tree belonging to vB. | |
| tT | is a vertex of the SPQR-tree belonging to vB. |
sT and tT have to be proper representants of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FIND-trees.
finds the proper representant of an SPQR-tree-vertex (FIND part of UNION/FIND).
| vT | is any vertex of m_T. |
finds the nearest common ancestor of sT and tT.
| sT | is a vertex of an SPQR-tree. | |
| tT | is a vertex of an SPQR-tree. |
sT and tT have to be proper representants of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FIND-trees.
| SList<node>& ogdf::DynamicSPQRForest::findPathSPQR | ( | node | sH, | |
| node | tH, | |||
| node & | rT | |||
| ) | const [protected] |
finds the shortest path between the two sets of SPQR-tree-vertices which sH and tH are belonging to.
| sH | is a vertex of m_H. | |
| tH | is a vertex of m_H. | |
| rT | is a reference! It is set to the very vertex of the found path which is nearest to the root vertex of the SPQR-tree. |
updates an SPQR-tree after a new edge has been inserted into the original graph.
| vB | is a BC-tree-vertex representing a B-component. The SPQR-tree, which is to be updated is identified by it. | |
| eG | is a new edge in the original graph. |
Both the source and the target vertices of eG must belong to the same B-component represented by vB.
updates an SPQR-tree after a new vertex has been inserted into the original graph by splitting an edge into eG and fG.
| vB | is a BC-tree-vertex representing a B-component. The SPQR-tree, which is to be updated is identified by it. | |
| 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. |
finds the proper representant of the SPQR-tree-vertex which a given real or virtual edge is belonging to.
This member function has to be used carefully (see Precondition)!
| eH | is an edge of m_H. |
Definition at line 303 of file DynamicSPQRForest.h.
returns the twin edge of a given edge of m_H, if it is virtual, or NULL, if it is real.
| eH | is an edge of m_H. |
Definition at line 311 of file DynamicSPQRForest.h.
returns the type of the triconnected component represented by a given SPQR-tree-vertex.
| vT | is a vertex of an SPQR-tree. |
Definition at line 323 of file DynamicSPQRForest.h.
returns a linear list of the edges in m_H belonging to the triconnected component represented by a given SPQR-tree-vertex.
| vT | is a vertex of an SPQR-tree. |
Definition at line 335 of file DynamicSPQRForest.h.
finds the shortest path between the two sets of SPQR-tree-vertices which sH and tH are belonging to.
| sH | is a vertex of m_H. | |
| tH | is a vertex of m_H. |
returns the virtual edge which leads from one vertex of an SPQR-tree to another one.
| vT | is a vertex of an SPQR-tree. | |
| wT | is a vertex of an SPQR-tree. |
vT and wT have to be proper representants of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FIND-trees. This condition is particularly fulfilled if vT and wT are members of a list gained by the findPathSPQR() member function.
updates the whole data structure after a new edge has been inserted into the original graph.
This member function generally updates both BC- and SPQR-trees. If any SPQR-tree of the B-components of the insertion path through the BC-tree exists, the SPQR-tree data structure of the resulting B-component will be valid afterwards. If none of the SPQR-trees does exist in advance, then only the BC-tree is updated and no SPQR-tree is created.
| eG | is a new edge in the original graph. |
Reimplemented from ogdf::DynamicBCTree.
Reimplemented in ogdf::DynamicSPQRTree.
updates the whole data structure after a new vertex has been inserted into the original graph by splitting an edge into eG and fG.
This member function updates the BC-tree at first. If the SPQR-tree of the B-component which the split edge is belonging to does exist, then it is updated, too. If it does not exist, it is not created.
| 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. |
Reimplemented from ogdf::DynamicBCTree.
Reimplemented in ogdf::DynamicSPQRTree.
Graph ogdf::DynamicSPQRForest::m_T [mutable, protected] |
NodeArray<node> ogdf::DynamicSPQRForest::m_bNode_SPQR [mutable, protected] |
The root vertices of the SPQR-trees.
For each vertex of the BC-tree representing a B-component, this array contains the root vertex of the respective SPQR-tree, or NULL, if the SPQR-tree does not exist.
Definition at line 102 of file DynamicSPQRForest.h.
NodeArray<int> ogdf::DynamicSPQRForest::m_bNode_numS [mutable, protected] |
The numbers of S-components.
For each vertex of the BC-tree representing a B-component, this array contains the number of S-components of the respective SPQR-tree. If the SPQR-tree does not exist, then the array member is undefined.
Definition at line 111 of file DynamicSPQRForest.h.
NodeArray<int> ogdf::DynamicSPQRForest::m_bNode_numP [mutable, protected] |
The numbers of P-components.
For each vertex of the BC-tree representing a B-component, this array contains the number of P-components of the respective SPQR-tree. If the SPQR-tree does not exist, then the array member is undefined.
Definition at line 120 of file DynamicSPQRForest.h.
NodeArray<int> ogdf::DynamicSPQRForest::m_bNode_numR [mutable, protected] |
The numbers of R-components.
For each vertex of the BC-tree representing a B-component, this array contains the number of R-components of the respective SPQR-tree. If the SPQR-tree does not exist, then the array member is undefined.
Definition at line 129 of file DynamicSPQRForest.h.
NodeArray<TNodeType> ogdf::DynamicSPQRForest::m_tNode_type [mutable, protected] |
NodeArray<node> ogdf::DynamicSPQRForest::m_tNode_owner [mutable, protected] |
The owners of the SPQR-tree-vertices in the UNION/FIND structure.
Definition at line 139 of file DynamicSPQRForest.h.
NodeArray<edge> ogdf::DynamicSPQRForest::m_tNode_hRefEdge [mutable, protected] |
The virtual edges leading to the parents of the SPQR-tree-vertices.
Definition at line 144 of file DynamicSPQRForest.h.
NodeArray<List<edge> > ogdf::DynamicSPQRForest::m_tNode_hEdges [mutable, protected] |
Lists of real and virtual edges belonging to SPQR-tree-vertices.
Definition at line 149 of file DynamicSPQRForest.h.
EdgeArray<ListIterator<edge> > ogdf::DynamicSPQRForest::m_hEdge_position [mutable, protected] |
The positions of real and virtual edges in their m_tNode_hEdges lists.
Definition at line 155 of file DynamicSPQRForest.h.
EdgeArray<node> ogdf::DynamicSPQRForest::m_hEdge_tNode [mutable, protected] |
The SPQR-tree-vertices which the real and virtual edges are belonging to.
Definition at line 160 of file DynamicSPQRForest.h.
EdgeArray<edge> ogdf::DynamicSPQRForest::m_hEdge_twinEdge [mutable, protected] |
NodeArray<node> ogdf::DynamicSPQRForest::m_htogc [mutable, protected] |
NodeArray<bool> ogdf::DynamicSPQRForest::m_tNode_isMarked [mutable, protected] |