Question:

DVR - distance vector routing
LSR - link state routing
Answer:
Destination | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
COST | 2 | 1 | 3 | 6 | 5 | 7 | 7 | 7 | 7 |
next hop/ intermidiate node | 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
we will chose the path that gives use the minimum cost and least number of intermidiate nodes. this works similarly to the bell man fords algo.
to compute the path between the SOURCE(x) and the DESTINATION (y) if it passes through an intermidiate node (v)
then,
dx(y)= min v { c(x,v) + dv(y)}
so for eg take the path from 0 to 4:
there are three way one can reach 4 from 0 but one can deduce from the diagram itself that there is loggically only one way although for a computer it can be hard so
we add the weights of each edge and compare the sums
in this case the optimal path will be from 0 to 1 to 4
that will make 1 the intermidiate node and give th minimum cost of the route as 6
which if we took the path from 0 to 2 to 8 to 7 to 4 would give 11
part 2:
node | 0 | 1 | 2 | 3 | 4 | 5 | 6 7 | 8 | 9 |
cost | 0 | 2 | 1 | 3 | infinity | infinity | both infinity | infinity | infinity |
now all the nodes that are not adjasent to 0 will be zero this is under stood best if one is fimiliar with Dijstars algorithum, even if you are not one can understand it as it pretty logical. As if it is not in its direct reach then there will be multiple way or zero way to reach it. it may varry and it will when we make the same form all the nodes.
by the end of each node we will get the table that will contain the minimum cost of all the paths.
but right now that doesnt consern us as we've been asked only about node 0.