<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
problem	O
is	O
said	O
to	O
have	O
optimal	B-Algorithm
substructure	I-Algorithm
if	O
an	O
optimal	O
solution	O
can	O
be	O
constructed	O
from	O
optimal	O
solutions	O
of	O
its	O
subproblems	O
.	O
</s>
<s>
This	O
property	O
is	O
used	O
to	O
determine	O
the	O
usefulness	O
of	O
greedy	B-Algorithm
algorithms	I-Algorithm
for	O
a	O
problem	O
.	O
</s>
<s>
Typically	O
,	O
a	O
greedy	B-Algorithm
algorithm	I-Algorithm
is	O
used	O
to	O
solve	O
a	O
problem	O
with	O
optimal	B-Algorithm
substructure	I-Algorithm
if	O
it	O
can	O
be	O
proven	O
by	O
induction	O
that	O
this	O
is	O
optimal	O
at	O
each	O
step	O
.	O
</s>
<s>
Otherwise	O
,	O
provided	O
the	O
problem	O
exhibits	O
overlapping	B-Algorithm
subproblems	I-Algorithm
as	O
well	O
,	O
divide-and-conquer	B-Algorithm
methods	I-Algorithm
or	O
dynamic	B-Algorithm
programming	I-Algorithm
may	O
be	O
used	O
.	O
</s>
<s>
If	O
there	O
are	O
no	O
appropriate	O
greedy	B-Algorithm
algorithms	I-Algorithm
and	O
the	O
problem	O
fails	O
to	O
exhibit	O
overlapping	B-Algorithm
subproblems	I-Algorithm
,	O
often	O
a	O
lengthy	O
but	O
straightforward	O
search	O
of	O
the	O
solution	O
space	O
is	O
the	O
best	O
alternative	O
.	O
</s>
<s>
In	O
the	O
application	O
of	O
dynamic	B-Algorithm
programming	I-Algorithm
to	O
mathematical	O
optimization	O
,	O
Richard	O
Bellman	O
's	O
Principle	O
of	O
Optimality	O
is	O
based	O
on	O
the	O
idea	O
that	O
in	O
order	O
to	O
solve	O
a	O
dynamic	B-Algorithm
optimization	I-Algorithm
problem	O
from	O
some	O
starting	O
period	O
t	O
to	O
some	O
ending	O
period	O
T	O
,	O
one	O
implicitly	O
has	O
to	O
solve	O
subproblems	O
starting	O
from	O
later	O
dates	O
s	O
,	O
where	O
t	O
<	O
s	O
<	O
T	O
.	O
</s>
<s>
This	O
is	O
an	O
example	O
of	O
optimal	B-Algorithm
substructure	I-Algorithm
.	O
</s>
<s>
Such	O
an	O
example	O
is	O
likely	O
to	O
exhibit	O
optimal	B-Algorithm
substructure	I-Algorithm
.	O
</s>
<s>
As	O
an	O
example	O
of	O
a	O
problem	O
that	O
is	O
unlikely	O
to	O
exhibit	O
optimal	B-Algorithm
substructure	I-Algorithm
,	O
consider	O
the	O
problem	O
of	O
finding	O
the	O
cheapest	O
airline	O
ticket	O
from	O
Buenos	O
Aires	O
to	O
Moscow	O
.	O
</s>
<s>
A	O
slightly	O
more	O
formal	O
definition	O
of	O
optimal	B-Algorithm
substructure	I-Algorithm
can	O
be	O
given	O
.	O
</s>
<s>
If	O
minimizing	O
the	O
local	O
functions	O
is	O
a	O
problem	O
of	O
"	O
lower	O
order	O
"	O
,	O
and	O
(	O
specifically	O
)	O
if	O
,	O
after	O
a	O
finite	O
number	O
of	O
these	O
reductions	O
,	O
the	O
problem	O
becomes	O
trivial	O
,	O
then	O
the	O
problem	O
has	O
an	O
optimal	B-Algorithm
substructure	I-Algorithm
.	O
</s>
<s>
Any	O
problem	O
that	O
can	O
be	O
solved	O
by	O
dynamic	B-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
Using	O
online	O
flight	O
search	O
,	O
we	O
will	O
frequently	O
find	O
that	O
the	O
cheapest	O
flight	O
from	O
airport	O
A	O
to	O
airport	O
B	O
involves	O
a	O
single	O
connection	O
through	O
airport	O
C	O
,	O
but	O
the	O
cheapest	O
flight	O
from	O
airport	O
A	O
to	O
airport	O
C	O
involves	O
a	O
connection	O
through	O
some	O
other	O
airport	O
D	O
.	O
However	O
,	O
if	O
the	O
problem	O
takes	O
the	O
maximum	O
number	O
of	O
layovers	O
as	O
a	O
parameter	O
,	O
then	O
the	O
problem	O
has	O
optimal	B-Algorithm
substructure	I-Algorithm
.	O
</s>
