"Optimal substructure" means that the solution to a given optimization problem can be obtained by the combination of optimal solutions to its sub-problems. Such optimal substructures are usually described by means of recursion. For example, given a graph "G=(V,E)", the shortest path "p" from a vertex "u" to a vertex "v" exhibits optimal substructure: take any intermediate vertex "w" on this shortest path "p". If "p" is truly the shortest path, then it can be split into sub-paths "p1" from "u" to "w" and "p2" from "w" to "v" such that these, in turn, are indeed the shortest paths between the corresponding vertices (by the simple cut-and-paste argument described in "Introduction to Algorithms"). Hence, one can easily formulate the solution for finding shortest paths in a recursive manner, which is what the Bellman–Ford algorithm or the Floyd–Warshall algorithm does.