• Aucun résultat trouvé

2 Visibility φ = 1 in FSYNC

N/A
N/A
Protected

Academic year: 2022

Partager "2 Visibility φ = 1 in FSYNC"

Copied!
5
0
0

Texte intégral

(1)

Master 2

Terminating Exploration with Limited Vision (Exercises)

Mika¨el Rabie Franck Petit

1 Introduction

System. We consider systems of autonomous mobile entities called robots evolving into a discrete environment modeled by a graph G = (V, E), V being a set of nodes representing a set of possible locations for the robots, E being a set of edges that represent bidirectional connections through which robots move from a station to another. We assume that the graph G is a ring of n nodes, u0, . . . , un−1, i.e., ui is connected to both ui−1 and ui+1 — every computation over indices is assumed to be modulo n. The indices 0. . . i . . . n−1 are used for notation purposes only; the nodes are anonymous and the ring is unoriented, i.e., given two neighboring nodes u, v, there is no kind of explicit or implicit labeling allowing to determine whether uis on the right or on the left ofv. Thedistance between two nodes in the ring is the number of edges in a shortest path connecting them.

On this ring, k ≤ n anonymous robots r0, . . . , rj, . . . , rk−1 are collaborating together to achieve a given task. The indices 0. . . j . . . k−1 are used for notation purposes only. Addition- ally, the robots are oblivious, i.e, they have no memory of their past actions. We assume the robots do not communicate in an explicit way. However, they have the ability to sense their environment. Zero, one, or more robots can be located on a node. The number of robots located on a node ui at instanttis called multiplicityof ui and is denoted byMi(t) (or simplyMi, ift is understood). We say a node ui isfreeat instantt ifMi(t) = 0. Conversely, we say thatui is occupied at instant t if Mi(t) 6= 0. If Mi(t) >1 then, we say that there is an Mi(t).tower (or simply atower) at ui at instantt.

We assume that each robot is equipped with an abstract device called multiplicity sensor allowing to measure node multiplicity. Multiplicity sensors are assumed to havelimited capac- ities (so called, limited visibility), i.e., each robot rj can sense the multiplicity of nodes that are at most at a fixed distance φ (φ >0) from the node where rj is located. We assume that φ is a common value to all the robots. The ring being unoriented, no robot is able to give an orientation to its view. More precisely, given a robot rj located at a node ui, the multiplicity sensor ofrj outputs a sequence,sj, of 2φ+ 1 integers x−φ, x1−φ, . . . , x−1,(x0), x1, . . . , xφ−1, xφ

such that: either x−φ =Mi−φ, . . . , x0 = Mi, . . . , xφ = Mi+φ, or x−φ =Mi+φ, . . . , x0 =Mi, . . . , xφ=Mi−φ—an example is shown in Figure 1.

prenom.nom@lip6.fr

(2)

ui rj

Figure 1: An example showing an output of the multiplicity sensor of a robotrj assumingφ= 3:

sj is equal to either 0101021 or 1201010, depending on the local orientation ofrj.

If the sequence x1, . . . , xφ−1, xφ is equal to the sequence x−1, . . . , x1−φ, x−φ, then the view of rj is said to be symmetric. Otherwise, it is said to be asymmetric.

Robots operate in three phase cycles: Look, Compute and Move (L-C-M). During the Look phase, a robot rj located at ui takes a snapshot of its environment given by the output of its multiplicity sensors, i,e., a sequence sj of 2φ+ 1 integers. Then, using sj and according to a local algorithm P, rj computes a destination to move to, i.e., either ui−1,ui, or ui+1. In the last phase (move phase), rj moves to the target destination computed in the previous phase.

Program. Each rule in an algorithmP is presented in the following manner:

< Label > : < Guard > :: < Statement >. The guard is a possible sequence sj provided by the sensor of a robot rj: sj =xi−φ. . . xi−1(xi)xi+1. . . xi+φ. A robotrj at nodeui isenabledat timet (or simplyenabled when it is clear from the context) if:

s=Mi−φ(t). . . Mi−1(t)(Mi)Mi+1(t). . . Mi+φ(t) or

s = Mi+φ(t). . . Mi+1(t)(Mi), Mi−1(t). . . Mi−φ(t). The corresponding rule < Label > is then also said to be enabled. The guards may include two extra symbols: ’ ?’ means either 0 or 1, and ’-’ means any value.

