Bellman-Ford Algorithm (n x n matrix A; source node x) Local variables: //here entry M[v,i] represents the //shortest path from x to v //that uses no more than i arcs 2-D n × n-1 array M indices i, j vertices v, z //initialize M array for j-1 to n – 1, //shortest path from x to x of any //number of arcs is //always length0 set M[x, J] = 0 for v = any vertex //shortest path
OR
OR