Dynamic SPQRforest. More...
#include <ogdf/decomposition/DynamicSPQRForest.h>
Public Types  
enum  TNodeType { TNodeType::SComp, TNodeType::PComp, TNodeType::RComp } 
Enumeration type for characterizing the SPQRtreevertices. More...  
Public Types inherited from ogdf::BCTree  
enum  BNodeType { BNodeType::BComp, BNodeType::CComp } 
Enumeration type for characterizing the BCtreevertices. More...  
enum  GNodeType { GNodeType::Normal, GNodeType::CutVertex } 
Enumeration type for characterizing the vertices of the original graph. More...  
Public Member Functions  
DynamicSPQRForest (Graph &G, bool not_connected=false)  
A constructor. More...  
DynamicSPQRForest (Graph &G, node vG, bool not_connected=false)  
A constructor. More...  
~DynamicSPQRForest ()  
node  spqrproper (edge eH) const 
void  createSPQR (node vB) const 
Creates the SPQRtree for a given Bcomponent of the BCtree. More...  
node  spqrroot (node vB) const 
Returns the root of the SPQRtree for a given Bcomponent of the BCtree. More...  
int  numberOfSNodes (node vB) const 
Returns the number of Snodes in the SPQRtree for a given Bcomponent of the BCtree. More...  
int  numberOfPNodes (node vB) const 
Returns the number of Pnodes in the SPQRtree for a given Bcomponent of the BCtree. More...  
int  numberOfRNodes (node vB) const 
Returns the number of Rnodes in the SPQRtree for a given Bcomponent of the BCtree. More...  
const Graph &  spqrTree () const 
Returns the SPQRtree graph. More...  
node  spqrParent (node vT) const 
Returns the parent node of a node of the SPQRtree Graph, or nullptr if vT is a root. More...  
edge  spqrParentEdge (node vT) const 
Returns the virtual edge leading to the parents of a SPQRtree vertex, or nullptr if vT is a root. More...  
node  spqrNodeOf (edge eH) const 
The SPQRtreevertex which a real or virtual edge eH belongs to, if the SPQRtree has been created using createSPQR. More...  
edge  twinEdge (edge eH) const 
Returns the twin edge of a given edge of m_H, if it is virtual, or nullptr, if it is real. More...  
TNodeType  typeOfTNode (node vT) const 
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 SPQRtreevertex. More...  
SList< node > &  findPathSPQR (node sH, node tH) const 
Finds the shortest path between the two sets of SPQRtreevertices which sH and tH are belonging to. More...  
edge  virtualEdge (node vT, node wT) const 
Returns the virtual edge which leads from one vertex of an SPQRtree to another one. More...  
edge  updateInsertedEdge (edge eG) override 
node  updateInsertedNode (edge eG, edge fG) override 
Updates the whole data structure after a new vertex has been inserted into the original graph by splitting an edge into eG and fG . More...  
Public Member Functions inherited from ogdf::DynamicBCTree  
DynamicBCTree (Graph &G, bool not_connected=false)  
DynamicBCTree (Graph &G, node vG, bool not_connected=false)  
A constructor. More...  
node  bccomp (node vH) const override 
node  bccomp (edge eH) const override 
Returns the BCtreevertex representing the biconnected component which a given edge of the auxiliary graph is belonging to. More...  
node  repVertex (node uG, node vB) const override 
node  cutVertex (node uB, node vB) const override 
Returns the copy of a cutvertex in the biconnected components graph which belongs to a certain Bcomponent and leads to another Bcomponent. More...  
edge  insertEdge (node sG, node tG) 
Inserts a new edge into the original graph and updates the BCtree. More...  
node  insertNode (edge eG) 
Inserts a new vertex into the original graph and updates the BCtree. More...  
node  bComponent (node uG, node vG) const 
Public Member Functions inherited from ogdf::BCTree  
BCTree (BCTree &&move)=delete  
BCTree (const BCTree ©)=delete  
BCTree (Graph &G, bool not_connected=false)  
A constructor. More...  
BCTree (Graph &G, List< node > &vG)  
Constructor for not connected graphs. More...  
BCTree (Graph &G, node vG, bool not_connected=false)  
A constructor. More...  
virtual  ~BCTree () 
Virtual destructor. More...  
void  consistencyCheck () const 
Asserts that this BCTree is consistent. More...  
BCTree &  operator= (BCTree &&move)=delete 
BCTree &  operator= (const BCTree ©)=delete 
const Graph &  originalGraph () const 
Returns the original graph. More...  
const Graph &  bcTree () const 
Returns the BCtree graph. More...  
const Graph &  auxiliaryGraph () const 
Returns the biconnected components graph. More...  
int  numberOfBComps () const 
Returns the number of Bcomponents. More...  
int  numberOfCComps () const 
Returns the number of Ccomponents. More...  
GNodeType  typeOfGNode (node vG) const 
node  bcproper (node vG) const 
Returns a BCtreevertex representing a biconnected component which a given vertex of the original graph is belonging to. More...  
node  bcproper (edge eG) const 
Returns the BCtreevertex representing the biconnected component which a given edge of the original graph is belonging to. More...  
node  rep (node vG) const 
Returns a vertex of the biconnected components graph corresponding to a given vertex of the original graph. More...  
edge  rep (edge eG) const 
Returns the edge of the biconnected components graph corresponding to a given edge of the original graph. More...  
node  original (node vH) const 
edge  original (edge eH) const 
Returns the edge of the original graph which a given edge of the biconnected components graph is corresponding to. More...  
BNodeType  typeOfBNode (node vB) const 
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 BCtreevertex. More...  
int  numberOfEdges (node vB) const 
Returns the number of edges belonging to the biconnected component represented by a given BCtreevertex. More...  
int  numberOfNodes (node vB) const 
Returns the number of vertices belonging to the biconnected component represented by a given BCtreevertex. More...  
node  bComponent (node uG, node vG) const 
SList< node > &  findPath (node sG, node tG) const 
Calculates a path in the BCtree. More...  
SList< node > *  findPathBCTree (node sB, node tB) const 
Calculates a path in the BCtree. More...  
Protected Member Functions  
void  addHEdge (edge eH, node vT) const 
Adds edge eH to a vertex vT of the SPQRForest. More...  
void  delHEdge (edge eH, node vT) const 
Deletes edge eH from m_H and removes its connection to a vertex vT of the SPQRForest. More...  
void  init () 
Initialization. More...  
node  newSPQRNode (node vB, const TNodeType spqrNodeType) const 
Creates a new node in the SPQRtree for a given Bcomponent of the BCtree. More...  
edge  newTwinEdge (edge eH, node vT) const 
Creates a twin edge for eH , adds it to vT and returns it. More...  
node  uniteSPQR (node vB, node sT, node tT) 
node  findSPQR (node vT) const 
Finds the proper representative of an SPQRtreevertex (FIND part of UNION/FIND). More...  
node  findNCASPQR (node sT, node tT) const 
SList< node > &  findPathSPQR (node sH, node tH, node &rT) const 
Finds the shortest path between the two sets of SPQRtreevertices which sH and tH are belonging to. More...  
edge  updateInsertedEdgeSPQR (node vB, edge eG) 
node  updateInsertedNodeSPQR (node vB, edge eG, edge fG) 
Updates an SPQRtree after a new vertex has been inserted into the original graph by splitting an edge into eG and fG . More...  
Protected Member Functions inherited from ogdf::DynamicBCTree  
void  init () 
node  unite (node uB, node vB, node wB) 
node  find (node vB) const 
The FIND function of the UNION/FIND structure. More...  
node  parent (node vB) const override 
node  condensePath (node sG, node tG) 
Performs path condensation. More...  
Protected Member Functions inherited from ogdf::BCTree  
void  biComp (adjEntry adjuG, node vG) 
Generates the BCtree and the biconnected components graph recursively. More...  
void  initNotConnected (List< node > &vG) 
Initialization for not connected graphs. More...  
void  initNotConnected (node vG) 
Initialization for not connected graphs. More...  
node  findNCA (node uB, node vB) const 
Calculates the nearest common ancestor of two vertices of the BCtree. More...  
void  init (node vG) 
Protected Attributes  
Graph  m_T 
A Graph structure containing all SPQRtrees. More...  
NodeArray< node >  m_bNode_SPQR 
NodeArray< int >  m_bNode_numS 
The numbers of Scomponents. More...  
NodeArray< int >  m_bNode_numP 
The numbers of Pcomponents. More...  
NodeArray< int >  m_bNode_numR 
The numbers of Rcomponents. More...  
NodeArray< TNodeType >  m_tNode_type 
The types of the SPQRtreevertices. More...  
NodeArray< node >  m_tNode_owner 
The owners of the SPQRtreevertices in the UNION/FIND structure. More...  
NodeArray< edge >  m_tNode_hRefEdge 
The virtual edges leading to the parents of the SPQRtree vertices. More...  
NodeArray< List< edge > * >  m_tNode_hEdges 
Lists of real and virtual edges belonging to SPQRtree vertices. More...  
EdgeArray< ListIterator< edge > >  m_hEdge_position 
The positions of real and virtual edges in their m_tNode_hEdges lists. More...  
EdgeArray< node >  m_hEdge_tNode 
The SPQRtreevertices which the real and virtual edges are belonging to. More...  
EdgeArray< edge >  m_hEdge_twinEdge 
The partners of virtual edges (nullptr if real). More...  
NodeArray< node >  m_htogc 
Auxiliary array used by createSPQR(). More...  
NodeArray< bool >  m_tNode_isMarked 
Auxiliary array used by findNCASPQR() More...  
Protected Attributes inherited from ogdf::DynamicBCTree  
NodeArray< int >  m_bNode_degree 
Array that contains for each proper BCtreevertex its degree. More...  
NodeArray< node >  m_bNode_owner 
Array that contains for each BCtreevertex its parent in its UNION/FINDtree structure. More...  
Protected Attributes inherited from ogdf::BCTree  
Graph  m_B 
The BCtree. More...  
Graph &  m_G 
The original graph. More...  
Graph  m_H 
The biconnected components graph. More...  
int  m_numB 
The number of Bcomponents. More...  
int  m_numC 
The number of Ccomponents. More...  
NodeArray< bool >  m_gNode_isMarked 
NodeArray< node >  m_gNode_hNode 
An injective mapping vertices(G) > vertices(H). More...  
EdgeArray< edge >  m_gEdge_hEdge 
A bijective mapping edges(G) > edges(H). More...  
NodeArray< BNodeType >  m_bNode_type 
Array that contains the type of each BCtreevertex. More...  
NodeArray< bool >  m_bNode_isMarked 
Array of marks for the BCtreevertices. More...  
NodeArray< node >  m_bNode_hRefNode 
Array that contains for each BCtreevertex the representantive of its parent within the subgraph in the biconnected components graph belonging to the biconnected component represented by the respective BCtreevertex. More...  
NodeArray< node >  m_bNode_hParNode 
Array that contains for each BCtreevertex the representant of itself within the subgraph in the biconnected components graph belonging to the biconnected component represented by the parent of the respective BCtreevertex. More...  
NodeArray< SList< edge > >  m_bNode_hEdges 
Array that contains for each BCtreevertex a linear list of the edges of the biconnected components graph belonging to the biconnected component represented by the respective BCtreevertex. More...  
NodeArray< int >  m_bNode_numNodes 
Array that contains for each BCtreevertex the number of vertices belonging to the biconnected component represented by the respective BCtreevertex. More...  
NodeArray< node >  m_hNode_bNode 
EdgeArray< node >  m_hEdge_bNode 
A surjective mapping edges(H) > vertices(B). More...  
NodeArray< node >  m_hNode_gNode 
A surjective mapping vertices(H) > vertices(G). More...  
EdgeArray< edge >  m_hEdge_gEdge 
A bijective mapping edges(H) > edges(G). More...  
int  m_count 
NodeArray< int >  m_number 
Temporary array. More...  
NodeArray< int >  m_lowpt 
Temporary array. More...  
ArrayBuffer< adjEntry >  m_eStack 
Temporary stack. More...  
NodeArray< node >  m_gtoh 
Temporary array. More...  
SList< node >  m_nodes 
Temporary list. More...  
Dynamic SPQRforest.
This class is an extension of DynamicBCTree.
It provides a set of SPQRtrees for each Bcomponent of a BCtree. These SPQRtrees are dynamic, i.e. there are member functions for dynamic updates (edge insertion and node insertion).
Definition at line 49 of file DynamicSPQRForest.h.