The statement describes the action to be performed by rj. There are only two possible actions: (i) →, meaning thatrj moves towards its right neighbor with respect to the direction of sj, (ii) ←, meaning that rj moves towards its left neighbor with respect to the direction of sj. For instance, consider the example in Figure 1 and the following rule:

T : 120(1)010 :: →. By executing T, rj moves on the left neighboring node with respect to Figure 1. Note that RuleT would be equivalent to RuleT0 defined as follows:

T0 : 010(1)021 ::←. Also, since the moving directions→and ←depend on the direction ofsj, such a coding is unambiguous only if sj is asymmetric. If sj is symmetric, then the scheduler chooses the moving direction. In this case, the statement is written as follows: ← ∨ →.

Computation. Given an arbitrary orientation of the ring and a nodeui+i(t) (respectively., γ−i(t)) denotes the sequence

hMi(t)Mi+1(t). . . Mi+n−1(t)i (resp.,hMi(t). . . Mi−(n−1)(t)i)

We call the sequencesγ−i(t) andγ+i(t)mirrors of each other. Of course, a symmetric sequence is its own mirror. By convention, we state that the configuration of the system at instant t is γ0(t). Letγ =hM0M1. . . Mn−1i be a configuration.

The configuration hMi, Mi+1, . . . , Mi+n−1i is obtained by rotating γ by i ∈ [0. . . n−1].

In the following, in oder to ease the reading and when it is clear in the context, we use the notationxk to denote a sequenceMi, Mi+1, . . . , Mi+k−1, where∀j∈[i, i+k−1],Mj =x. Two configurationsγ andγ0 are said to beundistinguishableif and only ifγ0 is obtained by rotating γ or its mirror. Two configurations that are not undistinguished are said to bedistinguished.

A configuration where no robot is able to move is said to be terminal.

At each step t, a non-empty subset of robots is selected by thescheduler, or daemon. The

(3)

