GATE | Gate IT 2005 | Question 90
Consider a simple graph with unit edge costs. Each node in the graph represents a router. Each node maintains a routing table indicating the next hop router to be used to relay a packet to its destination and the cost of the path to the destination through that router. Initially, the routing table is empty. The routing table is synchronously updated as follows. In each updation interval, three tasks are performed.
- A node determines whether its neighbours in the graph are accessible. If so, it sets the tentative cost to each accessible neighbour as 1. Otherwise, the cost is set to ∞.
- From each accessible neighbour, it gets the costs to relay to other nodes via that neighbour (as the next hop).
- Each node updates its routing table based on the information received in the previous two steps by choosing the minimum cost.
|1)||Table for node A|
|2)||Table for node C|
|Table for node B|
|4)||Table for node D|
This solution is contributed by Sandeep Pandey.
Quiz of this Question