An Optimal Algorithm for Online Freeze-tag

02/05/2019
by   Josh Brunner, et al.
MIT
0

In the freeze-tag problem, one active robot must wake up many frozen robots. The robots are considered as points in a metric space, where active robots move at a constant rate and activate other robots by visiting them. In the (time-dependent) online variant of the problem, frozen robots are not revealed until a specified time. Hammar, Nilsson, and Persson have shown that no online algorithm can achieve a competitive ratio better than 7/3 for online freeze-tag, and asked whether there is any O(1)-competitive algorithm. In this paper, we provide a (1+√(2))-competitive algorithm for online time-dependent freeze-tag, and show that no algorithm can achieve a lower competitive ratio on every metric space.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

11/07/2018

A Competitive Algorithm for Online Multi-Robot Exploration of a Translating Plume

In this paper, we study the problem of exploring a translating plume wit...
07/01/2021

Online Euclidean Spanners

In this paper, we study the online Euclidean spanners problem for points...
09/24/2021

Message Delivery in the Plane by Robots with Different Speeds

We study a fundamental cooperative message-delivery problem on the plane...
05/28/2019

Chasing Convex Bodies with Linear Competitive Ratio

We study the problem of chasing convex bodies online: given a sequence o...
08/27/2019

Online Energy Harvesting Problem Over An Arbitrary Directed Acyclic Graph Network

A communication network modelled by a directed acyclic graph (DAG) is co...
05/08/2021

The Pony Express Communication Problem

We introduce a new problem which we call the Pony Express problem. n rob...
05/24/2017

Inclusive Flavour Tagging Algorithm

Identifying the flavour of neutral B mesons production is one of the mos...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In the freeze-tag problem (FTP), there are robots in a metric space. Each robot is either awake (active) or asleep (frozen), and initially only one is awake. The goal is to get all the active robots to wake up all the asleep robots in the minimum possible time. Whenever an active robot reaches an asleep robot, that robot wakes up and can help wake up additional robots. All robots move at the same constant rate, but only active robots may move. A solution to the problem consists of a route which wakes up all of the robots, and is optimal if it wakes up all the robots in the minimal possible time.

The freeze-tag problem can be interpreted as finding a minimum-depth directed spanning tree on a set of points, where each vertex has out-degree at most 2. The first work was done in this language, e.g. in [4], and was motivated by (for example) the IP multicast problem, where a server needs to distribute information to a set of hosts. The freeze-tag problem was first introduced under this name in [1], and finding an optimal solution was shown to be NP-hard. Further work has mostly centered around approximation algorithms such as in [2] and [6]. No PTAS for general metric spaces has been found, though much progress has been made for Euclidean metrics in [5] and [7], finding a linear-time PTAS in some cases. In [1] it is shown that -approximation is NP-hard for general metrics arising from weighted graphs, so a PTAS does not exists assuming .

In this paper, we focus on the online version of this problem, where the asleep robots, or requests, are not known in advance. Each request is released at a certain time, before which the location, time, or existence of the request is not known. The goal is to minimize the time when the last robot is awakened. This variant was named time-dependent freeze-tag (TDFT) by Hammar, Nilsson, and Persson [3]. We feel that this variant models the schoolyard game of freeze-tag more closely, since one doesn’t know where or when the next person will get tagged, and also may be more relevant for some applications, where, say, requests for information are unpredictable.

Hammar, Nilsson, and Persson are concerned with the competitive ratio achieved by an online algorithm, to model the worst-case performance. They show that no algorithm can achieve a competitive ratio lower than , by giving a specific metric where this is not possible [3, Theorem 5]. They ask whether there is any online algorithm that achieves a constant competitive ratio. We will slightly improve their bound (through a generalized construction) to show that no competitive ratio lower than is possible, and give an algorithm which achieves this ratio.

2 Setup and Results

Recall that a metric space is a set equipped with a distance function which is non-negative, symmetric and satisfies the triangle inequality. Metric spaces induce a topology generated by the open balls , for and . Examples of metric spaces include those arising from weighted graphs satisfying the triangle inequality, or, say, Euclidean spaces. For time-dependent freeze-tag, we will exclusively use a special class of metric spaces.

Definition.

