A Uni(cid:12)ed Framework for Two-g uard Walk Problem

We propose a uniﬁed framework to study the walk problem in a polygonal area by two collaborative guards. A walk is conducted by the two mobile guards on the area’s boundary. They start at an initial boundary point, move along the boundary, and may possibly meet together again at an ending boundary point. It is required that the two guards maintain their mutual visibility at all times. Depending the geometric properties of the polygonal area, a walk may or may not be possible. In this work, three versions of the problem, namely, general polygon walk, room walk and street walk, are characterized in a uniﬁed manner in our framework. One additional merit of our framework is its simplicity. Applications of the walk problem by two guards include military rescue, area exploration, art gallery surveillance, etc.


Introduction
Imagine that two guards walk collaboratively along the boundary of a simple polygon. In order to protect themselves, each guard is equipped with a vision device such that there is always a light beam between them, i.e., the two guards maintain their mutual visibility at all times. This can be implemented by installing a mirror on one guard while the other guard carries a device that can emit a beam and receive it when it is reflected by the mirror. Given a polygon, the two-guard walk problem asks whether it is possible for the two guards to start at a boundary point, walk along on its boundary while maintain their mutual visibility, and eventually meet together again.
Depending on where the two guards start and end their walk, the walk problem has three different versions. A street [6] is a simple polygon with two predetermined vertices, designated as the entrance and exit. The two guards start walking in the opposite directions from the entrance along the boundary, while maintaining their mutual visibility. They may move backward from time to time, as long as each of them does not move beyond the entrance and the exit. The walk completes when they meet at the exit. A street is said to be walkable if it is possible for the two guards to conduct such a walk. Four variations -general walk, straight walk, counter walk, and straight counter walk -in a street are discussed in [6]. The work contains numerous involved and tedious discussions to characterize the walkable streets under each of these variations.
Heffernan [5] propose a linear-time algorithm to check whether a street is walkable, by making use of complex data structures. Tseng et al. [18] consider the problem of finding all the pairs of entrances and exits that can make the respective streets walkable. Bhattacharya et al. [2] come up with an optimal algorithm for the same problem. In [4], Crass et al. study an ∞-searcher in an open-edge "corridor", which uses edges as the entrance and exit. An ∞-searcher has a visibility of 360 o [14].
The two-guard walk problem is also studied in the setting of rooms [11,12]. A room is a simple polygon with a designated point on its boundary, called the door, which is like the entrance in a street walk. However, no exit is predetermined. The two guards start at the door and walk along the room boundary in the opposite directions as in a street walk and eventually meet somewhere again [11]. It is required that no inside intruders shall escape the room through its door. A characterization for walkable rooms is presented in [11,12]. In [3] a lineartime algorithm for checking whether a room is walkable is proposed, based on the characterization in [24], which is equivalent to the one in [11,12]. Zhang and Kameda [23] present how to find all doors in a polygon such that the respective rooms are walkable and the work in [21] improves its complexity. A 1-searcher carries one flashlight to which its vision is restricted, as shown below. Some results in [9,10,15] examine how to search a room by a 1-searcher.
In a more general sense, two-guard walk is one of the variations of the polygon search problems, formulated by Suzuki and Yamashita [14]. A k-searcher is equipped with a vision device that emits k light beams. The pur-234 A Unified Framework for Two-Guard Walk Problem pose of a search is to detect any intruders by eventually illuminating them, if possible. Among those models, there have been results for searching a polygon by a 1-searcher. For instance, a set of forbidden geometric patterns are introduced in [16,17] to determine whether a polygon is 1-searcherable or not. Another set of forbidden patterns are also proposed in [7] for the same problem. LaValle et al. [8] propose an algorithmic approach for deciding searchable polygons by a 1-searcher. Some attempts on the polygon search by two 1-searchers can be found in [13]. Recent work [20] in the general polygon setting follows the same strain of the two-guard walk problem in streets and rooms and examines walks in polygons without any entrance (door) and exit. It presents a set of, though quite complex, forbidden patterns for rendering a polygon to be non-walkable by two guards.
In this work, we study the two-guard problem from a theoretical viewpoint. We tackle the walk problem in general polygons, rooms and streets under a unified framework. By making use of the framework, our characterizations of the three versions of the two-guard walk problem are simple and easy to follow. We also conjecture that such simplicity would lead to complexity gains in some other related issues, such as designing and implementing efficient walk schedules.
The rest of the paper is structured as follows. In Sec. 2, we introduce the notation used throughout the paper and formally define the three versions of the twoguard polygon walk problem, i.e., general walk, room walk, street walk. We also introduce our unified framework, namely, the visibility diagram of a polygon. In Secs. 3, 4, 5, we present characterizations of walkable polygons for the three versions of the walk problem using our framework. Finally in Sec. 6 we summarize our results and discuss some future work. We use Fig. 1 as an illustration. A simple polygon P is defined by a clockwise sequence of distinct vertices numbered 1, 2, · · · , n, (n ≥ 3), and n edges, connecting adjacent vertices. The edge between vertices u and v is denoted by (u, v). The boundary of P , denoted by ∂P , consists of all its vertices and edges. The length of ∂P is denoted as |∂P |, which is the sum of the lengths of the edges on ∂P . (Naturally, we can consider P in a twodimensional Cartesian coordinate system. The length of an edge (u, v) is then defined as the Euclidean distance between vertices u and v.) We consider that ∂P is part of the polygon, i.e., a polygon is composed of its boundary and its interior. The vertices immediately preceding and succeeding vertex v clockwise are denoted by Pred(v) and Succ(v), respectively. For any two points a, b ∈ ∂P , the open and closed portions of ∂P from a to b clockwise are denoted by ∂P (a, b) and ∂P [a, b], respectively.

