On Fence Patrolling by Mobile Agents

Suppose that a fence needs to be protected (perpetually) by $k$ mobile agents with maximum speeds $v_1,\ldots,v_k$ so that no point on the fence is left unattended for more than a given amount of time. The problem is to determine if this requirement can be met, and if so, to design a suitable patrolling schedule for the agents. Alternatively, one would like to find a schedule that minimizes the \emph{idle time}, that is, the longest time interval during which some point is not visited by any agent. We revisit this problem, introduced by Czyzowicz et al.(2011), and discuss several strategies for the cases where the fence is an open and a closed curve, respectively. In particular: (i) we disprove a conjecture by Czyzowicz et al. regarding the optimality of their Algorithm ${\mathcal A_2}$ for unidirectional patrolling of a closed fence; (ii) we present an algorithm with a lower idle time for patrolling an open fence, improving an earlier result of Kawamura and Kobayashi.


Introduction
A set of k mobile agents with (possibly distinct) maximum speeds v i (i = 1, . . . , k) are in charge of guarding or in other words patrolling a given region of interest. Patrolling problems find applications in the field of robotics where surveillance of a region is necessary. An interesting one-dimensional variant have been introduced by Czyzowicz et al. [7], where the agents move along a rectifiable Jordan curve representing a fence. The fence is either a closed curve (the boundary of a compact region in the plane), or an open curve (the boundary between two regions). For simplicity (and without loss of generality) it can be assumed that the open curve is a line segment and the closed curve is a circle. The movement of the agents over the time interval [0, ∞) is described by a patrolling schedule, where the speed of the ith agent, a i (i = 1, . . . , k), may vary between zero and its maximum value v i in any of the two moving directions (left or right).
Given a closed or open fence of length and maximum speeds v 1 , . . . , v k > 0 of k agents, the goal is to find a patrolling schedule that minimizes the idle time I, defined as the longest time interval in [0, ∞) during which a point on the fence remains unvisited, taken over all points. A straightforward volume argument [7] yields the lower bound I ≥ / k i=1 v i for an (open or closed) fence of length . A patrolling algorithm computes a patrolling schedule for a given fence and set of speeds v 1 , . . . , v k > 0.
For an open fence (line segment), Czyzowicz et al. [7] proposed a simple partitioning strategy, algorithm A 1 , where each agent moves back and forth perpetually in a segment whose length is proportional with its speed. Specifically, for a segment of length and k agents with maximum speeds v 1 , . . . , v k , algorithm A 1 partitions the segment into k pieces of lengths v i / k j=1 v j , and schedules the ith agent to patrol the ith interval with speed v i . Algorithm A 1 has been proved to be optimal for uniform speeds [7], i.e., when all maximum speeds are equal. Algorithm A 1 achieves an idle time 2 / k i=1 v i on a segment of length , and so A 1 is a 2-approximation algorithm for the shortest idle time. It has been conjectured [7, Conjecture 1] that A 1 is optimal for arbitrary speeds, however this was disproved by Kawamura and Kobayashi [9]: they selected speeds v 1 , . . . , v 6 and constructed a schedule for 6 agents that achieves an idle time of 41 42 2 / k i=1 v i . A patrolling algorithm A is universal if it can be executed with any number of agents k and any speed setting v 1 , . . . , v k > 0 for the agents. For example, A 1 above is universal, however certain algorithms (e.g., algorithm A 3 in Section 3 or the algorithm in Section 4) can only be executed with certain speed settings or number of agents, i.e., they are not universal.
For the closed fence (circle), no universal algorithm has been proposed to be optimal. For uniform speeds (i.e., v 1 = . . . = v k = v), it is not difficult to see that placing the agents uniformly around the circle and letting them move in the same direction yields the shortest idle time. Indeed, the idle time in this case is Let r, 1 ≤ r ≤ k, be an index such that max 1≤i≤k iv i = rv r . Place the agents at equal distances of 1/r around the circle, so that each moves clockwise at the same speed v r . Discard the remaining agents, if any. Since all agents move in the same direction, we also refer to A 2 as the "runners" algorithm. It achieves an idle time of 1/ max 1≤i≤k iv i [7, Theorem 2]. Observe that A 2 is also universal.
Historical perspective. Multi-agent patrolling is a variation of the fundamental problem of multi-robot coverage [4,5], studied extensively in the robotics community. A variety of models has been considered for patrolling, including deterministic and randomized, as well as centralized and distributed strategies, under various objectives [1,8]. Idleness, as a measure of efficiency for a patrolling strategy, was introduced by Machado et al. [10] in a graph setting; see also the article by Chevaleyre [4].
The closed fence patrolling problem is reminiscent of the classical lonely runners conjecture, introduced by Wills [11] and Cusick [6], independently, in number theory and discrete geometry. Assume that k agents run clockwise along a circle of length 1, starting from the same point at time t = 0. They have distinct but constant speeds (the speeds cannot vary, unlike in the model considered in this paper). A runner is called lonely when he/she is at distance of at least 1 k from any other runner (along the circle). The conjecture asserts that each runner a i is lonely at some time t i ∈ (0, ∞). The conjecture has only been confirmed for up to k = 7 runners [2,3]. We use position-time diagrams to plot the agent trajectories with respect to time. One axis represents the position f i (t) of the agents along the fence and the other axis represents time. In Fig. 1, for instance, the horizontal axis represents the position of the agents along the fence and the vertical axis represents time. In Fig. 2, however, the vertical axis represents the position and the vertical axis represents time. A schedule with idle time I is equivalent to a covering problem in such a diagram (see Fig. 1). For a straight-line (i.e., constant speed) trajectory between points (x 1 , y 1 ) and (x 2 , y 2 ) in the diagram, construct a shaded parallelogram with vertices, (x 1 , y 1 ), (x 1 , y 1 + I), (x 2 , y 2 ), (x 2 , y 2 + I), where I denotes the desired idle time and the shaded region represents the covered region. In particular, if an agent stays put in a time-interval, the parallelogram degenerates to a vertical segment. A schedule for the agents ensures idle time I if and only if the entire area of the diagram in the time interval [I, ∞) is covered.
To evaluate the efficiency of a patrolling algorithm A, we use the ratio ρ = idle(A)/idle(A 1 ) between the idle times of A and the partition-based algorithm A 1 . Lower values of ρ indicate better (more efficient) algorithms. Recall however that certain algorithms can only be executed with certain speed settings or number of agents.
We write H n = n i=1 1/i for the nth harmonic number. Our results.
1. Consider the unidirectional unit circle (where all agents are required to move in the same direction).
(i) We disprove a conjecture by Czyzowicz et al. [7,Conjecture 2] regarding the optimality of Algorithm A 2 . Specifically, we construct a schedule for 32 agents with harmonic speeds v i = 1/i, i = 1, . . . , 32, that has an idle time strictly less than 1. In contrast, Algorithm A 2 yields a unit idle time for harmonic speeds (idle(A 2 ) = 1), hence it is suboptimal. See Theorem 1, Section 2.
(ii) For every τ ∈ (0, 1] and t ≥ τ , there exists a positive integer k = k(t) ≤ e 4t/τ 2 and a schedule for the system of k agents with harmonic speeds v i = 1/i, i = 1, . . . , k, that ensures an idle time at most τ during the time interval [0, t]. See Theorem 2, Section 2.

