Talk:Floyd–Warshall algorithm: Difference between revisions

Content deleted Content added
Line 11:
{{archives}}
 
== {{ESp|q}} Is the main function correct? ==
Where it appears:
next[i][j] ← next[i][k]
Line 17:
Should it be?:
next[i][j] ← next[k][j]
 
: Clearly, it seems to be a problem for many people. In fact, as in the web reference that goes with the pseudocode, the modification of the array next is ''path[i][j] := path[k][j]''. I did the modification yesterday without looking the talk page (my mistake) thinking it was a minor error, but my modification was reverted by {{reply to|MfR}} with this explanation : {{Quote frame|Pseudocode in this page computes the second node of the path from i to j, not the penultimate (as in reference).}}
: which I don't really understand... In ''Introduction to Algorithms, Cormen et al., MIT Press, Third Edition'' at page 697, again, we see '''[k][j]'''... [[User:Raphaelbwiki|Raphaelbwiki]] ([[User talk:Raphaelbwiki|talk]]) 13:49, 4 June 2019 (UTC)
 
==Is there a bug in the main loop? ==