Notation
In P , a vertex whose interior angle between its two incident edges is more than 180 o is called a reflex vertex. Consider a reflex vertex r. Extend edge (Succ(r), r) toward the interior of P , and let B(r) ∈ ∂P denote the backward extension point, where the extension leaves P for the first time. The polygonal area formed by ∂P [r, B(r)] and the chord rB(r) is called the clockwise component associated with r, and is denoted by C cw (r). Similarly, the extension of (Pred(r), r) determines the forward extension point, F (r), and the counterclockwise component, C ccw (r), associated with r is bounded by ∂P [F (r), r] and the chord rF (r).
Two points, u and v, inside P are said to be mutually visible if the line segment uv is completely contained inside P .

The two-guard walk problem
Consider walking a polygon by two guards and let L and R represent them (See below for more discussions on this.) respectively. We are seeking a time instant (b) For any t ∈ (0, T ), ℓ(t) ̸ = r(t), and ℓ(t) and r(t) are mutually visible.
Functions ℓ(t) and r(t), respectively, represent the positions of L and R on ∂P at t ∈ [0, T ]. Depending on whether we have restrictions or not on ℓ(0) = r(0) (the starting point) and/or ℓ(T ) = r(T ) (the ending point), we have three versions of the two-guard walk problem.
• For a general walk by two guards, there have no restrictions on the starting and ending points of the two guards. If time instant T exists, then we say that polygon P is walkable. In general, the two guards should walk in the opposite directions, though sometimes they may need to reverse their moves. Once they depart at some same starting point, they do not meet again, until, if possible, at an ending point eventually. For this reason, we designate that, when the two guards depart, the first that moves in the clockwise direction is L while the other is R.
• For a room walk by two guards, we require that . L walks along the boundary from d clockwise while R walks from d counter-clockwise. If time instant T exists, we say that the room is walkable. We denote a room with d in polygon P as P (d).
• For a street walk by two guards, we require that ℓ(0) = r(0) = s and ℓ(T ) = r(T ) = g, where s and g are the predetermined entrance and exit, respectively. It is also required that ∂P (s, g) and ∂P (g, s) be weakly mutually visible, i.e., any point on ∂P (s, g) should be visible to at least one point on ∂P (g, s) and vice versa. L walks along ∂P (s, g) clockwise while R walks along ∂P (g, s) counterclockwise. Note that for street walk, there are some other variations, as shall be seen in Sec. 5. Again, if time instant T exists, the street is walkable. We denote by P (s, g) a street with the entrance s and exit g in polygon P .
It is easy to see that in all three versions of the walk problem, for any t ∈ (0, T ), P is partitioned into two portions by the line segment ℓ(t)r(t) (i.e., the light beam between the two guards), such that one of them is always cleared of any intruders while the other is contaminated 1 , i.e., it contains intruders. We call (ℓ(t), r(t)), where t ∈ [0, T ], a walk schedule. Essentially, a walk schedule for the two guards is to enlarge the cleared portion and shrink the contaminated one in polygon P , until the area of the latter becomes zero, i.e., the two guards meet again.

Visibility diagram
Given a polygon P , for two boundary points p and q, we call ⟨p, q⟩ ∈ ∂P × ∂P a configuration [8]. ⟨p, q⟩ is a visible (invisible, resp.) configuration, if p and q are mutually visible (invisible, resp.).
We use x ∈ ℜ 2 to represent a point p(x) ∈ ∂P , which is at distance x − k|∂P | from the origin, where k is an integer such that 0 ≤ x − k|∂P | < |∂P |. According to this, given an x, there exists a k, such that x can be mapped to a point on ∂P . We thus can consider any x ∈ ℜ as representing a point p(x) on ∂P . It should be noted that there are infinitely many real numbers x ∈ ℜ that represent the same point p(x) on ∂P , due to the different values k can take. In the following, we interchangeably use x and p(x) to refer a point on ∂P , if no ambiguity arises. Consider the infinite area between and including the lines y = x (the line S) and y = x − |∂P | (the line G), as shown in Fig. 2 [7,8]. The visibility diagram (VD, for short) of polygon P , denoted as VD P , is drawn by shading some portions in this area gray as follows: the point (x, y) is gray if the configuration ⟨x, y⟩ is invisible. In Fig. 2, we show the gray areas due to reflex vertex r in the polygon in Fig. 1. It is easy to see that the gray areas are caused by reflex vertices, due to which the invisibility in the polygon arises. In Fig. 2, the straightedge sides of the gray areas touch either S or G. We call a gray area that touches S (G, resp.) a northwest barrier (southeast barrier, resp.). Each barrier has four straight sides and a curved side (which is hyperbolic [1]). We also label the tip sides of barriers. As a further example, Fig. 3 (b) shows the visibility diagram for the polygon in Fig. 3 (a). In the diagram, we show vertex labels on lines S and G for easy reference. Note that for a single configuration, there are an infinite number of points in the visibility diagram corresponding to it, as discussed above. That is why the gray areas in the diagram are periodic.
We now relate together the positions of the two guards on the boundary, the configurations, and VD P . Suppose that we move the two guards along the boundary of P . At any time t, L's position ℓ(t) is represented by a real number x (corresponding to a boundary point, as discussed above), measured by the distance from the origin (e.g., vertex 1). So is R's position r(t), y. These two positions can be mapped into a configuration ⟨x, y⟩, which corresponds to the coordinate (x, y), in VD P . On the other hand, if we choose a point in VD P , it then corresponds to a configuration, which designates the current positions of the two guards. Therefore, a point in the visibility diagram uniquely determines the current positions of the two guards on P 's boundary.
The general approach to characterizing walkability in our unified framework is to consider the interactions among barriers in VD P . Note that, since we are presenting our characterization of walkable polygons in term of visibility diagram, though we may still use some polygon-related terms, they should be interpreted in the context of visibility diagram, if not specified otherwise. One such an example is that ∂P (a, b) can be interpreted as the portion from point a to point b on S or G.

Basic geometric patterns
We first identify some basic geometric patterns that are useful in our characterizations. We show their counterparts in VD, which would help us better understand the nature of the walk problem by two guards in poly- Figure 6. A DCPccw.

