Description
Implement the following algorithms in C language.
- Distance Vector Routing
- Link State Routing
Hint: Use Bellman-Ford for DVR and Dijkstra’s algorithm for LSR.
Input format:
Two integers n and m, where n denotes the number of nodes and m denotes the
total number of links, followed by m lines denoting source, destination, and cost respectively of each link.
Output format:
- For DVR, display the final routing table at all nodes in the format {destination,next_hop, cost}
- For LSR, your program should print out the shortest path to all network nodesfrom all node with the complete path and the total cost.
Sample Input: 45
122 233 3 4 11 411 247
Sample Output:
For DVR,
Routing table at node 1 (similarly, display for all nodes)
110 222 325 441
For LSR, at node 1
1 -> 1
1 -> 2 1->2->3 5 1 -> 4 1
(Path to all nodes from Node 1, similarly, display for all nodes)
0 2