strong 
Enumeration type for characterizing the SPQRtreevertices.
Enumerator  

SComp  denotes a vertex representing an Scomponent 
PComp  denotes a vertex representing a Pcomponent 
RComp  denotes a vertex representing an Rcomponent 
Definition at line 52 of file DynamicSPQRForest.h.

inlineexplicit 
A constructor.
This constructor does only create the dynamic BCtree rooted at the first edge of G
. The data structure is prepared for dealing with SPQRtrees, but they will only be created on demand. See member function createSPQR(node).
G  is the original graph. 
not_connected  if set to true, will call initNotConnected() to process all connected components. Otherwise, only the connected component of G.firstNode() will be processed. 
Definition at line 302 of file DynamicSPQRForest.h.

inline 
A constructor.
This constructor does only create the dynamic BCtree rooted at the first edge of G
. The data structure is prepared for dealing with SPQRtrees, but they will only be created on demand. See member functions createSPQR(node).
G  is the original graph. 
vG  is the vertex of the original graph which the DFS algorithm starts, defaults to G.firstNode(). 
not_connected  if set to true, will call initNotConnected() to process all connected components. Otherwise, only the connected component of G.firstNode() will be processed. 
Definition at line 316 of file DynamicSPQRForest.h.

inline 
Definition at line 321 of file DynamicSPQRForest.h.
Adds edge eH
to a vertex vT
of the SPQRForest.
Definition at line 174 of file DynamicSPQRForest.h.
void ogdf::DynamicSPQRForest::createSPQR  (  node  vB  )  const 
Creates the SPQRtree for a given Bcomponent of the BCtree.
An SPQRtree belonging to a Bcomponent of the BCtree is only created on demand by findSPQRTree() and  under certain circumstances  by updateInsertedEdge().
vB  is a vertex of the BCtree representing a Bcomponent. 
vB
has to be the proper representative of its Bcomponent, i.e. it has to be the root vertex of its respective UNION/FINDtree. vB
must contain at least 3 edges. Deletes edge eH
from m_H and removes its connection to a vertex vT
of the SPQRForest.
Definition at line 186 of file DynamicSPQRForest.h.
Finds the nearest common ancestor of sT
and tT
.
sT  is a vertex of an SPQRtree. 
tT  is a vertex of an SPQRtree. 
sT
and tT
must belong to the same SPQRtree. sT
and tT
have to be proper representatives of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FINDtrees. sT
and tT
. Finds the shortest path between the two sets of SPQRtreevertices which sH
and tH
are belonging to.
sH  is a vertex of m_H. 
tH  is a vertex of m_H. 
sH
and tH
must belong to the same Bcomponent, i.e. to the same SPQRtree. This SPQRtree does not need to exist. If it it does not exist, it will be created. Finds the shortest path between the two sets of SPQRtreevertices 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 SPQRtree. 
sH
and tH
must belong to the same Bcomponent, i.e. to the same SPQRtree. This SPQRtree must exist! Finds the proper representative of an SPQRtreevertex (FIND part of UNION/FIND).
vT  is any vertex of m_T. 
vT
properly representing a triconnected component, i.e. the root of the UNION/FINDtree of vT
. Returns a linear list of the edges in m_H belonging to the triconnected component represented by a given SPQRtreevertex.
vT  is a vertex of an SPQRtree. 
vT
has to be the proper representative of its triconnected component, i.e. it has to be the root vertex of its respective UNION/FINDtree. This condition is particularly fulfilled if vT
is a member of a list gained by the findPathSPQR() member function. vT
. Definition at line 450 of file DynamicSPQRForest.h.

