Bellman-Ford(G,w,s)
- Initialize Single Source(G,s)
- for i = 1 to |V[G]| -1
- for each edge (u,v) ∈ E[G]
- relax(u,v,w);
Initialization at node x:
- for all destinations y in N
- dx(y) = c(x,y)
- for each neighbor v
- dv(y) = ∞
- for each neighbor v
- send dx Operation:
- wait until a new distance vector is received or a link cost changes
- for each y in N
- dx = minv(c(x,v)+dv(y))
- if dx changes
- for each neighbor v
- send dx