The San Francisco to San Diego route can be split at Los Angeles because the problem exhibits optimal substructure. Once the shortest SF→LA and LA→SD segments are known, they combine to give the shortest SF→SD route.
Conditions: The example assumes the overall route passes through Los Angeles.; The narrator states that finding the shortest subroutes guarantees the overall shortest route in this example.
The San Francisco to San Diego route can be split at Los Angeles because the problem exhibits optimal substructure. Once the shortest SF→LA and LA→SD segments are known, they combine to give the shortest SF→SD route.
Conditions: The example assumes the overall route passes through Los Angeles.; The narrator states that finding the shortest subroutes guarantees the overall shortest route in this example.
Optimal substructure means that the optimal solution to the overall problem can be constructed by efficiently combining the optimal solutions of its subproblems. In the route example, once the shortest SF→LA and LA→SD segments are known, they combine to give the shortest SF→SD route.
Conditions: The problem can be divided into subproblems.; The optimal solution of the main problem depends on the optimal solutions of its subproblems.
Optimal substructure means that the optimal solution to the overall problem can be constructed by efficiently combining the optimal solutions of its subproblems. In the route example, once the shortest SF→LA and LA→SD segments are known, they combine to give the shortest SF→SD route.
Conditions: The problem can be divided into subproblems.; The optimal solution of the main problem depends on the optimal solutions of its subproblems.