Collective fast delivery by energy-efficient agentsAn extended abstract of this paper appeared at MFCS 2018 [10]. It erroneously claimed the single agent approach for variant (iii) to have approximation ratio 2.
Abstract
We consider mobile agents initially located at distinct nodes of an undirected graph (on nodes, with edge lengths). The agents have to deliver a single item from a given source node to a given target node . The agents can move along the edges of the graph, starting at time , with respect to the following: Each agent has a weight that defines the rate of energy consumption while travelling a distance in the graph, and a velocity with which it can move.
We are interested in schedules (operating the agents) that result in a small delivery time (time when the item arrives at ), and small total energy consumption . Concretely, we ask for a schedule that: either (i) Minimizes , (ii) Minimizes lexicographically (prioritizing fast delivery), or (iii) Minimizes , for a given .
We show that is solvable in polynomial time, and show that (ii) is polynomial-time solvable for uniform velocities and solvable in time for arbitrary velocities on paths, but in general is NP-hard even on planar graphs. As a corollary of our hardness result, (iii) is -hard, too. We show that there is a -approximation algorithm for (iii) using a single agent.
1 Introduction
Technological development has allowed for low-cost mass production of small and simple mobile robots. Autonomous vacuum cleaners, mowers, or drones are some of the best known examples. There are attempts to deploy such autonomous agents to deliver physical goods – packages [30, 32]. In the future, for delivering over longer distances, a swarm of such autonomous agents is a likely option to be adapted, since the energy supply of the agents is limited, or the agents are simply required to operate locally, or simply because the usage of some agents is more costly than others. A careful cooperation and planning of the agents is thus necessary to provide energy, time, and cost efficient delivery. This leads to plentiful optimization problems regarding the operation of the agents.
Here we consider the problem of delivering a single package as quickly as possible from a source node to a target node in a graph with edge lengths by a team of agents. The agents have individual velocities, with which they can move along the edges of the graph, and also an energy-consumption rate for a travelled unit distance. The goal is to design centralized algorithms to coordinate the agents such that the package is delivered from to in an efficient way. In the literature, delivery problems focusing solely on energy efficiency have been studied. One research direction considers every agent to have an initial amount of energy (battery) that restricts the agents’ movements [1, 13]. The decision problem of whether the agents can deliver the package has been shown to be strongly -hard on planar graphs [7, 8] and weakly -hard on paths [14], and it remains -hard on general graphs even if the agents can exchange energy [15]. The second research direction considers every agent to have unlimited energy supply, and an individual energy-consumption rate per travelled distance [9, 11]. The problem of delivering the package and minimizing the total energy consumption can be solved in time [9].
In this paper, we primarily focus on delivering the package in a quickest possible way, and only secondarily on the total energy that is consumed by the agents. This has not been, to the best of our knowledge, studied before. Specifically, we consider the algorithmic problem of finding a delivery schedule that: (i) minimizes the delivery time, (ii) minimizes the delivery time using the least amount of energy, and (iii) minimizes a linear combination of delivery time and energy consumption.
Our model.
We are given an undirected graph on nodes. Each edge has a positive length . The length of a path is the sum of the lengths of its edges. We consider every edge to consist of infinitely many points, where every point is uniquely characterized by its distance from , which is between and . We consider every such point to subdivide the edge into two edges of lengths proportional to the position of the point on the edge. The distance between two points and (nodes or points inside edges) of the graph is the length of a shortest path from to in . There are mobile agents initially placed on nodes of . Every agent has a weight and a velocity . Agents can traverse the edges of the graph. To traverse an edge (in either direction), agent needs time and units of energy.
Furthermore there is a single package, initially (at time 0) placed on a source node , which has to be delivered to a given target node . Each agent can walk from its current location to the current location of the package (along a path in the graph), pick the package up, carry it to another location (a point of the graph), and drop it there. From this moment, another agent can pick up the package again. Only the moving in the graph takes time – picking up the package and dropping it off is done instantaneously. (The time spent by the package being dropped at a point until picked up again is, however, taken into account.)
We call a schedule that operates the agents such that the package is delivered a solution. In such a schedule , we denote by the total distance travelled by agent , and by the distance travelled by agent while carrying the package. The total energy consumption of the solution is thus and the time needed to deliver the package is given by Fast and energy-efficient Delivery is the optimization problem of finding a solution that has small delivery time as well as total energy consumption . We study the following three objectives (see Figure 1 for illustration):
- (i)
-
Minimize the delivery time .
- (ii)
-
Lexicographically minimize the tuple , i.e. among all solutions with minimum ,
find a solution that has minimum energy consumption . - (iii)
-
Minimize a convex combination , for some given value .
Recent parallel work studied the following complementary – energy focused – variants:
- (iv)
-
Lexicographically minimize the tuple , i.e. prioritize the minimization of [12].
- (v)
(ii) Using agents and , we get .
(iii) For , using agents and , we get and for a combined total of .
(iv) Using agents and , we get .
In all variants it is natural to (without loss of generality) only consider simple paths as the trajectory of the package, i.e., if at times () the package is at the same position , then it remains at position for the time in-between (). We will make this assumption throughout this paper.
Our contribution.
First, in Section 2, we prove for the first time that optimum solutions exist for all mentioned variants of Delivery (while previous work on (iv) and (v) implicitly assumed this). Then, in Section 3, we investigate the problem of minimizing the delivery time only. We call this optimization problem FastDelivery and show that there is a polynomial-time dynamic program of time complexity , where is the running time of an all-pair shortest path algorithm for undirected graphs.
In Section 4, we study FastEfficientDelivery, prioritizing the delivery time over the energy consumption . We first show that the problem can be solved in polynomial time for uniform velocities. However, we prove the problem to be -hard for general velocities even on planar graphs. We therefore consider the restricted graph class of paths, in which we can decompose the problem into uniform velocity instances. For each such instance, we establish a characterization of handover points. Using geometric point-line duality [20] and dynamic planar convex hull techniques [5], we give an algorithm for paths.
In Section 5, we show that for arbitrary given weights , the minimum convex combination can be -approximated by a single agent, while -hardness follows from an adaptation of the hardness proof in the preceding section. We call the task of minimizing the convex combination CombinedDelivery. Finally, in Section 6 we discuss several extended models to which our approach can be generalized. Some technical proofs are omitted in the main text and instead provided in the appendix, or also as inlined proofs in a thesis on several variants of Delivery [6].
Comparison to related work.
Among the earliest problems related to Delivery are the Chinese Postman Problem [21] and the Traveling Salesman Problem [2], in which a single agent has to visit multiple destinations located in edges or nodes of the graph, respectively. The latter has given rise to a class of problems known as Vehicle Routing Problems [31], which are concerned with the distribution of goods by a fleet of (homogeneous) vehicles under additional hard constraints such as time windows. Minimizing the total or the maximum travel distance of a group of agents for several tasks such as the formation of configurations [19] or the visit of designated arcs [22] have been studied for identical agents as well. Energy-efficient Delivery (without optimization of delivery time) has been recently introduced [9] for an arbitrary number of packages, with handovers restricted to take place at nodes of the graph only. This setting turns out to be -hard, but can be solved in polynomial-time for a single package, in which case the restriction of handovers to nodes becomes irrelevant (there is always an optimal solution which does not use any in-edge handovers). To the best of our knowledge, this present paper and a parallel work [12] on variant (iv) are the only ones studying the Delivery problem with agents which have different velocities. Similar to our approach, the latter studies a uniform weight setting first. The uniform weight result is then used as a subroutine in a dynamic program for general weights. Our hardness result shows that such an approach (combination of uniform velocities) is not possible for FastEfficientDelivery, even on planar graphs. Finally, mobile agents with distinct maximal velocities have been getting attention in areas such as searching [3], walking [16] and patrolling [17].
2 Preliminaries
We first formally establish that optimum solutions for all variants of efficient Delivery exist. To this end, we assume without loss of generality that each agent carries the package at most once. (If an agent carries the package twice, we replace all agents acting in-between this agent by the agent itself. By the triangle inequality, neither the delivery time nor the energy consumption increases.) Each solution which operates agents in this order can be represented by the drop-off locations of these agents only (note that for two consecutive agents , the drop-off location of agent , denoted by , corresponds to the pick-up location of agent , denoted by ). Since we allow in-edge handovers, there are infinitely many solutions – however, these can be divided into finitely many topologically compact sets. As act as continuous functions on these sets, we have in each set a minimum solution.
Theorem 1 (Existence of optimum solutions).
There exists an optimum solution minimizing the delivery time (the energy consumption , or , , , respectively).
3 Optimizing delivery time only
Throughout this section, we assume that all agents have weight . Hence in all three variants of fast energy-efficient Delivery, and we are after a solution for delivery with earliest-possible delivery time. We show that FastDelivery is polynomial-time solvable, due to the following characterization of optimum solutions (which exist by Theorem 1):
Lemma 2.
For every instance of FastDelivery, there is an optimum solution in which (i) the velocities of the involved agents are strictly increasing, (ii) no involved agent arrives at its pick-up location earlier than the package (carried by the preceding agent), and (iii) if more than one agent is involved in transporting the package over an edge in direction from to , then only the first involved agent will ever visit .
Proof.
All three properties can be shown by exchange arguments. Taking any optimum solution, we turn it into an optimum solution that adheres to the three properties as follows:
(i) Label the agents in the order in which they transport the package. Let be the first agent such that . Now we can simply replace agent by letting agent travel on the same trajectory on which transported the package; and by doing so, we don’t increase the delivery time.
(ii) Let be the first agent that has to wait at its pick-up location for the package to arrive. Instead of waiting, we let proceed on the original trajectory of the package towards until it meets the preceding agent . Handing over the package at this new spot cannot increase the delivery time , as (we only increase velocities along the trajectory). However, might remain constant if this increase in velocity is countered by a longer waiting time of the package at the handover to agent .
(iii) Assume that multiple agents bring the package from to over the edge , by visiting first. By assumption (i) the last such agent has the highest velocity and thus agent can just as well pick up the package at without the help of the other agents. ∎
Corollary 3.
After a preprocessing step of time – in which we remove in each node all but the agent with maximum velocity – we may assume that .
Towards a dynamic program.
Making use of characterization (i) of Lemma 2, we relabel the agents such that . We can then look at subproblems where we only use the first among all agents. Assume node is the first node that the new agent (starting at ) passes while actually carrying the package. According to characterizations (ii) and (iii), when defining the recursion, we have to take care of these two cases, see Figure 2:
- a)
-
Agent might arrive at node ‘late’, the package has already been dropped off there before by one of the agents and had been waiting.
- b)
-
Agent might arrive at node ‘early’, in which case it should walk towards the package to receive it earlier and bring it back to faster (having larger velocity than the currently carrying agent, after all). In this case, agent picks up the package at a point which is strictly in the interior of the edge and which is as close to node as possible, i.e., must be reachable by both agent and the package – carried by only the first agents – at the earliest possible time: .
(right) Agent picks up the package inside the edge at the earliest possible time.
Dynamic Program.
First we are interested in the distance between any two nodes in the graph, which we can find with an all-pair-shortest-paths algorithm . We denote the time needed for this precomputation by . Then, given the agents in ascending order of their velocities , for each prefix of the agent order and each node we define the following subproblem:
| A fastest schedule to bring the package to node using agents . | |||
| The time needed in to deliver the package to . | |||
| Index of the last agent to carry the package in . | |||
| The pick-up point strictly inside edge and closest to , reachable | |||
| by both the package (coming from , delivered by agents ) and | |||
| agent (coming via ) in time (if applicable). |
Note that although our graph only has undirected edges, considers an ordered tuple of nodes , denoting that the package is transported from to . Thus has the analogous meaning of the package crossing edge from towards . Both and might be undefined, as can be seen below.
We compute the optimum delivery times (together with ) without explicitly maintaining the schedules . A concrete final schedule can then be retraced from , see Theorem 4. For computing and we ‘guess’ the first node of cases a) and b) above by trying each node as a candidate. We then can compute and for all other nodes using the pre-computed distances between all pair of nodes:
- 1.
Initialization: For all nodes , we initialize and . This automatically takes care of case a), where the package arrives at before agent can reach .
- 2.
In-edge pick-ups: We go over all node pairs such that and check whether agent can pick up the package inside to advance it to node faster than in schedule . We do so by checking whether we have and . In this case, agent receives the package from a previous agent that brought it from or from . Thus we get a set of candidates for . The candidate set consists of all points strictly inside the edge such that there exists an agent of index , , for which we have
if is coming from , or – if is defined – Having computed as the point in closest to , we update node accordingly: Set , where using ‘’ takes care of cases in which we have multiple incident edges to that all potentially have in-edge pick-ups by , and set (valid since we consider the case where ).
- 3.
Updates: So far we have computed the subproblems correctly, if node corresponds to the first node of cases a) and b) (in particular we checked whether the faster agent can help to advance the package over only one edge). Now we also consider all cases where agent transports the package over arbitrary distances, by updating all other schedules accordingly: For each node , for each node , if we set and .
Theorem 4.
An optimum schedule for FastDelivery of a single package can be computed in time .
Proof.
For each from to we can compute all values in time for the initialization, to check for in-edge pick-ups and for the updates (for which we need precomputed all-pair shortest paths). Overall we get a running time of . The delivery time is then given in . Correctness of the algorithm follows from the definition of the subproblems and the case distinction stemming from Lemma 2. Since we did not explicitly maintain the schedules , we retrace the concrete schedule from by backtracking: Let denote the last used agent . We can find ’s ‘first node’ in time by searching for the smallest value such that
If , we recurse, otherwise we find the correct adjacent node and all in-edge handovers by looking – for each of the many neighbors of – at the overall many values (where ) and (where ). ∎
4 Prioritizing delivery time over energy consumption
In this Section, we want to find the most efficient among all fastest delivery schedules. We call this problem FastEfficientDelivery and will first show that it can be solved in polynomial time for uniform velocities (), due to a characterization of optimum schedules. In contrast, we prove -hardness for arbitrary speeds, even on planar graphs. However, for paths we show how one can subdivide general instances into phases of concecutive agents having the same velocity, and achieve an efficient -time algorithm.
4.1 A polynomial-time algorithm for uniform velocities
Lemma 5.
Consider FastEfficientDelivery on instances with uniform agent velocities and let denote the offset of the closest agent’s starting position to . Then there exists an optimum schedule such that the pick-up position of each involved agent satisfies:
- •
, i.e., lies on a shortest --path, and
- •
, with equality if lies strictly inside an edge.
Proof.
Since all agents have the same velocity , any fastest delivery of the package must follow a shortest path from to . Furthermore, since the closest agent could deliver the package on its own in time , each involved agent has to arrive at no later than the package itself, giving . It remains to show that we can modify every optimum solution into an optimum solution in which we have whenever lies strictly inside an edge . Denote by the first agent for which this is not the case and by its preceding agent. Assume that the package enters via (i.e. ). Note that must have entered via , since otherwise the energy consumption could be improved by letting pick up the package already at (without increasing the delivery time), contradicting the optimality of our solution. Now we distinguish two cases relating the weights and , yielding either a decrease of the energy consumption, or a possibility to move to a position satisfying the characterization.
- •
: Moving by towards decreases by an amount of .
- •
: We move towards (without increasing neither delivery time nor energy consumption) until we reach , or inside the edge such that , or . In the last case, discarding agent from our solution results in an energy consumption decrease of at least . ∎
Polynomial-time algorithm
We use the characterization in Lemma 5 to find an optimum solution for FastEfficientDelivery of delivery time : For each agent , we compute the set of all potential pick-up locations, i.e., the set of points that satisfy Lemma 5. The number of potential locations is . Then we build an auxiliary directed acyclic multi-graph on a node set , of size . Each directed edge in describes how agent can contribute to the delivery by bringing the package from its starting position to another agent’s starting position along a shortest --path: For each pair of nodes and such that and , we add an arc of weight to . Overall, we have at most many arcs. By construction of , running Dijkstra’s shortest path algorithm on the multi-graph finds a shortest path from to corresponding to an optimal solution.
Theorem 6.
An optimum solution for FastEfficientDelivery can be found in time , assuming all agents have the same velocity.
4.2 -hardness on planar graphs
Contrary to FastDelivery (where we had non-decreasing velocities ), when prioritizing delivery time but still regarding energy consumption, we can’t characterize the order of the agents by their coefficients : Consider an instance in which both the starting position of the absolutely fastest agent as well as the package destination are separated from the rest of the graph by two very long edges —, —. Then in every fastest solution, agent (with large, e.g. ) must deliver the package from to , see Figure 3 (right).
In FastEfficientDelivery, the task is thus to balance slow but efficient agents (with, e.g., ) and fast inefficient agents (with, e.g., ) to collectively deliver the package to ’s pick-up location just-in-time – i.e., in time – without using too much energy. We can construct suitable instances by a reduction from Planar3SAT [28] (Sketch): Starting from a planar formula in three-conjunctive normal form, as in Figure 3 (left), we build a delivery graph . This can be done such that the instance is guaranteed to have schedules with minimum delivery time, i.e. with . However, there should only be such a minimum-time schedule which simultaneously has low energy consumption if and only if the formula has a satisfiable variable assignment.
To this end, we place the fast agents on nodes corresponding to variables and literals. Intuitively, these agents decide on the routing of the package, thus setting the assignment of each variable. The slow agents, on the other hand, are placed on clause nodes, each clause receiving just one agent short of the number of its literals. Intuitively, for a just-in-time delivery to with small energy consumption, each clause has to spend one of its agents for each of its unsatisfied literals. By construction, this is only possible if each clause is satisfied:
Theorem 7.
FastEfficientDelivery is -hard, even on planar graphs.
4.3 An efficient algorithm for paths
The preceding hardness result raises the question for which restricted graph classes we can expect an efficient algorithm for arbitrary velocity instances. To contribute to this question it is natural to study paths – on paths, the V-shaped —— component attached to the rest of the graph, as used in the hardness proof, ‘collapses’ to a line. We show that this allows us to decompose the problem into linearly many uniform velocity instances in time . Theorem 6 then implies that FastEfficientDelivery can be solved in polynomial-time. Improving on this by a careful analysis of paths, we show how to solve each uniform velocity instance in time as well, and that these instances can be combined in time , giving an overall -time algorithm.
Decomposition into uniform velocity instances
In the following, we look at the path graph as the real line, and assume (after performing a depth-first search from and ordering the starting positions in time ) without loss of generality that , that and that , as the only relevant nodes on the line are , and the starting positions . Note that in an optimum solution of FastEfficientDelivery, no agent will ever take over the package from another agent which overtakes from the left. In particular, this means that we will need at most one agent with starting position , and that after the package is picked up at , it will never have to wait between a drop-off by an agent and a pick-up by the next agent , since could continue carrying the package towards , thus decreasing the overall delivery time. Hence in an optimum schedule we also have for consecutive agents with , that (otherwise we can discard , by this decreasing the delivery time).
Decomposition.
Assume that agent is the agent that delivers the package to . We represent the trajectory of the package while being carried by as a ray giving the position on the real line as a function of the time passed so far, see Figure 4 (right). We now inductively compute a set containing all functions , where .
If we have , then by the reasoning above, is the only involved agent, and the function is simply . For , the slope of the ray is set, but not its pick-up position. In order to minimize the earliest possible delivery time (i.e. ), by the non-decreasing velocity property must pick up the package as early as possible – e.g. in Figure 4 (left), the fastest agent would not get the package from agent , but from agent who is able to speed up the transport between agents and , thus advancing the last handover position and allowing agent to pick up the package earlier.
Formally, the pick-up position is given by the time-wise first (or in other words leftmost) intersection of a query line (modelling the agent moving towards ) with any preceding ray . Let denote the intersection point of the query line with the upper envelope of the preceding rays, and denote by a ray of steepest slope among all rays that contain – e.g. the query line “” in Figure 4 (right) intersects both and on the upper envelope, and since both have the same slope, we can consider either.
In case , agent will not be used in an optimal schedule and we set . If, however, , then is given by the line equality . After completion, an optimum schedule corresponds to a path along the rays of our diagram from to the ray reaching at the earliest possible time.
Fast computation and recombination
To quickly compute the equation of each ray , we need to find the intersection of a query line with the upper envelope of many rays. Precomputing this envelope as an ordered list of its segments would allow us to speed up the intersection queries from a linear to a binary search (convex hull trick for dynamic programming [24]). However, the set of functions that we query here is not known up front. Instead, we apply the classic geometric point-line duality [20]. In this dual setting, the task of finding the leftmost intersection point of a query line with a set of lines turns into finding a right tangent from a query point (the dual of the query line) onto the convex hull of a point set (the dual of the rays ). The dynamic planar convex hull data structure by Brodal and Jacob [5, 26] allows point insertions and tangent queries all in amortized time, giving an overall running time of . Assuming that we know the optimum schedule for each of the uniform velocity intervals, it remains to recombine these subschedules:
Lemma 8.
Arbitrary velocity instances of FastEfficientDelivery on paths can be decomposed into and recombined from uniform velocity instances in time .
A fast algorithm for uniform velocity instances on the line
We are left to solve the case where all agents have the same uniform velocity . As before, we denote by the offset of the closest agent’s starting position to , and let denote the corresponding agent. No agent with other than maybe agent is involved in an optimum schedule (all others would only slow down delivery). Also note that if , the setting is equivalent to one where starts at , so we can assume (after relabelling the agents) , . This also implies and we can ignore agents that are dominated by earlier, cheaper agents with and .
Towards a dynamic program.
We define the point as the leftmost point on the line where agent can pick up the package without causing a delay, i.e., we have since . Note that and for . Similarly as – but more specific than – in the characterization of uniform instances on general graphs (Lemma 5) we get a limited set of possible pick-up locations:
Lemma 9.
There is an optimum solution where each agent that is involved in advancing the package picks it up at or at .
Dynamic program.
Lemma 9 suggests that in an inductive approach from left to right it suffices to consider only finitely many handover options. We define the following subproblems:
| An energy-optimal schedule to deliver the package to | |||
| in time , using only the agents . | |||
| Energy consumption of . | |||
| Index of the last package-carrying agent in . | |||
| Index of the second to last carrying agent in (if any). |
We will argue how to compute the optimum energy costs (and with it and ) without explicitly maintaining the schedules ( can later be retraced from and ). For computing , and , we distinguish four cases (also shown in Figure 5):
- 1.
Agent is not involved in .
- 2.
Agent is involved in . Hence by Lemma 9, agent has pick-up location ; and we get the following three variations:
- (a)
and agent picks up the package at itself.
- (b)
Agent picks up the package from some other agent with .
- (c)
Agent picks up the package from some other agent with .
- (a)
In cases 1, 2b) and 2c), we can determine in constant time using a single prior entry of the dynamic programming table:
- Case 1.
-
If is not involved in , the best choice for the agent who transports the package to is agent , as it is the cheapest one on the last segment and we have for all by induction. Hence we can optimize in constant time:
- Case 2.a)
-
This is the base case where the first agent is on its own:
- Case 2.b)
-
If agent is involved in and takes over at from an agent with , we want to minimize , the cost of bringing the package to . Now let be the agent starting closest to the left of . As in Case 1, we argue that is the optimum choice for , as it minimizes the cost on and does not constrain the schedule up to further. Hence, we again get in amortized constant time, i.e., we update by incrementing it lazily when going from to :
The most interesting case is the remaining case , where the agent handing over to starts in between and . Where can we look up the energy consumption of an optimum schedule that ends with bringing the package – the dynamic program being only defined for points ? For some , we might have , so ends by walking to and back. In that case, we can exploit and use as a candidate for the energy consumption . But what if ? As we saw, this implies , but in that case we cannot just subtract : We do not know how looks like between and . We argue that we do not need to consider these agents as candidates at all!
Lemma 10.
If in some optimal schedule the agent preceding is of type 2.c), then in the schedule we have .
Proof.
Under the assumption of Case 2.c), the cost of agent is fixed to . Agents to will collaborate in the most efficient way to bring the package up to . By definition of , is the last agent bringing the package to . From the decreasing weight property, we know that none of the agents to were involved in . So if we take the partial schedule of up to and extend it by letting bring the package to , we obtain a feasible candidate schedule for as none of the agents to are involved. We now argue that is an optimum schedule for . The segment is covered with the minimum possible energy, as is the unique most efficient agent available for . The segment is also covered cheapest possible as its part of was optimized over all agents to , so a superset of the agents available for . Moreover, the uniqueness implies that all optimum schedules for need to end with agent on , hence . ∎
- Case 2.c)
-
Lemma 10 leaves us with only those agents whose schedules we understand sufficiently to modify them into candidates for under Case 2.c):
We can now take as the minimum over the four cases 1–2.c) and compute all schedules by proceeding over all subproblems in increasing order, giving us the energy-optimal schedules for delivering the package to the points in time . How can we use the solutions to the subproblems to find the energy of an energy-optimal schedule delivering the package to the target in optimum time ? Let be the closest agent on the left of , i.e., . Clearly, if in an optimum schedule the package is delivered to by an agent starting to the left of , then by the decreasing weight property this agent must be agent , giving us .
Delivery to and agents with .
It remains to take care of agents with starting positions :
As illustrated in Figure 6, multiple agents with might be involved in the most efficient delivery. Note that our dynamic programming problem is defined independent of and so we can also easily compute for . Agents with are not useful, however, for a delivery to , as they arrive in only after the package has been delivered. Similar to Lemma 10, we claim that among the remaining agents only those with need to be considered:
Lemma 11.
If an agent with is the last agent in any optimal schedule from to , then .
Proof.
We have . By the decreasing weight property, no agent will be used in . We extend to a schedule by letting agent walk from to . Then is a candidate for . Similar to Lemma 10, consists of an optimal solution for and the strictly cheapest agent on and hence is optimal for and all optimum schedules for have . The optimum --delivery is thus given by:
which takes linear time once at the very end. ∎
Details of the dynamic program.
The computational bottleneck of our dynamic program is (for each subproblem ) the minimization over the set of options in Case 2.c). Each option evaluates a linear function at position , which can be seen as a lower envelope intersection query. Similarly to before, we use point-line duality and a dynamic convex hull data structure to avoid considering all agents explicitly as predecessors and instead quickly search the best one.
Lemma 12.
An optimum schedule for FastEfficientDelivery with uniform velocity on the line can be computed in time.
Combining this with Lemma 8 gives the full solution on paths. Note that strictly speaking, in the uniform velocity instances, the package is not available at at time zero, but is brought there by agents of preceding instances at exactly the time when the first agent can reach it.
Theorem 13.
An optimum solution for FastEfficientDelivery on paths can be computed in time.
5 Optimizing convex combinations of objectives
In this section, we look at a convex combination of the two objectives: minimizing both the delivery time and the energy consumption by minimizing the term , for a given value . We call the problem of minimizing this combined objective CombinedDelivery. As an application of the -hardness proof for FastEfficientDelivery, we get -hardness of CombinedDelivery as well: The main idea is to counter small values of by scaling the weights of the agents by a small factor , thus decreasing the importance of alongside as well.
Theorem 14.
CombinedDelivery is -hard for all , even on planar graphs.
A -approximation for CombinedDelivery using a single agent
Recall that for FastDelivery, the agents involved in an optimum delivery were characterized by increasing velocities , while for FastEfficientDelivery on path graphs, the agents of an optimum solution were characterized by decreasing tuples .
Although it is not possible to characterize the order of the agents in an optimum CombinedDelivery schedule by their velocities and weights alone, we can at least characterize the position of a minimal agent, leading to a 3-approximation using a single agent:
Lemma 15.
Let without loss of generality denote the indices of all involved agents appearing in that order in an optimum CombinedDelivery schedule. Then the last agent is minimal in the following sense: .
Proof.
Recall that we denote by the total distance travelled by agent and by the distance travelled by agent while carrying the package. Thus agent contributes at least towards . Assume for the sake of contradiction that the minimum value is not obtained by agent but by an agent . Then we can replace the agents by agent , resulting in a decrease in the objective function of at least
contradicting the minimality of the optimum CombinedDelivery schedule. ∎
Theorem 16.
There is a -approximation for CombinedDelivery which uses only a single agent (and thus can be found in polynomial time).
Proof.
Note that agent contributes at most towards . Starting from an optimum CombinedDelivery schedule we can replace all agents along their trajectories by the minimal agent . This prolongs the travel distance of agent by . Overall, we increase the objective function by at most
Hence only using agent to deliver the package is a -approximation for CombinedDelivery. We get a polynomial-time approximation algorithm with approximation ratio by choosing among all agents the one with minimum value . ∎
6 Discussion
Our techniques and results extend to a variety of delivery problems and model generalizations. A key ingredient here is that the order of our dynamic programming subproblems depends only on the parameters the agent has while carrying the package. Hence it is possible to, e.g., incorporate 2-speed agent models (modeling different speeds [18] with/without carrying the package) or topographical features (modeling edge traversals in uphill/downhill direction).
Furthermore, the 3-approximation given for CombinedDelivery is applicable to FastDelivery as well, and a relaxation of FastEfficientDelivery, in which one allows the optimum delivery time to be achieved with a constant-factor approximation of the energy consumption, stays -hard. It is unclear whether FastEfficientDelivery can be solved efficiently on trees or whether CombinedDelivery allows a PTAS. We consider these two problems the major open questions raised by this work.
References
- [1] J. Anaya, J. Chalopin, J. Czyzowicz, A. Labourel, A. Pelc, and Y. Vaxès. Convergecast and Broadcast by Power-Aware Mobile Agents. Algorithmica, 74(1):117–155, 2016. See also DISC’12.
- [2] D. L. Applegate, R. E. Bixby, V. Chvatal, and W. J. Cook. The Traveling Salesman Problem: A Computational Study. Princeton University Press, Princeton, NJ, USA, 2007. ISBN: 978-0-691-12993-8.
- [3] E. Bampas, J. Czyzowicz, L. Gasieniec, D. Ilcinkas, R. Klasing, T. Kociumaka, and D. Pająk. Linear Search by a Pair of Distinct-Speed Robots. In 23rd International Colloquium on Structural Information and Communication Complexity SIROCCO’16, pages 195–211, 2016.
- [4] J. Basch, L. J. Guibas, and J. Hershberger. Data Structures for Mobile Data. Journal of Algorithms, 31(1):1–28, 1999. See also SODA’97.
- [5] G. S. Brodal and R. Jacob. Dynamic Planar Convex Hull. In 43rd Symposium on Foundations of Computer Science FOCS’02, pages 617–626, 2002.
- [6] A. Bärtschi. Efficient Delivery with Mobile Agents. PhD thesis, ETH Zürich, 2017.
- [7] A. Bärtschi, J. Chalopin, S. Das, Y. Disser, B. Geissmann, D. Graf, A. Labourel, and M. Mihalák. Collaborative Delivery with Energy-Constrained Mobile Robots. In 23rd International Colloquium on Structural Information and Communication Complexity SIROCCO’16, pages 258–274, 2016.
- [8] A. Bärtschi, J. Chalopin, S. Das, Y. Disser, B. Geissmann, D. Graf, A. Labourel, and M. Mihalák. Collaborative delivery with energy-constrained mobile robots. Theoretical Computer Science, 2017. To appear. See also SIROCCO’16.
- [9] A. Bärtschi, J. Chalopin, S. Das, Y. Disser, D. Graf, J. Hackfeld, and P. Penna. Energy-efficient Delivery by Heterogeneous Mobile Agents. In 34th International Symposium on Theoretical Aspects of Computer Science STACS’17, pages 10:1–10:14, 2017.
- [10] A. Bärtschi, D. Graf, and M. Mihalák. Collective fast delivery by energy-efficient agents. In 43rd International Symposium on Mathematical Foundations of Computer Science, MFCS’18, pages 56:1–56:16, 2018.
- [11] A. Bärtschi, D. Graf, and P. Penna. Truthful Mechanisms for Delivery with Agents. In 17th Workshop on Algorithmic Approaches for Transportation Modelling, Optimization, and Systems ATMOS’17, pages 2:1–2:17, 2017.
- [12] A. Bärtschi and T. Tschager. Energy-Efficient Fast Delivery by Mobile Agents. In 21st International Symposium on Fundamentals of Computation Theory FCT’2017, pages 82–95, 2017.
- [13] J. Chalopin, S. Das, M. Mihalák, P. Penna, and P. Widmayer. Data Delivery by Energy-Constrained Mobile Agents. In 9th International Symposium on Algorithms and Experiments for Sensor Systems, Wireless Networks and Distributed Robotics ALGOSENSORS’13, pages 111–122, 2013.
- [14] J. Chalopin, R. Jacob, M. Mihalák, and P. Widmayer. Data Delivery by Energy-Constrained Mobile Agents on a Line. In 41st International Colloquium on Automata, Languages, and Programming ICALP’14, pages 423–434, 2014.
- [15] J. Czyzowicz, K. Diks, J. Moussi, and W. Rytter. Communication Problems for Mobile Agents Exchanging Energy. In 23rd International Colloquium on Structural Information and Communication Complexity SIROCCO’16, 2016.
- [16] J. Czyzowicz, L. Gasieniec, K. Georgiou, E. Kranakis, and F. MacQuarrie. The Beachcombers’ Problem: Walking and searching with mobile robots. Theoretical Computer Science, 608:201–218, 2015.
- [17] J. Czyzowicz, L. Gasieniec, A. Kosowski, and E. Kranakis. Boundary Patrolling by Mobile Agents with Distinct Maximal Speeds. In 19th European Symposium on Algorithms ESA’11, pages 701–712, 2011.
- [18] J. Czyzowicz, K. Georgiou, E. Kranakis, F. MacQuarrie, and D. Pająk. Fence patrolling with two-speed robots. In 5th International Conference on Operations Research and Enterprise Systems ICORES’16, pages 229–241, 2016.
- [19] E. D. Demaine, M. Hajiaghayi, H. Mahini, A. S. Sayedi-Roshkhar, S. Oveisgharan, and M. Zadimoghaddam. Minimizing movement. ACM Transactions on Algorithms, 5(3):1–30, 2009. See also SODA’07.
- [20] H. Edelsbrunner. Algorithms in Combinatorial Geometry, volume 10 of EATCS Monographs on Theoretical Computer Science. Springer, Heidelberg, Germany, 1987.
- [21] J. Edmonds and E. L. Johnson. Matching, euler tours and the chinese postman. Mathematical Programming, 5(1):88–124, 1973.
- [22] G. N. Frederickson, M. S. Hecht, and C. E. Kim. Approximation Algorithms for Some Routing Problems. SIAM Journal on Computing, 7(2):178–193, 1978. See also FOCS’76.
- [23] R. L. Graham. An efficient algorith for determining the convex hull of a finite planar set. Information Processing Letters, 1(4):132–133, 1972.
- [24] W. C. I. P. E. Group. Convex hull trick. PEGWiki, September 2016.
- [25] J. Hershberger. Finding the upper envelope of n line segments in O(n log n) time. Information Processing Letters, 33(4):169–174, 1989.
- [26] R. Jacob. Dynamic planar convex hull. PhD thesis, Department of Computer Science, University of Aarhus, Denmark, 2002. BRICS Dissertation Series DS-02-3.
- [27] H. Kaplan, R. E. Tarjan, and K. Tsioutsiouliklis. Faster Kinetic Heaps and Their Use in Broadcast Scheduling. In 12th Symposium on Discrete Algorithms SODA’01, pages 836–844, 2001.
- [28] D. Lichtenstein. Planar Formulae and Their Uses. SIAM Journal on Computing, 11(2):329–343, 1982.
- [29] J. Matoušek. Lectures on Discrete Geometry, volume 212 of Graduate Texts in Mathematics. Springer, New York, NY, USA, 2002. Exercise 8.1.1.
- [30] Swiss Post. Swiss Post delivery robots in use by Jelmoli. Press release, August 2017. URL: https://www.post.ch/en/about-us/company/media/press-releases/2017/ swiss-post-delivery-robots-in-use-by-jelmoli.
- [31] P. Toth and D. Vigo, editors. The Vehicle Routing Problem. SIAM Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2001. ISBN: 0-89871-498-2.
- [32] E. Weise. Amazon delivered its first customer package by drone. USA Today, December 2016.
Appendix A Existence of optimum solutions
Theorem 1 (Existence of optimum solutions).
There exists an optimum solution minimizing the delivery time (the energy consumption , or , , , respectively).
Proof.
A solution which operates agents (after relabeling) in this order is uniquely described by the order of those agents and their drop-off locations : Agent picks up the package at and drops off the package at , agent picks it up at and drops it off at , …, and agent drops off the package at .
To each drop-off location we assign an energy consumption- and a time-measure: Let and denote the total energy consumption (time, respectively) spent up to the point where agent drops the package at . These values are inductively defined as follows:
| (1) |
and
| (2) |
Because there are infinitely many possible (in-edge-)handover positions, there are also infinitely many solutions. We will now show that we can subdivide these solutions into a finite number of equivalence classes. We prove that each equivalence class has
- •
a solution that minimizes the delivery time among all solutions in the class,
- •
a solution that minimizes the energy consumption among all solutions in the class.
Since the number of equivalence classes itself is finite, we immediately get that the (infinite) set of all solutions itself contains minimum solutions subject to and , respectively. We may think of the subdivision into equivalence classes as a partition, although strictly speaking some schedules will be contained in multiple distinct equivalence classes.
Representation via drop-off positions
We first group all solutions into schedules that operate the same agents in the same order. There is a finite number of such groups. Now recall that for a specific list of agents a solution is uniquely described by the many drop-off positions (since we must have ).
We represent a drop-off , in an edge as a tuple , where is a parameter denoting the position of in , . If lies strictly inside the edge , this representation is unique. The same is true if is a node of degree 1. If is a node of degree , there are many representations to choose from.
Similarly to individual handover points, we can represent schedules in this parametrized notation, too. For each schedule operating the agents in this order, we consider all possible representations of the whole schedule: If has many node drop-offs , then has a bounded number of exactly many different representations.
Equivalence relation between representations
We can now define an equivalence relation between parametrized representations of schedules: Two parametrized representations and of a solution and a solution , respectively, are equivalent, , if they operate the same set of agents in the same order and agree in the edge of each drop-off location (in other words, and differ only in the exact positions inside the edges, given by the respective parameters ).
Note that two different parametrized representations of the same schedule are not equivalent. Since a parametrized representation of a schedule preserves all information contained in , we can also measure subject to and .
Minima of equivalence classes
We are now ready to prove that, given an arbitrary parametrized schedule representation , the equivalence class of under , denoted by , contains a minimum element subject to and a minimum element subject to .
A schedule operating agents has parametrized drop-off locations. If , then contains the single element and thus has a minimum element. Otherwise, any different choice of the values of these parameters still represents a solution, and all these solutions are in the equivalence class . Hence we can identify with the -dimensional hypercube which is a bounded and closed metric space and thus a topologically compact space.
Since we have and , using Equations (1) and (2) together with the triangle inequality for distances in a graph, it is easy to see that and are continuous functions mapping parametrized schedule representations in the compact hypercube to the corresponding energy-consumption and delivery-time values in :
Consider the minimum velocity , the maximum weight and the maximum edge length . We use the -norm and show that for all there exists a , such that we have for any two parametrized schedule representations that
Note that from we get for any two parametrized drop-off that and thus . Using Equations (1) and (2) inductively together with the triangle inequality for graph distances we get
| and | |||||
We have and , and thus and are continuous functions. Hence by the extreme value theorem, there must be a solution of minimum value in with respect to and to , respectively. The same holds for the linear combination , and, furthermore, there are also lexicographically minimum solutions with respect to the tuples and , respectively [29].
Finally, since there is only a finite number of equivalence classes, there must be minimum solutions for all five variants of efficient Delivery overall. ∎
Appendix B -hardness of FastEfficientDelivery
Planar 3SAT.
We start with a three-conjunctive normal form on variables and clauses . Each clause is a disjunction of at most three literals of the form . can be represented by a graph defined as follows: is a bipartite graph with nodes corresponding to all clauses and all variables and an edge set which contains an edge between each clause and variable if and only if or is contained in , . To this graph we add a cycle consisting of edges between all pairs of consecutive variables, The 3CNF is called planar if there is a plane embedding of which at each variable node has all edges representing positive literals on one side of the cycle and all edges representing negative literals on the other side of . The decision problem Planar3SAT of finding whether a given planar 3CNF is satisfiable or not is -complete, a result due to Lichtenstein [28]. We assume without loss of generality that every clause contains at most one literal per variable, see Figure 7 (left).
Delivery graph.
We now transform into a planar graph on which we will build an instance of FastEfficientDelivery. First, we place an additional node on the edge and modify accordingly (by adding to and removing from ). In a second step, we add on both sides of each edge a path from to with internal nodes. We can now reconnect the literal edges while preserving planarity: If is the th literal edge of inside the cycle , we reconnect to the th internal node of the path from to which lies inside . We do the same for literal edges outside of . For every odd node on these paths which is not yet connected to a clause node, we create a single new node and connect it to the internal path node. Thus, for all , both paths from to have internal nodes of degree and internal nodes of degree , and these nodes alternate. If the path contains nodes connected to clauses which contain , we call the path , otherwise we call it . Finally, we delete all edges of , add the package’s source and destination and another node and connect these to , and , respectively. We redraw the graph such that are placed in this order from left to right, see Figure 7 (right).
Reduction idea.
We will place agents and set edge lengths such that any delivery of the package which goes via any of the clause nodes takes a long time. Thus the package has to be routed in each path pair through exactly one of the two paths. If the package is routed via the path , we interpret this as setting and hence we can read from the package trajectory a satisfiable assignment for .
Agent placement.
We use three kinds of agents: slow but energy-efficient agents , fast but inefficient agents and one very fast agent :
- •
The fastest agent is placed on and shall transport the package over the edge .
- •
Fast agents on one hand are placed on each variable node . These agents will decide whether to deliver the package over the path or the path , thus effectively setting the value of the corresponding boolean variable to true or to false. On the other hand, we will also use one fast agent on each internal path node of degree .
- •
Finally, slow agents are placed as follows: On each clause node of degree we place slow agents. We think of these agents as follows: If a clause consists of three literals, e.g. , then in a satisfiable assignment at most two of these literals (e.g. and ) are evaluated to false. Thus the paths and are used in the delivery and the agents are sent towards these paths to help carry the package. Along the same lines, on each newly created node that is connected to an internal node of a path we place a single slow agent. Additionally, a slow agent is placed on the package source .
Overall we have (i) two agents on nodes and , (ii) fast agents on the variable nodes, (iii) fast agents on the paths (one for each internal node of degree two), and (iv) for each of the internal path nodes of degree 3 (except for many) a unique slow agent on an adjacent node. In total we get mobile agents.
Edge lengths.
Recall that we started from variables and clauses. We set the length of the first edge to , and the lengths of the edges to . The edges along paths and have length if they lie directly to the right of a fast agent’s starting position and length if they are adjacent on its left. It remains to set the length of all remaining edges adjacent to internal path nodes (connecting to either a clause node or a newly created node). Each such edge, adjacent to the th internal node (counted from the left) of path or , gets length , see Figure 8.
From the defined edge lengths we get that each path and each path has length exactly and thus .
Lemma 17 (minimum delivery time).
Any fastest delivery of the package from to takes time and does not go via any clause node of .
Proof.
Clearly, any delivery which does not use the fastest agent (with ) takes time at least . Hence the fastest agent has to deliver the package to and thus travel from its starting position to and later on from to . We get .
Equality holds if and only if the other agents can collectively deliver the package to in time . This is the case if the slow agent at brings the package to in time , where the fast agent takes over and brings the package to in time .
If, however, the trajectory of the package contains a clause node , then the package travels at least a distance of which takes time at least . Note that in the last step we assumed that we do not use the very fast agent of velocity – if we used that agent, it would travel a total distance of strictly more than and hence as well. ∎
We now show that among all fastest delivery schedules (of time ) there exists a schedule with energy consumption if and only if is satisfiable (otherwise ).
Lemma 18 ( of a Planar3SAT-solution).
Given a satisfiable assignment (a solution) for the variables of a 3CNF there is a delivery schedule with delivery time and energy consumption .
Proof.
We first remark that the slow agent on can bring the package to in time with energy consumption and that the fastest agent on can get to in time with energy cost (and from there reach in time and energy ). It remains to show that all other agents can collectively deliver the package from to in time such that the package never has to wait and without spending more energy than .
Given a satisfiable assignment for the variables in , the actions of the fast agents are straightforward: Each agent placed on a variable node moves according to the variable assignment of along the first edge of either the true-path or the false-path as soon as the package arrives at . The other fast agents on internal path nodes of degree also wait for the package and upon arrival carry it over the adjacent edge of length . Collectively, each of the fast agents (with velocity and weight ) that move take time and energy to cross the adjacent edge.
Finally, we show that the package can be carried over the remaining gaps (edges of length ) by one slow agent each, stationed on an adjacent clause or newly created node, without the package having to wait for the agent to arrive. If this is the case, then slow and fast agents carry the package over a path from to in time with an energy consumption of . We certainly have enough clause agents for this task: Since is satisfiable, each clause has at most unsatisfied literals and thus has enough agents on its clause node to send one agent each to the corresponding paths in which they are needed. As for the timing: We can easily verify that each needed slow agent can reach its internal path node exactly by the time at which the package arrives at the same node, thus the package does not have to wait for its next agent.
Hence transporting the package from to takes time and needs an energy of , yielding an overall delivery time of and energy consumption of . ∎
Lemma 19 (Delivery schedule yields Planar3SAT assignment).
Any delivery schedule with delivery time needs an energy consumption of at least . Furthermore, if there is a delivery schedule with and , we can retrieve a satisfiable assignment to the variables of the underlying 3CNF from the delivery schedule.
Proof.
We already know by Lemma 17 that any delivery schedule with delivery time can’t deliver the package via any clause node and can’t use the fastest agent on the left side of . Thus the length of the package’s trajectory from to must have length . We only have slow agents () and fast agents () available to travel this distance. Hence to cover in time we need to use fast agents for a total length of at least . This, however, results in an energy consumption of at least and hence .
To achieve equality, all fast agents must travel a total length of exactly , moving only while carrying the package, and moving only from left to right. In particular, fast agents can’t help to transport the package over edges of length , from neither side.
Therefore, in any delivery schedule with delivery time and , the package must be transported over edges of length 2 by fast agents and over edges of length by slow agents. Furthermore, following the same line of reasoning as in the proof of Lemma 18, to actually achieve the package can never wait at an internal path node for the agent which will carry it next. Suppose the package just arrived at the th node of path . This means it has covered a distance of with the help of fast agents so far. Hence the current time is
Among all slow agents, only a slow agent on an adjacent node can reach the internal path node at this time, since all other slow agents are further away.
In conclusion, in a delivery schedule with delivery time and , agents stationed on a clause node can only help carrying the package on paths corresponding to the literals of this clause, and since there are only agents stationed on that clause, we know that for at least one literal of , the path has been taken (for which no help from a clause agent of is necessary). Hence we can read a satisfiable variable assignment for directly from the choice of the variable agents (which each pick the adjacent true- or the adjacent false-path): with this assignment, each clause has at least one satisfied literal. ∎
We remark that the graph created from is planar and that all edge lengths and agent velocities and weights have polynomial size. Hence we conclude:
Theorem 7.
FastEfficientDelivery is -hard, even on planar graphs.
Remark
The proof of Theorem 7 also extends to the following relaxation of FastEfficientDelivery: Variant (ii∗): Given a time constraint , minimize the energy such that .
Note that Variant (ii∗) includes the setting where . Hence our hardness result for FastEfficientDelivery extends to Variant (ii∗). Furthermore, in this case is NP-hard to approximate to within any constant factor : This follows by appropriately scaling the edges traveled by slow agents in the hardness proof for Theorem 7. Specifically, we scale the edges of length to and adapt all edges incident to the starting positions of slow agents or incident to , , accordingly. Then a Planar3SAT-solution will have a delivery time of and an energy consumption of , while any other solution with will have energy consumption .
Appendix C An efficient algorithm for FastEfficientDelivery on paths
C.1 Fast computation and recombination
Envelope intersections via point-line duality.
In classic geometric point-line duality [20], each line is mapped to a point and vice versa each point is mapped to a line .
In this dual setting, the task of finding the leftmost intersection point of a query line with a set of lines turns into finding the line of minimum slope of a query point with a set of points. This corresponds to asking for the right tangent from a query point (the dual of the query line) onto the convex hull of a point set (the dual of the rays 11 1 For the purpose of line-point duality, we treat the rays as lines. This is fine, since each ray is dominated for -values smaller than anyways.), see Figure 9. In order to use such tangent queries, we use the data structure for planar convex hulls of dynamic point sets by Brodal and Jacob [5, 26]. To find the corresponding ray of maximum slope , we also work in the geometric dual: Now that we have found the tangent (of direction ), we make an extreme point query in the orthogonal direction . The query returns an extremal vertex of the convex hull in this direction. In the (original) geometric primal, this vertex corresponds to a ray containing the intersection point . In case there is only one such ray, we have found (respectively its dual). However, if there are multiple such rays, the resulting extremal point – being a vertex of the convex hull – corresponds to a ray of minimal or maximal slope among all such rays. Hence we make an additional neighbor query, giving us the two neighboring vertices on the convex hull. We check whether the neighbor with higher -coordinate lies on the tangent , too. If so, the ray of maximal slope is given as the dual of this neighbor, otherwise as the dual of the extremal point query’s result itself.
Finally, we check whether , and if so, we insert into the point set of the geometric dual. The mentioned convex hull data structure allows point insertions and deletions in amortized time, and tangent, extremal point and neighbor queries in time . As for each we need one of each type of queries and one insertion, we get an overall running time of .
Uniform velocity instances and recombination.
As any optimum schedule transports the package to as early as possible, the delivery time thus corresponds to the -coordinate at which the upper envelope reaches . Every line segment of the upper envelope corresponds to intervals on the line of piecewise uniform velocity. Hence we would like to represent the upper envelope as an ordered list of its segments. Since we have already computed all the rays , computing this list of segments can be done in time : This can be done either by a divide-and-conquer approach by Hershberger [25] which finds the upper envelope of line segments (where we treat rays as segments extending up to ) or with a Graham scan-like sweep [23], first sorting the rays in order of increasing slopes, then adding the rays one by one in amortized constant time, maintaining a stack of lines appearing on the upper envelope [24].
Assuming that we know the optimum schedule for each of the uniform velocity intervals, we can recombine these subschedules as follows: Recall that either one or no agent with is involved in an optimum schedule. In the first case, the optimum schedule simply corresponds to the complete upper envelope. In the second case, the optimum corresponds to a ray with starting position on the -axis together with a suffix of the upper envelope to which it is a right tangent.22 2 For example, in Figure 9 (right), is a right tangent to , hence we consider the suffix . On the other hand, is a right tangent to both and , hence we consider up to with the suffix as well as up to with the line segment only. Each ray is a tangent to at most two distinct vertices of the upper envelope, and we treat the line segment defined by each such tangent as a uniform velocity instance itself. Overall, we get at most many time-optimal schedules (see Figure 10).
Out of these time-optimal candidates, it remains to find the schedule with minimum energy consumption . Hence we precompute for each suffix of line segments on the upper envelope the sum of energy consumptions of the corresponding subschedules. Given the energy consumption of each subschedule, all suffix-sums can be computed in overall time . After this precomputation, the schedule lexicographically minimizing is given as the minimum over all candidates. We conclude:
Lemma 8.
Arbitrary velocity instances of FastEfficientDelivery on paths can be decomposed into and recombined from uniform velocity instances in time .
C.2 Characterization of handover points
Lemma 9.
There is an optimum solution where each agent that is involved in advancing the package picks it up at or at .
Proof.
Assume otherwise, i.e., all optimum schedules contain some point . For the sake of a contradiction let be the optimal schedule where the coordinate of the first pick-up point different from and is maximized, and let be an arbitrary small constant. Denote by the agent transporting the package right before agent . Note that always exists as we must have by . We know that as would delay the delivery otherwise. We also know that as the transportation on would otherwise use more energy than necessary (). We now distinguish three cases:
- •
: We modify by moving by to the left towards . This does not change the delivery time but reduces the energy cost and thus contradicts ’s optimality.
- •
: If we modify by moving by to the right, the energy cost goes down, again contradicting being optimal.
- •
: If we again modify by moving by to the right, the delivery time and energy cost do not change, but we contradict the extremality of in .∎
C.3 Details of the dynamic program.
The computational bottleneck of our dynamic program is (for each subproblem ) the minimization over the set of options in Case 2.c). Each option evaluates a linear function
at position . So when we see as a function of , we get the lower envelope of all these linear functions (see Figure 11 (left)). The set of these functions is fully dynamic over time: Whenever we compute with , a new function is added to the set. Whenever we go from to , all functions with drop out of the window of functions we are minimizing over, which we can take care of by lazy incrementation. One particular data structure that supports insertion and deletion of up to linear functions as well as find-min-queries for up to query values is a parametric heap. If successive query values are non-decreasing, a parametrized data structure is also called kinetic [4]. The running time of a kinetic heap, however, is dominated by delete-operations, which take time each [27]. Hence we turn once more to the more recent dynamic planar convex hull data structure, which supports deletions in amortized time [5]. Overall we get:
Lemma 12.
An optimum schedule for FastEfficientDelivery with uniform velocity on the line can be computed in time.
Proof.
We formulate our optimization problem for agent in Case as the following equivalent geometric problem: Given up to linear equations : with 33 3 Note that it is without loss of generality that we assume here, as we have . and a vertical query line : , find the lowest intersection point between and any of the (see Figure 11 (left)). As before, we want to apply point-line duality, where each line is mapped to a point and vice versa. However, as the vertical line does not have a (finite) dual representation, we first swap the coordinates, reflecting the whole configuration at axis (see Figure 11 (center)). We get as and its dual as and can now also map : to : (see Figure 11 (right)).
In this dual setting, the task is to find the line of smallest slope (= leftmost point in the mirrored primal) that goes through and one of the . This corresponds to asking for the right tangent through onto the convex hull of the point set . We can find itself with an extreme point query to get . Each operation takes (amortized) time , and as we perform at most operations overall, we get a total running time of . ∎
Appendix D NP-hardness of CombinedDelivery
-hardness of FastEfficientDelivery followed from instances where and were lower bounded, i.e. for some and for every schedule with , for some depending on . Finding a delivery schedule with time and energy turned out to be equivalent to solving a corresponding instance of Planar3SAT. By scaling the weights of all agents by a factor , this turns into finding a delivery schedule with time and energy .
Set . Consider any delivery schedule with time/energy . Either we have and thus immediately. Or we have . In this case, we let the fast agents of velocity and weight cover less than the original distance in Lemma 19. This saves an energy amount of for some . However, we have to replace this distance by either a slow agent, or by letting the fastest agent of velocity do more work. Either way, we increase the delivery time by at least , and we again get
Thus, finding a delivery schedule of minimum yields a delivery schedule with delivery time and energy consumption from which we can infer a satisfiable assignment as in Lemma 19. We conclude:
Theorem 14.
CombinedDelivery is -hard for all , even on planar graphs.