protected 

inlineprotected 
Creates a new node in the SPQRtree for a given Bcomponent of the BCtree.
vB  is a vertex of the BCtree representing a Bcomponent. 
spqrNodeType  is the type of the new SPQRnode. 
vB
has to be the proper representative of its Bcomponent, i.e. it has to be the root vertex of its respective UNION/FINDtree. Definition at line 151 of file DynamicSPQRForest.h.
Creates a twin edge for eH
, adds it to vT
and returns it.
Definition at line 198 of file DynamicSPQRForest.h.

inline 
Returns the number of Pnodes in the SPQRtree for a given Bcomponent of the BCtree.
vB  is a vertex of the BCtree representing a Bcomponent. 
vB
(e.g. using createSPQR(vB
)) or 0 otherwise. Definition at line 382 of file DynamicSPQRForest.h.

inline 
Returns the number of Rnodes in the SPQRtree for a given Bcomponent of the BCtree.
vB  is a vertex of the BCtree representing a Bcomponent. 
vB
(e.g. using createSPQR(vB
)) or 0 otherwise. Definition at line 391 of file DynamicSPQRForest.h.

inline 
Returns the number of Snodes in the SPQRtree for a given Bcomponent of the BCtree.
vB  is a vertex of the BCtree representing a Bcomponent. 
vB
(e.g. using createSPQR(vB
)) or 0 otherwise. Definition at line 373 of file DynamicSPQRForest.h.
The SPQRtreevertex which a real or virtual edge eH
belongs to, if the SPQRtree has been created using createSPQR.
Definition at line 414 of file DynamicSPQRForest.h.
Returns the parent node of a node of the SPQRtree Graph, or nullptr if vT
is a root.
Definition at line 397 of file DynamicSPQRForest.h.
Returns the virtual edge leading to the parents of a SPQRtree vertex, or nullptr if vT
is a root.
Definition at line 411 of file DynamicSPQRForest.h.
Finds the proper representative of the SPQRtreevertex which a given real or virtual edge is belonging to.
eH  is an edge of m_H. 
eH
) must exist, i.e. spqrroot(bcproper(eH
)) != nullptr. Use createSPQR(eH
) to initialize the respective SPQRtree on demand otherwise. eH
is belonging to. Definition at line 338 of file DynamicSPQRForest.h.
Returns the root of the SPQRtree for a given Bcomponent of the BCtree.
vB  is a vertex of the BCtree representing a Bcomponent. 
vB
(e.g. using createSPQR(vB
)) or nullptr otherwise. Definition at line 364 of file DynamicSPQRForest.h.

