SLIDE 1 On Stabilization in Herman’s Algorithm
ICALP 2011 Stefan Kiefer1 Andrzej S. Murawski2 Jo¨ el Ouaknine1 James Worrell1 Lijun Zhang3
1Department of Computer Science, University of Oxford, UK 2Department of Computer Science, University of Leicester, UK 3DTU Informatics, Technical University of Denmark, Denmark
SLIDE 2
Particle Collision: CERN
SLIDE 3
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 4
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 5
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 6
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 7
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 8
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 9
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader.
SLIDE 10
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour
SLIDE 11
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour
SLIDE 12
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour
SLIDE 13
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour
SLIDE 14
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour
SLIDE 15
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour Number of tokens is odd. At any time. Guaranteed!
SLIDE 16
Herman’s Algorithm
Herman’s algorithm is a randomized leader election protocol. 1 1 1 1 1 1 1 Ring of N processors (N is odd) Some processors have a token. Pick a token randomly and move it clockwise. When a processor has two tokens: both disappear. Once there is only one token: this processor is the leader. Implementation: token = same bit as counter-clockwise neighbour Number of tokens is odd. At any time. Guaranteed! Main Question: How long does it take – on average – until a leader is elected?
SLIDE 17
Herman’s Algorithm
Two versions of Herman’s algorithm: Asynchronous: Each processor with a token passes the token to its clockwise neighbour with rate λ continuous-time Markov chain (as seen on the previous slides) Synchronous: Each processor with a token with probability 1/2: passes it (i.e., flips its bit) with probability 1/2: keeps it (i.e., keeps its bit) discrete-time Markov chain
SLIDE 18
Herman’s Algorithm
Illustration of the synchronous version:
SLIDE 19
Herman’s Algorithm
Illustration of the synchronous version:
SLIDE 20
Herman’s Algorithm
Illustration of the synchronous version:
SLIDE 21
Herman’s Algorithm
Illustration of the synchronous version:
SLIDE 22
Herman’s Algorithm
Illustration of the synchronous version: The synchronous version is standard. The probability of passing is usually chosen as 1/2, but is a parameter in our analysis. We study both versions (asynchronous and synchronous).
SLIDE 23
Self-Stabilization
Self-stabilization: a concept of fault-tolerance: Any configuration leads to a “legitimate” configuration (in Herman: a single-token configuration). Dijkstra (1974): In a token ring there is no symmetric deterministic self-stabilizing algorithm.
SLIDE 24
Self-Stabilization
Self-stabilization: a concept of fault-tolerance: Any configuration leads to a “legitimate” configuration (in Herman: a single-token configuration). Dijkstra (1974): In a token ring there is no symmetric deterministic self-stabilizing algorithm.
SLIDE 25
Time to Stabilization
Let T := time until a 1-token configuration is reached.
What is ET?
Markov Chain argument ET is finite for any initial conf.
SLIDE 26
Time to Stabilization
Let T := time until a 1-token configuration is reached.
What is ET?
Markov Chain argument ET is finite for any initial conf. 1990 Herman: invented the protocol showed ET ≤ 0.5N2 log N mentions improvement to ET ≤ c N2 2004 Fribourg et al.: ET ≤ 2N2 2005 McIver/Morgan: ET ≤ 2N2 (independently) 2005 Nakata: ET ≤ 0.93N2
SLIDE 27 Time to Stabilization
Let T := time until a 1-token configuration is reached.
What is ET?
Markov Chain argument ET is finite for any initial conf. 1990 Herman: invented the protocol showed ET ≤ 0.5N2 log N mentions improvement to ET ≤ c N2 2004 Fribourg et al.: ET ≤ 2N2 2005 McIver/Morgan: ET ≤ 2N2 (independently) 2005 Nakata: ET ≤ 0.93N2 Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Then ET ≤ π2 8 − 29 27
D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.64N2.
SLIDE 28
The 3-Token Case
SLIDE 29
The 3-Token Case
a b c Precise formula for 3 tokens [MM’05]: ET = 4abc/N
SLIDE 30
The 3-Token Case
a b c Precise formula for 3 tokens [MM’05]: ET = 4abc/N Maximized for equilateral configuration with a = b = c = N/3 ET = 4
27N2 = 0.148N2
SLIDE 31
The 3-Token Case
a b c Precise formula for 3 tokens [MM’05]: ET = 4abc/N Maximized for equilateral configuration with a = b = c = N/3 ET = 4
27N2 = 0.148N2
Open conjecture [MM’05]: 3-token equilateral conf. is worse than any other conf. If true, then ET ≤ 0.148N2 (cf. ET ≤ 0.64N2).
SLIDE 32
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2)
SLIDE 33
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2) What about a random initial configuration?
SLIDE 34
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2) What about a random initial configuration? A random initial configuration is reached after the first step.
SLIDE 35
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2) What about a random initial configuration? A random initial configuration is reached after the first step.
SLIDE 36
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2) What about a random initial configuration? A random initial configuration is reached after the first step.
SLIDE 37
The Full Configuration
Theorem Let D = r(1 − r) (for synchronous) or D = λ (for asynchronous). Starting in the full configuration, for almost all odd N: ET ≤ 0.0285N2/D . In particular, for synchronous and r = 1/2, we have ET ≤ 0.114N2. (cf. for general conf.: ET ≤ 0.64N2 for equilateral conf.: ET = 0.148N2) What about a random initial configuration? A random initial configuration is reached after the first step. no need for a different analysis
SLIDE 38
Restabilization
Imagine: starting from 1 token . . . 1 1 1 1 1 1
SLIDE 39
Restabilization
Imagine: starting from 1 token . . . 2 bit-errors occur 1 1 1 1 1 1
SLIDE 40
Restabilization
Imagine: starting from 1 token . . . 2 bit-errors occur 1 1 1 1 1 1 “flip-2 configuration”
SLIDE 41
Restabilization
Imagine: starting from 1 token . . . 2 bit-errors occur 1 1 1 1 1 1 “flip-2 configuration”
SLIDE 42
Restabilization
Imagine: starting from 1 token . . . 2 bit-errors occur 1 1 1 1 1 1 “flip-2 configuration”
SLIDE 43
Restabilization
Imagine: starting from 1 token . . . 2 bit-errors occur “flip-2 configuration” Theorem Consider the synchronous protocol with r ∈ (0.12, 0.88). Fix m. Then for any flip-m configuration: ET = O(N) (cf. O(N2) for all other bounds)
SLIDE 44
Interacting Particle Systems
Interacting particles under random motion occur in: statistical mechanics neural networks spread of infections tumor growth . . . (other physical and medical sciences) physical chemistry [Balding’88]
SLIDE 45
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 46
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 47
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 48
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 49
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 50
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 51
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 52
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 53
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion.
SLIDE 54
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 55
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 56
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 57
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 58
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 59
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 60
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 61
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 62
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 63
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 64
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 65
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 66
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 67
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 68
Analysis Techniques
Key ingredients: Taking the limit N → ∞ leads to Brownian motion. Tokens with two colours simplify the analysis of the possible interactions.
SLIDE 69
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C)
SLIDE 70
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C)
SLIDE 71
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C)
SLIDE 72
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C)
SLIDE 73
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C)
SLIDE 74
Two Colours: 3 Tokens
C B A For any time t ≥ 0: Pr(T ≤ t) = Pr(A → B) − Pr(B → A) + Pr(B → C) − Pr(C → B) + Pr(C → A) − Pr(A → C) Pr(T ≤ t) in terms of 1-D random walk with two absorbing barriers distributions well-known Principle generalizes to more than 3 tokens.
SLIDE 75
We use Mathematics . . .
SLIDE 76
Summary
Upper bounds for ET for various initial configurations: arbitrary configuration (improved bound) full configuration (new bound) random configuration (new bound) flip-m configurations (new bound, O(N)) Also considered: asynchronous version synchronous version with passing prob. = 1/2 Main techniques used: limit → Brownian motion two colours Main open question is still: Is the 3-token equilateral conf. the worst case?
SLIDE 77
Particle Collision: CERN