A metric space is strongly connected if for any two points , there exists a continuous function with and , and for all , we have .

Intuitively, a metric space is strongly connected if for every pair of points there is a path from to of length . If a connected metric space is not strongly connected, there is a metric space which is, where is the minimal value over all (continuous) paths from to of the maximal value of , where ranges over all points on the path. This modification is natural, because it makes the distance function actually reflect the time required to move between points.

An instance of the freeze-tag problem consists of a list of the positions of the robots in a metric space . The point denotes the starting position of the one active robot, while are the positions of the frozen robots. We refer to the robot which began at position by . Solutions to the freeze-tag problem can be considered as binary trees rooted at which span the positions . Then the FTP is equivalent to finding the spanning binary tree rooted at which has the minimal possible weighted depth.

An instance of the online (time-dependent) problem consists of the same points , but with associated release times . We assume that . The offline (normal FTP) problem is the special case where for all . The robots are denoted . Time-dependent freeze tag necessarily takes place in a strongly connected metric space, so that robots can take paths between any two points , which take time to complete. We do not lose much by restricting to strongly connected spaces, because as noted above any connected space can be modified to be strongly connected, and it doesn’t make sense to play freeze-tag on disconnected spaces.

A solution to an instance of the TDFT problem consists of a path in the metric space which unfreezes each robot, while an algorithm for TDFT gives a strategy which says how to move the active robots in any instance of the problem, possibly depending on the metric. An optimal solution to an instance consists of a optimal scheduling tree, which unfreezes each robot no earlier than it is released, and minimizes the time which the last robot is unfrozen. The problem of finding the optimal scheduling tree for a given input is NP-hard [1], but it is at least computable. We seek to minimize the competitive ratio of an algorithm for time-dependent freeze-tag. For each instance for TDFT, there is an associated time required for the optimal scheduling tree, denoted , and a time which the algorithm’s solution takes, . We want to minimize the competitive ratio, .

In [3], Hammar et. al. give an example of a metric space where no algorithm can achieve a competitive ratio lower than 7/3 for the online time-dependent freeze-tag problem. They pose the question of whether there is any algorithm which achieves a constant competitive ratio in every metric space. We answer this question affirmatively, and describe an algorithm which we show achieves the best possible competitive ratio.

Theorem 1.

The algorithm described in Section 3 is -competitive for the online TDFT problem on every continuous metric space. Moreover, for every , there exists a continuous metric space where no algorithm is -competitive for the online TDFT problem.

In Section 3 we describe our algorithm and show it is -competitive. In Section 4, we describe a metric space which is extremely similar to the one presented in [3], but give a different analysis that will prove a weaker bound but provide a framework, base-case, and motivation for a more complicated analysis. In Section 5 we generalize the construction to give a family of metrics, and show that the metrics in this family give lower bounds on the competitive ratio that can be arbitrarily close to , completing the proof of Theorem 1.

3 -Competitive Algorithm

The key idea of our algorithm is patience; we hope to have the robots wait near their starting positions until all of the robots are released, at which point we can copy the optimal scheduling tree. Ideally, we don’t move any robots until a time such that the optimal scheduling tree for the current input sequence would take time at most , at which point we use this scheduling tree to wake up all of the robots, taking a total time of , achieving the desired competitive ratio. Since we do not know the ultimate number of robots which will be released, we cannot know when we truly need to start waking up robots, and so the algorithm needs to be a little fancier. Let’s describe our algorithm more precisely now.

Let denote the minimum depth of a binary tree rooted at which wakes up all of the robots for , which are released by time , under the condition that robot is not activated until at least time . Equivalently, is the time of the last unfreezing in the optimal scheduling tree for the instance truncated at . Every time a robot is released, we recompute the value . This may be an NP-hard problem, as shown in [1], but it is as least computable.

Our online algorithm always has a schedule in mind for waking up the swarm. At every moment, all robots follow the current schedule. Every time a robot

is released, we overwrite the current schedule with the following new schedule, and start over from step 1.

  1. Send every active robot back to its starting position .

  2. Wait until time .

  3. Wake up the swarm in time by following an optimal schedule.

  4. Send every robot back to its starting position , and wait there.

