Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Like this? Share it with your network

Share

ALP Presentation

on

  • 271 views

Algorithms about mobile search for a black hole in a anonymous ring by mobile agents.

Algorithms about mobile search for a black hole in a anonymous ring by mobile agents.

Statistics

Views

Total Views
271
Views on SlideShare
265
Embed Views
6

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 6

http://www.linkedin.com 6

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

CC Attribution-NonCommercial LicenseCC Attribution-NonCommercial License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

ALP Presentation Presentation Transcript

  • 1. Stefan Dobrev - Paola Flocchini - Giuseppe Prencipe - Nicola Santoro Mobile Search for a Black Hole in an Anonymous Ring Parallel and Distributed Algorithms Teacher Speakers Prof. Linda Pagli Fabio Fosso Rudy Fastelli
  • 2. Introduction and Keywords Problem: Unambiguously determinate and report the location (Node) of a harmful item, called Black Hole, in a Ring Network by Mobile Agents. What’s a Ring Network? A ring network is a network topology in which each node connects to exactly two other nodes, forming a single continuous pathway. What’s a Node? A Node is an active electronic device attached to a network that has a bounded amount of storage, called Whiteboard. There are three types of nodes: Home Base, Black Hole and Generic Node. What’s a Black Hole? Black Hole is a stationary process whose existence we are aware of, but whose whereabouts are unknown. It destroys visiting agents upon their arrival without leaving any observable trace. Mobile Search for a Black Hole in an Anonymous Ring
  • 3. Introduction and Keywords Problem: Unambiguously determinate and report the location (Node) of a harmful item, called Black Hole, in a Ring Network by Mobile Agents. What’s a Ring Network? A ring network is a network topology in which each node connects to exactly two other nodes, forming a single continuous pathway. What’s a Node? ring R A Node is an active electronic device attached to a network that has a bounded amount of storage, called Whiteboard. There are three types of nodes: Home Base, Black Hole and Generic Node. Fig. 1: Example of a Ring Network What’s a Black Hole? Black Hole is a stationary process whose existence we are aware of, but whose whereabouts are unknown. It destroys visiting agents upon their arrival without leaving any observable trace. Mobile Search for a Black Hole in an Anonymous Ring
  • 4. Introduction and Keywords What’s a Mobile Agent? A Mobile Agent is a process with limited computing capabilities and storage which is able to migrate (move) autonomously from one enviroment (Node) to another and continue its execution on the destination. How work Mobile Agents: Mobile Agents are asynchronous and there are no assumptions on the amount of time required by an Agent’s action (computation, moviment, etc.) except that it is finite. Each Agent communicate to another by reading from and writing on the Whiteboards in mutual exclusion. Goal: The problem is solved if at least one Agent survives, and all surviving Agents know the location of the Black Hole. Mobile Search for a Black Hole in an Anonymous Ring
  • 5. Algorithms: Over view Black Hole Search (BHS) Cautious Walk Protocol co-located dispersed Agents Agents Divide Algorithm OptTime Algorithm oriented unoriented TradeOff Algorithm with ring ring Exploring Agents Technique DOR Algorithm Gathering Algorithm 1° Phase: Pairing Algorithm BOD Algorithm 2° Phase: Elimination Algorithm 3° Phase: Resolution Algorithm Mobile Search for a Black Hole in an Anonymous Ring
  • 6. Complexity of Algorithms and Bounds Measure of Complexity size cost Number of Agents Number of moves time Amount of time elapsed until termination Notations. A i s t h e s e t o f a n o n y m o u s M o b i l e A g e n t s : | A | = k R is the set of anonymous Nodes of the Ring: | R| =n Lemma 1. At least two Agents are needed to locate the Black Hole. Lemma 2. It is impossible to find the Black Hole if the size of the ring is unknown. Theorem. At least (n-1) log(n-1)+O(n) moves are needed to find a Black Hole in a ring, regardless of the number of Agents. Mobile Search for a Black Hole in an Anonymous Ring
  • 7. Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 8. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 9. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. ts‘ Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 10. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. ts‘ Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V ts‘’ lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 11. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. ts‘’’ ‘ Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V ts‘’ lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 12. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. ts‘’’ ‘ Case 1. Safe Nodes lu U ru lv V r v Case 2. Black Hole in V ts‘’ lu U ru lv V r v Mobile Search for a Black Hole in an Anonymous Ring
  • 13. Cautious Walk Protocol BHS Cautious Walk Protocol Rule 1. When an Agent moves from node u to v via an unexplored port, turning it into active, immediately returns to u, making the port safe, and only then go back to v to resume its execution. Rule 2. No Agent leaves via an active port. ts‘’’ ‘ Case 1. Safe Nodes lu U ru lv V r v t s‘‘’ ts Case 2. Black Hole in V lu U ru V lv BH r v Mobile Search for a Black Hole in an Anonymous Ring
  • 14. Algorithm Divide: Rounds Notations. Ei and Ui denote respectively the explored and unexplored nodes in the i-th round of the algorithm Divide. i -th Round Init i = ; E = { 0 }; U = { ,2,3, ... ,n- }. Node 0 is the Agent’s Home Base. 1. Divide Ui into two continuous disjoint parts Uil and Uir of almost equal size, where Uil is on the left of 0 and Uir on the right. 2. Let Agents l and r explore, using Cautious Walk Protocol, Uil and Uir, respectively. l r 3. Since Ui and Ui are disjoint, at most one of them contains the Black Hole; hence, one of the Agents ( w.l.g. assume r ) successfully completes Step 2. Agent r then moves across Ei l and follows the safe ports of Ui until it comes to the node v from which there is no safe port leading to the left. 4. Denote by Ui the remaining unexplored area. All nodes to the right of v, up to the last node of Uir explored by r, are now explored - they form Ei . If | Ui | = ,Agent r knows that the Black Hole is in the single unexplored node and terminates. Otherwise, Ui is divided into Uil and Uir as in Step 1. Agent r leaves on the whiteboard of v a message for l indicating the two areas Uil and Uir and the new stage number i , overwriting any previous message. 5. Agent r proceeds to round i : traverses Ei and goes to Step 2. 6. When (if) l returns to v, it finds the message and proceeds to round i . Mobile Search for a Black Hole in an Anonymous Ring
  • 15. Algorithm Divide: Rounds BHS Co-located Agents Algorithm Divide Notations. Ei and Ui denote respectively the explored and unexplored nodes in the i-th round of the algorithm Divide. i -th Round Init i = ; E = { 0 }; U = { ,2,3, ... ,n- }. Node 0 is the Agent’s Home Base. 1. Divide Ui into two continuous disjoint parts Uil and Uir of almost equal size, where Uil is on the left of 0 and Uir on the right. 2. Let Agents l and r explore, using Cautious Walk Protocol, Uil and Uir, respectively. l r 3. Since Ui and Ui are disjoint, at most one of them contains the Black Hole; hence, one of the Agents ( w.l.g. assume r ) successfully completes Step 2. Agent r then moves across Ei l and follows the safe ports of Ui until it comes to the node v from which there is no safe port leading to the left. 4. Denote by Ui the remaining unexplored area. All nodes to the right of v, up to the last node of Uir explored by r, are now explored - they form Ei . If | Ui | = ,Agent r knows that the Black Hole is in the single unexplored node and terminates. Otherwise, Ui is divided into Uil and Uir as in Step 1. Agent r leaves on the whiteboard of v a message for l indicating the two areas Uil and Uir and the new stage number i , overwriting any previous message. 5. Agent r proceeds to round i : traverses Ei and goes to Step 2. 6. When (if) l returns to v, it finds the message and proceeds to round i . Mobile Search for a Black Hole in an Anonymous Ring
  • 16. Algorithm Divide: Execution and Complexity HB 6 1 5 2 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 17. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide HB 6 1 5 2 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 18. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide l r U U HB 6 1 5 2 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 19. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide l r U U l r HB BH 6 1 5 2 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 20. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide l r U U r HB BH 6 1 r 5 2 r 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 21. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide l r U U r HB BH 6 1 r r r 5 2 r r 4 3 Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 22. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide l r U U r HB HB BH 6 1 BH 1 r r r 5 2 5 2 r r 4 3 4 3 Round 1 Round 2 Mobile Search for a Black Hole in an Anonymous Ring
  • 23. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard r : Ul = { 5, 6 } r : U r = { 4} l r U U l r U HB HB BH 6 1 BH 1 r r r 5 2 5 2 r r 4 3 4 3 r U Round 1 Round 2 Mobile Search for a Black Hole in an Anonymous Ring
  • 24. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard r : Ul = { 5, 6 } r : U r = { 4} l r U U l r U r HB HB BH 6 1 BH 1 r r r r 5 2 5 2 r r r 4 3 4 3 r r U Round 1 Round 2 Mobile Search for a Black Hole in an Anonymous Ring
  • 25. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard r : Ul = { 5, 6 } r : U r = { 4} l r U U l r U r HB HB BH 6 1 BH 1 r r r r r r 5 2 5 2 r r r r r 4 3 4 3 r r U Round 1 Round 2 Mobile Search for a Black Hole in an Anonymous Ring
  • 26. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard r : Ul = { 5, 6 } r : U r = { 4} l r U U l r U r HB HB HB BH 6 1 BH 1 BH 1 r r r r r r 5 2 5 2 5 2 r r r r r 4 3 4 3 4 3 r r U Round 1 Round 2 Round 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 27. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard Whiteboard r : Ul = { 5, 6 } r : Ul = { 6} r : U r = { 4} r : U r = { 5} l r U U l r U r l U HB HB HB BH 6 1 BH 1 BH 1 r r r r r r r U 5 2 5 2 5 2 r r r r r 4 3 4 3 4 3 r r U Round 1 Round 2 Round 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 28. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard Whiteboard r : Ul = { 5, 6 } r : Ul = { 6} r : U r = { 4} r : U r = { 5} l r U U l r U r l r U HB HB HB BH 6 1 BH 1 BH 1 r r r r r r r r U 5 2 5 2 5 2 r r r r r r r 4 3 4 3 4 3 r r r U Round 1 Round 2 Round 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 29. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard Whiteboard r : Ul = { 5, 6 } r : Ul = { 6} r : U r = { 4} r : U r = { 5} l r U U l r U r l r U HB HB HB BH 6 1 BH 1 BH 1 r r r r r r r r r r U 5 2 5 2 5 r 2 r r r r r r r r r 4 3 4 3 4 3 r r r U Round 1 Round 2 Round 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 30. Algorithm Divide: Execution and Complexity BHS Co-located Agents Algorithm Divide Whiteboard Whiteboard r : Ul = { 5, 6 } r : Ul = { 6} r : U r = { 4} r : U r = { 5} l r U U l r U r l r U HB HB HB BH 6 1 BH 1 BH 1 r r r r r r r r r r U 5 2 5 2 5 r 2 r r r r r r r r r 4 3 4 3 4 3 r r r U Round 1 Round 2 Round 3 Complexity. Cost and Time complexity are: 2n log(n) + O(n). Algorithm Divide is size-optimal and cost-optimal. Mobile Search for a Black Hole in an Anonymous Ring
  • 31. Algorithm OptTime: Execution Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Mobile Search for a Black Hole in an Anonymous Ring
  • 32. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Mobile Search for a Black Hole in an Anonymous Ring
  • 33. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 HB s1 Node 0 6 1 s2 Node 1 s3 Node 2 5 2 s4 Node 3 s5 Node 4 s6 Node 5 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 34. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB s1 Node 0 6 1 s2 Node 1 s3 Node 2 5 2 s4 Node 3 s5 Node 4 s6 Node 5 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 35. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB s1 Node 0 6 1 s ,s 1 3 s Node 1 s s, s 4 5 2 2 s 6 s3 Node 2 5 2 s4 Node 3 s5 Node 4 s6 Node 5 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 36. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB s1 Node 0 6 1 s ,s1 3 s Node 1 s s, s4 5 2 2 s 6 s3 Node 2 s 3 5 2 s4 Node 3 s5 Node 4 s ,s1 4 s6 Node 5 4 3 s ,s5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 37. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB s1 Node 0 6 1 s ,s1 3 s Node 1 s s, s4 5 2 2 s 6 s3 Node 2 s 3 5 2 s4 Node 3 s 4 s5 Node 4 s ,s1 4 s6 Node 5 4 3 s ,s5 6 s ,s ,s 1 5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 38. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB s1 Node 0 6 1 s ,s1 3 s Node 1 s s, s4 5 2 2 s 6 s3 Node 2 s 3 BH 5 2 s4 Node 3 s 4 s s 5 Node 4 s ,s 5 s ,s1 4 s6 Node 5 1 6 4 3 s ,s5 6 s ,s ,s 1 5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 39. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 Step 2 s , s ,s 1 2 3 s ,s ,s 4 5 6 HB HB s1 Node 0 6 1 s ,s1 3 6 1 s Node 1 s s, s4 5 s Node 3 2 2 s 6 2 s3 Node 2 s 3 s 3 Node 4 BH 5 2 5 2 s4 Node 3 s 4 s 4 Node 5 s s s 5 Node 4 s ,s 5 s ,s1 4 5 Node 6 s6 Node 5 1 6 4 3 s ,s5 6 4 3 s ,s ,s 1 5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 40. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 Step 2 s , s ,s 1 2 3 s ,s s ,s ,s 4 5 6 2 s ,s 4 3 5 HB HB s1 Node 0 6 1 s ,s1 3 6 1 s Node 1 s s, s4 5 s Node 3 2 2 s 6 2 s3 Node 2 s 3 s 3 Node 4 BH 5 2 5 2 s4 Node 3 s 4 s 4 Node 5 s s s 5 Node 4 s ,s 5 s ,s1 4 5 Node 6 s6 Node 5 1 6 4 3 s ,s5 6 4 3 s ,s ,s 1 5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 41. Algorithm OptTime: Execution BHS Co-located Agents Algorithm OptTime Let s ,..., s agents. Each Agent si is assigned a location i ; its task is to verify whether the Black Hole is there. It does so in two steps, executed independently of the other Agents. 1. si first goes to node [i - mod(n)] in clockwise direction and, if successful, returns to the Home Base. 2. It then goes, in counter clockwise direction, to node [-(n - i - ) mod (n)] and, if successful, returns to the Home Base: the Black Hole resides in the assigned location i. Step 1 Step 2 s , s ,s 1 2 3 s ,s s ,s ,s 4 5 6 2 s ,s 4 3 5 HB HB s Node 0 s ,s 1 6 1 s, s 1 3 s ,s 2 3 6 1 s2 Node 1 s 2 s 4 6 5 s 2 Node 3 s 4 s5 s3 Node 2 s 3 s 3 Node 4 BH 5 2 BH 5 2 s4 Node 3 s 4 s 4 Node 5 s s s 5 Node 4 s ,s 5 s ,s1 4 5 Node 6 s6 Node 5 1 6 4 3 s ,s5 6 4 3 s ,s ,s 1 5 6 Mobile Search for a Black Hole in an Anonymous Ring
  • 42. Algorithm OptTime: Complexity Complexity. OptTime lets n-1 co-located Agents find the Black Hole in 2n-4 time. + Theorem. In the worst case, 2n-4 time units are needed to find the Black Hole, regardless of the number of Agents available. Theorem. Algorithm OptTime is time-optimal. Mobile Search for a Black Hole in an Anonymous Ring
  • 43. Algorithm OptTime: Complexity BHS Co-located Agents Algorithm OptTime Complexity. OptTime lets n-1 co-located Agents find the Black Hole in 2n-4 time. + Theorem. In the worst case, 2n-4 time units are needed to find the Black Hole, regardless of the number of Agents available. Theorem. Algorithm OptTime is time-optimal. Mobile Search for a Black Hole in an Anonymous Ring
  • 44. Algorithm TradeOff: Over view and Complexity Goal: Obtain a trade-off between the number of Agents employed and the time needed to find the Black Hole. 1° Idea: Employ the time-optimal strategy over a number of stages, reusing in each stage the Agents. 2° Idea: Reduce the number of Agents that enter the Black Hole , at the expense of a small increase of in time and number of moves. This is achieved by Exploring Agents Technique that is used such an exploration phase in pipeline with the execution of the main algorithm. This technique frees k-2 agents from using cautious walk: these agents follow the main algorithm but they move only if the link they have to traverse is already marked as safe. If such a link is not safe, they simply wait. Complexity: Let 1≤ q≤ log(n). Algorithm TradeOff let n q+2 co-located Agents locate the Black Hole in 2(q+1)n - q - o (n) time. Mobile Search for a Black Hole in an Anonymous Ring
  • 45. Algorithm TradeOff: Over view and Complexity BHS Co-located Agents Algorithm TradeOff Goal: Obtain a trade-off between the number of Agents employed and the time needed to find the Black Hole. 1° Idea: Employ the time-optimal strategy over a number of stages, reusing in each stage the Agents. 2° Idea: Reduce the number of Agents that enter the Black Hole , at the expense of a small increase of in time and number of moves. This is achieved by Exploring Agents Technique that is used such an exploration phase in pipeline with the execution of the main algorithm. This technique frees k-2 agents from using cautious walk: these agents follow the main algorithm but they move only if the link they have to traverse is already marked as safe. If such a link is not safe, they simply wait. Complexity: Let 1≤ q≤ log(n). Algorithm TradeOff let n q+2 co-located Agents locate the Black Hole in 2(q+1)n - q - o (n) time. Mobile Search for a Black Hole in an Anonymous Ring
  • 46. Algorithm TradeOff Init k=n q+2 be the number of Agents, where 1≤ q≤ log(n) is the trade-off parameter. Node 0 is the Agent’s Home Base. e e 1. Two agents and perform the Exploring Agents Technique: e e and start from Home Base, move in opposite directions using Cautious Walk Protocol with the only purpose of marking the safe links before disappearing in the Black Hole. 2. The other agents ( s ,...,s n q ) start their algorithm in pipeline with the explorers, always q leaving from safe ports. The algorithm proceeds in rounds. In each round the unexplored area is divided into q segments P ,..., P q of almost equal n n size (e.g., at the first phase the segment Pi is (i-1)n(q-1)q + 1 ,..., i n (q-1)q ). a. Agent s verifies the guess that the Black Hole belongs to segment P by checking the nodes immediately outside P (first the left one, then the right one). b. Agent si moves left (possibly entering in Pi ) up to the last safe port. c. Agent si moves right up to the last safe port, passing through Home Base, notifying all the other agents to start the computation of the next round. d. When notified, an Agent stops the computation of the current round, and starts the new round. Mobile Search for a Black Hole in an Anonymous Ring
  • 47. Algorithm TradeOff BHS Co-located Agents Algorithm TradeOff Init k=n q+2 be the number of Agents, where 1≤ q≤ log(n) is the trade-off parameter. Node 0 is the Agent’s Home Base. e e 1. Two agents and perform the Exploring Agents Technique: e e and start from Home Base, move in opposite directions using Cautious Walk Protocol with the only purpose of marking the safe links before disappearing in the Black Hole. 2. The other agents ( s ,...,s n q ) start their algorithm in pipeline with the explorers, always leaving from safe ports. The algorithm proceeds in rounds. q In each round the unexplored area is divided into q segments P ,..., P q of almost equal n n size (e.g., at the first phase the segment Pi is (i-1)n(q-1)q + 1 ,..., i n (q-1)q ). a. Agent s verifies the guess that the Black Hole belongs to segment P by checking the nodes immediately outside P (first the left one, then the right one). b. Agent si moves left (possibly entering in Pi ) up to the last safe port. c. Agent si moves right up to the last safe port, passing through Home Base, notifying all the other agents to start the computation of the next round. d. When notified, an Agent stops the computation of the current round, and starts the new round. Mobile Search for a Black Hole in an Anonymous Ring
  • 48. Algorithm TradeOff: Execution of Round One |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; 80 20 P 2: 1 1 , . . . , 2 0 ; . 21 . . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 49. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; 80 20 P 2: 1 1 , . . . , 2 0 ; . 21 . . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 50. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; 80 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . 21 . BH . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 51. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; e1 e2 80 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . 21 . BH . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 52. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; e1 e2 80 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 53. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 A-s1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; s1 80 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 54. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 s2 11 |A|=k= n q +2 = 12; 81 P 1: 1 , . . . , 1 0 ; s 3 20 80 s1 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . s 9, s 10 P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 s 8 s 4 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 s 7 s5 . . 60 s6 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 55. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 s 8 P 1: 1 , . . . , 1 0 ; 80 s 1 , s 2, s 3, s 4, s 5, s 6, s 7 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . s 9, s 10 P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 56. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 s 8 P 1: 1 , . . . , 1 0 ; 80 s 1 , s 2, s 3, s 4, s 5, s 6, s 7 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . s 9, s 10 P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 57. Algorithm TradeOff: Execution of Round One BHS Co-located Agents Algorithm TradeOff |R|=n=100; 91 HB 1 1≤ q≤ log(n) = 2 ; 90 10 11 |A|=k= n q +2 = 12; 81 s 8 P 1: 1 , . . . , 1 0 ; 80 s 1 , s 2, s 3, s 4, s 5, s 6, s 7 20 P 2 : 1 1 , . . . , 2 0 ; Node 74 . Right Node 75 21 . BH Left Node 73 . s 9, s 10 P 9: 8 1 , . . . , 9 0 ; 71 P 10: 9 1 , . . . , 0 ; 70 30 s 1: 0 , 1 1 ; 31 s 2: 1 0 , 2 1 ; . 61 . . 60 40 41 s 9: 8 0 , 9 1 ; 51 50 s 10: 9 0 , 1 ; Mobile Search for a Black Hole in an Anonymous Ring
  • 58. Algorithm TradeOff: Execution of Round Two BHS Co-located Agents Algorithm TradeOff 81 80 P 1: 7 1 ; s 1: 7 0 , 7 2 ; 79 P 2: 7 2 ; s 2: 7 1 , 7 3 ; 78 P 3: 7 3 ; s 3: 7 2 , 7 4 ; 77 P 4: 7 4 ; s 4: 7 3 , 7 5 ; 76 P 5: 7 5 ; s 5: 7 4 , 7 6 ; P 6: 7 6 ; s 6: 7 5 , 7 7 ; 75 P 7: 7 7 ; s 7: 7 6 , 7 8 ; BH P 8: 7 8 ; s 8: 7 7 , 7 9 ; 73 P 9: 7 9 ; s 9: 7 8 , 8 0 ; 72 P 10: 8 0 ; s 10: 7 9 , 8 1 ; 71 70 Mobile Search for a Black Hole in an Anonymous Ring
  • 59. Algorithm TradeOff: Execution of Round Two BHS Co-located Agents Algorithm TradeOff 81 80 P 1: 7 1 ; s 1: 7 0 , 7 2 ; 79 P 2: 7 2 ; s 2: 7 1 , 7 3 ; 78 P 3: 7 3 ; s 3: 7 2 , 7 4 ; 77 P 4: 7 4 ; s 4: 7 3 , 7 5 ; 76 P 5: 7 5 ; s 5: 7 4 , 7 6 ; P 6: 7 6 ; s 6: 7 5 , 7 7 ; 75 P 7: 7 7 ; s 7: 7 6 , 7 8 ; BH P 8: 7 8 ; s 8: 7 7 , 7 9 ; 73 P 9: 7 9 ; s 9: 7 8 , 8 0 ; 72 P 10: 8 0 ; s 10: 7 9 , 8 1 ; 71 70 Mobile Search for a Black Hole in an Anonymous Ring
  • 60. Algorithm TradeOff: Execution of Round Two BHS Co-located Agents Algorithm TradeOff 81 80 P 1: 7 1 ; s 1: 7 0 , 7 2 ; 79 P 2: 7 2 ; s 2: 7 1 , 7 3 ; 78 P 3: 7 3 ; s 3: 7 2 , 7 4 ; 77 P 4: 7 4 ; s 4: 7 3 , 7 5 ; 76 P 5: 7 5 ; s 5: 7 4 , 7 6 ; P 6: 7 6 ; s 6: 7 5 , 7 7 ; 75 P 7: 7 7 ; s 7: 7 6 , 7 8 ; BH s 5, s 6, s 7 s4 s 8, s 9, s 10 P 8: 7 8 ; s 8: 7 7 , 7 9 ; 73 P 9: 7 9 ; s 9: 7 8 , 8 0 ; 72 s3 P 10: 8 0 ; s 10: 7 9 , 8 1 ; s2 71 s1 70 Mobile Search for a Black Hole in an Anonymous Ring
  • 61. Algorithm TradeOff: Execution of Round Two BHS Co-located Agents Algorithm TradeOff 81 80 P 1: 7 1 ; s 1: 7 0 , 7 2 ; 79 P 2: 7 2 ; s 2: 7 1 , 7 3 ; 78 P 3: 7 3 ; s 3: 7 2 , 7 4 ; 77 P 4: 7 4 ; s 4: 7 3 , 7 5 ; 76 P 5: 7 5 ; s 5: 7 4 , 7 6 ; s4 s 1, s 2, s 3 P 6: 7 6 ; s 6: 7 5 , 7 7 ; 75 P 7: 7 7 ; s 7: 7 6 , 7 8 ; BH s 5, s 6, s 7 s 8, s 9, s 10 P 8: 7 8 ; s 8: 7 7 , 7 9 ; 73 P 9: 7 9 ; s 9: 7 8 , 8 0 ; 72 P 10: 8 0 ; s 10: 7 9 , 8 1 ; 71 70 Mobile Search for a Black Hole in an Anonymous Ring
  • 62. Dispersed Agents: Lower Bounds Theorem. The cost of locating the black hole in oriented rings with dispersed agents is Ω (n log(n)) for every initial dispersion of k Agents. k is unknown. Theorem. If k is known a priori to the agents, the cost of locating the black hole in an oriented ring is Ω (n log(n-k)). Mobile Search for a Black Hole in an Anonymous Ring
  • 63. Dispersed Agents: Lower Bounds BHS Dispersed Agents Theorem. The cost of locating the black hole in oriented rings with dispersed agents is Ω (n log(n)) for every initial dispersion of k Agents. k is unknown. Theorem. If k is known a priori to the agents, the cost of locating the black hole in an oriented ring is Ω (n log(n-k)). Mobile Search for a Black Hole in an Anonymous Ring
  • 64. Algorithm DOR: Over view The goal: Obtain a cost-optimal algorithm for the oriented ring where k ≥ 2 anonymous agents are dispersed. Idea: Pairing two Agents in a few moves in order to execute Algorithm Divide. DOR Algorithm 1° Phase: Pairing Algorithm Create at least one Agents pair. 2° Phase: Elimination Algorithm In this phase, the number of pairs is reduced to at most two to reduce the cost. 3° Phase: Resolution Algorithm Remaining Agents pair/pairs execute Algorithm Divide. Mobile Search for a Black Hole in an Anonymous Ring
  • 65. Algorithm DOR: Over view BHS Dispersed Agents Oriented ring Algorithm DOR The goal: Obtain a cost-optimal algorithm for the oriented ring where k ≥ 2 anonymous agents are dispersed. Idea: Pairing two Agents in a few moves in order to execute Algorithm Divide. DOR Algorithm 1° Phase: Pairing Algorithm Create at least one Agents pair. 2° Phase: Elimination Algorithm In this phase, the number of pairs is reduced to at most two to reduce the cost. 3° Phase: Resolution Algorithm Remaining Agents pair/pairs execute Algorithm Divide. Mobile Search for a Black Hole in an Anonymous Ring
  • 66. Algorithm DOR: Pairing Phase Pairing Initially, all agents are not paired. Each agent moves along the ring clockwise, using cautious walk, marking (direction and distance to its own starting node) the visited nodes. 1. If an agent reaches a node visited by another agent b, it becomes chasing, and follows b’s trace. 2. If an agent arrives at a node visited by two agents, it terminates with status alone. 3. If a chasing agent reaches the last safe node visited by the chased agent, it leaves a mark Join me and terminates with status paired-left. 4. If a nonchasing agent, during its cautious walk, encounters the mark Join me, it clears this mark and terminates with status paired-right. Mobile Search for a Black Hole in an Anonymous Ring
  • 67. Algorithm DOR: Pairing Phase BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Pairing Initially, all agents are not paired. Each agent moves along the ring clockwise, using cautious walk, marking (direction and distance to its own starting node) the visited nodes. 1. If an agent reaches a node visited by another agent b, it becomes chasing, and follows b’s trace. 2. If an agent arrives at a node visited by two agents, it terminates with status alone. 3. If a chasing agent reaches the last safe node visited by the chased agent, it leaves a mark Join me and terminates with status paired-left. 4. If a nonchasing agent, during its cautious walk, encounters the mark Join me, it clears this mark and terminates with status paired-right. Mobile Search for a Black Hole in an Anonymous Ring
  • 68. Pairing: Execution Mobile Search for a Black Hole in an Anonymous Ring
  • 69. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 sb s a HB HB BH HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 70. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Whiteboard s : Joi n Me a s a sb sb sa HB HB BH sc HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 71. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Whiteboard s : Joi n Me a s a sb a s b sa HB HB s b BH sc HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 72. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Whiteboard s : Joi n Me a s a sb a s b sa HB HB s b BH sc HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 73. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Case 2 sa Whiteboard HB s : Joi n Me a BH HB sb s a sb a s b sa HB HB HB s s b c BH sc HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 74. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Case 2 sa s a Whiteboard HB s : Joi n Me a BH HB sb s s s s a b a b sa HB sc b HB HB s s b c BH sc HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 75. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Case 2 sa s a Whiteboard HB s : Joi n Me a s a BH HB sb s s s s a b a b sa HB sc b HB HB s s b c s b BH Whiteboard sc s : Joi n Me b HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 76. Pairing: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Case 1 Case 2 sa s a Whiteboard HB s : Joi n Me a s a BH HB sb s s s s a b a b sa HB sc b HB HB s s b b c s b a BH Whiteboard sc s : Joi n Me b HB s c Mobile Search for a Black Hole in an Anonymous Ring
  • 77. Algorithm DOR: Elimination Phase The computation proceeds in logical rounds. In each round, 1. The left agent lv cautiously moves to the left until a. it is destroyed by the black hole, b. it reaches a home base u with higher round number: lv returns to v, marks it Eliminated, and stops any further execution, c. it reaches a home base u with equal round number: lv marks u as Eliminated and returns to v; if v is not marked Eliminated, it is promoted to the next round. 2. Agent rv cautiously moves to the right until a. it is destroyed by the black hole, b. it finds the first home base u in equal or higher round; In case b. it then returns back to v. If the current level of v is not higher than the level of u, v is marked Eliminated and rv stops any further execution; otherwise rv travels again to the right. To prevent both agents of a pair entering the black hole, both lv and rv maintain a counter and travel to distance at most ˪(n−1)/2˩. If one of them has traveled such a distance without finding another home base with the same or higher round, it returns back to v, and v is marked Selected. Mobile Search for a Black Hole in an Anonymous Ring
  • 78. Algorithm DOR: Elimination Phase BHS Dispersed Agents Oriented ring Algorithm DOR Elimination The computation proceeds in logical rounds. In each round, 1. The left agent lv cautiously moves to the left until a. it is destroyed by the black hole, b. it reaches a home base u with higher round number: lv returns to v, marks it Eliminated, and stops any further execution, c. it reaches a home base u with equal round number: lv marks u as Eliminated and returns to v; if v is not marked Eliminated, it is promoted to the next round. 2. Agent rv cautiously moves to the right until a. it is destroyed by the black hole, b. it finds the first home base u in equal or higher round; In case b. it then returns back to v. If the current level of v is not higher than the level of u, v is marked Eliminated and rv stops any further execution; otherwise rv travels again to the right. To prevent both agents of a pair entering the black hole, both lv and rv maintain a counter and travel to distance at most ˪(n−1)/2˩. If one of them has traveled such a distance without finding another home base with the same or higher round, it returns back to v, and v is marked Selected. Mobile Search for a Black Hole in an Anonymous Ring
  • 79. Elemination: Execution Left Agent Mobile Search for a Black Hole in an Anonymous Ring
  • 80. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Round 1 Round 1 v HB HB u BH Mobile Search for a Black Hole in an Anonymous Ring
  • 81. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Round 1 Round 1 rv lu v HB HB u lv ru BH Mobile Search for a Black Hole in an Anonymous Ring
  • 82. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Round 1 Round 1 rv lu ru lv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 83. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Eliminated Round 1 Round 1 rv lu ru lv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 84. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Eliminated Round 1 Round 1 rv lu ru lv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 85. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Eliminated Round 1 Round 1 rv lu ru lv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 86. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Eliminated Round 1 Round 12 rv lu ru lv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 87. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 12 Round 2 Round 1 rv lu ru lv lu rv v HB HB u v HB HB u lv ru BH BH ru ru Mobile Search for a Black Hole in an Anonymous Ring
  • 88. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 12 Round 2 Round 1 rv lu ru lv rv lu rv lu v HB HB u v HB HB u lv ru BH BH ru ru Mobile Search for a Black Hole in an Anonymous Ring
  • 89. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Left Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 12 Round 2 Eliminated Round 1 rv lu ru lv rv lu rv lu v HB HB u v HB HB u lv ru BH BH ru ru Mobile Search for a Black Hole in an Anonymous Ring
  • 90. Elemination: Execution Right Agent Mobile Search for a Black Hole in an Anonymous Ring
  • 91. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Round 1 Round 1 v HB HB u BH Mobile Search for a Black Hole in an Anonymous Ring
  • 92. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Round 1 Round 1 rv rv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 93. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Round 1 Round 1 rv rv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 94. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Eliminated Round 1 Round 1 rv rv v HB HB u lv ru BH ru Mobile Search for a Black Hole in an Anonymous Ring
  • 95. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 1 Round 1 rv rv v HB HB u v HB HB u lv ru BH HB BH ru Whiteboard t Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 96. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 1 Round 1 rv rv rv v HB HB u v HB HB u lv ru lv BH HB BH ru Whiteboard t Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 97. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 1 Round 1 rv rv rv v HB HB u v HB HB u lv ru lv BH HB BH ru Whiteboard t Eliminated Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 98. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 1 Round 1 rv rv rv rv v HB HB u v HB HB u lv ru lv BH HB BH ru Whiteboard t Eliminated Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 99. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 12 Round 1 rv rv rv rv v HB HB u v HB HB u lv ru lv BH HB BH ru Whiteboard t Eliminated Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 100. Elemination: Execution BHS Dispersed Agents Oriented ring Algorithm DOR Elimination Right Agent Whiteboard Whiteboard Whiteboard Whiteboard Eliminated Round 1 Round 1 Round 12 Round 1 rv rv rv rv v HB HB u v HB HB u lv ru lv BH HB BH ru Whiteboard t Eliminated Round 1 Mobile Search for a Black Hole in an Anonymous Ring
  • 101. Algorithm DOR: Complexity and Conclusion Pairing Complexity: At least one pair is formed during the pairing phase. The pairing phase lasts at most 3n-6 time units, and its cost is at most 4n-7 moves. Elimination Complexity:. The elimination phase selects at least one and at most two pairs in O( n log(n) ) moves. DOR Complexity. Algorithm DOR lets k ≥ 2 dispersed anonymous Agents locate the Black Hole in oriented rings in O( n log(n) ) time and cost. Algorithm DOR is cost-optimal. Mobile Search for a Black Hole in an Anonymous Ring
  • 102. Algorithm DOR: Complexity and Conclusion BHS Dispersed Agents Oriented ring Algorithm DOR Pairing Complexity: At least one pair is formed during the pairing phase. The pairing phase lasts at most 3n-6 time units, and its cost is at most 4n-7 moves. Elimination Complexity:. The elimination phase selects at least one and at most two pairs in O( n log(n) ) moves. DOR Complexity. Algorithm DOR lets k ≥ 2 dispersed anonymous Agents locate the Black Hole in oriented rings in O( n log(n) ) time and cost. Algorithm DOR is cost-optimal. Mobile Search for a Black Hole in an Anonymous Ring
  • 103. Algorithm Gathering and Complexity Gathering The number k of agents is known. 1. Each agent moves along the ring clockwise using cautious walk. 2. When arriving at a node already visited by another agent, it proceeds to the right via the safe port. If there is no safe port, it tests how many agents are at this node; if the number of agents at the node is k− , the algorithm terminates. Complexity In oriented rings, k agents, with k known, can locate the black hole in time: n O( log(n) log(k-2) ) Mobile Search for a Black Hole in an Anonymous Ring
  • 104. Algorithm Gathering and Complexity BHS Dispersed Agents Oriented ring Algorithm Gathering Gathering The number k of agents is known. 1. Each agent moves along the ring clockwise using cautious walk. 2. When arriving at a node already visited by another agent, it proceeds to the right via the safe port. If there is no safe port, it tests how many agents are at this node; if the number of agents at the node is k− , the algorithm terminates. sa HB Complexity In oriented rings, k agents, with k known, BH 5 HB sb can locate the black hole in time: n O( log(n) log(k-2) ) HB sc Mobile Search for a Black Hole in an Anonymous Ring
  • 105. Algorithm Gathering and Complexity BHS Dispersed Agents Oriented ring Algorithm Gathering Gathering The number k of agents is known. 1. Each agent moves along the ring clockwise using cautious walk. 2. When arriving at a node already visited by another agent, it proceeds to the right via the safe port. If there is no safe port, it tests how many agents are at this node; if the number of agents at the node is k− , the algorithm terminates. sa s a HB Complexity In oriented rings, k agents, with k known, BH 5 HB sb can locate the black hole in time: n sc s b O( log(n) log(k-2) ) HB sc Mobile Search for a Black Hole in an Anonymous Ring
  • 106. Algorithm Gathering and Complexity BHS Dispersed Agents Oriented ring Algorithm Gathering Gathering The number k of agents is known. 1. Each agent moves along the ring clockwise using cautious walk. 2. When arriving at a node already visited by another agent, it proceeds to the right via the safe port. If there is no safe port, it tests how many agents are at this node; if the number of agents at the node is k− , the algorithm terminates. s a s a HB Complexity In oriented rings, k agents, with k known, BH 5 HB sb can locate the black hole in time: n sc s b O( log(n) log(k-2) ) HB sc s ,s a b Mobile Search for a Black Hole in an Anonymous Ring
  • 107. Algorithm BOD: Over view and Complexity Assumption: Assume we have a global clock and that each move cost one time unit. Goal 1: Obtain an algorithm that can be applied when number of agents is unknown. Goal 2: Even if number of agents is not known, more agents can indeed help to reduce time units and the length of the longest chain of causally related moves. Idea: Group Agents to let them execute the algorithm TradeOff. Complexity: Complexity of Algorithm BOD is at most as the time complexity of the algorithm TradeOff plus an additional O(n). Mobile Search for a Black Hole in an Anonymous Ring
  • 108. Algorithm BOD: Over view and Complexity BHS Dispersed Agents Oriented ring Algorithm BOD Assumption: Assume we have a global clock and that each move cost one time unit. Goal 1: Obtain an algorithm that can be applied when number of agents is unknown. Goal 2: Even if number of agents is not known, more agents can indeed help to reduce time units and the length of the longest chain of causally related moves. Idea: Group Agents to let them execute the algorithm TradeOff. Complexity: Complexity of Algorithm BOD is at most as the time complexity of the algorithm TradeOff plus an additional O(n). Mobile Search for a Black Hole in an Anonymous Ring
  • 109. Algorithm BOD k is unknown, and initially all agents are in state alone. Rules for agent r in state alone. 1. Cautiously walk to the right until you meet another agent r'. 2. If r' is in state alone, form a group G (r and r' change state to grouped) and start executing the group algorithm. 3. Otherwise (r' is in state grouped, belonging to the group G', formed at the node g') join the group G': Go to g' and set your state to Join[g']. Rules for group G. G is formed at node g, consisting of |G| agents. Execute Algorithm TRADEOFF using |G| agents, with the following actions taken after finishing each phase and before starting the next one: 1. If any of your agents have seen agents of another group G' whose starting node g' is to the right of g, join group G' by sending all your agents to g', with state Join[g']. 2. Otherwise add all the agents waiting at g with state Join[g] to G and execute the next phase of Algorithm 3 using the updated number of agents. Mobile Search for a Black Hole in an Anonymous Ring
  • 110. Algorithm BOD BHS Dispersed Agents Oriented ring Algorithm BOD k is unknown, and initially all agents are in state alone. Rules for agent r in state alone. 1. Cautiously walk to the right until you meet another agent r'. 2. If r' is in state alone, form a group G (r and r' change state to grouped) and start executing the group algorithm. 3. Otherwise (r' is in state grouped, belonging to the group G', formed at the node g') join the group G': Go to g' and set your state to Join[g']. Rules for group G. G is formed at node g, consisting of |G| agents. Execute Algorithm TRADEOFF using |G| agents, with the following actions taken after finishing each phase and before starting the next one: 1. If any of your agents have seen agents of another group G' whose starting node g' is to the right of g, join group G' by sending all your agents to g', with state Join[g']. 2. Otherwise add all the agents waiting at g with state Join[g] to G and execute the next phase of Algorithm 3 using the updated number of agents. Mobile Search for a Black Hole in an Anonymous Ring
  • 111. Algorithm BOD: Execution Mobile Search for a Black Hole in an Anonymous Ring
  • 112. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone 0 s2 : alone BH 1 5 2 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 113. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 0 s2 : alone BH 1 s2 5 2 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 114. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 0 s1 s : alone 2 BH 1 s2 5 2 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 115. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 0 s s1 s 1 :: join[1] 2 alone BH 1 s2: join[1] s2 5 2 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 116. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 5 2 5 2 s2 : join[2] 4 3 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 117. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 5 2 5 2 s2 : join[2] 4 3 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 118. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 5 2 5 2 s2 : join[2] 4 3 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 119. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 5 2 5 2 s2 :: join[2] 1 join[2] 4 3 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 120. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 5 2 5 2 s2 :: join[2] 1 join[2] s1 : join[0] 4 3 0 4 3 BH 1 5 2 s2 : join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 121. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 5 2 5 2 s2 :: join[2] 1 join[2] s1 : join[0] s1 4 3 0 4 3 BH 1 s2 5 2 s2 : join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 122. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 5 2 5 2 s2 :: join[2] 1 join[2] s1 : join[0] s1 ,s2 4 3 0 4 3 BH 1 s2 5 2 s2 : join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 123. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 Whiteboard s2 :: join[2] 5 2 5 2 1 join[2] Join 2 s1 : join[0] s1 ,s2 4 3 0 4 3 BH 1 s2 5 2 s2 : join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 124. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 Whiteboard s2 :: join[2] 5 2 5 2 1 join[2] Join 2 s1 : join[0] s1 ,s2 4 3 0 4 3 BH s2 1 s2 1 5 2 s2 : join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 125. Algorithm BOD: Execution BHS Dispersed Agents Oriented ring Algorithm BOD s1 : alone s1 : alone s1 s1 2 0 s s1 s 1 :: join[1] 0 2 alone BH 1 s2: join[1] BH 1 s2 s2 1 Whiteboard s2 :: join[2] 5 2 5 2 1 join[2] Join 2 s1 : join[0] s1 ,s2 4 3 0 4 3 BH s2 1 s2 1 5 2 s2 :: join[2] 1 join[2] 4 3 Mobile Search for a Black Hole in an Anonymous Ring
  • 126. Dispersed Agents: Unoriented Ring Lemma. At least three dispersed Agents are needed to locate the Black Hole in an Unoriented Ring. Lemma. Let P be a protocol for Oriented Ring which, using k agents, solves a problem S in time T and cost C . Then there is a protocol P’ for unoriented ring which, using 2 k -1 Agents, solves S in time T and complexity at most 2 C . Theorem. Three dispersed Agents are necessary and sufficient to locate the Black Hole in an Unoriented Ring. They can do so with optimal Θ(n log(n)) cost. Mobile Search for a Black Hole in an Anonymous Ring
  • 127. Dispersed Agents: Unoriented Ring BHS Dispersed Agents Unoriented ring Lemma. At least three dispersed Agents are needed to locate the Black Hole in an Unoriented Ring. Lemma. Let P be a protocol for Oriented Ring which, using k agents, solves a problem S in time T and cost C . Then there is a protocol P’ for unoriented ring which, using 2 k -1 Agents, solves S in time T and complexity at most 2 C . Theorem. Three dispersed Agents are necessary and sufficient to locate the Black Hole in an Unoriented Ring. They can do so with optimal Θ(n log(n)) cost. Mobile Search for a Black Hole in an Anonymous Ring
  • 128. DOR Extension: Pairing Phase Idea. Algorithm DOR can be employed to solve the BHS problem when the anonymous Agents are neither all co-located nor fully dispersed. DOR Extension 1. If an agent is the sole occupant of its home base, it will execute the algorithm without modifications 2. In the case of several agents sharing the same home base, Algorithm PAIRING (the first step of Algorithm DOR) becomes simpler: a. Only two of the co-located Agents will be selected; b. The two selected agents will form a pair and execute the rest of the algorithm, while the others will become alone. Mobile Search for a Black Hole in an Anonymous Ring
  • 129. DOR Extension: Pairing Phase BHS Extensions Idea. Algorithm DOR can be employed to solve the BHS problem when the anonymous Agents are neither all co-located nor fully dispersed. DOR Extension 1. If an agent is the sole occupant of its home base, it will execute the algorithm without modifications 2. In the case of several agents sharing the same home base, Algorithm PAIRING (the first step of Algorithm DOR) becomes simpler: a. Only two of the co-located Agents will be selected; b. The two selected agents will form a pair and execute the rest of the algorithm, while the others will become alone. Mobile Search for a Black Hole in an Anonymous Ring
  • 130. Stefan Dobrev - Paola Flocchini - Giuseppe Prencipe - Nicola Santoro Mobile Search for a Black Hole in an Anonymous Ring Parallel and Distributed Algorithms Teacher Speakers Prof. Linda Pagli Fabio Fosso Rudy Fastelli