Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Power of Tokens: Rendezvous and Symmetry Detection for two Mobile Agents in a Ring J. Czyzovicz, Stefan Dobrev, E. Kranakis, D. Krizanc.

Similar presentations


Presentation on theme: "The Power of Tokens: Rendezvous and Symmetry Detection for two Mobile Agents in a Ring J. Czyzovicz, Stefan Dobrev, E. Kranakis, D. Krizanc."— Presentation transcript:

1 The Power of Tokens: Rendezvous and Symmetry Detection for two Mobile Agents in a Ring J. Czyzovicz, Stefan Dobrev, E. Kranakis, D. Krizanc

2 The Ages-old Problem ♀ and ♂ want to meet

3 The Question ♀ and ♂ want to meet How dumb can they be and still manage to meet?

4 The Setting The Agents finite state machines The Environment an anonymous ring of unknown size n can be unidirectional or bidirectional synchronous computation/communication the agents can mark nodes only using non-distinguishable tokens, no long-distance direct communication not everyone needs to know that they are trying to meet, right?

5 Formally Agent: finite state machine (S, s, t,  ) S – the set of states, |S|=k s – initial state t – initial number of tokens  – transition function (S  T  T)  (S  T  {L,R,W}) T={0,1,… 2t} L = move left, R = move right, W = wait based on the current state, the number of tokens the agent holds and the number of tokens it sees at the node, the agent decides how many tokens to pick/drop and how to move

6 The Questions Rendezvous problem: have the two agents meet, if at all possible either come to a node at the same time, or cross an edge in the opposite directions if not possible to meet (e.g. symmetric situation), allowed to cycle forever Rendezvous with detection meet, if possible detect and declare not-possible if it is not possible to meet

7 Model Details We study in detail the effects of: whether the ring is unidirectional or bidirectional the initial number of tokens the agents have Is rendezvous (with detection) solvable at all? If yes, how long does it take? worst case number of steps

8 Our Results # of tokens# of directionsRendezvousRend. w. det. 11impossible 12  (n 2 ) impossible 21  (n 2 ) 22 t≥3*1  (n 2 /t) t≥3*2O(n (log n) 1+1/t’ )O(n 1+1/(t-2) ) * - assuming t is smaller then the number of states

9 Related Work Rendezvous as a search game for two or more agents in various topologies in operations research community Alpern 2002, Alpern, Gal 2003 Our setting – with agents using tokens Yu, Yung, ICALP 1996 PhD thesis of C. Sawchuk, 2004 the torus case: Kranakis et al, LATIN 2006 Other model variations studied as well whiteboard communication, presence of black hole faults

10 Talk Outline Introduction Model Upper bounds 1 token per agent, bidirectional, only rendezvous 2 tokens per agent, unidirectional, with detection t tokens per agent, bidirectional, with detection Impossibility results and lower bounds just basic ideas and techniques Conclusions

11 One token per agent 1.Drop your token 2.Then travel between the tokens and pull them together Idea: If started at asymmetric configuration, one agent is slightly faster and eventually manages to pull the tokens next to each other. But no detection: If symmetric, infinite cycling n1n1 n2n2

12 Results in O(n 2 log n) time: Logical rounds: agents arriving to tokens at times t 1, t 2, t 3, … t’ 1, t’ 2, t’ 3, … Define time shift: |t’ i -t i | Idea: the agents are seeing the same thing, but at different times In one round, the time shift changes by |n 2 -n 1 | Only when the time shift exceeds n 1 is the distance between the tokens really changed One token per agent

13 Worst case: when initial n 1 and n 2 differ by 1 it takes  n 2 /2  time to decrement n 1 for the first time but now n 2 -n 1 = 3, so the second decrement comes after n 2 /6 steps overall running time is bound by n 2 (1+1/3+1/5+1/7…)=O (n 2 log n) This can be improved: we can detect when n 1 changes for the first time sufficient to measure the distance modulo 3 O(n 2 ) time

14 Two tokens per agent Establish your base drop first token move right, drop second token Grow the bases cycle the graph, move every second token one step Resolution when moving the token would hit another token (bases collided), go to the next token and check whether the other two tokens hit as well if yes, the situation is symmetric, no rendezvous possible else wait for the other agent

15 Two tokens per agent One round: an agent travels around the whole ring Number of rounds: n 1 /2 Overall time: O(n 2 ) This also works for bidirectional rings: if the agents start in opposite directions, they will meet each other within n/2 steps