This algorithm appears to be -competitive, since it should complete waking up the swarm at time . The main thing which remains to be shown is that the algorithm always completes the first step before time .

Lemma 1.

Under the algorithm described, at any time , each robot is at a distance at most from its starting position .

Proof.

We note that it suffices to only consider times during step 3, since at any other time the robots are either at home or moving toward home.

Step 3 started at time at least , so if we have been in step 3 for a duration , the current time is at least . Step 3 takes a total of time, so we also have . Therefore , and so . Since robots move at unit speed, if a robot has been moving for at most time since the last time it was at its starting position, it must be within distance of its starting position. Since step 3 always begins with all robots at the starting position, it follows that each robot is always within of its starting position. ∎

We are now prepared to prove half of our main result.

Theorem 2.

The algorithm described is -competitive under any metric for the time-dependent online freeze-tag problem.

Proof.

Let be the time that an optimal schedule would need to wake up all of the robots. Note that if the final request is released at a time , then , since it is not possible to satisfy a request before it has been received. Thus, there will be no further requests released after time .

Consider the time . Since the last time we received a request was at the latest at time , we have not modified the schedule since then. Thus, we have had at least time to complete step 1 of the algorithm. By Lemma 1, at time , each robot is at most away from its starting location. Thus, by time , step 1 will have finished, and all the robots will be at their starting locations. Then step 3 will begin at time , and take at most time, for a total time of for when the last robot is awakened. ∎

Remark.

Our algorithm balances staying close to home with having to wait before executing an optimal schedule. Any algorithm for which Lemma 1 holds for a smaller constant than will necessarily have a larger competitive ratio. If there were an algorithm with a better competitive ratio, it seems that it must be willing to send a robot farther away, while keeping others slightly closer. Our proof in the next two sections can be viewed as giving a formal justification for why it isn’t viable to keep most of the robots closer to home.

One drawback of our algorithm is that computing takes an exponential amount of time, and so it is not particularly efficient in that sense. One could use an approximation algorithm for , which would increase the competitive ratio by the approximation factor. However, even -approximation is -hard, and the best known polynomial-time algorithm for general metrics is only a -approximation [1], so more work is required for our algorithm to be executable efficiently.

4 Example Lower Bound Construction

In this section, we use a metric which is very similar to the metric described in [3] which gave a lower bound of 7/3. This metric can give a lower bound on the optimal competitive ratio of by optimizing Lemma 2, which would by itself be an improvement on the bound. We will present a simplified analysis which only gives a lower bound of , but which aligns better with the methods in Section 5. The complicated family of constructions there can be viewed as generalizing the metric used here, and the analysis will follow a similar strategy. In fact, the metric in this section and the Lemmas proved will serve as the base case for an induction argument. We also will use Lemma 4 as a framework for proving stronger bounds.

A lower bound of is easily achieved by not revealing where a single frozen robot is until a time equal to its distance from , adversarially placing it opposite whatever direction had been moving before that time. To improve on this, Hammar et. al. [3] force two robots to move in one direction, then travel all the way back the other way to unfreeze the final robot. Roughly speaking, the improvement in our approach comes from forcing the robots to move a little bit farther before turning back.

Our metric space is formed by a weighted graph with 8 vertices. The origin is where the initial active robot starts, and there will be 7 other points , which aren’t necessarily starting points for robots. We place on edges at distance 1 from the origin, while is at a distance from the origin. We also add edges of length one connecting points and , forming three equilateral triangles with the origin. The metric consists of all points along edges in this graph, with distances given by shortest path between the points in the graph, and is pictured in the Figure 1 below. The construction in [3] has exactly the same structure, but with different edge lengths.

Figure 1: The metric space

We can now start describing a TDFT instance for this metric. First fix an algorithm on the metric . Let and also , so that we will have active robots available from the start. Do not release any other robots until time . At time , there must a triangle where neither of the robots are. Since the triangles are all the same, without loss of generality we will assume that this is the triangle . Then release one robot each at and at time . In summary, we define the input . Certainly the time which the algorithm takes to unfreeze both frozen robots is at least 2, since both robots are at least one away from both frozen robots at . The following lemma will be key for our analysis.

Lemma 2.

