Dispersion of Mobile Robots: The Power of Randomness
Anisur Rahaman Molla William K. Moses Jr





A. R. Molla and W. K. Moses Jr.

Cryptology and Security Research Unit, Indian Statistical Institute, Kolkata 700108, India. molla@isical.ac.in
Faculty of Industrial Engineering and Management, Technion - Israel Institute of Technology, Haifa, Israel. wkmjr3@gmail.com



Dispersion of Mobile Robots: The Power of Randomness
    Anisur Rahaman Molla1Research supported in part by DST Inspire Faculty research grant DST/INSPIRE/04/2015/002801. ORCID ID: 0000-0002-1537-3462William K. Moses Jr.2Research supported in part by a grant of his postdoctoral fellowship hosts from the Israeli Ministry of Science. ORCID ID: 0000-0002-4533-7593

    December 30, 2023
=======================================================================================================================================================================================================================================================================================================================






 


We consider cooperation among insects, modeled as cooperation between mobile robots on a graph. Within this setting, we consider the problem of mobile robot dispersion on graphs. The study of mobile robots on a graph is an interesting paradigm with many interesting problems and applications. The problem of dispersion in this context, introduced by Augustine and Moses Jr. <cit.>, asks that n robots, initially placed arbitrarily on an n node graph, work together to quickly reach a configuration with exactly one robot at each node. Previous work on this problem has looked at the trade-off between the time to achieve dispersion and the amount of memory required by each robot. However, the trade-off was analyzed for deterministic algorithms and the minimum memory required to achieve dispersion was found to be Ω(log n) bits at each robot. In this paper, we show that by harnessing the power of randomness, one can achieve dispersion with O(logΔ) bits of memory at each robot, where Δ is the maximum degree of the graph. Furthermore, we show a matching lower bound of Ω(logΔ) bits for any randomized algorithm to solve dispersion.  


We further extend the problem to a general k-dispersion problem where k> n robots need to disperse over n nodes such that at most ⌈ k/n ⌉ robots are at each node in the final configuration. 






 






§ INTRODUCTION



 






 §.§ Background & Motivation

The mobile robots paradigm has been used to study many types of systems, including those where simple insects cooperate with each other to accomplish some goal. These robots typically need to work together to solve some common problem such as shape formation or exploration of the environment or gathering at some common point. One of the primary motivations of this type of research is to understand how to use resource-limited robots to achieve some large task in a distributed manner.

Typically the environment that serves as a backdrop to these problems is a either a finite plane or a connected graph. However, a graph can just be thought of as a discretization of the space of a finite plane or in fact three dimensional space. Thus, using graphs as an environment allows, in some sense, for a more general study of a given problem. 

The problem of dispersion on graphs was recently introduced by Augustine and Moses Jr. <cit.>. The initial version of the problem asks that n robots that are initially arbitrarily placed on a graph should work together to reach a final configuration such that there is exactly one robot on each node. We study this problem and the more general version of it where k robots (for any k) are initially arbitrarily placed and must reach a configurations such that at most ⌈ k/n ⌉ robots are present on any given node. The study of dispersion is interesting and has practical applications to any problem where the cost of several robots sharing the same resource (node) far outweighs the cost of a robot finding a new resources (moving on the graph). One such example is when multiple electric cars must find a recharge station in an area where recharge stations are located close by. The time to charge the vehicle may be in the order of hours while the time to find another station would be in the order of minutes. Further, if the vehicles are “smart" and communicate with each other to exchange information about what stations are free or not, this problem is exactly modeled as dispersion. The study of dispersion is also interesting as it relates to the related problems of scattering on graphs, multi-robot exploration, and load balancing on graphs. Scattering on graphs asks that k≤ n spread themselves out in an equidistance manner on symmetric graphs like rings or grids. This is just dispersion with an extra constraint of equi-spacing. Multi-robot exploration asks that k robots starting at the same node work together to visit each node of the graph as quickly as possible. It is clear that any solution to dispersion solves this problem. Finally, load balancing on graphs asks that nodes send and receive loads and evenly distribute these loads among themselves. Dispersion can be seen as flipping this model by having the loads (i.e., robots) move around and distribute themselves evenly among the nodes. The techniques used to solve load balancing in graphs are quite different from those used to solve problems in mobile robots and by studying dispersion, our hope is to build a bridge between the two areas for cross-pollination of ideas and techniques.

As mentioned earlier, one of the key aspects of mobile robots is that we are solving large tasks in a distributed manner with resource limited mobile robots. In previous work, the study of memory of robots and time to achieve dispersion was of great interest. This paper furthers that study and shows that the introduction of randomness in a novel way allows robots to achieve dispersion using much less memory than previously shown.






 §.§ Our Results

