Comparison of Tarrys Algorithm and Awerbuchs Algorithm CS
Comparison of Tarry’s Algorithm and Awerbuch’s Algorithm CS 6/73201 Advanced Operating System Presentation by: Sanjitkumar Patel
Outline • • • Goal Introduction Experiments Setup Results and Analysis Conclusion and Future Work
Goal • To compare Tarry’s and Awerbuch’s Algorithm. • Theoretically, Time complexity of Awerbuch’s algorithm is better than Tarry’s algorithm Tarry ( 2 x Number of edges) Awerbuch ( 4 x Number of nodes) - 2 • Theoretically, Message complexity of Tarry’s algorithm is better than Awerbuch’s algorithm Tarry ( 2 x Number of edges) Awerbuch ( 4 x Number of edges) • How they perform in real world?
Introduction • Tarry’s Algorithm: – Initiator forwards the token to one of its neighbors, each neighbor forwards the token to all other nodes and when done returns the token. • Awerbuch’s Algorithm: – A node holding the token for the first time informs all neighbors except its father. – Prevents token forwarding over frond edges -each process knows which neighbors were visited before it forwards the token.
Experiments Setup • Graphs are usually random for these experiments • We need to measure time and message complexities while varying size and density of network • Number of nodes are entered from terminal. • Based on the input provided by user, random graph is generated. • E. g. user entered number of nodes = 4 then, 4 x 4 matrix is generated. • Matrix is initialized by randomly generating 0 and 1. • 1 means there is an edge between nodes and 0 means there is no edge between nodes
Experiments Setup • Suppose randomly generated matrix is as follows: 1 2 3 4 1 0 1 2 1 0 1 1 3 0 1 4 1 1 1 0
Experiments Setup • Suppose randomly generated graph is as follows: 1 2 3 4 1 0 1 2 1 0 1 1 3 0 1 4 1 1 1 0 1 2 4 3
Experiments Setup • Data are collected by varying number of nodes and connection probability. • Connection probability means if there is an edge between nodes or not. • Since 2 nodes don’t help, nodes taken into consideration for experiments were from 3 to 50. • Significant difference was noticed while nodes count was reaching to 50. • Connection probability considered was 25%, 50% and 75%.
Results and Analysis • Comparison of time complexity at connection probability of 25% 700 600 500 Time Complex. 400 Tarry 300 Awerbuch 200 100 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Results and Analysis • Comparison of time complexity at connection probability of 50% 1400 1200 Time complex. 1000 800 Tarry 600 Awerbuch 400 200 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Results and Analysis • Comparison of time complexity at connection probability of 75% 2000 1800 1600 1400 Time Complex. 1200 Tarry 1000 Awerbuch 800 600 400 200 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Results and Analysis • Comparison of message complexity at connection probability of 25% 1400 1200 Message Complex 1000 800 Tarry 600 Awerbuch 400 200 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Results and Analysis • Comparison of message complexity at connection probability of 50% 3000 2500 2000 Message Complex Tarry 1500 Awerbuch 1000 500 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Results and Analysis • Comparison of message complexity at connection probability of 75% 4000 3500 3000 Message Complex 2500 Tarry 2000 Awerbuch 1500 1000 500 0 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 Number of nodes
Conclusion • Awerbuch’s algorithm is more effective than Tarry’s algorithm in time complexity • Tarry’s algorithm is more effective than Awerbuch’s algorithm in message complexity • Both time and message complexity of Tarry’s algorithm, and message complexity of Awerbuch’s algorithm are sensitive to the density of graph, but time complexity of Awerbuch’s algorithm is not sensitive to the density of graph
Future Work • Experiment on larger N • Experiment on real distributed systems
Thank You
- Slides: 17