# How do I apply a single iteration of Floyd's algorithm to an adjacency matrix? [closed]

I have the following adjacency matrix for a graph with nodes {a,b,c,d}:

\begin{bmatrix} & & a& b& c& d\\ & & & & & \\ a& & 0& 1& 100& 10\\ b& & 13& 0& 2& 100\\ c& & 100& 12& 0& 3\\ d& & 4& 100& 11& 0 \end{bmatrix} I want to apply the Warshall-Floyd algorithm. I can do this since I know it computes the shortest paths between each pair of nodes. By manually calculating each individual entry, I get the final matrix:

\begin{bmatrix} & & a& b& c& d\\ & & & & & \\ a& & 0& 1& 3& 6\\ b& & 9& 0& 2& 5\\ c& & 7& 8& 0& 3\\ d& & 4& 5& 7& 0 \end{bmatrix}

My question is this: how can I draw the matrix after each 'iteration' of the algorithm? What qualifies as a single iteration and what does the matrix look like after iteration 1?

## closed as unclear what you're asking by David Richerby, Luke Mathieson, Juho, lPlant, Nicholas MancusoMay 26 '15 at 0:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• What have you tried? Did you find the pseudocode for Floyd-Warshall? Did you try running the pseudocode by hand? Is there something specific you are confused about? – D.W. May 19 '15 at 18:19