Traps
Two reflex vertices, {v, u}, form a geometric pattern called a trap, if v / ∈ C cw (u) and u / ∈ C ccw (v), as shown in Fig. 4 (a) 3 . We also show its counterpart in VD in Fig. 4 (b).

Disjoint component pairs
Two reflex vertices u and v form a clockwise disjoint component pair (DCPcw, for short), if C cw (u)∩C cw (v) = ∅. We show in Fig. 5 (a) a DCPcw and in Fig. 5 (b) its counterpart in VD. The intersection between the northwest barrier (southeast barrier, resp.) due to u and the southeast barrier (northwest barrier, resp.) duo to v causes a bridge in VD P . The two bridges caused by a DCPcw repeat periodically. Analogously, two reflex vertices u and v form a counterclockwise disjoint component pair (DPccw, for short), if C ccw (u) ∩ C ccw (v) = 0. Fig. 6 shows a DCPccw and its counterpart in VD. Again, the barriers in a DCPccw cause two bridges.
In the following sections, we present general walk, room walk, and street walk by two guards in a consecutive manner, with more and more restrictions on the starting and ending points of the two guards. 3 Note that it might be true that

General polygon walk by two guards
We first consider general walk in polygon P by making use of VD P 4 . If P is walkable by two guards, then initially ℓ(0) = r(0) and configuration ⟨ℓ(0), r(0)⟩ is a point on S in VD P . When the walk is done, ℓ(T ) = r(T ) and For any t ∈ T , since ℓ(t) and r(t) are mutually visible, the configuration ⟨ℓ(t), r(t)⟩ corresponds to a white point in VD P . All these white points, as time t goes from 0 to T continuously, delineate a continuous path from S to G in some white area in VD P . On the other hand, if there exists such a path, we can then count from time 0 at the configuration on S, map each point on the path to a configuration representing the current positions of the two guards on the boundary, and stop at time T at the configuration on G. All these mean that we have found a walk schedule for the two guards, i.e., the polygon is walkable.

Observation 3.1. Given a polygon P , for general walk, P is walkable by two guards if and only if there exists a path in the white area which connects line S and line G in VD P .
At time 0, the two guards have to start at some same point on ∂P , i.e., ℓ(0) = r(0) ∈ ∂P . We call it the walk starting point (WSP, for short). Beyond this point, the two guards walk along the boundary and, if possible, eventually meet again at a walk ending point (WEP, for short) at time T , i.e., ℓ(T ) = r(T ) ∈ ∂P . Not every boundary point can be used as a WSP or a WEP. In addition, if a WSP is selected, depending on the geometric properties of P , we may have to only select a WEP on some specific boundary portions. Also if we select a WSP, it might be that the two guards cannot finish their walk, though the polygon is walkable.
If P is walkable, i.e., there exists a time instant T , we can let the time count down from T to 0. The following is immediate.

Lemma 3.2. If polygon P is walkable by two guards starting at a WSP and ending at a WEP, it is also walkable starting at the WEP and ending at the WSP.
Before proceeding further, we introduce some useful lemmas related to the simple geometric patterns in Sec. 2.4. In Fig. 4, the northwest barriers from v and u intersect and form a triangular white area bordering S. Any path starting at a point from ∂P (v, u) on S, in order to reach G, has to go across the barriers due to v and u, which make the two guards lose their mutual visibility. The same applies to the triangular white area bordering G as well. Fig. 4 can be used as neither a WSP nor a WEP.

Lemma 3.3. A point on ∂P [v, u] in a trap in
In Fig. 4, each point on ∂P [v, u] is said to be covered by a trap. As for the pattern DCPcw in Fig. 5, we see that any path starting from S at a WSP from ∂P [v, u] must end at a WEP on ∂P [u, v], if the polygon is walkable. The reason is that any path starting from ∂P [v, u] has to stay within the two bridges due to the DCPcw. The same argument applies to the pattern DCPccw in Fig. 6. Fig. 5 Fig. 6

Disjoint component pair couples
Two DCPcws can be coupled together. A DCPcw couple (2DCPcw, for short) consists of three reflex vertices, u, v, and w, such that {u, v} and {u, w} each form a DCPcw, as shown in Fig. 7. A DCPccw couple (2DCPccw, for short) is defined analogously to consist of three reflex vertices, u, v and w, such that {v, u} and {w, u} each form a DCPccw, as shown in Fig. 8. It is obvious that the barriers due to u, v, and w cause some inaccessible area in VD P , as shown by the following lemma. Fig. 7 or a 2DCPccw in Fig. 8. Any point on ∂P [v, w] can be used as neither a WSP nor a WEP.

Lemma 3.5. Suppose that a walkable polygon contains a 2DCPcw in
In Fig. 7 (Fig. 8, resp.), each point on ∂P [v, w] is said to be covered by a 2DCPcw (a DPCccw, resp.). Note that a boundary point can be covered by a trap and a disjoint component pair couple simultaneously.

Patterns τ and reverse-τ
Pattern τ couples a DCPcw, formed by {u, r}, and a trap, formed by {u, v}, as shown in Fig. 9. Similarly, pattern reverse-τ couples a DCPccw and a trap together, as shown in Fig. 10. Figure 10. Pattern reverse-τ .
Lemma 3.6. If polygon P contains a pattern τ or reverse-τ , then it is not walkable.
Proof. We show the situation for pattern τ only, since the one for pattern reverse-τ is similar. From the barriers due to these vertices in VD P in Fig. 9 (b), it is easy to find that no path in the white area in VD P is possible from S to G without crossing barriers.

Characterizing walkable polygons by two guards
In order to make our presentation easier we categorize polygons into two groups, those whose VDs do not contain any bridges, i.e., the polygons do not contain DCPcws and DPccws (Case I) and those whose VDs do (Case II). Consider a polygon that does not contain any DCPcws and DCPccws, i.e., no patterns in Figs. 5, 6, 7, 8, 9, and 10 are present. The only possible ones are those containing traps in Fig. 4. For example, the polygon in Fig. 11 (a) has three traps, namely due to {9, 3}, {3, 6}, and {6, 9}. Due to them, there are contradictory requirements on the WSP and WEP of a walk. Thus the polygon is not walkable. This non-walkability of the polygon is shown clearly in Fig. 11 (b), where all points on both S and G are covered by the three traps.  Proof. The necessity is due to Lemma 3.3. Let us deal with the sufficiency part. In VD P , we pick a boundary p as a WSP that is not covered by any traps. We attempt, in two steps, to construct a path starting at p within the white area in VD P from S to G.