2.
Consider the open fence patrolling. For every integer x ≥ 2, there exist k = 4x+1 agents with k i=1 v i = 16x + 1 and a guarding schedule for a segment of length 25x/3. Alternatively, for every integer x ≥ 2 there exist k = 4x+1 agents with suitable speeds v 1 , . . . , v k , and a guarding schedule for a unit segment that achieves idle time at most 48x+3 In particular, for every ε > 0, there exist k agents with suitable speeds v 1 , . . . , v k , and a guarding schedule for a unit segment that achieves idle time at most 24 . This improves the previous bound of 41 by Kawamura and Kobayashi [9]. See Theorem 3, Section 4.
3. Consider the bidirectional unit circle.
(i) For every k ≥ 4, there exist maximum speeds v 1 ≥ v 2 ≥ . . . ≥ v k and a new patrolling algorithm A 3 that yields an idle time better than that achieved by both A 1 and A 2 . In particular, for large k, the idle time of A 3 with these speeds is about 2/3 of that achieved by A 1 and A 2 . See Proposition 1, Section 3.
(ii) For every k ≥ 2, there exist maximum speeds v 1 ≥ v 2 ≥ . . . ≥ v k so that there exists an optimal schedule (patrolling algorithm) for the circle that does not use up to k − 1 of the agents a 2 , . . . , a k . In contrast, for a segment, any optimal schedule must use all agents. See Proposition 2, Section 3.

