Optimal Motion Planning for Two Square Robots in a Rectilinear Environment
Abstract
Let be a rectilinear polygonal environment (that is, a rectilinear polygon potentially with holes) with a total of vertices, and let be two robots, each modeled as an axis-aligned unit square, that can move rectilinearly inside . The goal is to compute an optimal collision-free motion plan for and between a given pair of source and target configurations. We study two variants of this problem and obtain the following results.
-
Min-Sum: Here the goal is to compute a motion plan that minimizes the sum of the lengths of the paths of the robots. We present an -time algorithm for computing an optimal solution to the min-sum problem. This is the first polynomial-time algorithm to compute an optimal, collision-free motion of two robots amid obstacles in a planar polygonal environment.
-
Min-Makespan: Here the robots can move with at most unit speed, and the goal is to compute a motion plan that minimizes the maximum time taken by a robot to reach its target location. We prove that the min-makespan variant is NP-hard.
Keywords and phrases:
Computational geometry, motion planning, multiple robots, rectilinear pathsFunding:
Pankaj K. Agarwal: Supported by NSF grants CCF-20-07556, CCF-22-23870, and IIS-24-02823, and by the Binational Science Foundation Grant 2022131.Copyright and License:
![[Uncaptioned image]](x1.png)
Martijn Struijs; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithmsEditors:
Oswin Aichholzer and Haitao WangSeries and Publisher:

1 Introduction
A wide range of applications have led to extensive work on designing efficient algorithms for computing high-quality motion plans in a structured or an unstructured environment for a system of robots; see e.g. [7, 45] for recent surveys. Several criteria have been proposed to measure the quality of a motion plan, including the total length of the robot paths, the makespan (i.e., the maximum time taken by a robot to complete its motion), and the utility of the plan (i.e., how well it performs the underlying task). Already for two simple robots, such as unit squares or disks, translating in a planar polygonal environment, little is known about computing an optimal motion plan. Although polynomial-time algorithms are known for computing a collision-free motion plan of two simple robots [8, 35], no polynomial-time algorithm is known for computing a plan such that the sum (or the maximum) of the path lengths of the two robots is minimized, nor is the problem known to be NP-hard. In this paper we study the problem of computing an optimal motion plan for two simple robots, each modeled as a unit square.
Problem statement.
Let denote the axis-aligned square of unit side length – referred to as a unit square for short – centered at the origin. Let and be two robots, each modeled as a unit square, that can translate inside the same closed rectilinear polygonal environment . In other words, the shared workspace is a rectilinear polygon, possibly with holes. Let be the number of vertices of . A placement of (and, similarly, of ) is represented by the position of its center in the workspace . For such a placement to be free of collision with the boundary of , the representing point should be at -distance at least from . (Note that the robot is allowed to touch an obstacle, since we define to be a closed set.) We let denote the free space of a single robot, which is the subset of consisting of all collision-free placements. A (joint) configuration of and is represented as a pair , where and are the placements of and , respectively. The configuration space, called C-space for short, is the set of all configurations, and is thus represented as . A configuration is called free if and . Let denote the four-dimensional free space, comprising the set of all free configurations.
Let be a given source configuration and let be a given target configuration. An -plan is a continuous function , for some , with and . The image of is a continuous curve in the C-space, referred to as an -path. With a slight abuse of notation, we use to denote its image as well. If we say that is feasible, and if there exists a feasible -plan we say that the pair is reachable. For a plan , let and be the projections of onto the two-dimensional plane spanned by the first two coordinates and the last two coordinates, respectively. The functions and specify the motions of and that induces, that is, for all . Again, with a slight abuse of notation, we also use and to denote the paths followed by and , respectively. We define two versions of optimal motion planning.
-
Min-Sum. For a path in , let denote its -length. We define , the cost of an -plan , by , that is, is the sum of the -lengths of the paths of the two robots. The problem is to decide whether a given pair is reachable, and, if so, compute a minimum-cost feasible -plan. As explained later, we can restrict our attention to rectilinear paths because we work with the -metric inside a rectilinear environment.
-
Min-Makespan. We define the makespan of an -plan , denoted by , to be . The problem is to decide for a given pair if is reachable and, if so, compute a feasible -plan that minimizes the makespan under the condition that the maximum speed of each robot is at most 1. Note that we do not require the -plan to be continuous, so the speed of or may instantaneously change from to , and the robots may take sharp turns.
Both variants of the optimal motion planning problem are interesting in their own right. The first minimizes the total work done by the robots, while the second minimizes the total time taken until both robots have reached their destination.
Related work.
It is beyond the scope of this paper to review the known results on motion-planning algorithms; for an overview of key results, we refer the reader to recent books and surveys on the topic [22, 23, 30, 31, 7, 33]. We mention here only a small sample of results – ones that are most closely related to the problem at hand.
Computing an optimal motion plan for a single translating square robot, or more generally for a single convex polygonal translating robot with a constant number of vertices, is equivalent – through C-space formulation – to computing a shortest path for a point robot amid polygonal obstacles with vertices, and it can be solved in time [16, 25, 44]. If the robot is allowed to rotate, the problem becomes much harder and it is NP-hard in some cases [10, 9, 34, 1]. Computing the shortest path for a point robot amid polyhedral obstacles in is NP-hard [15], and fast -approximation algorithms are known [17, 5].
Computing a feasible (not necessarily optimal) plan for a team of translating unit square robots in a polygonal environment is PSPACE-hard [38]; see [13, 14, 24, 26, 41, 46] for related intractability results. Notwithstanding a rich literature [18, 33, 36, 42, 43] on multi-robot motion planning, little is known about algorithms for computing plans with provable quality guarantees. Even in the absence of obstacles, computing the min-sum motion plan for two unit squares/disks is non-trivial under the -metric [21, 29]. Variants with more than two robots in a setting without obstacles have been studied as well [19, 20, 27]. Recently, Agarwal et al. [4] presented the first polynomial-time approximation algorithm for the min-sum motion-planning problem for two squares that computes an -approximate solution in time (under both the - and -metrics). They leave it as an open problem whether an optimal plan in this case can be computed in polynomial time. Approximation algorithms have been proposed for min-sum multi-robot motion planning under the assumption that the source and target positions of robots are separated from each other and from the obstacles [3, 37, 40]; see also [2, 11]. There is also work on the unlabeled version of the problem, where each robot can end up at any of the (collective) target positions, as long as all of the target positions are occupied by robots at the end of the motion. Finally, we remark that sampling-based approaches have been proposed for optimal multi-robot motion planning [18, 28, 36, 39]; and that there is extensive work on the discrete version of the problem, where robots are moving on graphs; see e.g., [7, 42] for recent surveys.
Our contributions.
Our main result is that Min-Sum is in P, while Min-Makespan is NP-hard. This is stated in the two following theorems.
Theorem 1.
Let be a closed rectilinear polygonal environment with vertices, let be two axis-parallel unit-square robots translating inside , and let be source and target configurations of . We can compute an optimal min-sum motion plan from to under the -metric, or determine that no feasible motion exists, in time.
Theorem 2.
Let be a closed rectilinear polygonal environment with vertices, let be two axis-parallel unit-square robots translating inside , let be source and target configurations of , and let be a given maximum time. It is NP-hard to determine whether there is a feasible -plan such that the maximum speed of each robot is at most 1 and the makespan of is at most .
We prove Theorem 2 by a reduction from the Partition problem, which is to decide whether a given set of integers admits a partition into subsets such that . The idea of the reduction is to build a workspace that consists of gadgets , each corresponding to an element of and to choose a parameter , so that both robots must pass through every gadget and there is a plan with makespan at most if and only if there is a valid partition of . See Figure 1.
Our main technical contribution is a polynomial-time exact algorithm for Min-Sum, as stated in Theorem 1. The crucial step toward designing this algorithm is to prove the existence of an optimal plan that is a canonical-grid plan, in which the path followed by each robot lies on an non-uniform predefined grid; see Theorem 4.
For a single robot translating in a rectilinear environment in , it is well known that there is an optimal path, under the -metric, on the grid defined by the horizontal and vertical lines through the source and target positions and the lines containing the edges of the free space [32]. For a pair of robots, the existence of an optimal plan on a suitably defined grid seems intuitive as well. Indeed, consider an optimal plan . As argued in Section 2, we can assume each robot follows a rectilinear path (in ) under the plan . Imagine trying to push a horizontal (resp. vertical) segment of to a horizontal (resp. vertical) line of the (nonuniform) grid formed by the lines supporting the edges of or the lines at distance from . It may happen that we fail to push the segment onto the grid because robot is blocking it. The hope is that we can continue to push the segment of and push the appropriate segment of in the same direction – essentially is pushing out of the way – until hits – without increasing the total cost. Thus, we have pushed a segment of onto a line containing an edge of and the segment of onto a line at distance 1 from that line. Making this idea work is highly nontrivial, though. For instance, we must choose the direction into which we push a specific segment of in such a way that does not increase, but this may force us to push in such a way that increases. This is further complicated by the fact that may be on different sides of a segment of at different moments in time. Finally, a major complication is that pushing (a segment of) one robot onto a line at distance from an edge of , so that its length does not increase, may cause the other robot to end up on a line at distance from this edge, and this may cause a cascading effect so that the final grid will be too large.
To overcome these issues, we combine local pushing operations with global re-routing operations in such a way that the transformed paths lie on lines at distance 0, 1, or 2 from the edges of . These operations may increase the length of one path, but we prove that whenever this happens, the length of the other path decreases by at least the same amount. Thus we obtain an optimal plan that lies on a grid of size and is still optimal.
After having established the existence of an optimal canonical-grid plan, we show that we can construct a -dimensional weighted grid graph , with , of size , in such that a shortest )-path in corresponds to a min-sum -plan.
2 A polynomial-time algorithm for Min-Sum
This section describes a polynomial-time algorithm for Min-Sum. We first define a canonical-grid plan in Section 2.1 – an -plan where both robots move on a predefined nonuniform grid – and claim that for any reachable pair , there exists an optimal -plan that is a canonical-grid plan. In Section 2.2 we give a high-level overview of the proof of this claim; a more detailed sketch of the proof is deferred to Section 3. Finally, we describe our algorithm in Section 2.3.
2.1 Canonical-grid plans
Rectilinear, decoupled plans.
Since is a rectilinear environment and are squares, it is easily seen that is a polyhedral region. Hence, if there is a feasible -plan, then there is a piecewise-linear optimal -plan, that is, an optimal plan whose image is a polygonal chain in [4]. We thus focus on piecewise-linear plans. We refer to the vertices of such a plan as breakpoints. For a path , the breakpoints of and are the projections of the breakpoints of .
An -plan is decoupled if only one robot moves at any given time; the other robot is then parked somewhere in the free space. A decoupled plan can be represented as a sequence of moves, with each move specifying the parking location of one robot and the motion of the other robot. By definition of breakpoints, each parking spot of (resp. ) is a breakpoint of (resp. ). Agarwal et al. [4] proved that for any pair of reachable configurations, there is an optimal -plan that is decoupled. Since only one robot moves at a time, the parked robot can be considered as a rectilinear obstacle during the move, and (since we measure path length in the -metric) we can ensure that each robot follows a rectilinear path in in each move. We refer to such a plan as a rectilinear plan. The breakpoints of and in a rectilinear plan are the parking spots of and and the points at which they switch between horizontal and vertical segments. We conclude the following.
Proposition 3.
For any reachable pair of configurations , there is an optimal -plan that is rectilinear and decoupled.
The canonical grid.
For an integer , we define an -line to be a horizontal or vertical line that lies at distance from an edge of parallel to , or that lies at distance from one of the points . Note that -lines support an edge of or pass through one of the points . Let denote the set of all -lines, and set . We will be mostly interested in . The arrangement [6] of , denoted by , is the subdivision of induced by . Since each edge of is contained in a -line, each face of is a rectangle that is either contained in or disjoint from . The vertices and edges of form a planar grid graph. Let denote the subgraph of this graph that lies in , that is, and are the sets of vertices and edges, respectively, of that lie in . Note that and . We refer to as a grid, to a vertex of as a grid point, to an edge of as a grid edge, and to a line of as a grid line. We call a rectilinear, decoupled -plan a canonical-grid plan if each breakpoint of and is a grid point. Thus each segment of the path is the union of a number of consecutive collinear grid edges. By definition, each parking spot of or in a canonical-grid plan is a grid point. Our main technical result is the following theorem.
Theorem 4.
Let be a closed rectilinear polygonal environment with vertices, let be two axis-parallel unit-square robots translating inside . For a reachable pair of configurations , there is an optimal -plan that is a canonical-grid plan.
2.2 Converting an optimal plan to a canonical-grid plan
We give an overview of how we convert an optimal -plan to an optimal -plan that is a canonical-grid plan. By Proposition 3, we can assume is rectilinear and decoupled.
Alternating plans.
We assume that alternates between vertical and horizontal segments; hence, each breakpoint of is incident on a horizontal and a vertical segment and is thus a vertex of . This alternation property for can be ensured by adding zero-length segments at breakpoints where necessary. The alternation property, which we also assume for , implies that all parking spots of and lie on the vertices of their respective paths.
We convert into a canonical-grid plan in two phases: the first phase modifies the plan such that all horizontal segments of and lie on grid lines, and the second phase does the same for the vertical segments. Here we describe the first phase; the second phase proceeds analogously, with the roles of the and -axis exchanged.
The first phase.
We define a bad horizontal segment to be a horizontal segment on or that does not lie on a grid line. As long as contains a bad horizontal segment , we modify into a new plan so that the following conditions are satisfied:
-
(P1) Feasibility: The new plan is feasible.
-
(P2) Optimality: The cost of the plan does not increase, that is, .
-
(P3) Progress: The plan has at least one fewer bad horizontal segment than .
-
(P4) Vertical alignment: Any vertical segment of is collinear with a vertical segment of or , or it is contained in a vertical grid line; and the same holds for any vertical segment of .
-
(P5) Alternation: is an alternating, rectilinear, decoupled plan.
The Progress property guarantees that by applying the procedure finitely many times, starting with the optimal plan , we obtain a plan without bad horizontal segments. The Feasibility and Optimality properties imply that is an optimal -plan. Furthermore, the Alternation property implies that is also a rectilinear, decoupled, alternating plan, so we can indeed apply the procedure iteratively.
After eliminating all bad horizontal segments in the first phase,
we eliminate all bad vertical segments in the second phase. The Vertical Alignment
property, which in the second phase applies to horizontal segments, guarantees that
the horizontal segments are not moved off the grid in the second phase.
So, all segments of lie on grid lines, and since is alternating, its breakpoints therefore lie on grid points.
Hence, at the end of the second phase, we obtain an optimal, canonical-grid plan.
Note: Our transformation of the original plan into a satisfying (P1)–(P5)
is done via several intermediate steps. When describing these steps,
we typically denote, with a slight abuse of notation, the current plan by
and the next plan by .
Corridors.
To be able to push bad horizontal segments onto horizontal grid lines without creating a cascading effect, we classify the horizontal grid lines into two classes: primary grid lines, which are the horizontal - and -lines, and secondary grid lines, which are the horizontal -lines. Let be the subdivision of induced by the primary grid lines; see Figure 2.
Each face of is a rectangle because every vertex of is contained in a horizontal -line. We refer to the faces of as corridors. Note that the interior of a corridor may be intersected by secondary grid lines.
By definition, (the relative interior of) every bad horizontal segment lies in the interior of a corridor. At each step, we pick a bad segment , say of . We perform surgery on and so that is aligned with one of the horizontal edges of the corridor containing , and so that the resulting plan satisfies (P1)–(P5). The surgery and its proof of correctness are quite delicate because the topology of in the neighborhood of can be complex.
2.3 Computing an optimal canonical-grid plan
The configuration graph.
Let be the canonical grid described in Section 2.1. We construct an edge-weighted configuration graph with weight function whose nodes correspond to free configurations . More precisely,
By construction, . The set of edges of the configuration graph is defined as
An edge corresponds a move in which robot is parked at while robot moves from to an adjacent grid point . Similarly, an edge corresponds to a move in which moves from a grid point to an adjacent grid point while is parked at . (We can prove that such moves are feasible.) The weight of an edge is defined to be , which is the -distance between and in .
The algorithm.
We first compute in time in a standard manner [12, Chapter 13]. Next, we compute in time and then compute the grid graph in time using a sweep-line algorithm. After computing , we compute the configuration graph in time. Finally, we compute a shortest path from to in in time using Dijkstra’s algorithm. If we find that no path from to exists in , we report the instance to be infeasible, otherwise we return the -plan corresponding to the shortest path in . The total run time is . This completes the proof of Theorem 1.
3 Existence of an optimal canonical-grid plan
Let be an optimal plan that contains a bad horizontal segment , say of . Let where and , be the corridor that contains . This section describes how to modify so that becomes aligned with a grid line and the resulting plan satisfies (P1)–(P5). We begin by introducing some notation. For an axis-aligned rectangle , let and be the top and bottom edge of , respectively, and let denote its height. For , let denote the subplan of (or its image) during the closed interval , and let denote the subplan during the open interval . We define and , and and , in the same manner. For a horizontal segment , let be its -coordinate, and for a point let and denote its - and -coordinates.
Let be the time interval associated with ; thus . We now define two critical time values related to the bad segment :
(1) | ||||
Thus, (resp. ) is the last (resp. first) point on before (resp. after) at which lies on a horizontal edge of . Note that and that may touch a vertical edge of . The goal of our surgery is to push to or to align it with a grid line. This may cause collisions with , so we have to proceed carefully. Sometimes we push part of to and part to , and in one case we even modify the paths outside the interval . In all cases, we resolve the collisions by pushing out of the way, without increasing the overall length of the paths.
In the remainder of this section, we sketch the ideas underlying our pushing strategy. We first define a neighborhood of , called the influence region of and denoted by , and prove a few key properties of . Next, we define unsafe and swap time intervals, subintervals of during which the surgery on requires more care, and we state the crucial structural properties of an optimal plan during these intervals. With these properties at our disposal, we describe the surgery and give some ideas about the correctness proof. Before proceeding, we state a simple but important property of that we will use repeatedly.
Observation 5.
For any axis-aligned line , the length of each connected component of is more than . Consequently, for any axis-aligned segment of length at most such that , we have .
The influence region.
Let be the unit square as defined in Section 1. Let . Thus, where and . For any pair , if and , then . Next, we define two different extensions of that play a role in our analysis; see Figure 3. Let , that is, is obtained by extending by unit length to the left and to the right. Similarly, is the extension of by unit length in the upward and downward directions. Observe that consists of four semi-open unit squares, which we refer to as the corner squares of . Finally, we define , and , and . Note that and . The closures of are translates of by distance in the -direction, and is a partition of . Since no primary grid line of intersects , the regions and do not contain any vertices of . By Observation 5, the connected components of and are therefore rectangles, and is an -monotone rectilinear polygon.
We define the influence region of to be . For , if then can be pushed to or without colliding with , so we have to worry about subintervals of during which lies in . As illustrated in Figure 4, the influence region may consist of several connected components: a giant component that contains , and several tiny components, each of which lies inside a corner square of . Tiny components are -monotone by Observation 5. Note that the giant component may intersect the corner squares. In particular, let be a corner square that lies, say, to the left of . By Observation 5, there is at most one connected component of adjacent to the right edge of . If such a component exists, then and (like the tiny components) is -monotone. Other components of are tiny components of . Let be two corner squares on the same side of . If both and have non-empty connected components inside , denoted by and respectively, then we refer to pairs of points in as blocked pairs. The next lemma states the significance of blocked pairs.
Lemma 6.
Let be two points lying in the same connected component of . Then the shortest paths from to in are -monotone if and only if is not a blocked pair.
Thus, if contains a blocked pair, then the surgery of and the proof of its correctness become significantly harder.
Unsafe and swap intervals.
We next define critical subintervals of the time interval during which the surgery of requires more care, and then prove some structural properties of during these intervals. Again, we begin with a few definitions. A configuration is called -separated if and -separated if . We say that two -separated configurations have the same -order if ; otherwise the -order is swapped. An interval is called -separated if and are both -separated. Note that this definition does not require that is -separated for all .
Definition 7.
An interval is unsafe if
-
(i)
is a maximal interval such that and is -separated for all ; and
-
(ii)
there is a time such that is not -separated.
For any unsafe interval , either robot lies above throughout the interval – that is, for all – or lies below throughout the interval. Indeed, the robots cannot change their -order during an unsafe interval, because they must remain -separated. If an endpoint is not -separated then either or . An important type of unsafe interval is the so-called swap interval, as defined next.
Definition 8.
A swap interval is an -separated unsafe interval such that the -orders at and are swapped.
Roughly speaking, the roles of unsafe and swap intervals are as follows. If a time does not lie in an unsafe interval, translating vertically within does not cause a conflict with because is -separated or . If an unsafe interval is not -separated, we show that we can modify to avoid conflicts after translating vertically without increasing the length of . We prove the following crucial property of -separated unsafe intervals using Lemma 6. Suppose are the endpoints of -separated unsafe intervals, not necessarily endpoints of the same unsafe interval, such that and have the same -order. If , lie in the same component of and are not a blocked pair, then we can obtain another feasible plan by re-parametrizing such that the configuration is -separated for all . Thus, we can eliminate all such unsafe intervals during and push vertically to as above.
Hence, the challenging case is to perform surgery when contains a swap interval. We keep the situation under control using Lemma 9, which bounds the number of swap intervals and which relies on the above property of -separated unsafe intervals. The proof of this lemma is involved and needs a sequence of intermediate lemmas; see the full version.
We say that a modification of is compliant if the Feasibility (P1), Optimality (P2), Vertical alignment (P4) and Alternation (P5) properties hold, and all bad segments of are either present in or are a segment of .
Lemma 9.
Let be an optimal -plan, let be a bad horizontal segment on , and let be as defined in (1). Then there is a compliant modification of such that any unsafe -separated interval is a swap interval with the following properties.
-
(i)
The plan has at most one swap interval with above and at most one swap interval with below .
-
(ii)
If has two swap intervals and , then is connected, contains a blocked pair, and leaves .
We now describe the surgery we perform on and to align a given bad horizontal segment of with a grid line. The surgery consists of a sequence of one or more Push operations, described below, which push a part of or vertically onto a grid line. Let denote the (modified) plan after the surgery.
The Push procedure.
A Push operation takes three parameters: a robot , a time interval , and a -coordinate of a horizontal grid line – a line from the set – and it pushes the subpath onto the grid line . More formally, the new plan resulting from the operation is obtained by setting
Thus a Push operation only changes the -coordinates on the subpath . The exact surgery – the values of the parameters used in the Push operations that we perform – depends on the location of , the set of unsafe and swap intervals during , and the position of during the swap intervals, as explained later.
A Push operation may have two side effects that we need to address. First, may introduce a discontinuity at and/or , the endpoints of .
In other words, for we may have , where and . This happens when . We can resolve the discontinuity by adding the vertical segment , called a ghost segment, to to make the path continuous, and by re-parametrizing the motion along the ghost segments so that the resulting motion plan is feasible. The second side effect of pushing to is that may collide with the other robot during the interval . When this happens we perform a set of secondary pushes, as described later.
The overall surgery.
Without loss of generality, we assume that . Our modification of into follows three main cases:
-
Case I: .
We perform one push operation: ; see Figure 5(ii). -
Case II: . Furthermore, either there is at most one swap interval, or there are two swap intervals and lies above during the first swap interval.
In this case, we pick suitably and perform two push operations:
and . Thus, robot moves along from time to , and then it switches to moving along until time .Figure 6: The modifications in the subcases of Case II. The original paths are shown in pink and light blue. In all cases, jumps to at a suitable time . (i) The modification in Case II(a). is the moment when enters the last -separated interval. (ii) The modification in Case II(b). is the moment when enters the swap interval with below . (iii) The modification in Case II(c). is the moment when leaves the swap interval with above . We have three subcases for the choice of , illustrated in Figure 6.
-
–
Case II(a): There are no swap intervals. If every configuration in is -separated, then either lies below , or above , during the entire interval . If lies below (resp. above) during , set (resp. ). On the other hand, if there is a configuration in that is not -separated, set .
-
–
Case II(b): There is one swap interval and is below during this swap interval. Let be this swap interval. Set .
-
–
Case II(c): There is at least one swap interval and lies above during the first one. Let be this swap interval. Set .
-
–
-
Case III: and there are exactly two swap intervals, and lies below the during the first swap interval.
Let and be the two swap intervals, with . Since all configurations in are -separated and lies below during , the path lies in a connected component of , which is a rectangle . We prove that is contained in a rectangle of the subdivision of induced by the lines of . Let be the maximal interval containing such that . The push operations depend on which of lie on .-
–
Case III(a): and . We perform two push operations, and .
-
–
Case III(b): and . Symmetric to the previous case.
-
–
Case III(c): . Again, we perform two push operations. The first is . (Note that, unlike in the previous two subcases, we pushed to instead of .) Recall that , and let be the maximal interval such that lies on or below the horizontal line that contains . The second push operation is .
-
–
Case III(d): . We argue that this case does not occur.
-
–
Secondary pushes.
After applying the above surgery, we possibly apply secondary pushes to , as follows. For every unsafe interval , if there is a time such that conflicts with , then we execute , where
(2) |
Correctness proof (sketch).
To prove the correctness of the surgery, we need to prove that the new plan has properties (P1)–P(5). The proofs of (P3)–(P5) are not difficult – they are essentially satisfied by construction. The proof of Feasibility (P1) for the surgery performed in Cases (I) and (II) is not hard either, but it is highly nontrivial for Case (III) because might get modified beyond the interval , e.g. during the interval with in Case III(a) or during the interval in Case III(c). Since might not lie in during (or ), we have to prove that the modified plan during the interval (or ) remains feasible. We can prove the feasibility of in Case III(a) by showing that if were not feasible then would not have been an optimal plan. We prove the feasibility of in Case III(c) by showing the existence of an optimal plan with additional structural properties, performing a compliant modification on , if necessary, to ensure these properties, and arguing that these properties ensure that is feasible. Finally, we need to prove Optimality (P2) of the modified path, which is also nontrivial because the surgery may increase the length of one of the paths. To illustrate this, we show that the surgery in Case I does not increase the total length of the plan, even though it may increase the length of the plan of robot .
Lemma 10.
The modification in Case I yields a plan that is optimal.
Proof.
By construction, . If remains unchanged then trivially , so assume there is an unsafe interval in which lies in and is pushed to . If is not -separated then either or enters through . (It cannot enter through the right or left edge of , because then would be -separated.) Since , we have if ; this is true since is -separated for all . Hence, if is not -separated then . Since is pushed to during , we prove that this push procedure does not increase the length of the path of . The same holds if is not -separated. Hence, is still optimal in these cases.
Now assume that both and are -separated. By Lemma 9, we know that is a swap interval. Since there is at most one swap interval with above , by Lemma 9, there is at most one swap interval during which is modified. Pushing to during increases by at most the total length of the ghost segments and , which is . Pushing to during decreases the length of its path by at least . By definition, the configurations are -separated for , so . Hence,
4 Conclusion
We presented an algorithm to compute a plan of minimum total length for two unit squares in a rectilinear environment; this is the first polynomial algorithm for 2-robot optimal motion planning in a polygonal environment. In contrast, we showed that minimizing the makespan is weakly NP-hard. We conclude with some open problems:
-
Can the runtime of our algorithm for the Min-Sum problem be improved to ? Can our algorithm be extended to unit squares with runtime?
-
Is the Min-Sum problem for two squares in a general polygonal environment in ?
-
Is there a pseudo-polynomial-time algorithm for the Min-Makespan problem for two unit squares translating in a rectilinear environment?
References
- [1] Mohammad Ali Abam and Mohammad Ghodsi. An approximation algorithm for d-optimal motion of a rod robot with fixed rotations. Int. J. Comput. Math., 83(3):357–370, 2006. doi:10.1080/00207160600847787.
- [2] Aviv Adler, Mark de Berg, Dan Halperin, and Kiril Solovey. Efficient multi-robot motion planning for unlabeled discs in simple polygons. IEEE Trans. Autom. Sci. Eng., 12(4):1309–1317, 2015. doi:10.1109/TASE.2015.2470096.
- [3] Pankaj K. Agarwal, Tzvika Geft, Dan Halperin, and Erin Taylor. Multi-robot motion planning for unit discs with revolving areas. Comput. Geom., 114:102019, 2023. doi:10.1016/j.comgeo.2023.102019.
- [4] Pankaj K. Agarwal, Dan Halperin, Micha Sharir, and Alex Steiger. Near-optimal min-sum motion planning for two square robots in a polygonal environment. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4942–4962, 2024. doi:10.1137/1.9781611977912.176.
- [5] Pankaj K. Agarwal, R. Sharathkumar, and Hai Yu. Approximate Euclidean shortest paths amid convex obstacles. In Proceedings of the 2009 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 283–292, 2009. doi:10.1137/1.9781611973068.32.
- [6] Pankaj K. Agarwal and Micha Sharir. Arrangements and their applications. In J.-R. Sack and J. Urrutia, editors, Handbook of Computational Geometry, pages 49–119. North-Holland, 2000. doi:10.1016/B978-044482537-7/50003-6.
- [7] Luke Antonyshyn, Jefferson Silveira, Sidney Givigi, and Joshua A. Marshall. Multiple mobile robot task and motion planning: A survey. ACM Comput. Surv., 55(10):213:1–213:35, 2023. doi:10.1145/3564696.
- [8] Boris Aronov, Mark de Berg, A. Frank van der Stappen, Petr Svestka, and Jules Vleugels. Motion planning for multiple robots. Discret. Comput. Geom., 22(4):505–525, 1999. doi:10.1007/PL00009476.
- [9] Tetsuo Asano, David Kirkpatrick, and Chee K. Yap. -Optimal motion for a rod (extended abstract). In Proceedings of the 12th Annual Symposium on Computational Geometry, pages 252–263, 1996. doi:10.1145/237218.237394.
- [10] Tetsuo Asano, David G. Kirkpatrick, and Chee-Keng Yap. Minimizing the endpoint trace length of rod motions amidst polygonal obstacles is NP-hard. In Proc. 15th Canadian Conf. Comput. Geom., pages 10–13, 2003. URL: https://api.semanticscholar.org/CorpusID:123390076.
- [11] Bahareh Banyassady, Mark de Berg, Karl Bringmann, Kevin Buchin, Henning Fernau, Dan Halperin, Irina Kostitsyna, Yoshio Okamoto, and Stijn Slot. Unlabeled multi-robot motion planning with tighter separation bounds. In Proceedings of the 38th International Symposium on Computational Geometry (SoCG), pages 12:1–12:16, 2022. doi:10.4230/LIPICS.SOCG.2022.12.
- [12] Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars. Computational Geometry: Algorithms and Applications (3rd edition). Springer-Verlag, 2008.
- [13] Thomas Brocken, G. Wessel van der Heijden, Irina Kostitsyna, Lloyd E. Lo-Wong, and Remco J. A. Surtel. Multi-robot motion planning of -colored discs is PSPACE-hard. In Proceedings of the 10th International Conference on Fun with Algorithms (FUN), volume 157 of LIPIcs, pages 15:1–15:16, 2021. doi:10.4230/LIPICS.FUN.2021.15.
- [14] Josh Brunner, Lily Chung, Erik D. Demaine, Dylan H. Hendrickson, Adam Hesterberg, Adam Suhl, and Avi Zeff. 11 rush hour with fixed blocks is PSPACE-complete. In Proceedings of the 10th International Conference on Fun with Algorithms (FUN), volume 157 of LIPIcs, pages 7:1–7:14, 2021. doi:10.4230/LIPICS.FUN.2021.7.
- [15] John Canny and John Reif. New lower bound techniques for robot motion planning problems. In Proceedings of the 28th IEEE Symposium on Foundations of Computer Science (FOCS), pages 49–60, 1987. doi:10.1109/SFCS.1987.42.
- [16] Danny Z Chen and Haitao Wang. Computing shortest paths among curved obstacles in the plane. ACM Trans. Alg., 11(4):1–46, 2015. doi:10.1145/2660771.
- [17] Kenneth L. Clarkson. Approximation algorithms for shortest path motion planning. In Proceedings of the 19th ACM Symposium on Theory of Computing (STOC), pages 56–65, 1987. doi:10.1145/28395.28402.
- [18] Dror Dayan, Kiril Solovey, Marco Pavone, and Dan Halperin. Near-optimal multi-robot motion planning with finite sampling. IEEE Trans. Robotics, 39(5):3422–3436, 2023. doi:10.1109/TRO.2023.3281152.
- [19] Argyrios Deligkas, Eduard Eiben, Robert Ganian, Iyad Kanj, and M. S. Ramanujan. Parameterized algorithms for coordinated motion planning: Minimizing energy. In Proceedings of the 51st International Colloquium on Automata, Languages, and Programming (ICALP), volume 297 of LIPIcs, pages 53:1–53:18, 2024. doi:10.4230/LIPICS.ICALP.2024.53.
- [20] Eduard Eiben, Robert Ganian, and Iyad Kanj. The parameterized complexity of coordinated motion planning. In Proceedings of the 39th International Symposium on Computational Geometry (SoCG), volume 258 of LIPIcs, pages 28:1–28:16, 2023. doi:10.4230/LIPICS.SOCG.2023.28.
- [21] Guillermo Esteban, Dan Halperin, Víctor Ruíz, Vera Sacristán, and Rodrigo I. Silveira. Shortest coordinated motions for square robots. In Proceedings of the 18th International Symposium on Algorithms and Data Structures (WADS), volume 14079 of Lecture Notes in Computer Science, pages 430–443, 2023. doi:10.1007/978-3-031-38906-1_28.
- [22] Dan Halperin, Lydia Kavraki, and Kiril Solovey. Robotics. In Jacob E. Goodman, Joseph O’Rourke, and Csaba Tóth, editors, Handbook of Discrete and Computational Geometry, chapter 51, pages 1343–1376. Chapman & Hall/CRC, 3rd edition, 2018.
- [23] Dan Halperin, Micha Sharir, and Oren Salzman. Algorithmic motion planning. In Jacob E. Goodman, Joseph O’Rourke, and Csaba Tóth, editors, Handbook of Discrete and Computational Geometry, chapter 50, pages 1311–1342. Chapman & Hall/CRC, 3rd edition, 2018.
- [24] Robert A. Hearn and Erik D. Demaine. PSPACE-completeness of sliding-block puzzles and other problems through the nondeterministic constraint logic model of computation. Theor. Comput. Sci., 343(1-2):72–96, 2005. doi:10.1016/J.TCS.2005.05.008.
- [25] John Hershberger and Subhash Suri. An optimal algorithm for Euclidean shortest paths in the plane. SIAM J. Comput., 28(6):2215–2256, 1999. doi:10.1137/S0097539795289604.
- [26] John E Hopcroft, Jacob Theodore Schwartz, and Micha Sharir. On the complexity of motion planning for multiple independent objects: PSPACE-hardness of the “warehouseman’s problem”. Int. J. Robotics Res., 3(4):76–88, 1984.
- [27] Iyad Kanj and Salman Parsa. On the parameterized complexity of motion planning for rectangular robots. In Proceedings of the 40th International Symposium on Computational Geometry (SoCG), volume 293 of LIPIcs, pages 65:1–65:15, 2024. doi:10.4230/LIPICS.SOCG.2024.65.
- [28] Sertac Karaman and Emilio Frazzoli. Sampling-based algorithms for optimal motion planning. Int. J. Robotics Res., 30(7):846–894, 2011. doi:10.1177/0278364911406761.
- [29] David G. Kirkpatrick and Paul Liu. Characterizing minimum-length coordinated motions for two discs. In Proc. 28th Canadian Conf. Comput. Geom., pages 252–259, 2016.
- [30] Steven M. LaValle. Planning Algorithms. Cambridge University Press, 2006.
- [31] Joseph S.B. Mitchell. Shortest paths and networks. In Jacob E. Goodman, Joseph O’Rourke, and Csaba Tóth, editors, Handbook of Discrete and Computational Geometry, chapter 51, pages 811–848. Chapman & Hall/CRC, 3rd edition, 2018.
- [32] Pedro J. Rezende, Der-Tsai Lee, and Ying-Fung Wu. Rectilinear shortest paths in the presence of rectangular barriers. Discrete Comput. Geom., 4(1):41–53, 1989. doi:10.1007/BF02187714.
- [33] Oren Salzman. Sampling-based robot motion planning. Commun. ACM, 62(10):54–63, 2019. doi:10.1145/3318164.
- [34] Micha Sharir. A note on the papadimitriou-silverberg algorithm for planning optimal piecewise-linear motion of a ladder. Inf. Process. Lett., 32(4):187–190, 1989. doi:10.1016/0020-0190(89)90042-2.
- [35] Micha Sharir and Shmuel Sifrony. Coordinated motion planning for two independent robots. Ann. Math. Artif. Intell., 3(1):107–130, 1991. doi:10.1007/BF01530889.
- [36] Rahul Shome, Kiril Solovey, Andrew Dobson, Dan Halperin, and Kostas E. Bekris. dRRT: Scalable and informed asymptotically-optimal multi-robot motion planning. Auton. Robots, 44(3-4):443–467, 2020. doi:10.1007/S10514-019-09832-9.
- [37] Israela Solomon and Dan Halperin. Motion planning for multiple unit-ball robots in . In Proceedings of the 13th Workshop on the Algorithmic Foundations of Robotics (WAFR), pages 799–816, 2018. doi:10.1007/978-3-030-44051-0_46.
- [38] Kiril Solovey and Dan Halperin. On the hardness of unlabeled multi-robot motion planning. Int. J. Robotics Res., 35(14):1750–1759, 2016. doi:10.1177/0278364916672311.
- [39] Kiril Solovey, Lucas Janson, Edward Schmerling, Emilio Frazzoli, and Marco Pavone. Revisiting the asymptotic optimality of RRT∗. In Proceedings of the 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 2189–2195, 2020. doi:10.1109/ICRA40945.2020.9196553.
- [40] Kiril Solovey, Jingjin Yu, Or Zamir, and Dan Halperin. Motion planning for unlabeled discs with optimality guarantees. In Robotics: Science and Systems, 2015. doi:10.15607/RSS.2015.XI.011.
- [41] Paul G. Spirakis and Chee-Keng Yap. Strong NP-hardness of moving many discs. Inf. Process. Lett., 19(1):55–59, 1984. doi:10.1016/0020-0190(84)90130-3.
- [42] Roni Stern, Nathan R. Sturtevant, Ariel Felner, Sven Koenig, Hang Ma, Thayne T. Walker, Jiaoyang Li, Dor Atzmon, Liron Cohen, T. K. Satish Kumar, Roman Barták, and Eli Boyarski. Multi-agent pathfinding: Definitions, variants, and benchmarks. In Proc. 12th Int. Sympos. Combinatorial Search, pages 151–159, 2019. doi:10.1609/SOCS.V10I1.18510.
- [43] Matthew Turpin, Kartik Mohta, Nathan Michael, and Vijay Kumar. Goal assignment and trajectory planning for large teams of interchangeable robots. Auton. Robots, 37(4):401–415, 2014. doi:10.1007/S10514-014-9412-1.
- [44] Haitao Wang. A new algorithm for Euclidean shortest paths in the plane. In Proceedings of the 53rd Symposium on the Theory of Computing (STOC), pages 975–988, 2021. doi:10.1145/3406325.3451037.
- [45] Zhi Yan, Nicolas Jouandeau, and Arab Ali Cherif. A survey and analysis of multi-robot coordination. International Journal of Advanced Robotic Systems, 10(12):399, 2013.
- [46] Jingjin Yu and Steven M. LaValle. Structure and intractability of optimal multi-robot path planning on graphs. In Proc. 27th Conf. Artificial Intelligence, 2013. doi:10.1609/AAAI.V27I1.8541.