Throughout this paper, we study the trade-off between memory required by robots and the time it takes to achieve dispersion of n robots on different types of graphs with n nodes and m edges. We denote the diameter of these graphs by D and maximum degree of any node of the graph by Δ. We present algorithms for increasingly general types of graphs that utilize randomness to allow robots, with typically O(logΔ) bits of memory[Note that all log's that appear in this paper are to the base 2.], to achieve dispersion. This is a substantial improvement over past algorithms which, while deterministic, required robots to have Ω(log n) bits of memory each[Notice that our algorithms require only O(1) bits memory at each robot on paths, rings, grids and any constant degree graphs, whereas the previous deterministic algorithms require O(log n) bits.]. We also show a lower bound on the memory requirement that any randomized algorithm requires Ω(logΔ) bits to achieve dispersion, assuming all robots have the same amount of memory.

When we consider a rooted graph of a certain type, it implies that the topology of the graph is of that type and all robots start at one node, called the root, of the graph. We initially describe our algorithms for dispersion of n robots on n node graphs and subsequently generalize them to dispersion of any k robots on n node graphs. We assume that robots do not know the values of n, m, k, Δ, or D. However, in several instances, our algorithms require robots to have memory proportionate to either parameter Δ or D. This means that whatever memory supplied to the robot should be enough to satisfy the requirement, but the explicit knowledge of the parameter itself is not needed. 
Our upper bound results for dispersion of n robots on n node graphs are summarized in Table <ref>.

We first describe a primitive, Local-Leader-Election, that can be used by robots with access to randomness to choose one robot to settle down at a given node. This  allows us to side-step the requirement of Ω(log (k/n)) bits of memory required by each robot for a unique label if we want robots to deterministically choose a robot to settle down at each node.

We then proceed to show how a simple algorithm for rooted rings, Rooted-Ring, that requires robots to have O(logΔ) bits of memory and achieves dispersion in O(n) rounds. This serves as a warm-up and allows readers to internalize the way we use Local-Leader-Election and how these sorts of algorithms (with reduced memory) need to operate.

We then develop the algorithm Rooted-Tree for rooted trees that requires robots to have O(logΔ) bits of memory and achieves dispersion in O(n). This algorithm contains the key ideas for our algorithm on general rooted graphs.

We then present two algorithms to achieve dispersion on rooted graphs, Rooted-Graph-LogDelta-LogD and Rooted-Graph-Delta, which require robots to have O(max{logΔ, log D }) and O(Δ) bits of memory respectively and both algorithms achieve dispersion in O(m) rounds. Both algorithms are extensions of the Rooted-Tree algorithm and use different amounts of memory to handle the issue of dealing with cycles that may arise in the graph. We provide these two algorithms with contrasting memory requirements so that if an algorithm designer a priori knows which of the two memory requirements is less, they can program robots to use that algorithm.

Finally, we present an algorithm Arbitrary-Graph, which works on arbitrary graphs, and allows robots with O(logΔ) bits of memory to achieve dispersion in the cover time of the graph with high probability. The algorithm is a Las Vegas type randomized algorithm in that robots will eventually achieve dispersion, but the exact running time is not fixed and but bounded with high probability. The “cost" of having robots use less memory is that we require robots to stay active after they settle down. Namely, each robot runs the algorithm until it settles down and then must stay active to inform other robots that come to the node that the node is settled. In this sense, the algorithm is non-terminating. Contrast this against other algorithms which allow robots to settle down and need not be active after certain conditions are met.

After presenting the above algorithms and analyzing them for dispersion of n robots on n nodes, we then show how to generalize them to achieve dispersion of k robots on n nodes, where k can be any positive integer value.

We then present our lower bound of Ω(logΔ) bits of memory needed by each robot to achieve dispersion when randomness is allowed.









 §.§ Related Work


 







The problem of dispersion of mobile robots on a graph was introduced recently by Augustine and Moses Jr. <cit.> and studied in different graph classes. In the full version <cit.>, the authors rectified and improved some of their dispersion algorithms. Improvements and rectifications were also independently performed by Kshemkalyani and Ali <cit.>. Both papers focused on the trade-off between time complexity and memory requirement of robots to solve dispersion deterministically. Our results improve over the previous works <cit.> in terms of memory requirement with the help of randomness. In particular, our randomized algorithms reduce the memory requirement from O(log n) bits to O(logΔ) bits and the time complexity remains same or is faster (in some cases). While the algorithms in <cit.> chiefly rely on a timer to signal termination of the algorithm and as such require Ω(log n) bits of memory, our algorithms are more event oriented and robots terminate when the termination condition is triggered.   

Dispersion is closely connected to graph exploration by robots; a well-studied problem in the context of mobile robots. In the graph exploration problem, k robots are initially located at a node and the goal is to have the robots collectively visit all nodes in the graph. A number of papers have worked on this problem, however, most of the works are in specific graph classes, such as rings <cit.>, 
 trees <cit.>, 
  and grids <cit.>. 
  Several papers consider exploration on general graphs <cit.>. However, the model assumptions or the goal of these papers are different from ours and they may produce inefficient solutions to dispersion. For example, the papers  close to our model <cit.> only focus on minimizing memory of the robots and as a result the time complexity of their exploration algorithms is very high. Fraigniaud et al. <cit.> shows that a robot with Θ(DlogΔ) bits of memory can explore an anonymous graph, but may take time O(Δ^D+1). Cohen et al. <cit.> considers the model where the nodes also have memory. Then with some initial preprocessing, they solve exploration with less memory bits, but the exploration takes O(Δ^10m) time. Further, the exploration algorithm of Cohen et al. with O(1) bits memory at each node cannot solve dispersion immediately. Diks et al. <cit.> shows that exploration in a tree is possible with O(log^2 n) bits of memory. Ambühl et. al. <cit.> improved this memory bound to O(log n) bits. 
Dynia et al. <cit.> and Ortolf et al. <cit.> present optimal-time rooted tree exploration algorithms with k robots, but they assume unlimited memory of robots.  Our paper focuses on the trade-off between running time and memory requirement to solve dispersion.     







Another similar problem to dispersion is scattering or uniform deployment of k robots k ≤ n on a graph. In the scattering problem on a graph, k robots need to uniformly deploy over n nodes in the graph. Several papers studied the scattering problem on graphs; e.g., on rings <cit.> and on grids <cit.>, but in different settings. 

Most of the above algorithms for graph exploration or scattering on graphs are deterministic. To the best of our knowledge, our paper is the first presenting randomized solutions to dispersion and improve the previous results.    




A slightly different way of looking at the dispersion problem is as load balancing in graphs. Load balancing requires nodes to distribute the load over nodes evenly. Here, if we consider robots as the load, then dispersion of robots is similar to load balancing, where the power to move load around the graph lies with the load as opposed to the nodes. Load balancing is a well explored problem, in particular in graphs <cit.>. 
 Our model is closer to diffusion based load balancing <cit.> with discrete loads <cit.>.    
 







 §.§ Organization of Paper

The rest of the paper is organized as follows. In Section <ref>, we introduce the technical preliminaries needed for our results. In Section <ref>, we present an important primitive, Local-Leader-Election, which we use extensively in our algorithms. In Sections <ref>, <ref>, and <ref>, we present our algorithms to achieve dispersion on rooted rings, rooted trees, and rooted graphs respectively. In Section <ref>, we present a simple memory optimal algorithm to achieve dispersion on arbitrary graphs. 
We show how to extend our algorithms to handle dispersion with an arbitrary number of robots in Section <ref>. The lower bound on memory per robot is presented in Section <ref>.  Finally, in Section <ref>, we present conclusions and some future work.







§ TECHNICAL PRELIMINARIES



 



We consider a connected undirected graph of n nodes, m edges, diameter D, and maximum degree of any node Δ. The nodes are anonymous, i.e. they do not have unique labels. For every edge connected to a node, the node has a corresponding port number for the edge. The same edge may have different port number assigned to it at each of its attached nodes. For every node, there exists a total ordering on the port numbers from that node. 
A robot with x bits of memory has access to 2^x ports of that node. For a given node with y ports, if 2^x ≥ y, then the robot has access to all ports of the node. When 2^x < y, the robot only has access to a subset of the ports, where the exact subset of ports is chosen arbitrarily by nature.[The robot's memory restricts it to only use a subset of the available ports when determining which port to move through. Importantly, the robot does not know that there are more ports than it is seeing. Thus it cannot purposely choose which subset of ports to see. We call this lack of control  “by nature".] 
Thus, for a given node with Δ ports, any robot needs at least logΔ bits of memory in order to access all ports.[This does not necessarily give a Ω(logΔ) memory lower bound for dispersion. We discuss this further in the lower bound section (Section <ref>).]


We assume a synchronous system, i.e. time progresses in rounds, and each robot knows when the current round ends and a new round starts, although robots may not know the round number. Each round proceeds as follows: (i) First, robots colocated at the node exchange messages with each other and perform local computation. (ii) Second, robots move through a port of current node and reach a new node. Robots may also choose to stay at the current node. Note that in step (i) of the round, we consider local computation and message exchange to be bounded, but free[This can be considered a realistic assumption when the time taken for a robot to move through an edge is significantly more than the time taken for either local message exchange or local computation.].


Robots are anonymous, i.e. they do not have unique labels. Each robot has a limited amount of memory for computation and to store information. The exact limit depends on the algorithm to be run and is explicitly given in each section of the paper. Each robot has access to a fair coin that be used to generate an infinite number of random bits. However, the number of random bits that can be stored and used for any purpose is limited by the robots memory. When a robot is present at a node, it can access the port numbers  of that node, subject to memory restrictions as defined earlier. The robot can only view other robots colocated at the same node as it and cannot see anything beyond its current node (its “view" of the graph is limited). Robots do not know the value of n, m, D, or Δ. Note that our algorithms require do not require robots to know the actual values of D and Δ, but require the robots to have enough memory store either O(log D), O(logΔ), or O(Δ) bits according to the algorithm in question. Thus robots may have an upper bound on those values but do not explicitly know those values. 


We characterize the efficiency of solutions to dispersion along two metrics. First, how many bits of memory is each robot required to have. Second, what is the running time of the algorithm until dispersion is achieved. For all algorithms, save the algorithm in Section <ref>, robots execute the dispersion algorithm and then terminate within the running time we specify for the algorithm. For the algorithm in Section <ref>, we allow robots to be active indefinitely.


We now present several definitions of terms we use in the paper. We call a graph a rooted graph if all robots are initially placed at one node of that graph called its root. A similar definition applies for specific types of graphs such as rings and trees. We say that a robot settles at a given node if that robot chooses to stay at that node in the final dispersion configuration. We call a node with a robot that settles on it a settled node. The algorithm in Section <ref> is based on random walks. A simple random walk in an undirected graph is defined as: in each step, the walk chooses a random adjacent edge from the current node and moves to that neighbor. The probability of choosing a random neighbor u from the current node v is 1/d(v), where d(v) is the degree of v. The cover time of a random walk is defined to be the time required by the random walk to visit all the nodes in the graph. It is known that the cover time of any graph is bounded by O(mn) <cit.>. We refer the reader to the survey <cit.> for details on random walks and cover time. 


We now formally define dispersion of k robots on an n node graph. Initially, k robots are arbitrarily placed on the graph. Dispersion asks that robots move around the graph to reach a configuration such that at most ⌈ k/n ⌉ robots are present at any given node. 







§ LOCAL LEADER ELECTION



 

In this section, we describe a procedure which we use throughout the rest of the paper. The procedure allows any number of k robots co-located at an unsettled node to choose exactly one leader (robot) for the node within one round of an algorithm. Importantly, each robot only requires O(1) bits of memory and access to a random number generator in order to execute the algorithm. We first describe the algorithm and prove our claims on it. We subsequently discuss the applications of the algorithm that immediately arise. In order to differentiate between different instances of communication occurring between robots at a node within the same round, we refer to each instance of communication among at most k robots as one sub-round and use that terminology while describing our algorithm. Note that, as per our model assumptions, any amount of communication is allowed to take place between robots within a single round of the system, so long as the amount of communication is bounded. As we shall see, our procedure satisfies that requirement with high probability.



 §.§ Algorithm Local-Leader-Election
 Each robot starts off as a candidate for leader. In every sub-round, a robot that is a candidate leader flips a fair coin. If heads, it broadcasts that it is alive to other robots. If tails (and at least one other robot broadcasts in that sub-round) it stops being a candidate for leader and doesn't broadcast anymore. If tails and no other robot broadcasts in that sub-round, it remains a candidate for leader. This process is repeated until exactly one robot broadcasts in a given sub-round. Then all robots know that that robot is the leader, and it is chosen as the robot which settles down at the given node. Subsequently, all other robots can then move to other nodes according to a given algorithm. Note that if it occurs that no robot broadcasts in a given sub-round, that sub-round is ignored and all robots that were still alive previously broadcast again.


Local-Leader-Election can be run by multiple robots, each having O(1) bits of memory and co-located at a node, to select a common leader within one round of the system.



We first show that the algorithm can be run by robots and completes within one round of the system. Then we argue about its memory complexity.

It is easy to that Local-Leader-Election takes O(log n) sub-rounds on expectation for a leader to be chosen. Applying a Chernoff bound, it is also easy to see that it takes O(log n) sub-rounds with high probability for termination. Thus the number of sub-rounds is bounded with high probability. Recall that any amount of bounded communication between co-located robots is allowed in one round of the system. Thus the algorithm successfully executes within one round of the system.

Each robot requires only O(1) bits because a robot needs 1 bit to check if it's a candidate leader, 1 bit to check if it's the leader, and 2 bits to check if it heard 0, 1, or more than 1 robot broadcast in a given sub-round. 



 §.§ Applications

Local-Leader-Election can be directly applied to past deterministic algorithms in <cit.> to replace the use of O(log n) bits to compare multiple robots to decide which one settles at a node. In addition, if the termination condition is relaxed, some of the resulting algorithms use dramatically less memory as a result. We list the improvements to algorithms in <cit.>, as a result of these two modifications, below:


  * Algorithm Path-Ring-Tree-LogN achieves dispersion of n robots in O(n) rounds on paths, trees, and rings when robots have O(logΔ) bits of memory and do not terminate.

  * Algorithm Rooted-Graph-LogN achieves dispersion of n robots in O(m) rounds on rooted graphs when robots have O(logΔ) bits of memory and do not terminate.





§ DISPERSION ON ROOTED RINGS



 

In this section, we describe our algorithm to achieve dispersion of n robots on a rooted ring in O(n) rounds when robots have O(1) bits of memory. This does not contradict our lower bound because here Δ is a constant so O(logΔ) = O(1). Recall that for a ring, any algorithm to achieve dispersion takes at least Ω(n) rounds because the diameter of the graph is n/2. Thus our algorithm is asymptotically time optimal.



 §.§ Algorithm Rooted-Ring
 Each robot performs a traversal of the ring in a deterministic manner until it becomes the leader of the node it is at, as chosen in Local-Leader-Election. Once it becomes the leader of that node, it settles down and terminates execution of the algorithm. 

The traversal of the ring is done in the following manner. Initially have robots move through port 0. Subsequently, if the robot enters a node through port i and it does not become the leader, have it leave through port i+1  2.


Algorithm Rooted-Ring can be run by n robots with O(1) bits of memory each to ensure dispersion occurs in O(n) rounds on rooted rings.



It is easy to see that the entire ring is traversed by robots in O(n) rounds. Further, each robot terminates as soon as it becomes a leader. Finally, each node has exactly one leader robot assigned to it. Thus dispersion is achieved in O(n) rounds. The only memory requirement is a bit to remember which port the robot entered the node through and O(1) bits to execute Local-Leader-Election. Thus each robot only requires O(1) bits of memory. 




§ DISPERSION ON ROOTED TREES



 

In this section, we describe an algorithm to achieve dispersion of n robots on a rooted tree in O(n) rounds when each robot has O(logΔ) bits of memory.




 §.§ Algorithm Rooted-Tree

The algorithm has two phases of execution. In the first phase, the algorithm has every robot perform a deterministic depth first search (DFS) in order to uniquely settle down at a node. In the second phase, the final robot to settle down then backtracks to the root of the tree and performs a second DFS to inform each robot to terminate execution.

In the first phase, each robot that does not settle down performs a DFS in the following manner. It remembers the port i that it entered the node through. It then leaves through port (i+1) δ, where δ is the local degree of the node. Initially at the root, let the robots move through port 0 (since the robots did not initially enter the root through any node). At each empty node, a robot is chosen by Local-Leader-Election to settle down at it. This node remembers the port it entered the node through and we call the port the parent pointer.

In the second phase, the final robot to settle, x, changes its status to reflect that phase two has begun and backtracks to the root of the tree and then performs a second DFS until it finally settles down again and terminates. The robots it comes in contact with terminate when a special condition is met, as defined below. Consider the set of nodes on the path from the node where the last robot settled to the root and call it R. Let S represent the set of all nodes in the graph. For every node u∈ S ∖ R, the robot at u terminates execution when x leaves u through u's parent pointer. For each node u∈ R, we have the robot at u remember the port that x backtracked through to reach the root, i.e. the port x entered node u through as it backtracked, and we call that port the pointer to final node.[It is possible for the robot at u to differentiate x from just another robot executing phase one of the DFS because x has changed its status to reflect that the second phase has begun.] Once x passes through the pointer to final node of u, u terminates execution. Finally, when x reaches its empty node, it settles down and terminates execution.


Algorithm Rooted-Tree can be run by n robots with O(logΔ) bits of memory each to ensure dispersion occurs in O(n) rounds on rooted trees.



We first prove that the execution of Rooted-Tree results in dispersion being achieved and all robots terminating within O(n) rounds of the start of the algorithm. Subsequently, we argue that each robot requires only O(logΔ) bits of memory. 

It is clear that the first phase results in robots performing a DFS until an empty node is found to settle down in. Thus at the end of phase one, there is exactly one robot on each node. Note that we use notation from the algorithm. We now show that in phase two, due to the careful way we trigger termination of the algorithm in robots, all robots will terminate at the end of the DFS of x and x will end up back at the node it originally settled at. We first show this for robots at the nodes in the set S ∖ R and then for the remaining robots.


For every node u ∈ S ∖ R, the robot in every node in the subtree rooted at u terminates execution before the robot in u terminates execution.



Consider only the subtree rooted at u and let S' ⊆ S ∖ R denote the set of nodes of the subtree including u. Let the maximum depth of any node in this subtree be d. u is at depth 0 in this subtree. Now, we prove by induction on the depths of nodes in the subtree that for any node v ∈ S' at depth d', the following hypothesis holds. The robots in all descendant nodes of v have terminated before the robot in v terminates.

For a node at depth d, i.e. a leaf node, the hypothesis holds trivially because it has no descendants. 
Let the hypothesis hold true for all nodes at some depth d' in the subtree. We now prove that it holds for all nodes at depth d'-1. Consider a node w ∈ S' at depth d'-1. Before moving through the parent pointer of w, x will have explored each child of w and moved through that child's robot's corresponding parent pointer. Thus the robot at each child is triggered to end termination of the algorithm before the robot at w is triggered to end execution. Thus the invariant holds true for w.  

For every node u ∈ R excluding the final node that x settles down at, it is clear to see that once x passes through u's pointer to the final node, u will not be visited again. So the robot at u can terminate without a problem. And finally, once x reaches its empty node, it will also terminate execution. Thus, we see that for all nodes in S, after x completes its DFS in phase two, all robots at those nodes will terminate execution. The time taken to perform two DFS's on a tree and have x move to the root from a settled node is O(n) rounds. Thus the algorithm successfully completes in O(n) rounds.

Regarding the memory requirements of each robot, O(logΔ) bits are required for a parent pointer and pointer to the final node. O(1) bits are required to remember which phase the robot is in, to denote whether the robot is in the root of the tree, to denote whether a robot becomes the exploring robot x, and to perform Local-Leader-Election. So totally, each robot requires O(logΔ) bits of memory. 







§ DISPERSION ON ROOTED GRAPHS



 
 

In this section we describe two algorithms to achieve dispersion of n robots on a rooted graph in O(m) rounds. One algorithm requires robots to have O(max{logΔ, log  D} ) bits of memory each while the other has a requirement of O(Δ) bits of memory.




 §.§ Algorithm Rooted-Graph-LogDelta-LogD

This algorithm can be thought of as an extension to the algorithm Rooted-Tree found in Section <ref>. Similar to that algorithm, Rooted-Graph-LogDelta-LogD proceeds in two phases. In the first phase, robots again perform a deterministic DFS in order to find nodes to settle down at. However, the key difference between this algorithm and Rooted-Tree lies in how this algorithm deals with cycles in the graph. In the second phase, again the last settled robot goes to the root and performs a second DFS, triggering other robots to terminate execution of the algorithm in the process. 

In the first phase, robots again perform a DFS by remembering the port i they entered the node through and subsequently leaving through port (i+1) δ, where δ is the local degree of the port. For the root node, robots initially move through port 0. At each empty node along the way, robots perform Local-Leader-Election to choose one robot to settle down at that node. If a robot is exploring and comes across a node with a robot already settled on it, the exploring robot backtracks to its previous node and tries the next port from that node. Finally, the last robot settles down at the last node, marking the end of phase one. Note that settled robots maintain a parent pointer which records the port through which they first entered the given node. For the root, the value of its parent pointer is null. Also, each robot (both settled and exploring) maintain a counter indicating its distance from the root with respect to the tree of nodes formed by the DFS.

In the second phase, the last robot to settle down, x, changes its state info to indicate that it is in phase two and makes its way to the root of the graph. From here it performs a DFS, similar to that done in phase one. However, in this DFS, cycles are detected when the robot moves from a node at distance ℓ from the root to a node at distance < ℓ from the root. In such a case, the robot backtracks to its previous node and proceeds through the next available port. Similar to Rooted-Tree, consider all nodes along the path from the root to the node that x finally settles at. Call this set R. Let every robot belonging to a node in R except for x maintain a pointer to the final node, indicating the port through which x must go to return to the node it must settle at. Once x moves through this port in the course of the DFS, all robots belonging to nodes in R save x itself terminate execution. Let the set of all nodes in the graph be S. For a robot belonging to a node u ∈ S ∖ R, once x passes from u to u's parent via u's parent pointer, the robot at u terminates execution of the algorithm. Finally, x completes the DFS, returns to the node it must settle at, and terminates execution.



Algorithm Rooted-Graph-LogDelta-LogD can be run by n robots with O(max{logΔ, log  D} ) bits of memory each to ensure dispersion occurs in O(m) rounds on rooted graphs.



This proof is very similar to the proof of Theorem <ref>. We first prove that all robots running Rooted-Graph-LogDelta-LogD achieve dispersion in O(m) rounds. Then we argue that each robot requires O(max{logΔ, log  D} ) bits of memory to execute the algorithm.

To prove our claim on dispersion, we make use of the following Claim. We omit the proof as the Claim and its proof are very similar to Lemma <ref> and its proof.


For every node u ∈ S ∖ R, the robot in every node in the subtree rooted at u terminates execution before the robot at u terminates execution.


Note that the proof of Claim <ref> requires one extra argument in addition to the argument required in the proof of Lemma <ref>. We must show that x will immediately backtrack when a cycle is detected and not trigger the termination condition of a robot out of order of the DFS by accidentally further exploring through that robot's parent pointer. Our cycle checking strategy requires robots to maintain their distance from the root. x can easily identify that it is in a cycle if it moves from a node at distance ℓ to one at distance < ℓ. Importantly, in a DFS, cross edges do not exist but only forward and back edges. This means that x moved to an ancestor of the node. x would not have yet moved through the parent pointer of the robot attached to the ancestor, and thus would not have triggered that robot to terminate execution. So, x can communicate with the robot at the ancestor, discover the distance of the ancestor from the root, discover that it is in a cycle, and backtrack immediately.

Thus, at the end of phase two, x will successfully complete execution of the DFS. At the end of the DFS, all robots would be triggered to terminate execution. Furthermore, we know that a DFS on a graph takes O(m) rounds, so that is the execution time of the algorithm.

As to the memory requirement of robots. Each robot must use O(logΔ) bits to store information about parent pointer and pointer to final node. Additionally, O(log D) bits are required to store information about the distance to root. Finally, O(1) bits are needed to store information about which phase a robot is in, whether the robot is in the root or not, whether the robot is the exploring robot x or not, and to execute Local-Leader-Election. Therefore, each robot requires O(max{logΔ, log  D} ) bits of memory to execute the algorithm. 




 §.§ Algorithm Rooted-Graph-Delta


This algorithm is a variation of Rooted-Graph-LogDelta-LogD that provides a memory trade-off: instead of needing O(log D) bits of memory, this algorithm requires O(Δ) bits of memory. This algorithm again runs in two phases, with the goals of each phase being the same as that of the previous algorithm. We focus only on the variation between the two algorithms now.

In the previous algorithm, each settled robot was required to remember its distance from the root. In this algorithm, instead we require each settled robot to remember which of its ports lead to forward edges and which do not. This is done by maintaining a bit string of size at most Δ bits where each bit from LSB to MSB corresponds to one of the ports leading out of that node. Let us call it list of forward ports. Initially all bits except parent pointer's bit are set to one to indicate that all those ports possibly lead to forward edges. In the course of the DFS in phase one, if a robot uses a port from a node u and then realizes it is in a cycle, the robot will backtrack to u, inform the robot at u about the given port, and then move on with the DFS. The robot at u sets the corresponding bit in the list of forward ports to zero. Thus at the end of phase one, all settled robots have an accurate list of forward ports. Now, in phase two, when x performs its DFS, at a given node it only considers those ports whose corresponding bit in the list of forward ports is one.


Algorithm Rooted-Graph-Delta can be run by n robots with O(Δ) bits of memory each to ensure dispersion occurs in O(m) rounds on rooted graphs.



The proof of this theorem is identical to that of Theorem <ref>, so we omit details. However, we focus on two things: the proof that x does not end up in a cycle during the phase two DFS and the memory requirements of robots.

In phase two of the algorithm, x does not need to traverse an edge to discover if it is a back edge. Instead, at a given node u, it needs only rely on the list of forward ports maintained by the robot at u, which will be properly built in phase one of the algorithm. Therefore, the second DFS will be successful and all robots will terminate execution of the algorithm in O(m) rounds.

Instead of using O(log D) bits of memory to remember the distance from root, each robot is required to maintain the list of forward ports, which is a bit string of size at most Δ. Thus each robot requires O(Δ) bits of memory. 






§ DISPERSION ON ARBITRARY GRAPHS (WITHOUT TERMINATION)



 
 


In this section, we assume that the robots are initially arbitrarily located at nodes in the graph (i.e., not necessarily at a single node). We describe a simple randomized algorithm that can be run by robots to achieve dispersion and requires each robot to have O(logΔ) bits of memory each. The algorithm is a Las Vegas style randomized algorithm in that the time until dispersion is achieved is variable and is bounded by the cover time of the graph with high probability . 





 §.§ Algorithm Arbitrary-Graph

The idea of the algorithm is that each robot performs a simple random walk on the graph in parallel until it finds an empty node that it can settle at. The algorithm is described below in more detail.
 Each robot performs a random walk on the graph in parallel. During the random walk, if a robot finds an empty node, it settles down in that node. If multiple robots are present at an empty node in the same round, they compute a local leader using the procedure Local-Leader-Election and the leader settles at that node. Each robot performs the random walk until it settles down. A settled robot stays active indefinitely since it must inform other exploring robots about the occupancy of the node. 
   


Suppose n robots are placed arbitrarily over an n node graph. Then Algorithm Arbitrary-Graph solves dispersion with O(logΔ) bits of memory in cover time of the graph with high probability. The robots are active indefinitely.   



First of all, a robot can perform a simple random walk with O(logΔ) bits of memory as there are at most Δ adjacent edges at any node. Hence the robot can pick a random adjacent edge with O(logΔ) bits of memory (i.e., it can generate a random number from 1 to Δ with O(logΔ) bits of memory). 

Consider a particular robot exploring the graph by performing a random walk. Since the random walk is independent of all the other robots' random walks, the robot visits all the nodes in the graph by the cover time of the graph with high probability (see the definition of the cover time in Section <ref>). Hence, with high probability, by at most the cover time of the graph, the robot settles at some node. Since every robot performs a random walk in parallel (until it settles down) and independently, every robot will settle down after the cover time of the graph with high probability. Hence dispersion is achieved in cover time of the graph with high probability. The cover time of a graph lies in the range between Ω(n log n) and O(mn) depending on the graph structure. 

Whenever a robot settles at some node, the robot has to stay active until all the robots settle down. This is because the settled robot needs to inform other exploring robots that the node is already occupied; otherwise multiple robots may be settled down at a single node and dispersion will not be achieved. Since it takes cover time of the graph until all robots settle down, and the cover time of any graph is Ω(nlog n) <cit.>, a robot cannot maintain a counter to count the rounds until cover time is achieved with only O(logΔ) bits of memory and hence cannot terminate after the cover time. Thus, all the settled robots need to stay active for an indefinite number of rounds in order to achieve dispersion.    

Note that the random walk based exploration algorithm outperforms the O(m) time algorithms in several graph classes. For example, consider regular expander graphs. The cover time of a regular expander graph is Θ (nlog n) <cit.>. However, in dense regular expander graphs, the number of edges is ω (nlog n) and it could be as high as O(n^2) (e.g., a complete graph). In fact, the  Arbitrary-Graph algorithm is asymptotically faster than deterministic algorithms with more memory from <cit.> in the graphs where m=ω(cover-time). However, the algorithm is non-terminating. At the same time, Arbitrary-Graph requires robots to only have  O(logΔ) bits of memory. Moreover, since the random walks (corresponding to the robots) are independent of each other, the algorithm also works in an asynchronous system[It is required that Local-Leader-Election works without issue in that setting. This is the case.].   




§ EXTENDING ALGORITHMS TO ARBITRARY K



 

In this section, we describe how to extend our previous algorithms to work with an arbitrary number of robots. That is, we want to achieve dispersion of k robots on n nodes, for any positive integer value of k. There are two difficulties inherent in extending results to an arbitrary k, depending on whether k < n or k>n. When k<n, if an algorithm relies on a certain condition to be met before robots terminate, we must ensure that this condition is still met even with less than n robots participating. When k>n, we must figure out how to have robots settle in stages, because we do not want to  maintain a counter to allow ⌈ k /n ⌉ robots to settle at each node because the memory requirement will be O(log k), which could be arbitrarily large.

Rooted-Ring works for any arbitrary k. At the end of a given round, one robot has settled and terminated execution of the algorithm and the remaining robots are colocated at the next node. It takes one round to settle one robot, and the ring is settled node by node. Thus, for k robots, we can achieve dispersion with Rooted-Ring in O(k) rounds where each robot requires O(logΔ) bits of memory.

Rooted-Tree works without any modifications when k<n. This is because the last robot to settle down initiates phase two of the algorithm. It is easy for a robot to detect this because no other robot will participate in Local-Leader-Election with it. Since only k nodes of the graph are explored in phase one or two, Rooted-Tree only takes O(k) rounds to complete. When k>n, we have robots perform a second check to see if it is the last robot to settle. In a complete DFS traversal of a tree, a robot will reach the last node of the traversal when it has traversed the last port of each node from the root to a leaf node[Since ports are ordered, each robot can determine which port is last in the order. Furthermore, this ordering is unique to each node, so different robots will see the same ordering at each node.]. Thus, if a robot performing the DFS maintains a flag that indicates whether the robot traversed this path, we can detect the final node in the DFS traversal. Specifically, the robot sets the flag to true when at the root, and changes it to false if it traverses a port other than the last port of a given node. If the robot reaches a leaf node and the flag is true, and the robot is selected by Local-Leader-Election to settle down at the leaf node, then it knows that it is settling down at the last empty node in the tree. All other robots that got to this node but did not settle down go to the root node and wait. The last robot to settle down executes phase two of the algorithm as usual. Meanwhile, the robots waiting at the root node will execute a new iteration of the algorithm, i.e. start phase one, once the exploring robot in phase two passes through the final port of the root. This delay in start time  guarantees that the exploring robot will trigger other robots in the tree to terminate execution in time for the robots executing phase one to re-populate the tree with settled robots. The above process is repeated ⌊ k/n ⌋ times and takes O(n) rounds for each repetition and with an additional repetition done by some k - n*⌊ k/n ⌋ robots that takes O(k - n*⌊ k/n ⌋) rounds, for a total of O(k) rounds to achieve dispersion of all robots. Thus, for any k, Rooted-Tree achieves dispersion in O(k) rounds and requires robots to have O(logΔ) bits of memory each.

Rooted-Graph-LogDelta-LogD and Rooted-Graph-Delta both work when k<n without any modifications. When k>n, both work using the extension described in the previous paragraph on Rooted-Tree. However, since both algorithms take O(m) rounds to settle n robots, the total running times are both O(mk/n). However, an interesting change to the Rooted-Graph-Delta algorithm can ensure a running time of O(m + k). The change is to add an extra bit to each robot that indicates if they are participating in an “even" or “odd" set of phases of the algorithm. Order the robots in sets of n robots referencing the set of phases in which they are settled and terminate execution of the algorithm. If the set is an odd (even) number set in this order, it is called odd (even) set. Now, for every set of phases a and b where a immediately precedes b in the order, order of phases is as follows. First, phase one of set a occurs, then phase one of set b, then phase two of set a, then phase two of set b.[For 3 sets of phases a, b, and c, sequence is: phase one of a, phase one of b, phase two of a, phase one of c, phase two of b, phase two of c. This sequence can be easily seen now for more sets.] A node can be identified as a possible soon to be empty node (in the sense that the settled robot terminates execution) if only a robot with a different phase (odd vs. even) robot is settled at it. Thus in phase one of set b, have each settled robot copy the values of the at most Δ bits of the previous set's robot at that node indicating which ports lead to back edges. Thus, only in phase one of the first set of nodes will the DFS take O(m) rounds, and subsequent DFS's take only O(n) rounds each for the remaining O(k/n) sets of nodes (the algorithm is slightly tweaked so that future sets of robots take advantage of this info). Thus the running time becomes O(m + k) rounds. 

Arbitrary-Graph works without any modifications when k<n. When k>n, in general the algorithm will not work because robots never terminate execution of the algorithm. Thus, unlike the previous algorithms, we cannot have robots work in stages where the first set of robots settles down and terminates, then the next set, and so on. Instead, we would need a counter of O(⌈ k/n ⌉) bits to count how many robots have already settled at a node and settle down (if chosen by Local-Leader-Election) if that counter is < ⌈ k/n ⌉. This leads to the following special case where dispersion is possible. When n < k ≤Δ^c n, where c is a positive constant, we can achieve dispersion using Arbitrary-Graph, modified with a counter as earlier described, in the cover time of the graph with high probability where each robot needs O(logΔ) bits of memory.




§ LOWER BOUND ON MEMORY



 



In <cit.>, they showed that, assuming all robots have the same memory, a lower bound of Ω(log n) bits is required for dispersion when considering deterministic algorithms. The bound resulted from an argument that robots needed enough bits to uniquely choose a robot from a set of robots at each node. However, as we see later in this paper, we are able to circumvent this with the use of randomness. Now we argue another lower bound in the presence of randomness. 


Consider k robots trying to achieve dispersion on an n node graph. Assuming all robots have the same amount of memory, robots require Ω(logΔ) bits of memory each for any randomized algorithm to achieve dispersion on any graph.



We first describe a situation where robots containing o(logΔ) bits of memory will be unable to achieve dispersion. We then show that for all algorithms that attempt to achieve dispersion using o(logΔ) bits of memory, we can arrive at this situation.

Consider any number of robots present at a given node with degree O(Δ). If each robot has o(logΔ) bits of memory, it is impossible for any of them to individually access the entire list of possible ports to move through. Since the selection of ports by each of these robots is decided by nature, it may then occur that one particular port is never chosen in any of the subsets of ports. Let us focus on such a port.  

Let this port lead to an edge which acts as a cut between the set of nodes with robots currently on them and the set of empty nodes.  If k < n, additionally assume that the set of nodes with robots on them is of size ≤ k-1. Thus, the robots being unable to traverse that port prevents dispersion from being achieved. For any given algorithm, we can construct a graph such that there exists a node with associated cut edge satisfying the above description and all the robots start on nodes on the side of the cut with the node. Thus, for any algorithm, dispersion is impossible when robots have o(logΔ) bits of memory each. 




§ CONCLUSION AND FUTURE WORK



 

In this paper, we showed how to achieve dispersion on various types of graphs using less memory than required by other algorithms in the literature so far. Importantly, we showed how to leverage randomness in a novel way in the form of the Local-Leader-Election algorithm and utilize this primitive to reduce memory requirements. There are several interesting lines of research that result from this paper. We present two open problems of interest below.

Open Problem 1: All algorithms in our paper, save Arbitrary-Graph, work only for rooted versions of different types of graphs. The trade-off when implementing Arbitrary-Graph is that robots then must stay active indefinitely. Is it possible to develop algorithms for non-rooted versions of the graphs in question without requiring robots to stay active indefinitely?

Open Problem 2: Our algorithms for rooted graphs require robots to have possibly ω(logΔ) bits of memory each, depending on the values of Δ and D. Is it possible to develop algorithms with tighter upper bounds for rooted graphs?






splncs04
 