inline 
Returns the SPQRtree graph.
Definition at line 394 of file DynamicSPQRForest.h.
Returns the twin edge of a given edge of m_H, if it is virtual, or nullptr, if it is real.
eH  is an edge of m_H. 
eH
, if it is virtual, or nullptr, if it is real. Definition at line 423 of file DynamicSPQRForest.h.
Returns the type of the triconnected component represented by a given SPQRtreevertex.
vT  is a vertex of an SPQRtree. 
vT
has to be the proper representative of its triconnected component, i.e. it has to be the root vertex of its respective UNION/FINDtree. This condition is particularly fulfilled if vT
is a member of a list gained by the findPathSPQR() member function. vT
. Definition at line 437 of file DynamicSPQRForest.h.
Unites two SPQRtreevertices (UNION part of UNION/FIND).
vB  is a vertex of the BCtree representing a Bcomponent. 
sT  is a vertex of the SPQRtree belonging to vB . 
tT  is a vertex of the SPQRtree belonging to vB . 
vB
has to be the proper representative of its Bcomponent, i.e. it has to be the root vertex of its respective UNION/FINDtree. sT
and tT
have to be proper representatives of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FINDtrees. Updates the whole data structure after a new edge has been inserted into the original graph.
This member function generally updates both BC and SPQRtrees. If any SPQRtree of the Bcomponents of the insertion path through the BCtree exists, the SPQRtree data structure of the resulting Bcomponent will be valid afterwards. If none of the SPQRtrees does exist in advance, then only the BCtree is updated and no SPQRtree is created.
eG  is a new edge in the original graph. 
Reimplemented from ogdf::DynamicBCTree.
Reimplemented in ogdf::DynamicSPQRTree.
Updates an SPQRtree after a new edge has been inserted into the original graph.
vB  is a BCtreevertex representing a Bcomponent. The SPQRtree, which is to be updated is identified by it. 
eG  is a new edge in the original graph. 
vB
has to be the proper representative of its Bcomponent, i.e. it has to be the root vertex of its respective UNION/FINDtree. eG
must belong to the same Bcomponent represented by vB
. 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 BCtree at first. If the SPQRtree of the Bcomponent 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.
Updates an SPQRtree after a new vertex has been inserted into the original graph by splitting an edge into eG
and fG
.
vB  is a BCtreevertex representing a Bcomponent. The SPQRtree, 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. 
vB
. Returns the virtual edge which leads from one vertex of an SPQRtree to another one.
vT  is a vertex of an SPQRtree. 
wT  is a vertex of an SPQRtree. 
vT
and wT
must belong to the same SPQRtree and must be adjacent. vT
and wT
have to be proper representatives of their triconnected components, i.e. they have to be the root vertices of their respective UNION/FINDtrees. This condition is particularly fulfilled if vT
and wT
are members of a list gained by the findPathSPQR() member function. wT
and leads to vT
.

