Question: SO, please do the question written below. That is show that O(n^2) space can be achieved without sacrificing correctness by dropping the superscript in Floyd-Warshall


SO, please do the question written below. That is show that O(n^2) space can be achieved without sacrificing correctness by dropping the superscript in Floyd-Warshall algorithm by computing the distance matrices D(k) in place using single matrix D.
Problem As it appears above, the Floyd-Warshall algorithm requires (n3) space, since we compute d. for ij, k= 1.2...., n. Show that the following procedure, which simply drops all the superscripts, is correct, and thus only O(n) space is required. FLOYD-WARSHALL'(W) 1 + rows[W] 2 DEW 3 for k + I to n 4 do for i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
