Page 85 - Data Structures Interactive Book
P. 85
This simple program models a small social network. In real systems, such graphs are
analyzed using BFS or DFS to find mutual friends, shortest connections, or community
structures.
8.6.2 Computer Networks
Computer networks, including the internet, can be represented as graphs where
vertices represent routers or computers and edges represent communication links. Graph
algorithms are used to determine optimal routing paths, detect network failures, and ensure
efficient data transmission.
Routing protocols such as OSPF (Open Shortest Path First) use shortest path
algorithms like Dijkstra’s to compute the best routes for data packets. Detecting cycles and
redundant paths ensures fault tolerance, so that if one link fails, data can still be transmitted
through alternative routes.
Example: Network Routing using Dijkstra’s Algorithm
85

