#include <BCTree.h>

Public Types | |
| enum | GNodeType { Normal, CutVertex } |
| Enumeration type for characterizing the vertices of the original graph. More... | |
| enum | BNodeType { BComp, CComp } |
| Enumeration type for characterizing the BC-tree-vertices. More... | |
Public Member Functions | |
| BCTree (Graph &G, bool callInitConnected=false) | |
| A constructor. | |
| BCTree (Graph &G, node vG, bool callInitConnected=false) | |
| A constructor. | |
| virtual | ~BCTree () |
| Virtual destructor. | |
| const Graph & | originalGraph () const |
| returns the original graph. | |
| const Graph & | bcTree () const |
| returns the BC-tree graph. | |
| const Graph & | auxiliaryGraph () const |
| returns the biconnected components graph. | |
| int | numberOfBComps () const |
| returns the number of B-components. | |
| int | numberOfCComps () const |
| returns the number of C-components. | |
| GNodeType | typeOfGNode (node vG) const |
| returns the type of a vertex of the original graph. | |
| virtual 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. | |
| virtual 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 | rep (node vG) const |
| returns a vertex of the biconnected components graph corresponding to a given vertex of the original graph. | |
| edge | rep (edge eG) const |
| returns the edge of the biconnected components graph corresponding to a given edge of the original graph. | |
| node | original (node vH) |
| returns the vertex of the original graph which a given vertex of the biconnected components graph is corresponding to. | |
| edge | original (edge eH) const |
| returns the edge of the original graph which a given edge of the biconnected components graph is corresponding to. | |
| BNodeType | typeOfBNode (node vB) const |
| returns the type of the biconnected component represented by a given BC-tree-vertex. | |
| const SList< edge > & | hEdges (node vB) const |
| returns a linear list of the edges of the biconnected components graph belonging to the biconnected component represented by a given BC-tree-vertex. | |
| int | numberOfEdges (node vB) const |
| returns the number of edges belonging to the biconnected component represented by a given BC-tree-vertex. | |
| int | numberOfNodes (node vB) const |
| returns the number of vertices belonging to the biconnected component represented by a given BC-tree-vertex. | |
| 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. | |
| SList< node > & | findPath (node sG, node tG) const |
| calculates a path in the BC-tree. | |
| SList< node > & | findPathBCTree (node sB, node tB) const |
| calculates a path in the BC-tree. | |
| virtual 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. | |
| virtual 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. | |
Protected Member Functions | |
| void | init (node vG) |
| Initialization. | |
| void | initNotConnected (node vG) |
| Initialization for not connected graphs. | |
| void | biComp (adjEntry adjuG, node vG) |
| generates the BC-tree and the biconnected components graph recursively. | |
| virtual node | parent (node vB) const |
| returns the parent of a given BC-tree-vertex. | |
| node | findNCA (node uB, node vB) const |
| calculates the nearest common ancestor of two vertices of the BC-tree. | |
Protected Attributes | |
| Graph & | m_G |
| The original graph. | |
| Graph | m_B |
| The BC-tree. | |
| Graph | m_H |
| The biconnected components graph. | |
| int | m_numB |
| The number of B-components. | |
| int | m_numC |
| The number of C-components. | |
| NodeArray< bool > | m_gNode_isMarked |
| Array of marks for the vertices of the original graph. | |
| NodeArray< node > | m_gNode_hNode |
| An injective mapping vertices(G) -> vertices(H). | |
| EdgeArray< edge > | m_gEdge_hEdge |
| A bijective mapping edges(G) -> edges(H). | |
| NodeArray< BNodeType > | m_bNode_type |
| Array that contains the type of each BC-tree-vertex. | |
| NodeArray< bool > | m_bNode_isMarked |
| Array of marks for the BC-tree-vertices. | |
| NodeArray< node > | m_bNode_hRefNode |
| Array that contains for each BC-tree-vertex the representant of its parent within the subgraph in the biconnected components graph belonging to the biconnected component represented by the respective BC-tree-vertex. | |
| NodeArray< node > | m_bNode_hParNode |
| Array that contains for each BC-tree-vertex the representant of itself within the subgraph in the biconnected components graph belonging to the biconnected component represented by the parent of the respective BC-tree-vertex. | |
| NodeArray< SList< edge > > | m_bNode_hEdges |
| Array that contains for each BC-tree-vertex a linear list of the edges of the biconnected components graph belonging to the biconnected component represented by the respective BC-tree-vertex. | |
| NodeArray< int > | m_bNode_numNodes |
| Array that contains for each BC-tree-vertex the number of vertices belonging to the biconnected component represented by the respective BC-tree-vertex. | |
| NodeArray< node > | m_hNode_bNode |
| A surjective mapping vertices(H) -> vertices(B). | |
| EdgeArray< node > | m_hEdge_bNode |
| A surjective mapping edges(H) -> vertices(B). | |
| NodeArray< node > | m_hNode_gNode |
| A surjective mapping vertices(H) -> vertices(G). | |
| EdgeArray< edge > | m_hEdge_gEdge |
| A bijective mapping edges(H) -> edges(G). | |
| int | m_count |
| Temporary variable. | |
| NodeArray< int > | m_number |
| Temporary array. | |
| NodeArray< int > | m_lowpt |
| Temporary array. | |
| BoundedStack< adjEntry > | m_eStack |
| Temporary stack. | |
| NodeArray< node > | m_gtoh |
| Temporary array. | |
| SList< node > | m_nodes |
| Temporary list. | |
This class provides static BC-trees.
The data structure consists of three parts:
Definition at line 78 of file BCTree.h.
| ogdf::BCTree::BCTree | ( | Graph & | G, | |
| bool | callInitConnected = false | |||
| ) | [inline] |
A constructor.
This constructor does only call init() or initNotConnected().
| G | is the original graph. | |
| vG | is the vertex of the original graph which the DFS algorithm starts | |
| callInitConnected | decides which init is called, default call is init() |
| virtual ogdf::BCTree::~BCTree | ( | ) | [inline, virtual] |
| void ogdf::BCTree::init | ( | node | vG | ) | [protected] |
Initialization.
initializes all data structures and generates the BC-tree and the biconnected components graph by call to biComp().
| vG | is the vertex of the original graph which the DFS algorithm starts with. |
| void ogdf::BCTree::initNotConnected | ( | node | vG | ) | [protected] |
Initialization for not connected graphs.
initializes all data structures and generates a forest of BC-trees and the biconnected components graph by call to biComp().
| vG | is the vertex of the original graph which the DFS algorithm starts first with. |
generates the BC-tree and the biconnected components graph recursively.
The DFS algorithm is based on J. Hopcroft and R. E. Tarjan: Algorithm 447: Efficient algorithms for graph manipulation. Comm. ACM, 16:372-378 (1973).
returns the parent of a given BC-tree-vertex.
| vB | is a vertex of the BC-tree or NULL. |
Reimplemented in ogdf::DynamicBCTree.
calculates the nearest common ancestor of two vertices of the BC-tree.
| uB | is a vertex of the BC-tree. | |
| vB | is a vertex of the BC-tree. |
| const Graph& ogdf::BCTree::originalGraph | ( | ) | const [inline] |
| const Graph& ogdf::BCTree::bcTree | ( | ) | const [inline] |
| const Graph& ogdf::BCTree::auxiliaryGraph | ( | ) | const [inline] |
| int ogdf::BCTree::numberOfBComps | ( | ) | const [inline] |
| int ogdf::BCTree::numberOfCComps | ( | ) | const [inline] |
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. |
Reimplemented in ogdf::DynamicBCTree.
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. |
Reimplemented in ogdf::DynamicBCTree.
returns a vertex of the biconnected components graph corresponding to a given vertex of the original graph.
| vG | is a vertex of the original graph. |
returns a linear list of the edges of the biconnected components graph belonging to the biconnected component represented by a given BC-tree-vertex.
| vB | is a vertex of the BC-tree. |
| int ogdf::BCTree::numberOfEdges | ( | node | vB | ) | const [inline] |
returns the number of edges belonging to the biconnected component represented by a given BC-tree-vertex.
| vB | is a vertex of the BC-tree. |
| int ogdf::BCTree::numberOfNodes | ( | node | vB | ) | const [inline] |
returns the number of vertices belonging to the biconnected component represented by a given BC-tree-vertex.
| vB | is a vertex of the BC-tree. |
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. |
Reimplemented in ogdf::DynamicBCTree.
calculates a path in the BC-tree.
| sG | is a vertex of the original graph. | |
| tG | is a vertex of the original graph. |
calculates a path in the BC-tree.
| sB | is a vertex of the BC-tree. | |
| tB | is a vertex of the BC-tree. |
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 a vertex of the BC-tree. |
Reimplemented in ogdf::DynamicBCTree.
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 a vertex of the BC-tree. | |
| vB | is a vertex of the BC-tree. |
Reimplemented in ogdf::DynamicBCTree.
Graph& ogdf::BCTree::m_G [protected] |
Graph ogdf::BCTree::m_B [protected] |
Graph ogdf::BCTree::m_H [mutable, protected] |
The biconnected components graph.
This graph contains copies of the the biconnected components (B-components) and the cut-vertices (C-components) of the original graph. The copies of the B- and C-components of the original graph are not interconnected, i.e. the biconnected components graph is representing B-components as isolated biconnected subgraphs and C-components as isolated single vertices. Thus the copies of the edges and non-cut-vertices of the original graph are unambiguous, but each cut-vertex of the original graph being common to a C-component and several B-components appears multiple times.
int ogdf::BCTree::m_numB [protected] |
int ogdf::BCTree::m_numC [protected] |
NodeArray<bool> ogdf::BCTree::m_gNode_isMarked [protected] |
NodeArray<node> ogdf::BCTree::m_gNode_hNode [protected] |
An injective mapping vertices(G) -> vertices(H).
For each vertex vG of the original graph:
EdgeArray<edge> ogdf::BCTree::m_gEdge_hEdge [protected] |
NodeArray<BNodeType> ogdf::BCTree::m_bNode_type [protected] |
NodeArray<bool> ogdf::BCTree::m_bNode_isMarked [mutable, protected] |
NodeArray<node> ogdf::BCTree::m_bNode_hRefNode [protected] |
Array that contains for each BC-tree-vertex the representant of its parent within the subgraph in the biconnected components graph belonging to the biconnected component represented by the respective BC-tree-vertex.
For each vertex vB of the BC-tree:
NodeArray<node> ogdf::BCTree::m_bNode_hParNode [protected] |
Array that contains for each BC-tree-vertex the representant of itself within the subgraph in the biconnected components graph belonging to the biconnected component represented by the parent of the respective BC-tree-vertex.
NodeArray<SList<edge> > ogdf::BCTree::m_bNode_hEdges [protected] |
Array that contains for each BC-tree-vertex a linear list of the edges of the biconnected components graph belonging to the biconnected component represented by the respective BC-tree-vertex.
For each vertex vB of the BC-tree:
NodeArray<int> ogdf::BCTree::m_bNode_numNodes [protected] |
Array that contains for each BC-tree-vertex the number of vertices belonging to the biconnected component represented by the respective BC-tree-vertex.
For each vertex vB of the BC-tree:
NodeArray<node> ogdf::BCTree::m_hNode_bNode [mutable, protected] |
A surjective mapping vertices(H) -> vertices(B).
For each vertex vH of the biconnected components graph, m_hNode_bNode[vH] is the very BC-tree-vertex representing the B- or C-component with respect to the copy of the very block or representation of a cut-vertex, which vH is belonging to.
EdgeArray<node> ogdf::BCTree::m_hEdge_bNode [mutable, protected] |
NodeArray<node> ogdf::BCTree::m_hNode_gNode [protected] |
EdgeArray<edge> ogdf::BCTree::m_hEdge_gEdge [protected] |
int ogdf::BCTree::m_count [protected] |
NodeArray<int> ogdf::BCTree::m_number [protected] |
NodeArray<int> ogdf::BCTree::m_lowpt [protected] |
BoundedStack<adjEntry> ogdf::BCTree::m_eStack [protected] |
NodeArray<node> ogdf::BCTree::m_gtoh [protected] |
SList<node> ogdf::BCTree::m_nodes [protected] |