For any online algorithm on the metric with input , we have either , or there is some time such that all but at most robots are at a distance more than from , and closer to a frozen robot than is.

Proof.

Suppose at every time there is a robot within of the origin. The earliest time that either of the initial requests can be satisfied is time 2. Without loss of generality, let robot satisfy the request at . At the point when reaches , the only way to finish before time is if the request at is satisfied by our other initial robot . When reaches , it is at a distance from , which is greater than when . Then the lemma will hold if is closest to , so assume some robot goes back towards from (assume it’s ). The scenario right when arrives at at time is depicted in Figure 2.

Figure 2: Robots at time , where is away from

Let be the earliest time after reaching that can be within of the origin. At that time, will be exactly away from . Since it left at time at least 2, this means that it is also at most away from . Thus, we have that . Solving this for gives that .

At this time, must still be within of the origin, since until it was the only robot available to satisfy our assumption that some robot is within of the origin. The case where both robots are exactly away from the origin at time is depicted in Figure 3.

Figure 3: Robots at time , both a distance from

After this time however, now that is sufficiently close to the origin, can immediately walk at full speed to . It will still take at least additional time to reach , for a total time of:

Thus, as long as there is always a robot within of the origin, it is not possible to satisfy both requests before time . ∎

We’ll need to verify some other easy but strange-looking facts.

Lemma 3.

There exists a schedule for the input on which unfreezes all robots by time , and another schedule where a single robot unfreezes every other robot by time . Moreover, has additional edges of length connected to , on which none of the requests in occur.

Proof.

The two robots could unfreeze both by going to and right away. One robot could complete by first visiting , and then , taking time units. Also, has the edge connecting and of length that is not used by . ∎

Now, we can consider the two cases given by Lemma 2 to prove a lower bound.

Lemma 4.

Let be a real number, an integer. Suppose is a metric such that for any algorithm , there exists an input with robots at at time , such that Lemma 2 and Lemma 3 both hold. Then any online algorithm on achieves a competitive ratio of at most .

Proof.

Take any algorithm on and let be the input given by the hypotheses. By Lemma 2, we know that either takes at least time on , or there exists some time when only robots are within of the origin. We will consider each of these as separate cases.

Case 1: takes at least time to complete . For , we know from Lemma 3 that the optimal scheduling tree finishes by time 1, so . This gives a competitive ratio of .

Case 2: There exists some time when only robots are closer than from . Let be the endpoints other than of the edges of given Lemma 3. Now, we modify to add the additional requests , which occur at time along the edge from to located at a distance of away from , for . Then the optimal schedule can complete in time . It starts by sending one robot to complete by time using Lemma 3, and the other robots to complete the extra requests at time .

For , when the last request is released at time , there are only robots closer than to . If there are any robots on the edges connecting and for , then they are no closer than is to a frozen robot, so by Lemma 2, they are counted among the . Now, robots cannot complete the additional requests in time less than , which is far too slow. Therefore some robot not among the must unfreeze one of the new robots. Combining the hypotheses of Lemmas 2 and 3, the shortest route this robot can take goes through . This robot (and therefore ) must spend a total time of at least total time to satisfy that request, giving a competitive ratio of at least .

Since , the competitive ratio for any algorithm is not less than . ∎

If we apply Lemma 4 to our particular metric and , it proves that no competitive ratio better than is possible. As said before, we could optimize the analysis in this case to show a better bound, but since we will prove a tight bound in the next section, we won’t bother. Since we have phrased Lemma 4 in such a general manner, it suffices to construct metrics where Lemma 3 holds and Lemma 2 can be proven for a smaller values of .

5 Tight Lower Bound

Let be a non-negative integer. We will define a metric with parameters , a natural number, and , a rooted tree on vertices that has depth , both of which are a function of .

Let’s construct a weighted graph which will form our metric . Let be vertices of degree one connected to a vertex by edges of length . Then make copies of the tree (to be described), rooted at vertices . Finally, connect all vertices in these trees to by edges of length 1.

We will describe the tree recursively. We will define to always be the number of vertices in the tree , and so also achieve a recursive description of . The tree is a single point, and consists of two vertices connected by an edge of length one. Then for , let be rooted at a vertex , with descendants . All of the edges connecting and have length For all , let be the root of a copy of with all edge lengths halved. This completes the description of and , and so also . A sketch of the tree can be seen in Figure 4. Observe that , that has layers (where layer is just the root), but that any path from the root to a leaf has length exactly , for . Also, note that is exactly the metric used in the Section 4.

