Optimal substructure: Difference between revisions

Content deleted Content added
m rm extraneous phrase
No edit summary
Line 2:
In [[computer science]], a problem is said to have '''optimal substructure''' if an optimal solution can be constructed efficiently from optimal solutions of its subproblems. This property is used to determine the usefulness of dynamic programming and greedy algorithms for a problem.<ref>[http://books.google.com/books?id=NLngYyWFl_YC&pg=PA15&dq=introduction+to+algorithms&psp=1&sig=jX-xfEDWJU3PprUwH8Qfxidli6M#PPP1,M1 Introduction to Algorithms], 2nd ed., (Cormen, Leiserson, Rivest, and Stein) 2001, p. 327. ISBN 0-262-03293-7.</ref>
 
Typically, a [[greedy algorithm]] is used to solve a problem with optimal substructure if it can be proved by induction that this is optimal at each step (Cormen et al. pp.&nbsp;381–2). Otherwise, providing the problem exhibits [[overlapping subproblem]]s as well, [[dynamic programming]] is used. If there are no appropriate greedy algorithms and the problem fails to exhibit overlapping subproblems, often a lengthy but straightforward search of the solution space is the best alternative.
<!-- A special case of optimal substructure is the case where a subproblem S<sub>ab</sub> has an activity P<sub>y</sub>, then it should contain optimal solutions to subproblems S<sub>ay</sub> and S<sub>yb</sub>. --> <!-- *TODO: Add Recursion, misc. -->
In the application of [[dynamic programming]] to [[Optimization (mathematics)|mathematical optimization]], [[Richard Bellman]]'s [[Principle of optimality|Principle of Optimality]] is based on the idea that in order to solve a dynamic optimization problem from some starting period ''t'' to some ending period ''T'', one implicitly has to solve subproblems starting from later dates ''s'', where ''t<s<T''. This is an example of optimal substructure. The Principle of Optimality is used to derive the [[Bellman equation]], which shows how the value of the problem starting from ''t'' is related to the value of the problem starting from ''s''.