<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
an	O
online	B-Algorithm
algorithm	I-Algorithm
is	O
one	O
that	O
can	O
process	O
its	O
input	O
piece-by-piece	O
in	O
a	O
serial	O
fashion	O
,	O
i.e.	O
,	O
in	O
the	O
order	O
that	O
the	O
input	O
is	O
fed	O
to	O
the	O
algorithm	O
,	O
without	O
having	O
the	O
entire	O
input	O
available	O
from	O
the	O
start	O
.	O
</s>
<s>
In	O
contrast	O
,	O
an	O
offline	B-Algorithm
algorithm	I-Algorithm
is	O
given	O
the	O
whole	O
problem	O
data	O
from	O
the	O
beginning	O
and	O
is	O
required	O
to	O
output	O
an	O
answer	O
which	O
solves	O
the	O
problem	O
at	O
hand	O
.	O
</s>
<s>
In	O
operations	O
research	O
,	O
the	O
area	O
in	O
which	O
online	B-Algorithm
algorithms	I-Algorithm
are	O
developed	O
is	O
called	O
online	B-Algorithm
optimization	I-Algorithm
.	O
</s>
<s>
As	O
an	O
example	O
,	O
consider	O
the	O
sorting	B-Algorithm
algorithms	I-Algorithm
selection	B-Algorithm
sort	I-Algorithm
and	O
insertion	B-Algorithm
sort	I-Algorithm
:	O
selection	B-Algorithm
sort	I-Algorithm
repeatedly	O
selects	O
the	O
minimum	O
element	O
from	O
the	O
unsorted	O
remainder	O
and	O
places	O
it	O
at	O
the	O
front	O
,	O
which	O
requires	O
access	O
to	O
the	O
entire	O
input	O
;	O
it	O
is	O
thus	O
an	O
offline	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
insertion	B-Algorithm
sort	I-Algorithm
considers	O
one	O
input	O
element	O
per	O
iteration	O
and	O
produces	O
a	O
partial	O
solution	O
without	O
considering	O
future	O
elements	O
.	O
</s>
<s>
Thus	O
insertion	B-Algorithm
sort	I-Algorithm
is	O
an	O
online	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Note	O
that	O
the	O
final	O
result	O
of	O
an	O
insertion	B-Algorithm
sort	I-Algorithm
is	O
optimum	O
,	O
i.e.	O
,	O
a	O
correctly	O
sorted	B-Algorithm
list	I-Algorithm
.	O
</s>
<s>
For	O
many	O
problems	O
,	O
online	B-Algorithm
algorithms	I-Algorithm
cannot	O
match	O
the	O
performance	O
of	O
offline	B-Algorithm
algorithms	I-Algorithm
.	O
</s>
<s>
If	O
the	O
ratio	O
between	O
the	O
performance	O
of	O
an	O
online	B-Algorithm
algorithm	I-Algorithm
and	O
an	O
optimal	O
offline	B-Algorithm
algorithm	I-Algorithm
is	O
bounded	O
,	O
the	O
online	B-Algorithm
algorithm	I-Algorithm
is	O
called	O
competitive	B-Algorithm
.	O
</s>
<s>
Not	O
every	O
offline	B-Algorithm
algorithm	I-Algorithm
has	O
an	O
efficient	O
online	O
counterpart	O
.	O
</s>
<s>
Because	O
it	O
does	O
not	O
know	O
the	O
whole	O
input	O
,	O
an	O
online	B-Algorithm
algorithm	I-Algorithm
is	O
forced	O
to	O
make	O
decisions	O
that	O
may	O
later	O
turn	O
out	O
not	O
to	O
be	O
optimal	O
,	O
and	O
the	O
study	O
of	O
online	B-Algorithm
algorithms	I-Algorithm
has	O
focused	O
on	O
the	O
quality	O
of	O
decision-making	O
that	O
is	O
possible	O
in	O
this	O
setting	O
.	O
</s>
<s>
Competitive	B-Algorithm
analysis	I-Algorithm
formalizes	O
this	O
idea	O
by	O
comparing	O
the	O
relative	O
performance	O
of	O
an	O
online	O
and	O
offline	B-Algorithm
algorithm	I-Algorithm
for	O
the	O
same	O
problem	O
instance	O
.	O
</s>
<s>
Specifically	O
,	O
the	O
competitive	B-Algorithm
ratio	I-Algorithm
of	O
an	O
algorithm	O
,	O
is	O
defined	O
as	O
the	O
worst-case	O
ratio	O
of	O
its	O
cost	O
divided	O
by	O
the	O
optimal	O
cost	O
,	O
over	O
all	O
possible	O
inputs	O
.	O
</s>
<s>
The	O
competitive	B-Algorithm
ratio	I-Algorithm
of	O
an	O
online	O
problem	O
is	O
the	O
best	O
competitive	B-Algorithm
ratio	I-Algorithm
achieved	O
by	O
an	O
online	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Intuitively	O
,	O
the	O
competitive	B-Algorithm
ratio	I-Algorithm
of	O
an	O
algorithm	O
gives	O
a	O
measure	O
on	O
the	O
quality	O
of	O
solutions	O
produced	O
by	O
this	O
algorithm	O
,	O
while	O
the	O
competitive	B-Algorithm
ratio	I-Algorithm
of	O
a	O
problem	O
shows	O
the	O
importance	O
of	O
knowing	O
the	O
future	O
for	O
this	O
problem	O
.	O
</s>
<s>
dynamic	B-General_Concept
algorithm	I-General_Concept
:	O
focusing	O
on	O
the	O
time	O
complexity	O
of	O
maintaining	O
solutions	O
to	O
problems	O
with	O
online	O
inputs	O
.	O
</s>
<s>
Some	O
online	B-Algorithm
algorithms	I-Algorithm
:	O
</s>
<s>
A	O
problem	O
exemplifying	O
the	O
concepts	O
of	O
online	B-Algorithm
algorithms	I-Algorithm
is	O
the	O
Canadian	O
Traveller	O
Problem	O
.	O
</s>
<s>
An	O
alternative	O
analysis	O
of	O
the	O
problem	O
can	O
be	O
made	O
with	O
the	O
help	O
of	O
competitive	B-Algorithm
analysis	I-Algorithm
.	O
</s>
<s>
For	O
this	O
method	O
of	O
analysis	O
,	O
the	O
offline	B-Algorithm
algorithm	I-Algorithm
knows	O
in	O
advance	O
which	O
edges	O
will	O
fail	O
and	O
the	O
goal	O
is	O
to	O
minimize	O
the	O
ratio	O
between	O
the	O
online	O
and	O
offline	B-Algorithm
algorithms	I-Algorithm
 '	O
performance	O
.	O
</s>
<s>
There	O
are	O
many	O
formal	O
problems	O
that	O
offer	O
more	O
than	O
one	O
online	B-Algorithm
algorithm	I-Algorithm
as	O
solution	O
:	O
</s>
