Jesh wants to implement a program for basic distance vector routing in a computer…
- User
Jesh wants to implement a program for basic distance vector routing in a computer network. Given the number of nodes and an adjacency matrix representing link costs, determine the distance vector routing table for each node starting from a specified source node. Output the node number, distance from the source, and the next hop for each node. Input format: The first line of input is an integer N representing the number of nodes in the network. The next N lines of input consists of N space-separated integers each, representing the adjacency matrix. Each integer is either the cost of the link or -1 if there is no direct link. The last line of input consists of an integer source representing the source node for the algorithm. Output format: The first line of output displays "Distance Vector Routing Table:", indicating that the following lines will contain the routing table information.Output format: The first line of output displays "Distance Vector Routing Table:", indicating that the following lines will contain the routing table information. The next line of output should display "Node", "Distance", and "Next Hop are column headers. Each subsequent line contains the information for a single node, with three space-separated values: the node number, the distance from the source node, and the next hop node. Refer to the sample output for the formatting specifications. Code constraints: In this scenario, the given test cases will fall under the following constraints: 15 N510
- Cost of link s 10Sample test cases:
- Assistant