<s>
In	O
graph	O
theory	O
,	O
a	O
branch	O
of	O
mathematics	O
,	O
the	O
triconnected	B-Data_Structure
components	I-Data_Structure
of	O
a	O
biconnected	O
graph	O
are	O
a	O
system	O
of	O
smaller	O
graphs	O
that	O
describe	O
all	O
of	O
the	O
2-vertex	O
cuts	O
in	O
the	O
graph	O
.	O
</s>
<s>
An	O
SPQR	B-Data_Structure
tree	I-Data_Structure
is	O
a	O
tree	B-Application
data	I-Application
structure	I-Application
used	O
in	O
computer	B-General_Concept
science	I-General_Concept
,	O
and	O
more	O
specifically	O
graph	O
algorithms	O
,	O
to	O
represent	O
the	O
triconnected	B-Data_Structure
components	I-Data_Structure
of	O
a	O
graph	O
.	O
</s>
<s>
The	O
SPQR	B-Data_Structure
tree	I-Data_Structure
of	O
a	O
graph	O
may	O
be	O
constructed	O
in	O
linear	O
time	O
and	O
has	O
several	O
applications	O
in	O
dynamic	O
graph	O
algorithms	O
and	O
graph	O
drawing	O
.	O
</s>
<s>
The	O
basic	O
structures	O
underlying	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
,	O
the	O
triconnected	B-Data_Structure
components	I-Data_Structure
of	O
a	O
graph	O
,	O
and	O
the	O
connection	O
between	O
this	O
decomposition	O
and	O
the	O
planar	O
embeddings	O
of	O
a	O
planar	O
graph	O
,	O
were	O
first	O
investigated	O
by	O
;	O
these	O
structures	O
were	O
used	O
in	O
efficient	O
algorithms	O
by	O
several	O
other	O
researchers	O
prior	O
to	O
their	O
formalization	O
as	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
by	O
.	O
</s>
<s>
An	O
SPQR	B-Data_Structure
tree	I-Data_Structure
takes	O
the	O
form	O
of	O
an	O
unrooted	O
tree	O
in	O
which	O
for	O
each	O
node	O
x	O
there	O
is	O
associated	O
an	O
undirected	O
graph	O
or	O
multigraph	B-Language
Gx	O
.	O
</s>
<s>
In	O
a	O
P	O
node	O
,	O
the	O
associated	O
graph	O
is	O
a	O
dipole	O
graph	O
,	O
a	O
multigraph	B-Language
with	O
two	O
vertices	O
and	O
three	O
or	O
more	O
edges	O
,	O
the	O
planar	O
dual	O
to	O
a	O
cycle	O
graph	O
.	O
</s>
<s>
In	O
some	O
works	O
on	O
SPQR	B-Data_Structure
trees	I-Data_Structure
,	O
this	O
type	O
of	O
node	O
does	O
not	O
appear	O
in	O
the	O
SPQR	B-Data_Structure
trees	I-Data_Structure
of	O
graphs	O
with	O
more	O
than	O
one	O
edge	O
;	O
in	O
other	O
works	O
,	O
all	O
non-virtual	O
edges	O
are	O
required	O
to	O
be	O
represented	O
by	O
Q	O
nodes	O
with	O
one	O
real	O
and	O
one	O
virtual	O
edge	O
,	O
and	O
the	O
edges	O
in	O
the	O
other	O
node	O
types	O
must	O
all	O
be	O
virtual	O
.	O
</s>
<s>
The	O
R	O
stands	O
for	O
"	O
rigid	O
"	O
:	O
in	O
the	O
application	O
of	O
SPQR	B-Data_Structure
trees	I-Data_Structure
in	O
planar	O
graph	O
embedding	O
,	O
the	O
associated	O
graph	O
of	O
an	O
R	O
node	O
has	O
a	O
unique	O
planar	O
embedding	O
.	O
</s>
<s>
Each	O
edge	O
xy	O
between	O
two	O
nodes	O
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
is	O
associated	O
with	O
two	O
directed	O
virtual	O
edges	O
,	O
one	O
of	O
which	O
is	O
an	O
edge	O
in	O
Gx	O
and	O
the	O
other	O
of	O
which	O
is	O
an	O
edge	O
in	O
Gy	O
.	O
</s>
<s>
Each	O
edge	O
in	O
a	O
graph	O
Gx	O
may	O
be	O
a	O
virtual	O
edge	O
for	O
at	O
most	O
one	O
SPQR	B-Data_Structure
tree	I-Data_Structure
edge	O
.	O
</s>
<s>
An	O
SPQR	B-Data_Structure
tree	I-Data_Structure
T	O
represents	O
a	O
2-connected	O
graph	O
GT	O
,	O
formed	O
as	O
follows	O
.	O
</s>
<s>
Whenever	O
SPQR	B-Data_Structure
tree	I-Data_Structure
edge	O
xy	O
associates	O
the	O
virtual	O
edge	O
ab	O
of	O
Gx	O
with	O
the	O
virtual	O
edge	O
cd	O
of	O
Gy	O
,	O
form	O
a	O
single	O
larger	O
graph	O
by	O
merging	O
a	O
and	O
c	O
into	O
a	O
single	O
supervertex	O
,	O
merging	O
b	O
and	O
d	O
into	O
another	O
single	O
supervertex	O
,	O
and	O
deleting	O
the	O
two	O
virtual	O
edges	O
.	O
</s>
<s>
Performing	O
this	O
gluing	O
step	O
on	O
each	O
edge	O
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
produces	O
the	O
graph	O
GT	O
;	O
the	O
order	O
of	O
performing	O
the	O
gluing	O
steps	O
does	O
not	O
affect	O
the	O
result	O
.	O
</s>
<s>
Typically	O
,	O
it	O
is	O
not	O
allowed	O
within	O
an	O
SPQR	B-Data_Structure
tree	I-Data_Structure
for	O
two	O
S	O
nodes	O
to	O
be	O
adjacent	O
,	O
nor	O
for	O
two	O
P	O
nodes	O
to	O
be	O
adjacent	O
,	O
because	O
if	O
such	O
an	O
adjacency	O
occurred	O
the	O
two	O
nodes	O
could	O
be	O
merged	O
into	O
a	O
single	O
larger	O
node	O
.	O
</s>
<s>
With	O
this	O
assumption	O
,	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
is	O
uniquely	O
determined	O
from	O
its	O
graph	O
.	O
</s>
<s>
When	O
a	O
graph	O
G	O
is	O
represented	O
by	O
an	O
SPQR	B-Data_Structure
tree	I-Data_Structure
with	O
no	O
adjacent	O
P	O
nodes	O
and	O
no	O
adjacent	O
S	O
nodes	O
,	O
then	O
the	O
graphs	O
Gx	O
associated	O
with	O
the	O
nodes	O
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
are	O
known	O
as	O
the	O
triconnected	B-Data_Structure
components	I-Data_Structure
of	O
G	O
.	O
</s>
<s>
The	O
SPQR	B-Data_Structure
tree	I-Data_Structure
of	O
a	O
given	O
2-vertex-connected	O
graph	O
can	O
be	O
constructed	O
in	O
linear	O
time	O
.	O
</s>
<s>
The	O
problem	O
of	O
constructing	O
the	O
triconnected	B-Data_Structure
components	I-Data_Structure
of	O
a	O
graph	O
was	O
first	O
solved	O
in	O
linear	O
time	O
by	O
.	O
</s>
<s>
Based	O
on	O
this	O
algorithm	O
,	O
suggested	O
that	O
the	O
full	O
SPQR	B-Data_Structure
tree	I-Data_Structure
structure	O
,	O
and	O
not	O
just	O
the	O
list	O
of	O
components	O
,	O
should	O
be	O
constructible	O
in	O
linear	O
time	O
.	O
</s>
<s>
After	O
an	O
implementation	O
of	O
a	O
slower	O
algorithm	O
for	O
SPQR	B-Data_Structure
trees	I-Data_Structure
was	O
provided	O
as	O
part	O
of	O
the	O
GDToolkit	O
library	O
,	O
provided	O
the	O
first	O
linear-time	O
implementation	O
.	O
</s>
<s>
Sort	O
the	O
edges	O
of	O
the	O
graph	O
by	O
the	O
pairs	O
of	O
numerical	O
indices	O
of	O
their	O
endpoints	O
,	O
using	O
a	O
variant	O
of	O
radix	B-Algorithm
sort	I-Algorithm
that	O
makes	O
two	O
passes	O
of	O
bucket	B-Algorithm
sort	I-Algorithm
,	O
one	O
for	O
each	O
endpoint	O
.	O
</s>
<s>
After	O
this	O
sorting	O
step	O
,	O
parallel	O
edges	O
between	O
the	O
same	O
two	O
vertices	O
will	O
be	O
adjacent	O
to	O
each	O
other	O
in	O
the	O
sorted	O
list	O
and	O
can	O
be	O
split	O
off	O
into	O
a	O
P-node	O
of	O
the	O
eventual	O
SPQR	B-Data_Structure
tree	I-Data_Structure
,	O
leaving	O
the	O
remaining	O
graph	O
simple	O
.	O
</s>
<s>
The	O
partition	O
found	O
in	O
this	O
way	O
is	O
not	O
uniquely	O
defined	O
,	O
because	O
the	O
parts	O
of	O
the	O
graph	O
that	O
should	O
become	O
S-nodes	O
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
will	O
be	O
subdivided	O
into	O
multiple	O
triangles	O
.	O
</s>
<s>
To	O
find	O
the	O
split	O
components	O
,	O
use	O
depth-first	B-Algorithm
search	I-Algorithm
to	O
find	O
a	O
structure	O
that	O
they	O
call	O
a	O
palm	O
tree	O
;	O
this	O
is	O
a	O
depth-first	B-Algorithm
search	I-Algorithm
tree	O
with	O
its	O
edges	O
oriented	O
away	O
from	O
the	O
root	O
of	O
the	O
tree	O
,	O
for	O
the	O
edges	O
belonging	O
to	O
the	O
tree	O
,	O
and	O
towards	O
the	O
root	O
for	O
all	O
other	O
edges	O
.	O
</s>
<s>
When	O
a	O
component	O
is	O
found	O
in	O
this	O
way	O
,	O
a	O
stack	B-Application
data	I-Application
structure	I-Application
is	O
used	O
to	O
identify	O
the	O
edges	O
that	O
should	O
be	O
part	O
of	O
the	O
new	O
component	O
.	O
</s>
<s>
With	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
of	O
a	O
graph	O
G	O
(	O
without	O
Q	O
nodes	O
)	O
it	O
is	O
straightforward	O
to	O
find	O
every	O
pair	O
of	O
vertices	O
u	O
and	O
v	O
in	O
G	O
such	O
that	O
removing	O
u	O
and	O
v	O
from	O
G	O
leaves	O
a	O
disconnected	O
graph	O
,	O
and	O
the	O
connected	O
components	O
of	O
the	O
remaining	O
graphs	O
:	O
</s>
<s>
The	O
two	O
vertices	O
u	O
and	O
v	O
may	O
be	O
the	O
two	O
endpoints	O
of	O
a	O
virtual	O
edge	O
in	O
the	O
graph	O
associated	O
with	O
an	O
R	O
node	O
,	O
in	O
which	O
case	O
the	O
two	O
components	O
are	O
represented	O
by	O
the	O
two	O
subtrees	B-Application
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
formed	O
by	O
removing	O
the	O
corresponding	O
SPQR	B-Data_Structure
tree	I-Data_Structure
edge	O
.	O
</s>
<s>
In	O
this	O
case	O
the	O
components	O
formed	O
by	O
the	O
removal	O
of	O
u	O
and	O
v	O
are	O
represented	O
by	O
subtrees	B-Application
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
,	O
one	O
for	O
each	O
virtual	O
edge	O
in	O
the	O
node	O
.	O
</s>
<s>
If	O
the	O
two	O
vertices	O
are	O
not	O
adjacent	O
then	O
the	O
two	O
components	O
are	O
represented	O
by	O
two	O
paths	O
of	O
the	O
cycle	O
graph	O
associated	O
with	O
the	O
S	O
node	O
and	O
with	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
nodes	O
attached	O
to	O
those	O
two	O
paths	O
.	O
</s>
<s>
Specifically	O
,	O
whenever	O
two	O
nodes	O
in	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
of	O
the	O
graph	O
are	O
connected	O
by	O
a	O
pair	O
of	O
virtual	O
edges	O
,	O
it	O
is	O
possible	O
to	O
flip	O
the	O
orientation	O
of	O
one	O
of	O
the	O
nodes	O
(	O
replacing	O
it	O
by	O
its	O
mirror	O
image	O
)	O
relative	O
to	O
the	O
other	O
one	O
.	O
</s>
<s>
Additionally	O
,	O
in	O
a	O
P	O
node	O
of	O
the	O
SPQR	B-Data_Structure
tree	I-Data_Structure
,	O
the	O
different	O
parts	O
of	O
the	O
graph	O
connected	O
to	O
virtual	O
edges	O
of	O
the	O
P	O
node	O
may	O
be	O
arbitrarily	O
permuted	B-Algorithm
.	O
</s>
