distance vector routing using bellmann ford algorithm for a cost matrix of an undirected graph

1k views Asked by At

I am trying to implement distance vector algorithm using bellman ford algorithm for an directed graph . My input is the initial matrix which describes the weight of the nodes adjacent to other nodes. In order to calculate shortest path between nodes , I also need to calculate the iterations that will occur of the changes in the matrix . How to calculate the iterations after which the matrix will give shortest path for all the nodes? sample initial matrix of nodes is as below , we are considering the graph as

R1 -> R2 = 3
R1 -> R3 = 999
R1 -> R4 = 7
R2 -> R3 = 6
R2 -> R4 = 999
R3 -> R4 = 2

Here 999 is considered as infinity as the nodes are not directly connected.

1

There are 1 answers

0
wilx On

This seems like something you should be able to derive from the algorithm. AFAICS, the matrix will be filled with the result after basically |V|*|E| iterations.