<s>
A	O
link/cut	B-Data_Structure
tree	I-Data_Structure
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
for	O
representing	O
a	O
forest	O
,	O
a	O
set	O
of	O
rooted	O
trees	O
,	O
and	O
offers	O
the	O
following	O
operations	O
:	O
</s>
<s>
However	O
,	O
if	O
we	O
represent	O
each	O
tree	O
in	O
the	O
forest	O
as	O
a	O
link/cut	B-Data_Structure
tree	I-Data_Structure
,	O
we	O
can	O
find	O
which	O
tree	O
an	O
element	O
belongs	O
to	O
in	O
O(log(n )	O
)	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
Moreover	O
,	O
we	O
can	O
quickly	O
adjust	O
the	O
collection	O
of	O
link/cut	B-Data_Structure
trees	I-Data_Structure
to	O
changes	O
in	O
the	O
represented	O
forest	O
.	O
</s>
<s>
In	O
particular	O
,	O
we	O
can	O
adjust	O
it	O
to	O
merge	O
(	O
link	O
)	O
and	O
split	O
(	O
cut	O
)	O
in	O
O(log(n )	O
)	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
Link/cut	B-Data_Structure
trees	I-Data_Structure
divide	O
each	O
tree	O
in	O
the	O
represented	O
forest	O
into	O
vertex-disjoint	O
paths	O
,	O
where	O
each	O
path	O
is	O
represented	O
by	O
an	O
auxiliary	O
data	B-General_Concept
structure	I-General_Concept
(	O
often	O
splay	B-Data_Structure
trees	I-Data_Structure
,	O
though	O
the	O
original	O
paper	O
predates	O
splay	B-Data_Structure
trees	I-Data_Structure
and	O
thus	O
uses	O
biased	O
binary	O
search	O
trees	O
)	O
.	O
</s>
<s>
The	O
nodes	O
in	O
the	O
auxiliary	O
data	B-General_Concept
structure	I-General_Concept
are	O
ordered	O
by	O
their	O
depth	O
in	O
the	O
corresponding	O
represented	O
tree	O
.	O
</s>
<s>
In	O
one	O
variation	O
,	O
Naive	O
Partitioning	O
,	O
the	O
paths	O
are	O
determined	O
by	O
the	O
most	O
recently	O
accessed	O
paths	O
and	O
nodes	O
,	O
similar	O
to	O
Tango	B-Data_Structure
Trees	I-Data_Structure
.	O
</s>
<s>
This	O
gives	O
a	O
more	O
complicated	O
structure	O
,	O
but	O
reduces	O
the	O
cost	O
of	O
the	O
operations	O
from	O
amortized	B-General_Concept
O(log n )	O
to	O
worst	O
case	O
O(log n )	O
.	O
</s>
<s>
In	O
the	O
original	O
publication	O
,	O
Sleator	O
and	O
Tarjan	O
referred	O
to	O
link/cut	B-Data_Structure
trees	I-Data_Structure
as	O
"	O
dynamic	B-Data_Structure
trees	I-Data_Structure
"	O
,	O
or	O
"	O
dynamic	O
dyno	O
trees	O
"	O
.	O
</s>
<s>
These	O
paths	O
are	O
represented	O
internally	O
by	O
auxiliary	O
trees	O
(	O
here	O
we	O
will	O
use	O
splay	B-Data_Structure
trees	I-Data_Structure
)	O
,	O
where	O
the	O
nodes	O
from	O
left	O
to	O
right	O
represent	O
the	O
path	O
from	O
root	O
to	O
the	O
last	O
node	O
on	O
the	O
path	O
.	O
</s>
<s>
In	O
a	O
splay	B-Data_Structure
tree	I-Data_Structure
this	O
is	O
a	O
relatively	O
simple	O
procedure	O
;	O
we	O
splay	O
at	O
v	O
,	O
which	O
brings	O
v	O
to	O
the	O
root	O
of	O
the	O
auxiliary	O
tree	O
.	O
</s>
<s>
root	O
R	O
.	O
The	O
root	O
may	O
be	O
linearly	O
deep	O
(	O
which	O
is	O
worst	O
case	O
for	O
a	O
splay	B-Data_Structure
tree	I-Data_Structure
)	O
,	O
we	O
therefore	O
splay	O
it	O
so	O
that	O
the	O
next	O
access	O
will	O
be	O
quick	O
.	O
</s>
<s>
To	O
do	O
this	O
we	O
access	O
v	O
,	O
which	O
gives	O
us	O
an	O
auxiliary	O
tree	O
with	O
all	O
the	O
nodes	O
on	O
the	O
path	O
from	O
root	O
R	O
to	O
node	O
v	O
.	O
The	O
data	B-General_Concept
structure	I-General_Concept
can	O
be	O
augmented	O
with	O
data	O
we	O
wish	O
to	O
retrieve	O
,	O
such	O
as	O
min	O
or	O
max	O
values	O
,	O
or	O
the	O
sum	O
of	O
the	O
costs	O
in	O
the	O
subtree	O
,	O
which	O
can	O
then	O
be	O
returned	O
from	O
a	O
given	O
path	O
in	O
constant	O
time	O
.	O
</s>
<s>
FindRoot	O
has	O
an	O
O(log n )	O
amortized	B-General_Concept
upper	O
bound	O
,	O
plus	O
the	O
cost	O
of	O
the	O
access	O
.	O
</s>
<s>
The	O
data	B-General_Concept
structure	I-General_Concept
can	O
be	O
augmented	O
with	O
additional	O
information	O
(	O
such	O
as	O
the	O
min	O
or	O
max	O
valued	O
node	O
in	O
its	O
subtrees	O
,	O
or	O
the	O
sum	O
)	O
,	O
depending	O
on	O
the	O
implementation	O
.	O
</s>
<s>
Access	O
makes	O
use	O
of	O
splaying	B-Data_Structure
,	O
which	O
we	O
know	O
has	O
an	O
O(log n )	O
amortized	B-General_Concept
upper	O
bound	O
.	O
</s>
<s>
The	O
number	O
of	O
heavy	O
edges	O
becoming	O
preferred	O
can	O
be	O
for	O
any	O
given	O
operation	O
,	O
but	O
it	O
is	O
amortized	B-General_Concept
.	O
</s>
<s>
We	O
have	O
bound	O
the	O
number	O
of	O
preferred	O
child	O
changes	O
at	O
,	O
so	O
if	O
we	O
can	O
show	O
that	O
each	O
preferred	O
child	O
change	O
has	O
cost	O
O(1 )	O
amortized	B-General_Concept
we	O
can	O
bound	O
the	O
access	O
operation	O
at	O
.	O
</s>
<s>
This	O
is	O
done	O
using	O
the	O
potential	B-General_Concept
method	I-General_Concept
.	O
</s>
<s>
We	O
know	O
that	O
the	O
amortized	B-General_Concept
cost	O
of	O
splaying	B-Data_Structure
is	O
bounded	O
by	O
:	O
</s>
<s>
We	O
know	O
that	O
after	O
splaying	B-Data_Structure
,	O
v	O
is	O
the	O
child	O
of	O
its	O
path-parent	O
node	O
w	O
.	O
So	O
we	O
know	O
that	O
:	O
</s>
<s>
We	O
use	O
this	O
inequality	O
and	O
the	O
amortized	B-General_Concept
cost	O
of	O
access	O
to	O
achieve	O
a	O
telescoping	O
sum	O
that	O
is	O
bounded	O
by	O
:	O
</s>
<s>
s(R )	O
=	O
n	O
,	O
so	O
we	O
have	O
amortized	B-General_Concept
.	O
</s>
<s>
Link/cut	B-Data_Structure
trees	I-Data_Structure
can	O
be	O
used	O
to	O
solve	O
the	O
dynamic	B-Algorithm
connectivity	I-Algorithm
problem	O
for	O
acyclic	O
graphs	O
.	O
</s>
<s>
Another	O
data	B-General_Concept
structure	I-General_Concept
that	O
can	O
be	O
used	O
for	O
the	O
same	O
purpose	O
is	O
Euler	O
tour	O
tree	O
.	O
</s>
<s>
In	O
solving	O
the	O
maximum	B-Algorithm
flow	I-Algorithm
problem	I-Algorithm
,	O
link/cut	B-Data_Structure
trees	I-Data_Structure
can	O
be	O
used	O
to	O
improve	O
the	O
running	O
time	O
of	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
from	O
to	O
.	O
</s>
