Talk:Bellman–Ford algorithm

This is an old revision of this page, as edited by 202.10.35.10 (talk) at 14:39, 14 September 2006 (Zero weight cycles). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 19 years ago by 164.55.254.106 in topic How do you compile the C code?

Assembly code has no place in algorithm articles; it doesn't help explain the algorithm at all.

I removed the license notice and the attribution to "JellyWorld" from the C code. Fortunately, the license was GFDL-compatible, and it permitted the attribution to be removed.

RSpeer 17:46, Apr 21, 2005 (UTC)

I changed the problem from weighted graph to weighted *digraph* because Bellman Ford fails spectacularly on undirected graphs: If there is a negative weight edge, say {u, v}, then Bellman-Ford will get stuck updating u and v foreover, even if there is no negative weight cycle. This subtlety may be worth mentioning in the main article. To find shortest paths in undirected graphs with negative edge weights, you can reduce the problem to weighted nonbipartite matching.

Zero weight cycles

sdz a'f]

]L;

]' ' 'then the correctnes proof should be rewritten a little so that it states all the cases. --Hdante 18:40, 7 November 2005 (UTC) sdfdsfs sdfsd f sd f sd fsd f sdReply

Counting to infinity

I didn't know what "counting to infinity" meant in the list of limitations of the distributed algorithm, so I searched around a bit and added a few words expressing what I found. But if anyone has a better explanation, please do add. -- Orbst 15:29, 17 April 2006 (UTC)Reply

How do you compile the C code?

That would be nice if you can modify the C source code so that it compiles with gcc. When I copy/paste the code and compiles it with gcc, it gives me:

/usr/lib/gcc/powerpc-linux-gnu/3.4.5/../../../../lib/crt1.o:(.rodata+0x4): undefined reference to `main' collect2: ld returned 1 exit status

Defining main() would probably be a good start. :P Compiling to object code works just fine; you've forgotten the "-o" flag to gcc. 164.55.254.106 18:51, 31 May 2006 (UTC)Reply