16 More tokens With 2 tokens, we achieved detection, even in unidirectional rings. The time remained O(n 2 ) Can we reduce the time using more tokens? Yes: in bidirectional rings, using at least 4 tokens Not significantly: in unidirectional rings

17 More tokens Idea: mark your home base use the remaining tokens to build a counter measuring the distances between the homebases count up until hitting the other base then count down, until hitting your base, or the counter reached 0 counter = 0 and hit the base: symmetric situation counter = 0, no base yet: wait counter > 0: walk until you find the other agent

18 More tokens Hm, but how does this help? The agent has to drag and update the counter as it travels between homebases. we have to account for this cost with good counter implementation, expanding the base by one step now costs O(m), where m is the counter size How to implement such counter? use two tokens to delimit its endpoints, at distance m now we have m-2 positions to place t-3 tokens once all possibilities are exhausted, increment m Example: t=4, counter counting up to n is of size O(  n) =8+45

19 More tokens - discussion Complexity: Assume t <<n (simplifies the formulas): counter size ~ n 1/(t-2) overall complexity O(n 1+1/(t-2) ) We really need bidirectionality in order to drag and update the counters. 4 tokens results in O(n 3/2 ), but we are not able to benefit from 3 tokens intuitively, we have tokens only for a unary counter we do not have a proper lower bound of  (n 2 ) for t=3 log n tokens will get us to O(n log n) binary counter but technical mess, as we cannot remember the tokens in the state

20 More tokens – without detection Idea: instead of carrying a big counter, just travel around and check the distances modulo 2, 3, …, if there is difference, it will be detected after at most log n rounds The counter size is O(log n 1/t’ ) instead of n 1/(t-2) Overall complexity: O(n (log n) 1+1/t’ ) but we have no detection higher minimal useful number of tokens needs to carry the current divisor, and the modulo

21 Talk Outline Introduction Model Upper bounds 1 token per agent, bidirectional, only rendezvous 2 tokens per agent, unidirectional, with detection t tokens per agent, bidirectional, with detection Impossibility results and lower bounds just basic ideas and techniques Conclusions

22 Basic Notions base tricky definition, works only for 1-2 tokens oceans the areas between the bases logical rounds per agent crossing the ocean increments the round time shift the time difference between the starts of logical rounds of the agents

23 Key Lemma Crucial lemma: As long as the time shift is shorter that the inter- base distances and the bases do not collide, everything can be made to look the same to the agents set the difference between the ocean sizes to a multiple of k! the agents crossing this ocean must be cycling and can’t recognize the difference Corollary: In order to rendezvous, the bases must collide or the time shift must exceed their distance MM+k!

24 Impossibility Results Unidirectional ring, 1 token: not even simple rendezvous is possible the time shifts do not grow the time shift of every even round is 0 the bases do not grow (1 token per base), so they can’t collide By the lemma, the algorithm will never see the difference between these two initial configurations: MM+k! MM

25 Impossibility Results Bidirectional ring, 1 token: Rendezvous with detection is impossible. if the algorithm A detects symmetry after x rounds on the right hand configuration, then x ≤ k (otherwise it would fall in cycle and never declare detection) on the left side, during those x rounds, the time shift could have grown to at most xk!, so choosing M>(k+1)! ensures that A would produce wrong output on the left side. MM+k!MM

26 Lower Bounds – Basic Facts Fact 1: Let M be the (smaller) ocean size It costs min(m, M) to grow a base of size m by a constant either travel across the base, paying m or arrive from the other base, paying M Fact 2: Let M 1 and M 2 be the ocean sizes. Then in one round the time shift can increase by at most c|M 1 -M 2 |, where c is the effective speed of crossing oceans. (Note that c is a constant.) M m

27 Lower Bounds - Bidirectional Theorem: Rendezvous in bidirectional ring with 2 tokens takes  (n 2 ) time. We show that it takes  (M 2 ) time until either a) the base size exceeds M/3, or b) the time shift exceeds M/3 a) From Fact 1, we need O(M) crossings of the base or of the ocean. b) From Fact 2 we need O(M) ocean crossings MM+k!MM

28 Conclusions We have fully characterized the case of 2 agents, 1 and 2 tokens, providing asymptotically optimal algorithms. Open problems: lower bound for t≥3, bidirectional ring or at least  (M 2 ) lower bound for t=3 closer look at the number of states… more agents asynchronous computation

29 Thank You


Download ppt "The Power of Tokens: Rendezvous and Symmetry Detection for two Mobile Agents in a Ring J. Czyzovicz, Stefan Dobrev, E. Kranakis, D. Krizanc."

Similar presentations


Ads by Google