• No results found

Gairing et al. provide a mechanism to transform self-stabilizing algorithms having distance-two knowledge for the distributed scheduler [GGH+04]. This transformation leads to a slowdown factor of O(n2) moves. Another option is to use a general transformer to convert an algorithm stabilizing under a central scheduler into one that stabilizes under a distributed scheduler. Usually this is achieved by avoiding simultaneous rule executions of neighboring nodes. Then the transformed schedule is equivalent to a serial schedule. In the best cases this leads to a slowdown factor of O(∆) moves [GT07]. In the following, Algorithm 4.3 is modified such that it stabilizes under a distributed scheduler with only a constant slowdown. The key observation is that it is not necessary to avoid all simultaneous rule executions in order to preserve the stabilization property. Furthermore, the proof makes use of a special characteristic of Algorithm4.2.

Algorithm4.3already prevents neighboring nodes to execute rule CHANGE simul- taneously since neighboring nodes cannot be prepared at the same time. A problem arises when a nodev executes rule RESET at the same time as the node w it is pointing to performs a CHANGE move (Figure4.7). Letu be the node that v points to after

u

v

w



 Figure 4.7: Node v executes rule RESET at the same time as node w makes a

CHANGE move. Nowu can execute rule CHANGE despite being in an inconsistent state!

the RESET move. Note that at this moment the value u.bn is not consistent. If u would make a CHANGE move in this situation, then this move would not be legal with respect to Algorithm4.2. To avoid such situations, the rules RESET and CHANGE are revised so that a node can detect whether the neighbor it is currently pointing to wants to perform a CHANGE: A node wishing to execute a CHANGE move has to set itswtc (“want to change”) flag first using rule LOCK.

Another modification addresses the ASK rule. Allowing neighboring nodes to per- form ASK moves simultaneously can result inO(n2)ASK moves between CHANGE

moves. To avoid this to happen another flagwta (“want to ask”) is introduced. A node v is allowed to perform an ASK move if and only if it is the node with the smallest identifier in N[v] that has its wta flag set to true. Another rule is added to reset this flag if a node cannot execute an ASK due to not being enabled with respect to Algorithm4.2anymore. The complete set of rules is shown in Algorithm4.4.

Algorithm 4.4 WCMDS with Network Decomposition, Distributed Scheduler

Actions:

UPDATE :: [v is not correct] −→update v.bn

ASK ::[v is willing and neutral and∀w ∈ N(v) : (w >v or w.wta= f alse)] −→if (v.wta = f alse)

thenv.wta :=true elsev.p :=v

v.wta := f alse

RESET :: [v is correct and v.p 6=minN[v]andv.p.wtc= f alse] −→v.p :=minN[v]

LOCK :: [v is prepared and v.wtc= f alse] −→v.wtc :=true

CHANGE::[v is correct and v.wtc=true] −→if (v is prepared and willing)

then execute Algorithm4.2

v.p :=null v.wtc := f alse

UNASK :: [v is correct and not willing and v.wta =true] −→v.wta := f alse

In the following, an execution of rule ASK for node v will be referred to as a REALASK move ifv points to itself after the move.

Lemma 4.5.1. The number of RESET moves of nodes that point to themselves before execution is limited to one per node.

Proof. A nodev can only point to itself via performing REAL−ASK, which implies that all neighbors point tonull. Afterwards no neighbor can perform a REALASK

and thus,v cannot perform a RESET. Therefore this situation can only appear once for each node, namely in the initial configuration.

Lemma 4.5.2. During an interval without REALCHANGE moves all nodes to- gether make at mostO(n+m)moves.

Proof. a) Letv be any node. Obviously v makes at most one UPDATE move during such an interval. After a CHANGE move ofv, v.wtc (resp. v.p) has value false (resp. null). For v to make another CHANGE move, it must first execute a LOCK move requiringv to be prepared. Thus, v must execute a REALASK move and for that to happen it must be neutral. Hence, at the time of the LOCK move all neighbors of v must have moved, and their bn values are correct at the time of the LOCK move. Thus,v is enabled with respect to Algorithm4.2and cannot execute a CHANGE move without this being a REAL−CHANGE.

Between every two LOCK moves ofv there must be at least one CHANGE move. Thus, there are at most two LOCK moves per node. If v performs a REAL−ASK move then all its neighbors point tonull. Obviously the next move of v cannot be an UPDATE, ASK, LOCK, or UNASK move. If its next move is a RESET move there must be a neighbor pointing to itself. Therefore this neighbor must have executed rule REALASK itself, which is impossible, becausev does not point to null. Thus, the next move ofv is a CHANGE move. Since this rule can be executed only once, there cannot be more than two REAL−ASK moves.

Hence, v makes at most O(n) REALASK, LOCK, CHANGE, and UPDATE moves.

b) In between two successive RESET moves the set of self-pointing neighbors must change. By the result of the last paragraph and Lemma4.5.1each neighbor can enter and leave the set of self-pointing nodes only twice. Thus, it follows that a nodev can execute at most5dvRESET moves.

A node can execute rule UNASK only if it has executed rule ASK before (except for the very first time). At this time it was enabled with respect to Algorithm4.2. If it is enabled to perform an UNASK this must have changed, and thus, one of its neighbors must have performed an UPDATE. Every neighbor can execute at most one UPDATE move, so the number of UNASK moves of a nodev is bounded by dv+1.

Obviously, a nodev cannot execute rule ASK twice without having executed rule UNASK or REALASK in between. Thus,v can make at most dv+4 ASK moves.

Hence, there are at mostO(m)moves of the types ASK, UNASK and RESET.

Lemma 4.5.3. Algorithm4.4stabilizes after at most O(nm) moves under the dis- tributed scheduler. After stabilization the black nodes form a minimal dominating set for the graph induced by all black and gray nodes and those white nodes that have a black or gray neighbor.

Proof. Lemma 4.4.3 holds for Algorithm 4.4under a distributed scheduler, since neighboring nodes cannot simultaneously execute a CHANGE and a RESET move. This yields that Lemma 4.4.4is also valid for Algorithm 4.4using the distributed scheduler. Note that even under this scheduler neighboring nodes cannot execute a CHANGE move concurrently. Thus, there will be no more thanO(n)moves of type REALCHANGE. By Lemma4.5.2the algorithm stabilizes after at mostO(nm) moves.

When no node is enabled for Algorithm 4.4, then all nodes are correct and the variable wtc has value false for all nodes. Furthermore, all non-willing nodes have setwta to false. Suppose there is a node that points to itself. Then the node with the smallest identifier pointing to itself would be prepared and thus rule LOCK would be enabled. Hence, all nodes are neutral. Suppose there is a node that is willing. Among all such nodes, letv be the node with the smallest identifier. Then rule ASK would be enabled forv. This contradiction proves, that no node is enabled with respect to Algorithm4.2. Hence, the second statement follows from Lemma4.4.1.

LetAbe a self-stabilizing algorithm to compute a breadth-first tree that is enhanced as described above and that stabilizes afterO(A)moves under an unfair distributed scheduler. Denote byD the composition ofAand Algorithm4.4. This leads to the main result of this chapter.

Theorem 4.5.1. D is a self-stabilizing algorithm to compute a weakly connected minimal dominating set. Under an unfair distributed schedulerDstabilizes after at mostO(nmA)moves.

Proof. The proof is similar to that of Theorem4.4.1, using Lemma4.5.3instead of Lemma4.4.5.

Related documents