Talk:Floyd-Warshall's algorithm

Three comments. 1. I don't think it requires triangle inequality.. I haven't deleted it, I just commented it out, let me know if I'm wrong.. 2. It's just a simple dynamic programming.. but maybe we should change the pseudo-code to the O( n^3 ) space version to show to beginners the recurrence.. 3. Writing out the recurrence (or psuedocode in its recursive form) should illustrate better what we're doing.. instead of giving them a black box of "three for loops" (which admittingly, got by for me for quite some time..) Larry 12:59, 9 Dec 2005 (EST)
 * You're right about 1. (The triangle inequality was already there in the original article, though; I only gave it a name). We aren't really "using" the triangle inequality. About 2 (and 3), the dilemma is more general&mdash;should the easier-to-understand version be presented, or the more efficient one? What is important for Algorithmist&mdash;explaining algorithms or just giving the best possible ones? Aboyner 20:42, 9 Dec 2005 (EST)


 * I think that in cases like this one the best way is to present both approaches. Start with the simple & pedagogical one. Once everything is clear, show the practical one and explain why it does the same. --Misof 18:48, 11 Dec 2005 (EST)

Also, don't forget to add a pre-condition about negative cycles in the graph... and a paragraph about their detection. --Misof 18:50, 11 Dec 2005 (EST)