Definition
The class SPQRTree maintains the arrangement of the triconnected
components of a biconnected multi-graph G [HT73] as a so-called
SPQR tree
[DT96a,DT96b].
We call G the original graph of
.
The class SPQRTree supports only the statical construction
of an SPQR-tree for a given graph G, dynamic updates are
not supported.
Each node of the tree has an associated type (represented by
SPQRTree::NodeType), which is either SNode, PNode, or
RNode, and a skeleton (represented by the class Skeleton).
The skeletons of the nodes of
are in one-to-one
correspondence to the triconnected components of G, i.e.,
S-nodes correspond to polygons, P-nodes to bonds, and
R-nodes to triconnected graphs.
In our representation of SPQR-trees, Q-nodes are omitted. Instead,
the skeleton S of a node
v
contains two types of edges:
real edges, which correspond to edges in G, and virtual edges, which
correspond to edges in
having v as an endpoint.
There is a special edge er
G at
which
is rooted, i.e., the root node of
is the node
whose skeleton contains the real edge corresponding to er.
The reference edge of the skeleton of the root node is er, the reference edge of the skeleton S of a non-root node v is the virtual edge in S that corresponds to the tree edge (father(v), v).
#include < AGD/SPQRTree.h >
Types
SPQRTree::NodeType | the type of a tree node in ![]() |
Creation
SPQRTree | T(const leda_graph& G, bool is_map = false) | |
creates an SPQR tree
![]() |
||
SPQRTree | T(const leda_graph& G, leda_edge e, bool is_map = false) | |
creates an SPQR tree
![]() ![]() |
Operations
a) Access operations
const leda_graph& | T.tree() | returns a reference to the tree
![]() |
const leda_graph& | T.original_graph() | returns a reference to the original graph G. |
leda_edge | T.root_edge() | returns the edge er in G at which
![]() |
leda_node | T.root_node() | returns the root node of
![]() |
int | T.number_of_S_nodes() | returns the number of S-nodes in
![]() |
int | T.number_of_P_nodes() | returns the number of P-nodes in
![]() |
int | T.number_of_R_nodes() | returns the number of R-nodes in
![]() |
leda_list<leda_node> | T.nodes_of_type(NodeType t) | |
returns the list of all nodes with type t. | ||
NodeType | T.type(leda_node v) | returns the type of node v. Precondition:
v ![]() ![]() |
const Skeleton& | T.skeleton(leda_node v) | returns the skeleton of node v. Precondition:
v ![]() ![]() |
leda_edge | T.skeleton_edge_src(leda_edge e) | |
returns the edge in skeleton of source(e) that corresponds
to tree edge e. Precondition:
e ![]() ![]() |
||
leda_edge | T.skeleton_edge_tgt(leda_edge e) | |
returns the edge in skeleton of target(e) that corresponds
to tree edge e. Precondition:
e ![]() ![]() |
||
const Skeleton& | T.skeleton_of_real(leda_edge e) | |
returns the skeleton that contains the real edge e.
Precondition: e ![]() |
||
leda_edge | T.copy_of_real(leda_edge e) | |
returns the skeleton edge that corresponds to the real
edge e. Precondition: e ![]() |
||
void | T.pertinent_graph(leda_node vT, PertinentGraph& Gp) | |
returns the pertinent graph of tree node vT in Gp.
Precondition:
vT ![]() ![]() |
b) Update operations
leda_node | T.root_tree_at(leda_edge e) | |
roots
![]() ![]() ![]() |
Implementation
Let n be the number of vertices and m be the number of edges in
G. Let
n be the number of nodes in
.
The construction of an SPQR-tree
for graph G
is implemented using the algorithm [HT73] by Hopcroft and
Tarjan for computing the triconnected components of a biconnected
graph and takes time
(n + m).
The operations root_tree_at() and nodes_of_type() take
time
(n
).
The first call of pertinent_graph() takes time
(n + m),
subsequent calls take time
(| P|), where P is the
computed pertinent graph.
All other operations take constant time. The data structure uses
(n + m) space.
© Copyright 1998-2001, Algorithmic Solutions Software GmbH. All rights reserved.
2001-08-13