<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
Fibonacci	B-Application
heap	I-Application
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
for	O
priority	B-Application
queue	I-Application
operations	O
,	O
consisting	O
of	O
a	O
collection	O
of	O
heap-ordered	B-Application
trees	I-Application
.	O
</s>
<s>
It	O
has	O
a	O
better	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
than	O
many	O
other	O
priority	B-Application
queue	I-Application
data	B-General_Concept
structures	I-General_Concept
including	O
the	O
binary	B-Application
heap	I-Application
and	O
binomial	B-Application
heap	I-Application
.	O
</s>
<s>
Michael	O
L	O
.	O
Fredman	O
and	O
Robert	O
E	O
.	O
Tarjan	O
developed	O
Fibonacci	B-Application
heaps	I-Application
in	O
1984	O
and	O
published	O
them	O
in	O
a	O
scientific	O
journal	O
in	O
1987	O
.	O
</s>
<s>
Fibonacci	B-Application
heaps	I-Application
are	O
named	O
after	O
the	O
Fibonacci	B-Algorithm
numbers	I-Algorithm
,	O
which	O
are	O
used	O
in	O
their	O
running	O
time	O
analysis	O
.	O
</s>
<s>
For	O
the	O
Fibonacci	B-Application
heap	I-Application
,	O
the	O
find-minimum	O
operation	O
takes	O
constant	O
(O(1 )	O
)	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
The	O
insert	O
and	O
decrease	O
key	O
operations	O
also	O
work	O
in	O
constant	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
Deleting	O
an	O
element	O
(	O
most	O
often	O
used	O
in	O
the	O
special	O
case	O
of	O
deleting	O
the	O
minimum	O
element	O
)	O
works	O
in	O
O(log n )	O
amortized	B-General_Concept
time	I-General_Concept
,	O
where	O
n	O
is	O
the	O
size	O
of	O
the	O
heap	B-Application
.	O
</s>
<s>
This	O
means	O
that	O
starting	O
from	O
an	O
empty	O
data	B-General_Concept
structure	I-General_Concept
,	O
any	O
sequence	O
of	O
a	O
insert	O
and	O
decrease	O
key	O
operations	O
and	O
b	O
delete	O
operations	O
would	O
take	O
O( a+blogn	O
)	O
worst	O
case	O
time	O
,	O
where	O
n	O
is	O
the	O
maximum	O
heap	B-Application
size	O
.	O
</s>
<s>
In	O
a	O
binary	O
or	O
binomial	B-Application
heap	I-Application
,	O
such	O
a	O
sequence	O
of	O
operations	O
would	O
take	O
O( ( a+b	O
)	O
log	O
n	O
)	O
time	O
.	O
</s>
<s>
A	O
Fibonacci	B-Application
heap	I-Application
is	O
thus	O
better	O
than	O
a	O
binary	O
or	O
binomial	B-Application
heap	I-Application
when	O
b	O
is	O
smaller	O
than	O
a	O
by	O
a	O
non-constant	O
factor	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
merge	O
two	O
Fibonacci	B-Application
heaps	I-Application
in	O
constant	O
amortized	B-General_Concept
time	I-General_Concept
,	O
improving	O
on	O
the	O
logarithmic	O
merge	O
time	O
of	O
a	O
binomial	B-Application
heap	I-Application
,	O
and	O
improving	O
on	O
binary	B-Application
heaps	I-Application
which	O
cannot	O
handle	O
merges	O
efficiently	O
.	O
</s>
<s>
Using	O
Fibonacci	B-Application
heaps	I-Application
for	O
priority	B-Application
queues	I-Application
improves	O
the	O
asymptotic	O
running	O
time	O
of	O
important	O
algorithms	O
,	O
such	O
as	O
Dijkstra	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
for	O
computing	O
the	O
shortest	O
path	O
between	O
two	O
nodes	O
in	O
a	O
graph	O
,	O
compared	O
to	O
the	O
same	O
algorithm	O
using	O
other	O
slower	O
priority	B-Application
queue	I-Application
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
A	O
Fibonacci	B-Application
heap	I-Application
is	O
a	O
collection	O
of	O
trees	O
satisfying	O
the	O
minimum-heap	B-Application
property	I-Application
,	O
that	O
is	O
,	O
the	O
key	O
of	O
a	O
child	O
is	O
always	O
greater	O
than	O
or	O
equal	O
to	O
the	O
key	O
of	O
the	O
parent	O
.	O
</s>
<s>
Compared	O
with	O
binomial	B-Application
heaps	I-Application
,	O
the	O
structure	O
of	O
a	O
Fibonacci	B-Application
heap	I-Application
is	O
more	O
flexible	O
.	O
</s>
<s>
The	O
trees	O
do	O
not	O
have	O
a	O
prescribed	O
shape	O
and	O
in	O
the	O
extreme	O
case	O
the	O
heap	B-Application
can	O
have	O
every	O
element	O
in	O
a	O
separate	O
tree	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
merging	O
heaps	B-Application
is	O
done	O
simply	O
by	O
concatenating	O
the	O
two	O
lists	O
of	O
trees	O
,	O
and	O
operation	O
decrease	O
key	O
sometimes	O
cuts	O
a	O
node	O
from	O
its	O
parent	O
and	O
forms	O
a	O
new	O
tree	B-Application
.	O
</s>
<s>
However	O
,	O
at	O
some	O
point	O
order	O
needs	O
to	O
be	O
introduced	O
to	O
the	O
heap	B-Application
to	O
achieve	O
the	O
desired	O
running	O
time	O
.	O
</s>
<s>
In	O
particular	O
,	O
degrees	O
of	O
nodes	O
(	O
here	O
degree	O
means	O
the	O
number	O
of	O
direct	O
children	O
)	O
are	O
kept	O
quite	O
low	O
:	O
every	O
node	O
has	O
degree	O
at	O
most	O
log	O
n	O
and	O
the	O
size	O
of	O
a	O
subtree	B-Application
rooted	O
in	O
a	O
node	O
of	O
degree	O
k	O
is	O
at	O
least	O
Fk+2	O
,	O
where	O
Fk	O
is	O
the	O
kth	O
Fibonacci	B-Algorithm
number	I-Algorithm
.	O
</s>
<s>
When	O
a	O
second	O
child	O
is	O
cut	O
,	O
the	O
node	O
itself	O
needs	O
to	O
be	O
cut	O
from	O
its	O
parent	O
and	O
becomes	O
the	O
root	O
of	O
a	O
new	O
tree	B-Application
(	O
see	O
Proof	O
of	O
degree	O
bounds	O
,	O
below	O
)	O
.	O
</s>
<s>
For	O
the	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
analysis	O
,	O
we	O
use	O
the	O
potential	B-General_Concept
method	I-General_Concept
,	O
in	O
that	O
we	O
pretend	O
that	O
very	O
fast	O
operations	O
take	O
a	O
little	O
bit	O
longer	O
than	O
they	O
actually	O
do	O
.	O
</s>
<s>
where	O
t	O
is	O
the	O
number	O
of	O
trees	O
in	O
the	O
Fibonacci	B-Application
heap	I-Application
,	O
and	O
m	O
is	O
the	O
number	O
of	O
marked	O
nodes	O
.	O
</s>
<s>
The	O
amortized	B-General_Concept
time	I-General_Concept
for	O
an	O
operation	O
is	O
given	O
by	O
the	O
sum	O
of	O
the	O
actual	O
time	O
and	O
c	O
times	O
the	O
difference	O
in	O
potential	O
,	O
where	O
c	O
is	O
a	O
constant	O
(	O
chosen	O
to	O
match	O
the	O
constant	O
factors	O
in	O
the	O
O	O
notation	O
for	O
the	O
actual	O
time	O
)	O
.	O
</s>
<s>
Thus	O
,	O
the	O
root	O
of	O
each	O
tree	B-Application
in	O
a	O
heap	B-Application
has	O
one	O
unit	O
of	O
time	O
stored	O
.	O
</s>
<s>
This	O
unit	O
of	O
time	O
can	O
be	O
used	O
later	O
to	O
link	O
this	O
tree	B-Application
with	O
another	O
tree	B-Application
at	O
amortized	B-General_Concept
time	I-General_Concept
0	O
.	O
</s>
<s>
To	O
allow	O
fast	O
deletion	O
and	O
concatenation	O
,	O
the	O
roots	O
of	O
all	O
trees	O
are	O
linked	O
using	O
a	O
circular	O
doubly	B-Data_Structure
linked	I-Data_Structure
list	I-Data_Structure
.	O
</s>
<s>
It	O
does	O
not	O
change	O
the	O
potential	O
of	O
the	O
heap	B-Application
,	O
therefore	O
both	O
actual	O
and	O
amortized	B-General_Concept
cost	O
are	O
constant	O
.	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
merge	O
is	O
implemented	O
simply	O
by	O
concatenating	O
the	O
lists	O
of	O
tree	B-Application
roots	O
of	O
the	O
two	O
heaps	B-Application
.	O
</s>
<s>
This	O
can	O
be	O
done	O
in	O
constant	O
time	O
and	O
the	O
potential	O
does	O
not	O
change	O
,	O
leading	O
again	O
to	O
constant	O
amortized	B-General_Concept
time	I-General_Concept
.	O
</s>
<s>
Operation	O
insert	O
works	O
by	O
creating	O
a	O
new	O
heap	B-Application
with	O
one	O
element	O
and	O
doing	O
merge	O
.	O
</s>
<s>
The	O
amortized	B-General_Concept
cost	O
is	O
thus	O
still	O
constant	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
of	O
this	O
phase	O
is	O
O(d )	O
=	O
O(log n )	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
difference	O
in	O
the	O
potential	O
function	O
from	O
before	O
this	O
phase	O
to	O
after	O
it	O
is	O
:	O
O(log n )	O
−	O
m	O
,	O
and	O
the	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
is	O
then	O
at	O
most	O
O( log	O
n	O
+	O
m	O
)	O
+	O
c(O(log n )	O
−	O
m	O
)	O
.	O
</s>
<s>
Fibonacci	B-Application
heap	I-Application
from	O
Figure	O
1	O
after	O
first	O
phase	O
of	O
extract	O
minimum	O
.	O
</s>
<s>
Fibonacci	B-Application
heap	I-Application
from	O
Figure	O
1	O
after	O
extract	O
minimum	O
is	O
completed	O
.	O
</s>
<s>
Then	O
the	O
result	O
is	O
linked	O
with	O
tree	B-Application
rooted	O
at	O
node	O
2	O
.	O
</s>
<s>
Fibonacci	B-Application
heap	I-Application
from	O
Figure	O
1	O
after	O
decreasing	O
key	O
of	O
node	O
9	O
to	O
0	O
.	O
</s>
<s>
This	O
node	O
as	O
well	O
as	O
its	O
two	O
marked	O
ancestors	O
are	O
cut	O
from	O
the	O
tree	B-Application
rooted	O
at	O
1	O
and	O
placed	O
as	O
new	O
roots	O
.	O
</s>
<s>
The	O
overall	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
of	O
extract	O
minimum	O
is	O
therefore	O
O(log n )	O
.	O
</s>
<s>
Operation	O
decrease	O
key	O
will	O
take	O
the	O
node	O
,	O
decrease	O
the	O
key	O
and	O
if	O
the	O
heap	B-Application
property	I-Application
becomes	O
violated	O
(	O
the	O
new	O
key	O
is	O
smaller	O
than	O
the	O
key	O
of	O
the	O
parent	O
)	O
,	O
the	O
node	O
is	O
cut	O
from	O
its	O
parent	O
.	O
</s>
<s>
The	O
actual	O
time	O
to	O
perform	O
the	O
cutting	O
was	O
O(k )	O
,	O
therefore	O
(	O
again	O
with	O
a	O
sufficiently	O
large	O
choice	O
of	O
c	O
)	O
the	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
is	O
constant	O
.	O
</s>
<s>
Finally	O
,	O
operation	O
delete	O
can	O
be	O
implemented	O
simply	O
by	O
decreasing	O
the	O
key	O
of	O
the	O
element	O
to	O
be	O
deleted	O
to	O
minus	O
infinity	O
,	O
thus	O
turning	O
it	O
into	O
the	O
minimum	O
of	O
the	O
whole	O
heap	B-Application
.	O
</s>
<s>
The	O
amortized	B-General_Concept
running	I-General_Concept
time	I-General_Concept
of	O
this	O
operation	O
is	O
O(log n )	O
.	O
</s>
<s>
The	O
amortized	B-General_Concept
performance	O
of	O
a	O
Fibonacci	B-Application
heap	I-Application
depends	O
on	O
the	O
degree	O
(	O
number	O
of	O
children	O
)	O
of	O
any	O
tree	B-Application
root	O
being	O
O(log n )	O
,	O
where	O
n	O
is	O
the	O
size	O
of	O
the	O
heap	B-Application
.	O
</s>
<s>
Here	O
we	O
show	O
that	O
the	O
size	O
of	O
the	O
(	O
sub	O
)	O
tree	B-Application
rooted	O
at	O
any	O
node	O
x	O
of	O
degree	O
d	O
in	O
the	O
heap	B-Application
must	O
have	O
size	O
at	O
least	O
Fd+2	O
,	O
where	O
Fk	O
is	O
the	O
kth	O
Fibonacci	B-Algorithm
number	I-Algorithm
.	O
</s>
<s>
Consider	O
any	O
node	O
x	O
somewhere	O
in	O
the	O
heap	B-Application
(	O
x	O
need	O
not	O
be	O
the	O
root	O
of	O
one	O
of	O
the	O
main	O
trees	O
)	O
.	O
</s>
<s>
Define	O
size(x )	O
to	O
be	O
the	O
size	O
of	O
the	O
tree	B-Application
rooted	O
at	O
x	O
(	O
the	O
number	O
of	O
descendants	O
of	O
x	O
,	O
including	O
x	O
itself	O
)	O
.	O
</s>
<s>
Although	O
Fibonacci	B-Application
heaps	I-Application
look	O
very	O
efficient	O
,	O
they	O
have	O
the	O
following	O
two	O
drawbacks	O
:	O
</s>
<s>
They	O
are	O
not	O
as	O
efficient	O
in	O
practice	O
when	O
compared	O
with	O
the	O
theoretically	O
less	O
efficient	O
forms	O
of	O
heaps	B-Application
.	O
</s>
<s>
In	O
their	O
simplest	O
version	O
they	O
require	O
storage	O
and	O
manipulation	O
of	O
four	O
pointers	O
per	O
node	O
,	O
whereas	O
only	O
two	O
or	O
three	O
pointers	O
per	O
node	O
are	O
needed	O
in	O
other	O
structures	O
,	O
such	O
as	O
Binary	B-Application
heap	I-Application
,	O
Binomial	B-Application
heap	I-Application
,	O
Pairing	B-Application
heap	I-Application
,	O
Brodal	B-Application
queue	I-Application
and	O
Rank	O
pairing	B-Application
heap	I-Application
.	O
</s>
<s>
For	O
this	O
reason	O
Fibonacci	B-Application
heaps	I-Application
and	O
other	O
amortized	B-General_Concept
data	B-General_Concept
structures	I-General_Concept
may	O
not	O
be	O
appropriate	O
for	O
real-time	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
create	O
a	O
data	B-General_Concept
structure	I-General_Concept
which	O
has	O
the	O
same	O
worst-case	O
performance	O
as	O
the	O
Fibonacci	B-Application
heap	I-Application
has	O
amortized	B-General_Concept
performance	O
.	O
</s>
<s>
One	O
such	O
structure	O
,	O
the	O
Brodal	B-Application
queue	I-Application
,	O
is	O
,	O
in	O
the	O
words	O
of	O
the	O
creator	O
,	O
"	O
quite	O
complicated	O
"	O
and	O
"[not]	O
applicable	O
in	O
practice.	O
"	O
</s>
<s>
Created	O
in	O
2012	O
,	O
the	O
strict	O
Fibonacci	B-Application
heap	I-Application
is	O
a	O
simpler	O
(	O
compared	O
to	O
Brodal	O
's	O
)	O
structure	O
with	O
the	O
same	O
worst-case	O
bounds	O
.	O
</s>
<s>
Despite	O
having	O
simpler	O
structure	O
,	O
experiments	O
show	O
that	O
in	O
practice	O
the	O
strict	O
Fibonacci	B-Application
heap	I-Application
performs	O
slower	O
than	O
more	O
complicated	O
Brodal	B-Application
queue	I-Application
and	O
also	O
slower	O
than	O
basic	O
Fibonacci	B-Application
heap	I-Application
.	O
</s>
<s>
The	O
run-relaxed	O
heaps	B-Application
of	O
Driscoll	O
et	O
al	O
.	O
</s>
<s>
give	O
good	O
worst-case	O
performance	O
for	O
all	O
Fibonacci	B-Application
heap	I-Application
operations	O
except	O
merge	O
.	O
</s>
<s>
Fibonacci	B-Application
heaps	I-Application
have	O
a	O
reputation	O
for	O
being	O
slow	O
in	O
practice	O
due	O
to	O
large	O
memory	O
consumption	O
per	O
node	O
and	O
high	O
constant	O
factors	O
on	O
all	O
operations	O
.	O
</s>
<s>
Recent	O
experimental	O
results	O
suggest	O
that	O
Fibonacci	B-Application
heaps	I-Application
are	O
more	O
efficient	O
in	O
practice	O
than	O
most	O
of	O
its	O
later	O
derivatives	O
,	O
including	O
quake	O
heaps	B-Application
,	O
violation	O
heaps	B-Application
,	O
strict	O
Fibonacci	B-Application
heaps	I-Application
,	O
rank	O
pairing	B-Application
heaps	I-Application
,	O
but	O
less	O
efficient	O
than	O
either	O
pairing	B-Application
heaps	I-Application
or	O
array-based	O
heaps	B-Application
.	O
</s>
