2015/11/17wave and traversal algorithms1 introduction to distributed algorithm part two: fundamental...

54
111/06/27 Wave and Traversal Algorithms 1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms Teacher: Chun-Yuan Lin

Upload: ashlee-gallagher

Post on 05-Jan-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 1

Introduction to Distributed AlgorithmPart Two: Fundamental Algorithm

Chapter 6- Wave and Traversal Algorithms

Teacher: Chun-Yuan Lin

Page 2: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 2

Wave and Traversal Algorithms (1) In the design of distributed algorithms for various applications several

very general problems for process networks appear frequently as subtasks.

broadcasting of information achieving a global synchronization between processes triggering the execution of some event in each process computing a function of which each process holds part of the input

These tasks are so fundamental that solutions to more complicated problems

election (Chapter 7) termination detection (Chapter 8)

Page 3: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 3

Wave and Traversal Algorithms (2)

The importance of message-passing schemes, called wave algorithms This chapter formally defines wave algorithms (Subsection 6.1.1) proves some general results about them (Subsection 6.1.2) The observation that the same algorithms can be used for all of the

fundamental tasks (Subsections 6.1.3 through 6.1.5) Section 6.2 presents some widely used wave algorithms. Section 6.3 considers traversal algorithms Section 6.4 gives several algorithms for a distributed depth-first search

Page 4: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 4

Wave and Traversal Algorithms (3)

The treatment of wave algorithms as a separate issue is useful for two reasons. (why study wave algorithm?)

First, the introduction of the concept facilitates the later treatment of more involved algorithms because the properties of their subroutines have already been studied.

Second, certain problems in distributed computing can be solved by generic constructions that yield a specific algorithm when parameterized with a specific wave algorithm.

Page 5: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 5

Definition and Use of Wave Algorithms

Page 6: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 6

Definition of Wave Algorithms (1)

Page 7: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 7

Definition of Wave Algorithms (2)

Page 8: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 8

Definition of Wave Algorithms (3)

Page 9: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 9

Definition of Wave Algorithms (4)

Page 10: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 10

Definition of Wave Algorithms (5)

Page 11: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 11

Elementary Results about Wave Algorithms (1)

Page 12: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 12

Elementary Results about Wave Algorithms (2)

Page 13: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 13

Elementary Results about Wave Algorithms (3)

Page 14: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 14

Propagation of Information with Feedback (1)

Page 15: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 15

Propagation of Information with Feedback (2)

Page 16: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 16

Synchronization

Page 17: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 17

Computation of Infimum Functions (1)

Page 18: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 18

Computation of Infimum Functions (2)

Page 19: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 19

Computation of Infimum Functions (3)

Page 20: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 20

A Collection of Wave Algorithms (1)

In all cases the algorithm text is given for the process p.

The Ring Algorithm

Page 21: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 21

A Collection of Wave Algorithms (2)

Page 22: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 22

A Collection of Wave Algorithms (3) The Tree Algorithm

(when a process receive all messages from its neighbor, decide)

Page 23: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 23

A Collection of Wave Algorithms (4)

(leave to root, root to leave)

Page 24: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 24

A Collection of Wave Algorithms (5) The Echo Algorithm

Page 25: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 25

A Collection of Wave Algorithms (6)

Page 26: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 26

A Collection of Wave Algorithms (7) The Polling Algorithm

Page 27: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 27

A Collection of Wave Algorithms (8)

Page 28: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 28

A Collection of Wave Algorithms (9) The Phase Algorithm

Page 29: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 29

A Collection of Wave Algorithms (10)

Page 30: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 30

A Collection of Wave Algorithms (11)

Page 31: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 31

A Collection of Wave Algorithms (12)

Finn's Algorithm

Page 32: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 32

A Collection of Wave Algorithms (13)

Page 33: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 33

A Collection of Wave Algorithms (14)

Page 34: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 34

Traversal Algorithms (1)

Page 35: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 35

Traversal Algorithms (2)

Page 36: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 36

Traversal Algorithms (3) Traversing Cliques

Page 37: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 37

Traversal Algorithms (4)

Page 38: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 38

Traversal Algorithms (5) Traversing Tori

Page 39: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 39

Traversal Algorithms (6) Traversing Hypercubes

Page 40: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 40

Traversal Algorithms (7) Traversing Connected Networks

A traversal algorithm for arbitrary connected networks was given by Tarry in 1895.

Page 41: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 41

Page 42: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 42

Time Complexity: Depth-first Search (1)

The processes in Tarry's algorithm are given sufficient freedom, in choosing a neighbor to which to forward the token.

In Section 6.4.1, a minor modification of Tarry's algorithm enables the algorithm to compute depth-first search trees. (classical depth-first search algorithm)

In Subsection 6.4.2 two algorithms will be discussed that compute depth-first search trees in less time than the classical algorithm.

In Subsection 6.4.3 a depth-first search algorithm will be presented for networks with initial knowledge of neighbors' identities.

Page 43: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 43

Time Complexity: Depth-first Search (2)

The time complexity of distributed algorithms

Page 44: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 44

Distributed Depth-first Search (1)

Page 45: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 45

Page 46: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 46

Depth-first Search Algorith'ms Using Linear Time

Awerbuch's solution

Cidon's solution

Page 47: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 47

Page 48: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 48

Page 49: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 49

Page 50: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 50

Depth-first Search with Neighbor Knowledge

Page 51: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 51

Remaining Issues (1) Overview of Wave Algorithms

Computing Sums Impossibility of a general construction Computing the sum with a traversal algorithm Computing the sum using a spanning tree Computing the sum using identities

Alternative Definitions of Time Complexity

Page 52: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 52

Page 53: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 53

Page 54: 2015/11/17Wave and Traversal Algorithms1 Introduction to Distributed Algorithm Part Two: Fundamental Algorithm Chapter 6- Wave and Traversal Algorithms

112/04/20Wave and Traversal

Algorithms 54

Remaining Issues (2)

Definitions based on more restrictive timing assumptions

Definition based on message chains