80 likes | 89 Views
Learn about the importance of graph algorithms in distributed systems, including topology, routing, efficient broadcasting, and maxflow. Explore classical algorithms like Bellman-Ford and Dijkstra's algorithm, and understand the difference between ordinary and distributed graph algorithms.
E N D
Graph Algorithms Why should we learn about graph algorithms in distributed systems? • Topology is a graph. • Routing table computation uses the shortest path algorithm • Efficient broadcasting uses a spanning tree • Maxflow algorithm determines the maximum flow between a pair of nodes.
Routing • Shortest path • Link state routing • Distance vector routing • Routing in mobile ad-hoc networks • Routing in sensor networks
Routing: Shortest Path Classical algorithms Bellman-Ford Dijkstra’s algorithm What is the difference between an (ordinary) graph algorithm and a distributed graph algorithm
Directed graph G=(V,E) Each edge e has a weight w(e) e E, w(e) > 0 i V, compute the distance of i from a designated node called the root. Model 0 w(0,j),0 j w(0,j)+w(j,k),j k
Most are adaptation of the classic Bellman-Ford algorithm. Let D(j) = shortest distance of j from initiator 0 Routing: Shortest Path 0 w(0,j),0 j w(0,j)+w(j,k),j k
{Chandy & Misra’s algorithm: for process i > 0} {for process i > 0: this includes termination detection} do message = (S ,k) S < D if deficit > 0 parent ≠ i send ack to parent fi; parent := k; D := S; send (D + w(i,j)), i to each successor; deficit := deficit + number successors message (S,k) S ≥ D send ack to sender ack deficit := deficit – 1 deficit = 0 parent i send ack to parent od Shortest path It also detects termination
Shortest path The real issue is: how well do such algorithms perform when the topology changes? Let us examine distance vector routing that is adaptation of the shortest path algorithm
Distance Vector D for each node i contains N elements, and D[i,j] defines its distance from node i to node j. Each node j periodically broadcasts its distance vector to its immediate neighbors. Every neighbor i of j, after receiving the broadcasts from its neighbors, updates its distance vector as follows: k≠ i: D[i,k] = mink(w[i,j] + D[j,k] ) Distance Vector Routing Observe what can happen when the link fails