Case I
In Step One, initially starting from p, we extend the path horizontally. Such an extension can be stopped by a northwest barrier from S. (Other situations will be discussed shortly.) We then turn the path downward along the barrier's straight side, as shown in Fig. 12 5 . We keep extending the path along the side. In this process, (1) if we encounter a northwest barrier (as marked by (1)) from S again, this means that the two northwest barriers form a trap by which p is covered, a contradiction; (2) if we encounter a southeast barrier (as marked by (2)), then the two barriers form a bridge, a contradiction again. We should be able to reach the tip side of the northwest barrier. We then let the path follow the tip side. After that, we keep extending the path horizontally again. We then repeat the above process.
In the above process, if the path hits G, then the proof is done, with the path constructed. If the path hits a southeast barrier, we switch to Step Two. See Fig. 12 for the path after the first arrow. We follow the barrier's boundary downward. We keep doing this. We may encounter another barrier. But this barrier must be a southeast one (no bridge in VD P ). We then follow this new barrier's boundary. We may go back to the previous barrier or we may encounter a new barrier again. But we keep the path's extension along the boundaries of those southeast barriers. Since there exists at least one boundary point that is not covered on G, eventually the path is led into that uncovered point. A path from S to G has been just constructed.

Case II
In Case II, a polygon contains DCPcws and/or DCPccws. According to Lemmas 3.4 and 3.4, there are some 5 We only show the parts in VD P that is relevant to our discussions.
restrictions on the WSP and therefore the WEP of a walk.
For a DCPcw, if there exists at least one point on each of the two portions, ∂P (v, u) and ∂P (u, v), that is not covered, we say that the DCPcw is a Path Construction Candidate (PCC for short). We call it a PCC DCPcw. A similar definition also applies to a DCPccw. The intuition behind our proof is to focus the path construction within the area between the two bridges caused by a PCC DCPcw or a PCC DCPccw. Proof. The necessity is due to the fact that, if there is no PCC DCPcw and PCC DCPccw in P , then according to Lemma 3.4, no path construction is possible.
For the sufficiency, we select such a PCC DCPcw (The situation for a PCC DCPccw is similar). Suppose that the PCC DCPcw is the one depicted in Fig. 5. We pick a point p ∈ ∂P (v, u), as a WSP, that is not covered on S. From there, we attempt to construct a path to a point on ∂P (u, v), as a WEP, that is not covered on G. Point p must be above reflex vertex v in VD P . The path construction is conducted in four steps. In Step One, we extend the path from p horizontally. There are two possible situations during this extension to follow afterward.
(1) The path hits a northwest barrier due to a reflex vertex r 1 . We then let the path extend downward along the straight side of the barrier. We claim that the path should be able to reach the tip side of the barrier. We use Fig. 13 as an illustration. During the extension, (i) the path should not hit a northwest barrier due to r 2 again, as shown in Fig. 13 (a), since this means that the two northwest barriers form a trap, by which point p is covered. After the tip side of the northwest barrier due to r 1 is reached, we designate that path follow the boundary of the barrier. We switch to Step Two; (ii) The path might encounter a southeast barrier due to a reflex vertex r 3 above v on its curved side or tip side. For this situation, we let the path extend downward along the boundary of the barrier. We switch to Step Two; (iii) In (ii), the southeast barrier might be due to a reflex vertex r 3 below v. If this happens, we could have another two bridges due to a DCPcw formed by reflex vertices r 1 and r 3 . We then have to consider whether such a DCPcw is PCC or not and whether we need to apply the path construction again. We show this in Fig. 13 (b) for both (ii) and (iii), where the phantom but filled barrier is for (iii). Note that it might be true that reflex vertex r 3 is v itself. Under that situation, we jump to Step Three below directly after the path reaches the tip side of the southeast barrier due to r 3 = v.
(2) The path hits the boundary of a southeast barrier due to a reflex vertex below v, as shown in Fig. 13 (c). For this situation, we let the path extend vertically, until when it hits the curved side or tip side of a northwest barrier (similar to the northwest barrier due to r 1 in (i) in (1)), we switch to Step Two as in (i) in (1), or when it hits a southeast barrier (similar to the southeast barrier due to r 3 in (ii) in (1)), we switch to Step Two as in   Step Two for Case II.
(ii) in (1), or when it hits S again, we restart the path construction with a new p. In Step Two, we trace along the boundaries of all the relevant barriers without leaving them to extend the path, as detailed below. We claim that such a trace should be able to reach the tip side of the southeast barrier due to reflex vertex v. Note that during this extension, all the possible southeast barriers the path might encounter are due to the reflex vertices above v, as explained below, in VD P . Again, we have some situations to consider, as shown in Fig. 14.
(1) The path meets the boundary of a northwest barrier. We continue extending the path along the boundary of the barrier. Any northwest barrier preventing this would mean a trap by which point p is covered, as indicated in Fig. 14 (a).
(2) The path meets the boundary of a southeast barrier due to reflex vertex r 1 . The path should be able to extended to the tip side of this barrier. (i) If the extension is hindered by the northwest barrier due to reflex vertex r 2 in Fig. 14 (b), this means that either the path went across the barrier due to r 2 before, if p is below r 2 in the visibility diagram, or p is covered by a 2DCPcw formed by reflex vertices r 1 , r 2 , and u, if p is above r 2 . Both lead to a contradiction; (ii) The path meets the boundary of a southeast barrier. Such a barrier should be originated from a reflex vertex r 3 below u. However, this means that reflex vertices r 1 and r 3 form a trap, such that the portion from u to v on line G is covered, as shown in Fig. 14 (c), a contradiction to that we are considering a PCC DCPcw.
Going over the situations in (1) and (2) in this step, the path eventually reaches the tip side of the southeast barrier due to v, where we go to Step Three. In Step Three, we extend the path along the boundary of the southeast barrier due to reflex vertex v. Such an extension should reach the tip side of the northwest barrier due to reflex vertex u. (1) It might hit the boundary  of northwest barrier due to a reflex vertex u ′ below u, as shown in Fig. 15 (a). However, this northwest barrier intersect with the southeast barrier due to v. The path extension should be able to go around its tip side and go back to the southeast barrier due to v again. If there is another southeast barrier (due to reflex vertex v ′ , shown as the phantom barrier in Fig. 15 (a)) preventing us from do this, this means that the two reflex vertices u ′ and v ′ form a DCPcw. We need to consider our path construction with this new DCPcw if it is a PCC. It is easy to see that this will not affect our proof, since all the above arguments are still valid. (2) The path might hit the boundary of a southeast barrier due to a reflex vertex r 1 below reflex vertex u. Now the three reflex vertices r 1 , u and v form a pattern τ , a contradiction to the condition 240 A Unified Framework for Two-Guard Walk Problem in the theorem. This is shown in Fig. 15 (b). In Step Four, when the path is at the tip side of the northwest barrier due to u, we let the path extend along the barrier. See Fig. 16. It might hit a northwest barrier originated from a reflex vertex above u in VD P . But this renders no threat, since the path just needs to follow the barrier's boundary. The path might hit a southeast barrier. Again it just follows its boundary. Note that during the extension of the path in Step Four, all the southeast barriers are due to reflex vertices above u but below v on line G. Since we are constructing the path within a PCC DCPcw, the path should be able to reach a point that is not covered on ∂P (u, v) on G. One may argue that, when we extend our path along a southeast barrier due to reflex vertex r 1 , after the path goes around its tip side, it hits a southeast barrier due to reflex vertex r 2 . Suppose that the path has not reached any point that is not covered (since otherwise the path construction is finished). Such a reflex vertex r 2 can only be above u, since otherwise the portion from u to r 1 is covered by the trap formed by reflex vertices r 1 and r 2 . The path so far has not found any point that is not covered and the remaining part is covered by the trap, as indicated by the phantom barrier in Fig. 16. Thus the DCPcw is not a PCC, a contradiction. We can then just let the path follow the boundary of the barriers due to r 1 and r 2 . Eventually it reaches a point on G that is not covered. We have just constructed a path from S to G within some white area in VD P .
The paths we have constructed in the proofs of Theorems 3.7 and 3.8 obviously correspond to walk schedules by the two guards. However, it can be also seen that such a path may have many unnecessary portions. It would be an interesting problem, by making use of the path construction idea in the visibility diagram, to build an "optimal" walk schedule. One optimality criterion could be the minimization of the walk distances by the two guards on the boundary. Another one could be the minimization of the number of turns the two guards need to do, i.e, changing their move direction. Since, when a guard reverses its move directions on the boundary, it consumes its battery energy, such a criterion would be interesting when designing and implementing mobile guards. In addition, we are also working on how to optimally check the walkability for a given polygon, based on the characterization presented here.

