Has Optimal Substructure Property?
In Computer Science, a Problem Is Said to Have Optimal Substructure If an Optimal Solution Can Be Constructed from Optimal Solutions of Its Subproblems. This...
In computer science, a problem is said to have optimal substructure if an optimal solution can be constructed from optimal solutions of its subproblems. This property is used to determine the usefulness of dynamic programming and greedy algorithms for a problem.
Does dynamic programming have optimal substructure?
"Optimal substructure" is a specific property of some problems and is not exclusive to dynamic programming. In other words, many problems actually have optimal substructures, but most of them do not have overlapping subproblems, so we cannot classify them dynamic programming problems.
What is meant by the optimal substructure property of a shortest path in a graph?
For example, the Shortest Path problem has following optimal substructure property: If a node x lies in the shortest path from a source node u to destination node v then the shortest path from u to v is combination of shortest path from u to x and shortest path from x to v.