destination used to convey a default route. In RIP, the Bellman-Ford algorithms make each router
periodically broadcast its routing tables to all its neighbors. Then a router knowing its neighbors’
tables can decide to which destination neighbor to forward a packet.
OSPF is a routing protocol developed for Internet Protocol (IP) networks by the Interior Gateway
Protocol (IGP) Working Group of the Internet Engineering Task Force (IETF). OSPF was
created because in the mid-1980s, RIP was increasingly incapable of serving large, heterogeneous
internetworks. Like most link-state algorithms, OSPF uses a graph-theoretic model of network
topology to compute shortest paths. Each router periodically broadcasts information about the
status of its connections. OSPF floods information about adjacencies to all routers in the network
where each router locally computes the shortest paths by running Dijkstra’s algorithm.
4.2 SPT-based approximations
Besides their applications to network routing problems, the shortest-paths tree algorithms could
also serve as good approximations for some NP-hard problems. For example, we will later show
that a shortest-paths tree rooted at some vertex is a 2-approximation of the minimum routing
cost spanning tree (MRCT) problem, which is known to be NP-hard. In fact, several SPT-based
approximations will be studied in the next chapters.
5 Summary
We have introduced two most basic algorithms for constructing a shortest-paths tree for a given
directed or undirected weighted graph. Both of them use the technique of relaxation, progressively
decreasing a shortest-path estimate ±[v] for each vertex v. The relaxation causes the shortest-path
estimates to descend monotonically toward the actual shortest-path weights. Dijkstra’s algorithm
relaxes each edge exactly once (twice in the case of undirected graphs) if all the edge weights are
positive. On the other hand, the Bellman-Ford algorithm relaxes each edge n¡1 times, so that the
effect of a negative edge can be propagated properly. If the shortest-path estimates do not stabilize
after n¡1 passes, then there must exist a negative cycle in the graph, and the algorithm indicates
that no solution exists.