Routing algorithms compute paths through a network to reach destination addresses. Distance-vector algorithms (e.g., RIP) share distances to known destinations with neighbors; link-state algorithms (e.g., OSPF) flood the entire network topology to all routers. Each approach has tradeoffs in convergence time, overhead, and scalability.
Simulate both distance-vector and link-state protocols in a network simulator; observe how each converges after topology changes.
From your study of IP routing basics, you know that routers forward packets hop-by-hop toward a destination by consulting their routing tables. Routing algorithms are the mechanisms by which routers populate those tables — determining the best path to every known destination in the network. Two fundamentally different approaches exist: distance-vector and link-state.
In a distance-vector protocol, each router maintains a table of distances to every known destination and periodically shares this table with its direct neighbors. When a neighbor advertises a distance, the receiving router adds 1 (or some cost) for the link to that neighbor and updates its own table if it found a shorter route. Over many rounds of exchange, routing information propagates hop by hop until all routers converge on consistent paths. RIP (Routing Information Protocol) is the classic example. The weakness of this approach is slow convergence: if a link fails, the misinformation can bounce between neighbors in a phenomenon called "count to infinity" — routers keep advertising increasingly large (but nonexistent) distances until the protocol stabilizes.
Link-state protocols take a different approach: each router builds a complete map of the entire network. Every router floods a short advertisement describing only its directly connected links and their costs — not its full routing table. Once a router has received link-state advertisements from every other router, it runs Dijkstra's shortest-path algorithm on the complete topology to compute the optimal path to every destination. OSPF (Open Shortest Path First) is the dominant real-world example. Because every router works from the same complete map, link-state protocols converge much faster and avoid count-to-infinity problems, at the cost of more flooding overhead and more memory.
The tradeoff between the two approaches comes down to what information is shared and where computation happens. Distance-vector is simple and low-overhead but slow to react to failures. Link-state is more complex and chatty but produces faster, more accurate convergence. Modern enterprise and ISP networks almost universally prefer link-state protocols (OSPF, IS-IS) for their superior convergence properties, while distance-vector protocols (RIP) survive mainly in simpler or legacy environments.