Content deleted Content added
→Example: Remove US-centric example Tags: Reverted Visual edit |
Undid revision 1285865773 by 87.214.42.62 (talk) |
||
Line 9:
==Example==
Consider finding a [[Shortest path problem|shortest path]] for traveling between two cities by car, as illustrated in Figure 1. Such an example is likely to exhibit optimal substructure. That is, if the shortest route from
As an example of a problem that is unlikely to exhibit optimal substructure, consider the problem of finding the cheapest airline ticket from Buenos Aires to Moscow. Even if that ticket involves stops in Miami and then London, we can't conclude that the cheapest ticket from Miami to Moscow stops in London, because the price at which an airline sells a multi-flight trip is usually not the sum of the prices at which it would sell the individual flights in the trip.
|