Unidirectional Circle Patrolling
A counterexample for the optimality of algorithm A 2 . We show that Algorithm A 2 by Czyzowicz et al. [7] for unidirectional circle patrolling is not always optimal. We consider agents with harmonic speeds v i = 1/i, i ∈ N. Obviously, for this setting we have idle(A 2 ) = 1, which is already achieved by the agent a 1 with the highest (here unit) speed. We design a periodic schedule (patrolling algorithm) for k = 32 agents with idle time I < 1. In this schedule, agent a 1 moves continuously with unit speed, and it remains to schedule agents a 2 , . . . , a 32 such that every point is visited at least one more time in the unit length open time interval between two consecutive visits of a 1 . We start with a weaker claim, for closed intervals but using only 6 agents.
For each critical point (t, x), we assign one, two, or four agents such that they jointly traverse a small neighborhood of the critical point in each period in the periodic schedule.
We schedule agents a 7 and a 8 to move continuously with speed 1/8, as follows.
Agents This schedule ensures that every point on the fence within a small neighborhood of the 12 critical points is visited by some agent within every time interval of length 1 − ε, where ε > 0 is a sufficiently small constant. Apart from these neighborhoods, the first 6 agents already visit every point within every time interval of length 1 − ε if ε > 0 is sufficiently small.
Remark. In Theorem 1, we required that all agents move in the same direction (clockwise) along the unit circle, but we allowed agents to stop (i.e., have zero speed). If all agents are required to maintain a strictly positive speed, the proof of Theorem 1 would still go through: in this case, agents a 3 , a 5 and a 6 could move at an extremely slow but positive speed instead of stopping. As a result, some points at the neighborhoods of the 12 critical points would remain unvisited for 1 unit of time (this frequency is maintained by agent a 1 alone). However, agents a 7 , . . . , a 32 would still ensure that every point in these neighborhoods is also visited within every time interval of length 1 − ε.
Finite time patrolling. Interestingly enough, we can achieve any prescribed idle time below 1 for an arbitrarily long time in this setting, provided we choose the number of agents k large enough. Proof. We construct a schedule with an idle time at most τ . Let agent a 1 start at time 0 and move clockwise at maximum (unit) speed, i.e., a 1 (t) = t mod 1 denotes the position on the unit circle of agent a 1 at time t. Assume without loss of generality that t is a multiple of τ , i.e., t = mτ , where m is a natural number. Divide the time interval [0, t] into 2m subintervals of length τ /2. For j = 1, . . . , 2m, [(j − 1)τ /2, jτ /2] is the jth interval.
For each j, cover the unit circle C so that every point of C is visited at least once by some agent. This ensures that each point of the circle is visited at least once in the time interval [0, τ /2] and no two consecutive visits to any one point are separated in time by more than τ thereafter until time t, as required.
To achieve the covering condition in each interval j, we use the first agent (a 1 , of unit speed), and as many other unused agents as needed. The 'origin' on C is reset to the current position of a 1 at time (j − 1)τ /2, i.e., the beginning of the current time interval. So the fastest agent is used (continuously) in all 2m time intervals. Agent a 1 can cover a distance of τ /2 during one interval. From its endpoint, at time (j − 1)τ /2, start the unused agent with the smallest index, say i 1 (j); this agent can cover a distance of τ 2 1 i 1 (j) during the interval. Continue in the same way using new agents, all starting at time (j − 1)τ /2, until the entire circle C is covered; let the index of the last agent used be i 2 (j). The covering condition can be written as: For example, if τ = 2/3: j = 1 requires agents a 1 through a 11 , since H 11 ≥ 3, but H 10 < 3; j = 2 requires agents a 1 and agents a 12 through a 85 , since 1 + (H 85 − H 11 ) ≥ 3, but 1 + (H 84 − H 11 ) < 3. We now bound from above the total number k of distinct agents used i.e., with speeds 1/i, for i = 1, . . . , k. Observe that the covering condition (1) may lead to overshooting the target. Because the harmonic series has decreasing terms, the overshooting error cannot exceed the term 1 i 2 (1)+1 for τ = 1, namely 1/5 (the overshooting for τ = 1 is only 1 3 − 1 4 = 1 12 < 1 5 ). So inequality (1) becomes Recall that t = mτ . By adding inequality (2) over all 2m time intervals yields (in equivalent forms) For t ≥ τ we have 1 ≤ 8t 5τ . Since ln k ≤ H k , it follows from (3) that as required.