Figure 4: The tree , in terms of

Let’s define the input , for an arbitrary online algorithm for the metric . Suppose there are starting robots active at at time 0, and no frozen robots. Observe the positions of the robots at time . Then since there are copies of , at least one tree will have no robots along any of the edges to any of the vertices in the tree. Without loss of generality assume this is the tree rooted at . Then let be the input which starts robots active at at time , and releases robots at time at each node of the tree rooted at . Namely, if a node of has down-degree , then release frozen robots at that node. The only exception will be the root of , which has down-degree , but releases frozen robots at the root instead of (this extra robot will make the analysis slightly more clean). The idea behind this construction of is that it provides just enough robots such that if the root were unfrozen, the robots could cascade through the tree unfreezing everything in 1 unit time.

Lemma 5.

The number of frozen robots released by in layers of the tree is equal to the number of nodes in layer .

Proof.

We use induction on . For the base case , the number of frozen robots in layer is just the number of frozen robots at the root, which by construction is , which is also the number of nodes in layer 1 of .

Suppose the lemma holds for some . In layer , each node has down degree and robots located at it (since ). Thus, the total number of nodes in layer layer plus the number of robots in layer is equal to the number of nodes in layer . By our inductive hypothesis, then, the total number of robots in layers is equal to the number of nodes in layer . ∎

We aim to prove versions of Lemmas 2 and 3 for , for some real number depending on . The previous section provides the base case , where . Also note that everything holds for , when the graph consists of three spokes, and . In general, we will define . One can check that this matches and . This formula has the important properties that and that , which are both clear. This definition isn’t just arbitrary though; it arises as the amount of time it takes to bounce back and forth between and the ball of radius around .

Lemma 6.

Suppose that at all times there are at least robots within a distance of . Then there exist robots that are unfrozen at time which do not unfreeze any robots at any time .

Proof.

A similar argument to what follows appeared within the proof of Lemma 2.

At time , there exist at least robots that are within of . If these robots stay within of , then they will never reach a frozen robot in this time interval, since all frozen robots are at least one away from and . Then at some time some robot that either was frozen at time or unfroze another robot must enter the ball of radius , otherwise there will always be these robots that never unfreeze other robots. Now, since this robot entering the ball must have come from a point at a distance 1 from , the minimal time after required such that is . Then, a robot exiting the ball has a distance remaining to reach a frozen robots, which therefore cannot occur until time at least .

Now, it can be checked that in fact, . Therefore it is impossible to avoid having robots never unfreeze a robot in this time interval. ∎

Lemma 7.

Lemma 3 holds for the metric with input and the integer .

Proof.

A schedule can unfreeze all the robots released in by time by having each of our starting robots go directly from to a different vertex of the tree rooted at . At time , they will all arrive and wake up all of the robots.

We can also have a single robot unfreeze all of the robots by time . First, our one robot moves to by time . Then, each of the newly unfrozen robots moves down the tree to the root of some copy of . There were robots frozen at , so all of the roots can be reached by time . By induction, can be traversed by a single robot in one time unit (the base case is clear), but these copies of have edges of half the length, so all of these robots can be traversed in half a time unit. Therefore the entire tree can be visited by time .

Finally, the edge from to the vertices give us additional edges of length on which no requests from occur. ∎

It now remains to prove a sufficiently strong version of Lemma 2, so that we can use Lemma 4. Call an unfrozen robot free at time if it is more than away from . In the context of Lemma 2, we are looking for a time when all but possibly robots are free. It will be helpful to use this to constrain how many robots can be free by a certain time.

Lemma 8.

Suppose is an algorithm such that at any time under the input , there are at least robots which are not free. Then cannot unfreeze as many robots as there are nodes in layers before time .

Proof.

We use induction on . The base case, , simply says that cannot unfreeze any robots before time . This is true because chooses to put all of the frozen robots on a tree that no active robot is near. The nearest a robot could be at is , which is distance 1 away from any node of the tree.