Room Walk by two guards
We next consider walk in a room P (d). If P (d) is walkable, then initially ℓ(0) = r(0) = d and the configuration ⟨ℓ(0), r(0)⟩ is at (d, d) on S. When the walk is done, ℓ(T ) = r(T ) and |∂P (ℓ(0), ℓ(T ))| + |∂P (r(T ), r(0))| = ∂P . This means that the configuration ⟨ℓ(T ), r(T )⟩ is on G. For any t ∈ T , ℓ(t) and r(t) are mutually visible, i.e., the configuration ⟨ℓ(t), r(t)⟩ corresponds to a white point in VT P (d) . In addition, since at any time t ∈ (0, T ), d ∈ ∂P [r(t), ℓ(t)], this means that no guard can move across the door at any time. The configuration ⟨l(t), r(t)⟩ is always within the area bounded by x ≥ d and y ≤ d. It is easy to see that this bounded area is triangular. We call it the visibility triangle for P (d) and   denote it by VT P (d) . We also call the left side of VT P (d) LS and the top side TS.
As an example, for the polygon in Fig. 3, if we select vertex 3 as the door, as shown in Fig. 17 (a), then according to the discussions above, VT P (3) is the corresponding visibility triangle originated from vertex 3 in VD P , as shown in Fig. 17 (b).
Within this triangular area, the initial configuration for the two guards ⟨d, d⟩ is the only point on S. We call it the door point. Therefore, we have the following simple observation:

Observation 4.1. A room P (d) is walkable by two guards if and only if there exists a path in VT P (d) that starts at the door point, stays in the white area, and ends on G.
We identify some patterns related to room walk. It is easy to see that many of the following patterns involve those basic patterns in Figs. 4, 5, and 6 in conjunction with the location of the door d. We abuse the notation a little. When the door point is considered, if one of the patterns in Fig. 18 appears in VT P (d), we say that the door point is trapped. For points on G in Fig. 19 (a) The walkability of a room is characterized in the following theorem.

