Bellman-Ford algorithm

From Algorithmist
(Redirected from Bellman-Ford)
Jump to navigation Jump to search
This is a stub or unfinished. Contribute by editing me.

For now, see http://en.wikipedia.org/wiki/Bellman-Ford_algorithm

BEGIN 
FOR ALL V=!S,D[V]=~;
   D[S]=0;
     FOR ALL V,  X[V]=NIL;
     FOR STEP =1 TO N;
      FOR(U,V) BELONGS TO E;
        IF (D[W]+W[U,V]< D[V])
         D[V] =D[W]+W[U,V]<D[V]);
           X[V]=U;
END;