Let be the number of nodes in layers . Suppose that our lemma holds for . Then just before time , there are at most free robots, since of our initial robots at least of them must be near and not be free.

By Lemma 6, there must be robots which were unfrozen before that never unfreeze any robots between the times and . In particular, without loss of generality we will assume that these are the robots that are required to stay near , so the only robots we have available during this interval are the free robots.

Since , and every edge coming out of a node in one of layers has length at least , it is not possible for any free robot to fully traverse one of these edges between times and . Thus, we can assume these edges don’t exist for bounding the number of robots that can be woken up between times and . Ignoring these edges, we have a bunch of subtrees in the bottom layers, each of which have a total of robots on them, and single nodes in layers which each have at least robots frozen on them.

Each of our robots can wake up at most all of the robots in either one subtree or one single node. Since every node in layers has at least robots at it, and each of the subtrees has at most robots in it, the most robots that can be woken up is maximized by sending a free robot to each of the nodes in layers . By Lemma 5, the total number of robots in these layers equal to the number of nodes in layer . Thus, we now have a total of free robots, so we cannot have more than free robots before time .

If we have free robots, then since we started with 1 free robot, we have unfrozen less than robots by this point. ∎

Corollary 1.

Lemma 2 holds on the metric with input , the integer , and .

Proof.

Suppose that at every time there exists at least robots at a distance more than from , otherwise the result is immediate. Then we can apply Lemma 8 with to get that the number of robots unfrozen must not be more than there are nodes in (which is ) before time . Now, the number of frozen robots released in is more than the number of nodes in , since each node has at least one frozen robot but most have more. Therefore . ∎

Proof of Theorem 1.

First, Theorem 2 says that our algorithm is -competitive.

Due to Corollary 1 and Lemma 7, we can use Lemma 4 on , with input , integer , and . Then any online algorithm on achieves a competitive ratio of at most . Fix . Since , choose such that . Therefore no algorithm is -competitive on . ∎

Our analysis required trees which have size exponential in , since is doubly exponential in and is singly exponential in . Could there be an algorithm that is on the order of -competitive, for metrics coming from weighted graphs on at most vertices?

6 Acknowledgements

The generalization of the metric in Section 4 to the construction of Section 5 was inspired by a discussion with Yuan Yao. This paper began as a final project in an advanced algorithms course taught by David Karger and Aleksander Madry. We thank them for teaching the course, and for their useful feedback on a draft of this paper. Finally, we thank three peer editors, Leo Castro, Roberto Ortiz, and Tianyi Zeng for their helpful comments on an early draft.

References

  • [1] Esther M Arkin, Michael A Bender, Sándor P Fekete, Joseph SB Mitchell, and Martin Skutella. The freeze-tag problem: how to wake up a swarm of robots. Algorithmica, 46(2):193–221, 2006.
  • [2] Esther M Arkin, Michael A Bender, and Dongdong Ge. Improved approximation algorithms for the freeze-tag problem. In Proceedings of the fifteenth annual ACM symposium on Parallel algorithms and architectures, pages 295–303. ACM, 2003.
  • [3] Mikael Hammar, Bengt J Nilsson, and Mia Persson. The online freeze-tag problem. In Latin American Symposium on Theoretical Informatics, pages 569–579. Springer, 2006.
  • [4] Jochen Könemann, Asaf Levin, and Amitabh Sinha. Approximating the degree-bounded minimum diameter spanning tree problem. Algorithmica, 41(2):117–129, 2005.
  • [5] Zahra Moezkarimi and Alireza Bagheri. A PTAS for geometric 2-FTP. Information Processing Letters, 114(12):670–675, 2014.
  • [6] Marcelo O Sztainberg, Esther M Arkin, Michael A Bender, and Joseph SB Mitchell.

    Analysis of heuristics for the freeze-tag problem.

    In Scandinavian Workshop on Algorithm Theory, pages 270–279. Springer, 2002.
  • [7] Ehsan Najafi Yazdi, Alireza Bagheri, Zahra Moezkarimi, and Hamidreza Keshavarz. An O(1)-approximation algorithm for the 2-dimensional geometric freeze-tag problem. Information Processing Letters, 115(6-8):618–622, 2015.