Theorem 4.2. [24] A room P (d) is walkable if and only if the door point is not trapped and there is a point on
Proof. The necessity is obvious, due to Observation 4.1, since we either could not start constructing a path or it Computer Science and Information Technology 3(6): 233-246, 2015 Figure 19. The reflex vertex patterns that cover some portions on G. (2) (1) could not reach G. We next prove the sufficiency. Assume that the point (configuration) on G that is not covered is called g. We will show that, if the conditions of the theorem are satisfied, then we can always construct a path in some white area in VT P (d) that connects the door point to g.
We use Fig. 20 as an illustration for our proof. Note that the visibility diagram in the figure is partial for clear presentation. Suppose that r 1 ≺ cw g ≺ cw r 2 on ∂P , where r 1 and r 2 are two reflex vertices and there is no reflex vertex between r 1 and r 2 . We first extend the path horizontally toward LS, as marked by (1), in Fig. 20. This is the first step of our path construction. In this step, the path may encounter some barriers originated from S or G that hinder it going further horizontally. Here we discuss the case where the path hits a barrier from S. The case for barrier from G can be treated similarly. We know that this barrier cannot intersect the southeast barrier due to r 1 , since otherwise g is covered in VT P (d) . (The two barriers form the pattern shown Fig. 19 (d), where g is inside.) For the same reason, it cannot intersect any southeast barrier due to r ′ , where r ′ ≺ cw r 1 . Furthermore, any northwest barrier originated from S intersecting this barrier would make the door point trapped. We are thus able to extend the path downward along the curved side of the barrier. When the path reaches its tip side, it then resumes going horizontally until it hits the next vertical barrier. Using this argument repeatedly, the path is able to reach LB of VT P (d) eventually.
We then switch to the next step (as marked by (2)). At the beginning of this step, the path is at some point sufficiently close to LB. The path now goes upward along LB. In this process, the path might encounter horizontal barriers. But we first claim that those horizontal barriers should not be originated from G. There are two cases we have to consider here. If it is a leftward bone due to a reflex vertex r ′ originated from S, where r ′ ≺ cw g, the barrier must go across from G to LB in VT P (d) . Since the path is being extended upward, we know that the path should be above the barrier sometime before. This results in a contradiction, since it means that the path has gone across the barrier before. On the other hand, if the leftward bone is due to r ′′ , where t ≺ cw r ′′ , then the fact that this barrier should go across from G to LB means that g is covered, a contradiction again.
For any barrier originated from S, the path can then follow its curved until its tip side. Using the same reasoning as above, we know that this barrier bone cannot intersect any barrier from G, since, if so, the path was already inside the region generated by the two barrier, LB and G, a contradiction to the fact that the path was generated without crossing any barriers. By going around the tip side, the path follows the barrier leftward. Now we consider the barriers originated from S. But any intersection between some of these barriers and the current barrier means that the door point is trapped. So the path will eventually be able to reach LB in VT P (d) again. Repeating this process, the path will finally reach the door point. By reversing the path we just constructed and using the same argument in Lemma 3.2, the theorem follows.
Bhattacharya et al. [3] propose a linear-time algorithm for checking whether a room is walkable, based on the characterization reported as above.

Street walk by two guards
Finally we apply our unified framework to street walk 6 . For convenience, on both ∂P [s, g] and ∂P [g, s], when L and R walk from s to g, if point a is encountered before point b, we say that a is preceding b and denote it as a ≺ b.
In [6], four different variations of street walk by two guards are discussed. We reformat them under the context of our discussions.
Function ell(t) (r(t), resp.) measures that the distance from ℓ(0) (r(0), resp.) to the current position of the guard on L (R, resp.) at time t. It is easy to see that in the general walk and straight walk, the task of the two guards is to push any intruders inside the street from the entrance to the exit, whereas in the counter walk and straight counter walk, the task is to provide a way to separate intruders such that they cannot meet. For all the variations, if at any time t ∈ [0, T ], ℓ(t) and r(t) are mutually visible, we say that P (s, g) is walkable. Previous characterizations [6] of walkable streets under the four different variations are involved. In contrast, by making use of our proposed unified framework, we attempt to reconsider them and obtain the equivalent characterizations in a much simplified way.

Visibility diagram of a street
We reconsider VD P in the context of street walk.
It is obvious that these configurations are confined within a rectangular area in VD P . We call this area the visibility rectangle for street P (s, g) and denote it by VR P (s,g) . For instance, for the polgyon in Fig. 3, if we select vertex 4 as the entrance s and vertex 13 as the exit g, as shown in Fig. 21 (a), then VT P (4,13) is the corresponding visibility rectangle imposed on VD P , as shown in Fig. 21 (b).
The top-left corner of VR P (s,g) corresponds to the configuration ⟨s, s⟩ while the bottom-right corner corresponds to the configuration ⟨g, g⟩. For VR P (s,g) , we call its top side TS, right side RS, bottom side BS, and left side LS.
By abusing the notion, we call a barrier intruding from the TS (originated from line S) a north barrier (NB), a barrier from the BS (from line G) a south barrier (SB), a barrier from the LS (from line S) a west barriers (WB), and a barrier from the RS (from line G) a east barrier (EB). It is easy to see that an NB and an SB never overlap while an EB and a WB never overlap.
Next we interpret street walk in VR P (s,g) using these barriers. In a general walk, the two guards start at time t = 0, where ⟨ℓ(0), r(0)⟩ corresponds to point (s, s) in VR P (s, g). If P (s, g) is walkable, at any time t ∈ (0, T ), ⟨ℓ(t), r(t)⟩ is a visible configuration, which corresponds to a white point in VR P (s,g) . The walk ends at time t = T , where ⟨ℓ(T ), r(T )⟩ is at point (g, g). Imagine that, as time t changes from 0 to T , the points corresponding to ⟨ℓ(t), r(t)⟩ form a continuous path within the white area in VR P (s,g) , which starts at (s, s) and ends at (g, g). Conversely, if there exists such a path in VR P (s, g), then P (s, g) is walkable by the two guards, since any point on the path is corresponding to a visible configuration, which can represent the current positions of the two guards on ∂P [s, g] and ∂P [g, s], respectively. This is the main intuition that we will frequently utilize in our following discussions.
Consider then a straight walk by the two guards, who must not move backward along ∂P [s, g] and ∂P [g, s], i.e., both functions ℓ(·) and r(·) are monotonically increasing. For a straight walkable street, the path must run southeastward (the degenerate cases are the southward and eastward directions) but not in any other directions. As one example, if the path goes northward, it means that the right guard moves backward along ∂P [g, s].
As for a counter walk, the left guard starts at s and ends at g while the right guard starts at g and ends at s. If we interpret this requirement within VR P (s,g) , then a path exists in the white area but starts at the configuration (s, g) and ends at the configuration (g, s). Furthermore, for a straight counter walkable street, the path can run only northeastward (the degenerate cases are the northward and eastward directions) but not in any other directions.

