Question: As it appears above, the Floyd-Warshall algorithm requires O(n^3) space, since we compute d ij (k) for i, j, k = 1, 2, n. Show
As it appears above, the Floyd-Warshall algorithm requires O(n^3) space, since we compute dij(k) for i, j, k = 1, 2, n. Show that the following procedure, which simply drops all the superscripts, is correct, and thus only O(n^2) space is required.
More specifically, show and explain that O(n2) space can be achieved without sacrificing correctness by dropping the superscripts in the Floyd-Warshall algorithm by computing the distance matrices D(k)in place using a single matrix D. [5 points]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