Bidirectional Circle Patrolling
A new schedule for closed fence patrolling. Czyzowicz et al. [7,Theorem 5] showed that for k = 3 there exist maximum speeds v 1 , v 2 , v 3 and a schedule that achieves a shorter idle time than both algorithm A 1 and A 2 , namely 35/36 versus 12/11 and 1. We extend this result for all k ≥ 4. We propose a new algorithm, A 3 for maximum speeds v 1 ≥ v 2 ≥ . . . ≥ v k > 0, and then show that A 3 outperforms both A 1 and A 2 for some speed settings for all k ≥ 4.
We will need v 1 > v 2 in this algorithm. Place the k − 1 agents a 2 , . . . , a k at equal distances, x on the unit circle, and let them move all clockwise perpetually at the same speed v k ; we say that a 2 , . . . , a k make a "train". Let a 1 move back and forth (i.e., clockwise and counterclockwise) perpetually on the moving arc of length 1 − (k − 2)x, i.e., between the start and the end of the train. Refer to Fig. 3.

Proposition 1.
For every k ≥ 4, there exist maximum speeds v 1 > v 2 ≥ . . . ≥ v k such that algorithm A 3 achieves a shorter idle time than A 1 and A 2 . In particular, for large k, the idle time achieved by the train algorithm is about 2/3 of those achieved by A 1 and A 2 .
Proof. Consider the speed setting v 1 = a, v 2 = . . . = v k = b, where a > b > 0, and max 1≤i≤k iv i = kb (i.e., a ≤ kb). Put y = 1 − (k − 2)x. To determine the idle time, x/b, write: Solving for x/b yields For our speed setting, we also have In particular, for a = 1, and b = 1/k (note that a ≤ kb), we have Useless agents for circle patrolling. Czyzowicz et al. [7] showed that for k = 2 there are maximum speeds for which an optimal schedule does not use one of the agents. Here we extend this result for all k ≥ 2: and an optimal schedule for the circle with these speeds that does not use up to k − 1 of the agents a 2 , . . . , a k .
(ii) In contrast, for a segment, any optimal schedule must use all agents.
Proof. (i) Let v 1 = 1 and v 2 = . . . = v k = ε/k, for a small positive ε ≤ 1/300, and C be a unit circle. Obviously by using agent a 1 alone (moving perpetually clockwise) we can achieve unit idle time. Assume for contradiction that there exists a schedule achieving an idle time less than 1. Let a 1 (t) = t mod 1 denote the position of agent a 1 at time t. Assume without loss of generality that a 1 (0) = 0 and consider the time interval [0, 2]. For 2 ≤ i ≤ k, let J i be the interval of points visited by agent a i during the time interval [0, 2], and put J = ∪ k i=2 J i . We have |J i | ≤ 2ε/k, thus |J| ≤ 2ε. We make the following observations: Pick three points x 1 , x 2 , x 3 ∈ C \J close to 1/4, 2/4, and 3/4, respectively, i.e., |x i −i/4| ≤ 1/100, for i = 1, 2, 3. By Observations 2 and 4, these three points must be visited by a 1 in the first two rotations during the time interval [0, 2] in the order x 1 , x 2 , x 3 , x 1 , x 2 , x 3 . Since a 1 has unit speed, successive visits to x 1 are separated in time by at least one time unit, contradicting the assumption that the idle time of the schedule is less than 1.
(ii) Given v 1 ≥ v 2 ≥ . . . ≥ v k > 0, assume for contradiction that there is an optimal guarding schedule with unit idle time for a segment s of maximum length that does not use agent a j (with maximum speed v j ), for some 1 ≤ j ≤ k. Extend s at one end by a subsegment of length v j /2 and assign a j to this subsegment to move back and forth from one end to the other, perpetually. We now have a guarding schedule with unit idle time for a segment longer than s, which is a contradiction.
Overtaking other agents. Consider an optimal schedule for circle patrolling (with unit idle time) for the agents in the proof of Proposition 2, with v 1 = 1 and v 2 = . . . = v k = ε/k, in which all agents move clockwise at their maximum speeds. Obviously a 1 will overtake all other agents during the time interval [0, 2]. Thus there exist settings in which if all k agents are used by a patrolling algorithm, then some agent(s) need to overtake (pass) other agent(s). Observe however that overtaking can be easily avoided in this setting by not making use of any of the agents a 2 , . . . , a k .