Characterizing walkable streets
In this section, we will derive the characterizations of different variations of street walk by unifying them under the framework of VR P (s,g) . As discussed in above, the street walkability problem amounts to constructing a path in VR P (s,g) .

The general walk and counter walk
We consider the general walk and counter walk together since our arguments for them are similar.  We redraw pattern trap in Fig. 4 in conjunction with the entrance s in Fig. 22 (a), whose VD counterpart is shown in Fig. 22 (b). Within VR P (s, g), if an NB and a WB, due to a trap, intersect, as shown in Fig. 22 (b), we say that they form a northwest cross. If such a cross exists in VR P (s,g) , no path is possible, since, no matter how we extend it, it is confined within the closed area formed by the TS, the LS, and the cross.
Analogously, the exit g may be involved with a trap, as shown in Fig. 23 (a), whose VD counterpart is shown in Fig. 23 (b). If an SB and an EB intersect, they form a southeast cross. Its existence VR P (s,g) results in that a path cannot reach (g, g) because it cannot be extended into the closed area formed by the RS, the BS, and the cross. Proof. The necessity is obvious, according to the above discussions. So we only discuss the sufficiency. We use Fig. 24 as a reference. Within VR P (s,g) , we attempt to construct a path from (s, s). We divide the construction into two steps. In the first step, we extend the path eastward along the TS. There are two cases. The path hits the RS, in which case we switch to the second step, or hit an NB's boundary, in which case the path is extended along it southward (as marked by (1) in the figure).
Such an extension should be able to reach the NB's tip side. We need to consider two situations. (a) It hits a WB's boundary (as marked by (2)). However, this is impossible, because then the NB and WB form a northwest cross; (b) It hits an EB's boundary. We can then continue the extension along the EB's curved side southwestward. We do not need to worry about any NB (as marked by (3)) intersecting with the EB, since this means that the path had been extended into the closed area formed by the TS, the RS, the NB, and the EB. Going around the EB's tip side, we extend the path along the EB's boundary eastward, attempting to reach the previous NB (from (1)). No SB can stop this (as marked by (4)), since if so, there existed a southeast cross. When the path hits the NB's boundary, we extend it southward again.
We may need to repeat the above process, extending the path around the tip sides of some EBs. But eventually, the path should be at the NB's tip side (from (1)). After that, we extend the path eastward, until the path hits the next NB's boundary, in which case we repeat the above process. If it hits an SB's boundary (as marked by (5)), it is extended northwestward along its curved side. Any EB stopping this extension would mean that a southeast cross existed. On the other hand, any WB doing so would mean that the path had been extended into the closed area formed by the LS, the BS, the SB, and the WB. After reaching the SB's tip side, the path is extended again eastward until the next NB or SB. If it hits the RS, we go to the second stage.
We extend the path clockwise, along the RS of VR P (s,g) or the boundaries of EBs, attempting to reach (g, g). The extension is always possible. It may encounter an EB (as marked by (6)). But we can always go around its tip side and follow its boundary clockwise, by the similar reasonings as above. It is impossible to come across any WB. The path just constructed represents a walk schedule for the two guards. As for a counter walk, we need to construct a path connecting between (s, g) to (g, s). Let us call the intersection between an SB and a WB a southwest cross and the intersection between an NB and an EB a northeast cross, as shown in Figs. 25 and 26, respectively. It is easy to see that, this time, s is in conjunction with a DCPccw (Fig. 6) while g is in conjunction with a DCPcw (Fig. 5). Proof. We only discuss the sufficiency. We use Fig. 27 as an illustration. We start a path at (s, g) and extend it northward along the LS until it hits a WB. It then goes northeastward along its curved side. The path will never hit an SB's boundary (as marked by (1)) since this implies the existence of a southwest cross.
The path may come across an NB (as marked by (2)) but should be able to extend along its boundary southward to its tip side. Any WB stopping this (3) would mean that the path had been extended into the closed area surrounding (s, s). No EB intersects the NB, due to the absence of a northeast cross.
Going around the NB's tip side, the path extends along the curved side of the NB toward the curved side of the WB. It is obvious that no EB (4) can prevent this. The path should be able to reach the WB's curved side and then goes along it until the WB's tip side.
After this, the path extends northward, until it hits the next WB, in which case we repeat the above process, or it hits an EB (as marked by (5)). We then argue that the path is able to reach the EB's tip side, since we do not need to worry about any SB preventing this, which would imply that the path had been extended into a closed area surrounding (g, g) before.
The path then extends northward again. Eventually, it reaches the TS or an NB's boundary. In the latter case, we can continue extending it clockwise around the NB's boundary, until it hits the TS again or the next NB's boundary. This is always possible. When the path goes southward to the NB's tip side, no WB can prevent this since it means that the path had been extended into the closed area around (s, s). No EB can prevent the path from going northeastward to reach the TS or the next NB's boundary, due to the absence of any northeast cross. Finally, the path reaches (g, s) and the theorem follows. Let us first consider the straight walk case. For convenience, we will assume that the given street is already determined to be walkable. For a straight walk, the path in VR P (s,g) must only run southeastward but not in any other directions. Consider the relationship between a WB, due to v 1 ∈ ∂P [g, s], and an EB, due to v 2 ∈ ∂P [g, s], where v 1 ≺ v 2 . If the WB's tip side is to the right of the EB's, a path should be at least at the WB's tip side first before going southwestward until the EB's, i.e., function ell(·) is not monotonic, shown in Fig. 28. We say that the WB and EB form a Type-I S-pair, capturing the S-like relationship between their relative locations. Similarly, we say that an NB, due to u 1 ∈ ∂P [s, g], and an SB, due to u 2 ∈ ∂P [s, g], where u 1 ≺ u 2 , form a Type-II S-pair, if the NB's tip side is below the SB's, as shown in Fig. 29. A path has to reach the NB's tip side first and then climb up to the SB's, which means that function r(·) is not monotonic. Proof. The necessity is due to the above discussions. In order to avoid the two barriers in each S-pair, at least one of the functions ℓ(· · · ) and r(·) is not monotonic. For the sufficiency, we start with an empty VR P (s,g) without any barriers. Let us connect (s, s) and (g, g) using a rubber band. We can imagine that the rubber band runs from northwest to southeast. It looks like a strip with the top and bottom borders and has an infinitely small width. We add NBs, EBs, SBs, and WBs, in that order, to it. Consider an NB we are adding in. It may or may not touch the rubber band at its tip side. If it does, it must be at the tip side's left end point and there is a right angle between the rubber band and its tip side. This is shown in Fig. 30. After adding some NBs, a new NB may only make the rubber band protrude further south.