Distributed means that, at every time instant t, any non-empty subset R(t) of robots can be activated,i.e., 0<|R(t)| ≤k. Fair means that every robot is activated infinitely often during a computation. We consider two computational models: (i) the (fully) synchronous model (in the following also referred to as FSYNC), and (ii) the semi-synchronous model (also referred to asSSYNC.

At every time instantt, every robot that is selected instantaneously executes the full cycle L- C-M betweentandt+1. The only difference between the fully synchronous model (i.e.,FSYNC) and the semi-synchronous model (i.e.,SSYNC) is that with the former∀t≥0,|R(t)|=k—i.e., every robot is selected by the scheduler at each time instant—, with the latter ∀t ≥ 0,0 <

|R(t)| ≤k—i.e., the scheduler may introduce asynchrony by selecting any non-empty subset of robots.

We callcomputation any infinite sequence of configurationsγ0, . . . , γt, γt+1, . . . such that (1) γ0 is a possible initial configuration and (2) for every instant t ≥ 0, γt+1 is obtained from γt

after some non-empty set of robots execute a move. Any transition γt, γt+1 is called a step of the computation. A computationc terminates ifc contains a terminal configuration.

Problem Specification.

Definition 1 (Deterministic Terminating Exploration) LetP be adeterministicdistributed algorithm designed for a cohort ofkrobots with a given positive visibilityφ, evolving on ann-size ring. P is a deterministic terminating exploration (DTE, for short) algorithm if and only if every computation cof P starting from an initial configuration, the k robots collectively explore the ring, i.e.,

Termination: c terminates,

Exploration: every node is visited by at least one robot during c.

Theorem 1 Assuming a distributed fully- or semi-synchronous fair scheduler (i.e.,FSYNC or SSYNC), ifP is a deterministic exploration protocol, then for every pair of distinct configura- tions γi and γj in any executionc of P, γi and γj are distinguished.

Proof. SupposeP is a deterministic exploration protocol, and there exists an executionc of P and a pair of distinct configurations,γi and γj ofc, such thatγi and γj are undistinguished.

SinceP is a deterministic exploration protocol,cterminates in finite time. Lets=γ0γ1. . . γl−1

be the smallest prefix of cof length l that contains distinguishable configurations only. Recall that we assume that no two consecutive configurations ofcare identical. Sincesis the smallest prefix of ccontaining only distinguished configurations by assumption there exists γi inssuch thatγi andγlare undistinguished. Such aγl exists since we assume thatccontains at least two undistinguished configurations. So, executing P, the set of actions that led the system from γi to γi+1 are also applicable in γl. Thus, by executing the same set of actions, there exists a configuration γl+1 reachable from γl such that γi+1 and γl+1 are undistinguished. Following the same reasoning for every j ∈ [2..l−1], there exists a configuration γl+j reachable from γl+j−1 such thatγi+j andγl+j are undistinguished. Therefore, there exists an execution cofP leading to the infinite sequence of actions starting forγi. This contradicts the assumption that

c terminates in finite time.

The above theorem means that every execution of an algorithm solving DTE contains dis- tinguishable configurations only.

(4)

2 Visibility φ = 1 in FSYNC

Question 1 List all the possible rules in the initial configuration.

Question 2 For every n >3, is it possible to solve DTE withk= 2 robots?

Question 3 There exists a DTE algorithm for k= 2 and n= 3. Give this algorithm.

Question 4 Same question as Question 2 forn >4 and k= 3.

Question 5 Similarly as Question 3, give a DTE algorithm for k= 3 andn= 4.

Question 6 Does the algorithm of Question 3 also work for k= 4and n= 5? For k= 5 and n= 6? Fork= 4 and n= 6?

Question 7 Is the problem found at Question 6 solved by adding Rsgl to Rout? Try this solution on each following cases: (i) k= 2 and n= 3, (ii) k = 3 and n = 4, (iii) k = 4 and n= 5, and(iv) k= 4 and n= 6.

Question 8 Try to solve the problem of Question 7.

Question 9 Assuming that the robots form a single block in the initial configuration, does the algorithm of Question 7 work for k= 4 and n= 7? Under the same initial configuration, does it work with the algorithm of Question 3?

It can easily be shown that for n >7, there exists no algorithm working withk= 4 robots.

The next lemma follows from this fact and Questions 2 and 4:

Lemma 2 Let P be a synchronous exploration protocol for φ = 1 and 2 ≤ k < n. If n > 7, then,k must be greater than or equal to 5.

According to Lemma 2, the two questions next assume k= 5.

Question 10 Assuming that the 5 robots form a single block in the initial configuration, does the algorithm given in Question 7 work with n= 7? n = 8? n= 9? Same question with the algorithm given in Question 3.

Question 11 Provide a general DTE algorithm for k= 5 and n >7.

(5)

3 Visibility φ = 2 in SSYNC

Consider 7 myopic robots on an n-ring withn≥9 andφ= 2.

Question 12 Assume that the system starts from a configuration in which the seven robots are located on seven contiguous nodes. Provide an algorithm that leads to Configuration 2.

H

T3 T2

L

Figure 2: Configuration2

Question 13 Assume that the system starts from Configuration 2. Provide an algorithm that explores the n nodes of the ring works and stops.

Question 14 Show that the algorithm made of both algorithms given in Questions 13 and 12 solves DTE.

Références

Documents relatifs

10 Situation et parcours des jeunes femmes 18-25 ans victimes de violences, Centre Hubertine Auclert, 2016, accessible

Mme TOURENNE précise que si les parents choisissent le régime 3, l'élève n'est plus sous la responsabilité de l'établissement. BROUET dit que si le régime 1 est

TABLE DES RACINES PRIMITIVES ET DES CARACTI~RES OUI S'Y RAPPORTENT POUR LES NOMBRES PREMIERS ENTRE.. 5000

Or, les r6duites d'une fraction continue simple du tableau constituent une suite de cette nature, et la proposition que nous voulions d6montrer se trouve

Ich babe im Folgenden die Frage behandelt, ob es mSglich ist, von der einfach herzustellenden Normalform einer nicht Singularen Substigution zu der einer

In FELIX KLEIZ~ Ober t~iemann's Theorie der Abel'schen IMegrale finden sieh wichtige Siitze tiber weitcrgehende Beziehungen dicser Art.. l~ber einige Gruudgebilde

le capital social de 16 592 K€ composé de 434 421 861 actions, des réserves pour – 6 408 K€, des dettes financières courantes qui s’élèvent à 13 989 K€ se répartissant en

Les relations entre les collectivités locales et leurs habitants ne sont pas limitées aux seuls problèmes de collecte sélective des déchets d’emballages ménagers..