mutableprotected 
The numbers of Pcomponents.
For each vertex of the BCtree representing a Bcomponent, this array contains the number of Pcomponents of the respective SPQRtree. If the SPQRtree does not exist, then the array member is undefined.
Definition at line 92 of file DynamicSPQRForest.h.

mutableprotected 
The numbers of Rcomponents.
For each vertex of the BCtree representing a Bcomponent, this array contains the number of Rcomponents of the respective SPQRtree. If the SPQRtree does not exist, then the array member is undefined.
Definition at line 102 of file DynamicSPQRForest.h.

mutableprotected 
The numbers of Scomponents.
For each vertex of the BCtree representing a Bcomponent, this array contains the number of Scomponents of the respective SPQRtree. If the SPQRtree does not exist, then the array member is undefined.
Definition at line 82 of file DynamicSPQRForest.h.
The root vertices of the SPQRtrees.
For each vertex of the BCtree representing a Bcomponent, this array contains the root vertex of the respective SPQRtree, or nullptr, if the SPQRtree does not exist.
Definition at line 72 of file DynamicSPQRForest.h.

mutableprotected 
The positions of real and virtual edges in their m_tNode_hEdges lists.
Definition at line 121 of file DynamicSPQRForest.h.
The SPQRtreevertices which the real and virtual edges are belonging to.
Definition at line 124 of file DynamicSPQRForest.h.
The partners of virtual edges (nullptr if real).
Definition at line 127 of file DynamicSPQRForest.h.
Auxiliary array used by createSPQR().
Definition at line 132 of file DynamicSPQRForest.h.

mutableprotected 
A Graph structure containing all SPQRtrees.
Definition at line 63 of file DynamicSPQRForest.h.
Lists of real and virtual edges belonging to SPQRtree vertices.
Definition at line 116 of file DynamicSPQRForest.h.
The virtual edges leading to the parents of the SPQRtree vertices.
Definition at line 113 of file DynamicSPQRForest.h.

mutableprotected 
Auxiliary array used by findNCASPQR()
Definition at line 135 of file DynamicSPQRForest.h.
The owners of the SPQRtreevertices in the UNION/FIND structure.
Definition at line 110 of file DynamicSPQRForest.h.
The types of the SPQRtreevertices.
Definition at line 107 of file DynamicSPQRForest.h.