The straight walk and straight counter walk
We then continue by adding EBs. An EB may protrude the rubber band further west. If there is a touch between the rubber band and an EB's tip side, the touching point must be the bottom end point of the tip side, as shown in Fig. 30. Note that the addition of an EB may make the rubber band detach from an NB's tip side.
The only possibility that the rubber band may change its direction is where it touches an NB's or an EB's tip side. Since the tip side from NBs and EBs only touch the top border of the rubber band, no matter how we add those barriers, they can only protrude the rubber band further south and west but keep its general direction running southeastward.
The key observation is that the only way to change the rubber band's direction from southeastward to north-eastward or to southwestward is to protrude it from the band's bottom border. In particular, to change its direction to northeastward requires that the rubber band touch tightly both end points of an NB's tip side. Similarly, to change to southwestward requires that it touch tightly both end points of an EB's tip side. In both situations, the street is not straight walkable.
With this observation, we continue adding SBs and WBs. An SB may protrude the rubber band north while a WB may protrude it further east. Suppose that the street was not straight walkable. Then we must have situations observed above, i.e., (a) the rubber band goes tight around an NB's tip side; and/or (b) the rubber band goes tight around an EB's tip side.
If the situation (a) happens, it means that there must exist an SB whose tip side is higher than an NB's, i.e., a Type-II S-pair existed. This leads to a contradiction. Note that a WB cannot make this happen. The protruding from a WB can only possibly make smaller the angle between the rubber band and an NB's tip side, because of the absence of a northwest cross. As for the situation (b), there then must exist a WB whose tip side is to the right of an EB's, which means that a Type-I S-pair was present. Similarly, the protruding from an SB can only make smaller the angle between the rubber band and an EB's tip side, due to the absence of a southeast cross.
Changing the order of adding barriers to VR P (s,g) does not affect our analysis, since we are given a walkable street and the only possible way to change the rubber band's direction is to have opposite protrudings on its two borders.
After adding all the barriers, the rubber band delineates a path whose general direction runs only southeastward from (s, s) to (g, g), which completes the proof. We now consider the straight counter walk and assume that the street is counter walkable. Let us introduce another two types of S-pairs. Consider a WB, due to v 1 ∈ ∂P (g, s), and an EB, due to v 2 ∈ ∂P (g, s), where v 1 ≺ v 2 . If the EB's tip side is to the left of the WB's, we say that the two barriers form a Type-III S-pair of barriers, as shown in Fig. 31. Any path to be constructed from (s, g) to (g, s) must reach the WB's tip side before turning northwestward to reach the EB's, i.e., function ℓ(·) is not monotonically increasing. Similarly, consider an SB, due to u 1 ∈ ∂P (s, g), and an NB, due to u 2 ∈ ∂P (s, g), where u 1 ≺ u 2 . If the SB's tip side is above the NB's, we say that the SB and the NB form a Type-IV S-pair, as in Fig. 32, due to which any path has to reach the SB's tip side before going southeastward to the NB's. Function r(·) is non-monotonic. Proof. We only sketch the proof for the sufficiency, since it is similar to the one for Theorem 5.3. Let us first connect (s, g) and (g, s) using a rubber band within VR P (s,g) . The rubber band runs from southwest to northeast and has an infinitely small width.
We first add NBs, which may touch the rubber band and stretch it further south. Note that an NB's tip side touches the rubber band, if there is any, at its right end point. Next we add EBs. Those barriers may protrude the rubber band further west. Since the street is counter walkable (thus no northeast cross is present), the protruding can only reduce the angle between the rubber band and the NB's tip side.
We then add SBs and WBs. When the rubber band touches the right end point of the tip side of an NB (say, due to u 2 ), in order to change its direction to southeast, it has to go tight around the tip side. The only situation that can make this happen is where the tip side of an SB (say, due to u 1 , where u 1 ≺ u 2 ) is above the NB's, protruding the rubber band north and making it tight around the NB's tip side, i.e., there was a Type-IV Spair present, a contradiction.
There could be impacts from WBs on the touching between the rubber band and an EB's tip side. If there is a touch between the rubber band and an EB (due to v 1 ), it must happen at the top end point of the EB's tip side. For the running direction of the rubber band to change to northwest, the rubber band has to go tight round the tip side. This only happens when there is a WB (due to v 2 , where v 1 ≺ v 2 ) whose tip side is to the right of the EB's, protruding the rubber band east and making it tight around the EB's tip side. In this situation, a Type-III S-pair existed, i.e., function ℓ(·) was not monotonic, a contradiction again.
It can be easily checked that the characterizations regarding the four variations of street walk, i.e., Theorems 5.1, 5.2, 5.3, and 5.4, are equivalent to the ones in [6]. Furthermore, Heffernan [5] propose a linear-time algorithm to check whether a street is walkable under the four variations.

Conclusion
We have presented a unified framework for characterizing different versions of the two-guard walk problem.
As shown in our discussions, the merit of our characterizations is their simplicity, in contrast to the previous tedious ones. We conjecture that this simplicity may shed light on some other related issues, such as constructing optimal walk schedules for guards, conducting on-line walks, and so on.
Our near future work along this direction includes generating optimal walk schedules, applying the framework to other polygon walk problems, and etc.