Talk:Bellman–Ford algorithm: Difference between revisions

Content deleted Content added
SineBot (talk | contribs)
m Signing comment by ToneDaBass - ""
Pseudocode bug?: new section
Line 98:
The lead cites a reduction by Sedgewick from the [[NP-Complete]] [[Hamiltonian path problem]] to the [[shortest path problem]]. Since the shortest path problem (even <ins>for all-pairs</ins> with <ins>edges of</ins> negative weight<del>s</del>) is not NP-Complete (i.e., Floyd-Warshall = O(n^3)), something needs to be clarified/corrected. <b>[[User:Justin W Smith|Justin W Smith]]</b> <i><sup>[[User talk:Justin W Smith|talk]]</sup>/<sub>[[Special:Contributions/Justin W Smith|stalk]]</sub></i> 06:15, 21 April 2010 (UTC)
: I think I figured out what was being said. If someone could verify this, I would appreciate it. <b>[[User:Justin W Smith|Justin W Smith]]</b> <i><sup>[[User talk:Justin W Smith|talk]]</sup>/<sub>[[Special:Contributions/Justin W Smith|stalk]]</sub></i> 14:08, 21 April 2010 (UTC)
 
== Pseudocode bug? ==
 
The pseudocode in the article states:
for i from 1 to size(vertices)-1:
I'm pretty sure that it's supposed to be
for i from 0 to size(vertices)-1:
or, equivalently
for i from 1 to size(vertices):
 
The program I made based on the pseudocode didn't work until I made this change. Can anyone confirm that this is indeed the case (and not just some other bug in my program) and if so, correct the article? --[[User:Smallhacker|Smallhacker]] ([[User talk:Smallhacker|talk]]) 15:38, 3 March 2011 (UTC)