An Improved Idle Time for Open Fence Patrolling
Kawamura and Kobayashi [9] showed that algorithm A 1 by Czyzowicz et al. [7] does not always produce an optimal schedule for open fence patrolling. They presented two counterexamples: their first example uses 6 agents and achieves an idle time of 41 42 idle(A 1 ); their second example uses 9 agents and achieves an idle time of 99 100 idle(A 1 ). By replicating the strategy from the second example with a number of agents larger than 9, i.e., iteratively using blocks of agents, we improve the ratio to 24/25 + ε for any ε > 0. We need two technical lemmas to verify this claim.
Lemma 2. Consider a segment of length L = 25 3 such that three agents a 1 , a 2 , a 3 are patrolling perpetually each with speed of 5 and generating an alternating sequence of uncovered triangles T 2 , T 1 , T 2 , T 1 , . . ., as shown in the position-time diagram in Fig. 4. Denote the vertical distances between consecutive occurrences of T 1 and T 2 by δ 12 and between consecutive occurrences of T 2 and T 1 by δ 21 . Denote the bases of T 1 and T 2 by b 1 and b 2 respectively, and the heights of T 1 and T 2 by h 1 and h 2 respectively. Then   Proof. (i) In Fig. 5 (left), tan α = 1/s 1 , and solving for s 2 , we get s 2 = h 3b/2+y−1 .
Theorem 3. For every integer x ≥ 2, there exist k = 4x + 1 agents with k i=1 v i = 16x + 1 and a guarding schedule for a segment of length 25x/3. Alternatively, for every integer x ≥ 2 there exist k = 4x + 1 agents with suitable speeds v 1 , . . . , v k , and a guarding schedule for a unit segment that achieves idle time at most 48x+3 50x 2 k i=1 v i . In particular, for every ε > 0, there exist k agents with suitable speeds v 1 , . . . , v k , and a guarding schedule for a unit segment that achieves idle time at most 24 25 + ε Proof. Refer to Fig. 6. We use a long fence divided into x blocks; each block is of length 25/3. Each block has 3 agents each of speed 5 running in zig-zag fashion. Consecutive blocks share one agent of speed 1 which covers the uncovered triangles from the trajectories of the zig-zag agents in the position-time diagram. The first and the last block use two agents of speed 1 not shared by any other block. The setting of these speeds is explained below. From Lemma 2(ii), we conclude that all the uncovered triangles generated by the agents of speed 5 are congruent and their base is b = 1/3 and their height is h = 5/6. By Lemma 3(i), we can set the speeds of the agents not shared by consecutive blocks to s 1 = 5/6 1−1/6 = 1. Also, in our strategy, Lemma 2(ii) yields y = δ = 4/3. Hence, by Lemma 3(ii), we can set the speeds of the agents shared by consecutive blocks to s 2 = 5/6 1/2+4/3−1 = 1. In our strategy, we have 3 types of agents: agents running with speed 5 as in Fig. 6 (top), unit speed agents not shared by 2 consecutive blocks and unit speed agents shared by two consecutive blocks as in Fig. 6 (middle). By Lemma 2(i), the agents of first type have period 10/3. In Fig. 6 (middle), there are two agents of second type and both have a similar trajectory. Thus, it is enough to verify for the leftmost unit speed agent. It takes 5/6 time from A to B and again 5/6  Figure 6: Top: iterative construction with 5 blocks; each block has three agents with speed 5. Middle: six agents with speed 1. Bottom: patrolling strategy for 5 blocks using 21 agents for two time periods (starting at t = 1/3 relative to Fig. 4); the block length is 25/3 and the time period is 10/3. time from B to C. Next, it waits for 5/3 time at C. Hence after 5/6 + 5/6 + 5/3 = 10/3 time, its position and direction at D is same as that at A. Hence, its time period is 10/3. For the agents of third type, refer to Fig. 6 (middle): it takes 10/6 time from E to F and 10/6 time from F to G. Thus, arguing as above, its time period is 10/3. Hence, overall, the time period of the strategy is 10/3. For x blocks, we use 3x+(x+1) = 4x+1 agents. The sum of all speeds is 5(3x)+1(x+1) = 16x+1 and the total fence length is 25x 3 . The resulting ratio is ρ = 16x+1 2 / 25x 3 = 48x+3 50x . For example, when x = 2 we reobtain the bound of Kawamura and Kobayashi [9] (from their 2nd example), when x = 39, ρ = 100 104 and further on, ρ −→ x→∞ 24 25 . Thus an idle time of at most 24 25 + ε can be achieved for every given ε > 0, as required.