I have read and searched about Floyd Warshall algorithm and i think i understand it. But in the example which i read on the book "Introduction to the Algorithms (Thomas H. Cormen's Book)" i stacked at a point. I confused.Here is a picture which is the same in the book.My question is in the last step namely π(5).
Here is the example:
http://integrator-crimea.com/images/fig653_01_0.jpg
I think the first row of π(5) must be :
NIL 5 5 5 1
However it is written in the book :
NIL 3 4 5 1
Could anybody clear my confusion above? Is it written wrong in the book ?