arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:1809.00077v1 [cs.DS] 31 Aug 2018

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.

Andreas Bärtschi Affiliation:  ETH Zürich, Department of Computer Science, Switzerland
{\left\{\right.andreas.baertschi, daniel.graf}\left.\right\}@inf.ethz.ch
   Daniel Graf Affiliation:  ETH Zürich, Department of Computer Science, Switzerland
{\left\{\right.andreas.baertschi, daniel.graf}\left.\right\}@inf.ethz.ch
   Matúš Mihalák Affiliation:  Department of Data Science and Knowledge Engineering, Maastricht University, Netherlands
matus.mihalak@maastrichtuniversity.nl
Abstract

We consider kk mobile agents initially located at distinct nodes of an undirected graph (on nn nodes, with edge lengths). The agents have to deliver a single item from a given source node ss to a given target node tt. The agents can move along the edges of the graph, starting at time 00, with respect to the following: Each agent ii has a weight ωi\omega_{i} that defines the rate of energy consumption while travelling a distance in the graph, and a velocity υi\upsilon_{i} with which it can move.

We are interested in schedules (operating the kk agents) that result in a small delivery time 𝒯\mathcal{T} (time when the item arrives at tt), and small total energy consumption \mathcal{E}. Concretely, we ask for a schedule that: either (i) Minimizes 𝒯\mathcal{T}, (ii) Minimizes lexicographically (𝒯,)(\mathcal{T},\mathcal{E}) (prioritizing fast delivery), or (iii) Minimizes ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E}, for a given ϵ(0,1)\epsilon\in\left(0,1\right).

We show that (i)(i) is solvable in polynomial time, and show that (ii) is polynomial-time solvable for uniform velocities and solvable in time 𝒪(n+klogk)\mathcal{O}(n+k\log k) for arbitrary velocities on paths, but in general is NP-hard even on planar graphs. As a corollary of our hardness result, (iii) is NP\mathrm{NP}-hard, too. We show that there is a 33-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 ss to a target node tt in a graph G=(V,E)G=(V,E) with edge lengths by a team of kk 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 ss to tt 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 NP\mathrm{NP}-hard on planar graphs [7, 8] and weakly NP\mathrm{NP}-hard on paths [14], and it remains NP\mathrm{NP}-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 𝒪(k+n3)\mathcal{O}(k+n^{3}) [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 G=(V,E)G=(V,E) on n=|V|n=|V| nodes. Each edge eEe\in E has a positive length lel_{e}. The length of a path is the sum of the lengths of its edges. We consider every edge e={u,v}e=\{u,v\} to consist of infinitely many points, where every point is uniquely characterized by its distance from uu, which is between 00 and lel_{e}. We consider every such point to subdivide the edge {u,v}\{u,v\} into two edges of lengths proportional to the position of the point on the edge. The distance dG(p,q)d_{G}(p,q) between two points pp and qq (nodes or points inside edges) of the graph is the length of a shortest path from pp to qq in GG. There are kk mobile agents initially placed on nodes p1,,pkp_{1},\ldots,p_{k} of GG. Every agent i=1,,ki=1,\ldots,k has a weight 0ωi<0\leq\omega_{i}<\infty and a velocity 0<υi0<\upsilon_{i}\leq\infty. Agents can traverse the edges of the graph. To traverse an edge ee (in either direction), agent ii needs time le/υil_{e}/\upsilon_{i} and ωile\omega_{i}\cdot l_{e} units of energy.

Furthermore there is a single package, initially (at time 0) placed on a source node ss, which has to be delivered to a given target node tt. 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 SS, we denote by di(S)d_{i}(S) the total distance travelled by agent ii, and by di(S)d_{i}^{*}(S) the distance travelled by agent ii while carrying the package. The total energy consumption of the solution is thus (S)=i=1kωidi(S)\mathcal{E}(S)=\sum_{i=1}^{k}\omega_{i}\cdot d_{i}(S) and the time needed to deliver the package is given by 𝒯(S)=i=1kdi(S)/υi+(the overall time the package is not carried).\mathcal{T}(S)=\sum_{i=1}^{k}d_{i}^{*}(S)/\upsilon_{i}+(\text{the overall time the package is not carried}). Fast and energy-efficient Delivery is the optimization problem of finding a solution that has small delivery time 𝒯\mathcal{T} as well as total energy consumption \mathcal{E}. We study the following three objectives (see Figure 1 for illustration):

(i)

Minimize the delivery time 𝒯\mathcal{T}.

(ii)

Lexicographically minimize the tuple (𝒯,)(\mathcal{T},\mathcal{E}), i.e. among all solutions with minimum 𝒯\mathcal{T},
find a solution that has minimum energy consumption \mathcal{E}.

(iii)

Minimize a convex combination ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E}, for some given value ϵ(0,1)\epsilon\in\left(0,1\right).

Recent parallel work studied the following complementary – energy focused – variants:

(iv)

Lexicographically minimize the tuple (,𝒯)(\mathcal{E},\mathcal{T}), i.e. prioritize the minimization of \mathcal{E} [12].

(v)

Minimize the energy consumption \mathcal{E} [9, 11].

Figure 1: Example for optima of variants of fast and energy-efficient Delivery:
(ii) Using agents 22 and 44, we get (𝒯,)=(max{6/2,12/3}+12/3, 46+212+212)=(8,72)(\mathcal{T},\mathcal{E})=(\max\left\{6/2,12/3\right\}+12/3,\ 4\cdot 6+2\cdot 12+2\cdot 12)=(8,72).
(iii) For ϵ=45\epsilon=\tfrac{4}{5}, using agents 11 and 44, we get 45𝒯=45(max{4.5/1,(12+1.5)/3}+(1.5+12)/3)\tfrac{4}{5}\mathcal{T}=\tfrac{4}{5}\left(\max\left\{4.5/1,(12+1.5)/3\right\}+(1.5+12)/3\right) and 15=15(4.52+(12+1.5)2+(1.5+12)2)\tfrac{1}{5}\mathcal{E}=\tfrac{1}{5}(4.5\cdot 2+(12+1.5)\cdot 2+(1.5+12)\cdot 2) for a combined total of 45(4.5+4.5)+15(9+27+27)=19.8\tfrac{4}{5}\left(4.5+4.5\right)+\tfrac{1}{5}(9+27+27)=19.8.
(iv) Using agents 11 and 33, we get (,𝒯)=(26+112+112,max{6/1,12/2}+12/2)=(36,12)(\mathcal{E},\mathcal{T})=(2\cdot 6+1\cdot 12+1\cdot 12,\ \max\left\{6/1,12/2\right\}+12/2)=(36,12).

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 t1,t2t_{1},t_{2} (0t1t2𝒯0\leq t_{1}\leq t_{2}\leq\mathcal{T}) the package is at the same position pp, then it remains at position pp for the time in-between (t[t1,t2]\forall t\in\left[t_{1},t_{2}\right]). 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 𝒯\mathcal{T} only. We call this optimization problem FastDelivery and show that there is a polynomial-time dynamic program of time complexity 𝒪(k2|E|+k|V|2+APSP)𝒪(k2n2+n3)\mathcal{O}(k^{2}|E|+k|V|^{2}+\mathrm{APSP})\subseteq\mathcal{O}(k^{2}n^{2}+n^{3}), where 𝒪(APSP)\mathcal{O}(\mathrm{APSP}) is the running time of an all-pair shortest path algorithm for undirected graphs.

In Section 4, we study FastEfficientDelivery, prioritizing the delivery time 𝒯\mathcal{T} over the energy consumption \mathcal{E}. We first show that the problem can be solved in polynomial time for uniform velocities. However, we prove the problem to be NP\mathrm{NP}-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 𝒪(n+klogk)\mathcal{O}(n+k\log k) algorithm for paths.

In Section 5, we show that for arbitrary given weights ϵ(0,1)\epsilon\in(0,1), the minimum convex combination ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E} can be 33-approximated by a single agent, while NP\mathrm{NP}-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 NP\mathrm{NP}-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 i1,i2,,ii_{1},i_{2},\ldots,i_{\ell} in this order can be represented by the drop-off locations of these agents only (note that for two consecutive agents i,ji,j, the drop-off location of agent ii, denoted by qiq_{i}^{-}, corresponds to the pick-up location of agent jj, denoted by qj+q_{j}^{+}). Since we allow in-edge handovers, there are infinitely many solutions – however, these can be divided into finitely many topologically compact sets. As ,𝒯\mathcal{E},\mathcal{T} 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 𝒯\mathcal{T} (the energy consumption \mathcal{E}, or ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E}, (𝒯,)(\mathcal{T},\mathcal{E}), (,𝒯)(\mathcal{E},\mathcal{T}), respectively).

3 Optimizing delivery time only

Throughout this section, we assume that all agents have weight ωi=0\omega_{i}=0. Hence in all three variants of fast energy-efficient Delivery, =0\mathcal{E}=0 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 {u,v}\left\{u,v\right\} in direction from uu to vv, then only the first involved agent will ever visit uu.

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 1,2,,i,1,2,\ldots,i,\ldots in the order in which they transport the package. Let ii be the first agent such that υiυi+1\upsilon_{i}\geq\upsilon_{i+1}. Now we can simply replace agent i+1i+1 by letting agent ii travel on the same trajectory on which i+1i+1 transported the package; and by doing so, we don’t increase the delivery time.

(ii) Let ii be the first agent that has to wait at its pick-up location for the package to arrive. Instead of waiting, we let ii proceed on the original trajectory of the package towards ss until it meets the preceding agent i1i-1. Handing over the package at this new spot cannot increase the delivery time 𝒯\mathcal{T}, as υi1<υi\upsilon_{i-1}<\upsilon_{i} (we only increase velocities along the trajectory). However, 𝒯\mathcal{T} might remain constant if this increase in velocity is countered by a longer waiting time of the package at the handover to agent i+1i+1.

(iii) Assume that multiple agents bring the package from uu to vv over the edge {u,v}\left\{u,v\right\}, by visiting uu first. By assumption (i) the last such agent ii has the highest velocity and thus agent ii can just as well pick up the package at uu without the help of the other agents. ∎

Corollary 3.

After a preprocessing step of time 𝒪(k+|V|)\mathcal{O}(k+|V|) – in which we remove in each node all but the agent with maximum velocity υi\upsilon_{i} – we may assume that k|V|k\leq|V|.

Towards a dynamic program.

Making use of characterization (i) of Lemma 2, we relabel the agents such that υ1υ2υk\upsilon_{1}\leq\upsilon_{2}\leq\ldots\leq\upsilon_{k}. We can then look at subproblems where we only use the first i1i-1 among all kk agents. Assume node vv^{*} is the first node that the new agent ii (starting at pip_{i}) 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 ii might arrive at node vv^{*} ‘late’, the package has already been dropped off there before by one of the agents 1,2,,i11,2,\ldots,i-1 and had been waiting.

b)

Agent ii might arrive at node vv^{*} ‘early’, in which case it should walk towards the package to receive it earlier and bring it back to vv^{*} faster (having larger velocity than the currently carrying agent, after all). In this case, agent ii picks up the package at a point pp which is strictly in the interior of the edge {u,v}\left\{u,v^{*}\right\} and which is as close to node vv^{*} as possible, i.e., pp must be reachable by both agent ii and the package – carried by only the first i1i-1 agents – at the earliest possible time: (d(pi,v)+d(v,p))/υi(d(p_{i},v^{*})+d(v^{*},p))/\upsilon_{i}.

Figure 2: Examples for cases a) and b): (left) Agent ii picks up the package at node vv^{*}.
(right) Agent ii picks up the package inside the edge (u,v)(u,v^{*}) 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 APSP\mathrm{APSP}. We denote the time needed for this precomputation by 𝒪(APSP)\mathcal{O}(\mathrm{APSP}). Then, given the agents in ascending order of their velocities υi\upsilon_{i}, for each prefix 1,2,i1,2,\ldots i of the agent order and each node vv we define the following subproblem:

S[i,v]=\displaystyle S\left[i,v\right]= A fastest schedule to bring the package to node vv using agents {1,,i}\left\{1,\ldots,i\right\}.
𝒯[i,v]=\displaystyle\mathcal{T}\left[i,v\right]= The time needed in S[i,v]S\left[i,v\right] to deliver the package to vv.
A[i,v]=\displaystyle A\left[i,v\right]= Index of the last agent to carry the package in S[i,v]S\left[i,v\right].
p[i,(u,v)]=\displaystyle p\left[i,(u,v)\right]= The pick-up point pp strictly inside edge {u,v}\left\{u,v\right\} and closest to vv, reachable
by both the package (coming from uu, delivered by agents 1,,i11,\ldots,i-1) and
agent ii (coming via vv) in time (d(pi,v)+d(v,p))/υi(d(p_{i},v)+d(v,p))/\upsilon_{i} (if applicable).

Note that although our graph only has undirected edges, p[i,(u,v)]p[i,(u,v)] considers an ordered tuple of nodes (u,v)(u,v), denoting that the package is transported from uu to vv. Thus p[i,(v,u)]p[i,(v,u)] has the analogous meaning of the package crossing edge {u,v}\left\{u,v\right\} from vv towards uu. Both p[i,(u,v)]p[i,(u,v)] and p[i,(v,u)]p[i,(v,u)] might be undefined, as can be seen below.

We compute the optimum delivery times 𝒯[i,v]\mathcal{T}[i,v] (together with A[i,v]A[i,v]) without explicitly maintaining the schedules S[i,v]S[i,v]. A concrete final schedule SS can then be retraced from A[,]A[,], see Theorem 4. For computing 𝒯[i,v]\mathcal{T}[i,v] and A[i,v]A[i,v] we ‘guess’ the first node vv^{*} of cases a) and b) above by trying each node vv as a candidate. We then can compute 𝒯[i,v]\mathcal{T}[i,v] and A[i,v]A[i,v] for all other nodes using the pre-computed distances between all pair of nodes:

  1. 1.

    Initialization: For all nodes vv, we initialize S[i,v]:=S[i1,v],A[i,v]:=A[i1,v]S[i,v]:=S[i-1,v],A[i,v]:=A[i-1,v] and 𝒯[i,v]:=𝒯[i1,v]\mathcal{T}[i,v]:=\mathcal{T}[i-1,v]. This automatically takes care of case a), where the package arrives at vv before agent ii can reach vv.

  2. 2.

    In-edge pick-ups: We go over all node pairs (u,v)(u,v) such that {u,v}E\left\{u,v\right\}\in E and check whether agent ii can pick up the package inside {u,v}\left\{u,v\right\} to advance it to node vv faster than in schedule S[i1,v]S[i-1,v]. We do so by checking whether we have d(pi,v)/υi<𝒯[i1,v]d(p_{i},v)/\upsilon_{i}<\mathcal{T}[i-1,v] and d(pi,u)/υi>𝒯[i1,u]d(p_{i},u)/\upsilon_{i}>\mathcal{T}[i-1,u]. In this case, agent ii receives the package from a previous agent jj that brought it from uu or from p[j,(u,v)]p[j,(u,v)]. Thus we get a set PP of candidates for p[i,(u,v)]:=argminpP{d(p,v)}p[i,(u,v)]:=\smash{\arg\min_{p\in P}}\left\{d(p,v)\right\}. The candidate set PP consists of all points pp strictly inside the edge {u,v}\left\{u,v\right\} such that there exists an agent of index jj, A[i1,u]j<iA[i-1,u]\leq j<i, for which we have

    max{𝒯[i1,u],d(pj,u)υj}+d(u,p)υj\displaystyle\max\left\{\mathcal{T}[i-1,u],\frac{d(p_{j},u)}{\upsilon_{j}}\right\}+\frac{d(u,p)}{\upsilon_{j}} =d(pi,v)+d(v,p)υi\displaystyle=\frac{d(p_{i},v)\ +\ d(v,p)}{\upsilon_{i}}
    if jj is coming from uu, or – if p[j,(u,v)]p[j,(u,v)] is defined –
    d(pj,v)+d(v,p[j,(u,v)])+d(p[j,(u,v)],p)υj\displaystyle\frac{d(p_{j},v)\ +\ d(v,p[j,(u,v)])\ +\ d(p[j,(u,v)],p)}{\upsilon_{j}} =d(pi,v)+d(v,p)υi.\displaystyle=\frac{d(p_{i},v)\ +\ d(v,p)}{\upsilon_{i}}.

    Having computed p[i,(u,v)]p[i,(u,v)] as the point in PP closest to vv, we update node vv accordingly: Set 𝒯[i,v]:=min{𝒯[i,v],d(pi,v)+2d(p[i,(u,v)],v)υi}\mathcal{T}[i,v]:=\min\left\{\mathcal{T}[i,v],\tfrac{d(p_{i},v)+2d(p[i,(u,v)],v)}{\upsilon_{i}}\right\}, where using ‘min\min’ takes care of cases in which we have multiple incident edges to vv that all potentially have in-edge pick-ups by ii, and set A[i,v]=iA[i,v]=i (valid since we consider the case where d(pi,v)<𝒯[i1,v]d(p_{i},v)<\mathcal{T}[i-1,v]).

  3. 3.

    Updates: So far we have computed the subproblems S[i,v]S[i,v] correctly, if node vv corresponds to the first node vv^{*} of cases a) and b) (in particular we checked whether the faster agent ii can help to advance the package over only one edge). Now we also consider all cases where agent ii transports the package over arbitrary distances, by updating all other schedules S[i,u]S[i,u] accordingly: For each node vv, for each node uu, if 𝒯[i,u]>max{𝒯[i,v],d(pi,v)/υi}+d(v,u)/υi\mathcal{T}[i,u]>\max\left\{\mathcal{T}[i,v],d(p_{i},v)/\upsilon_{i}\right\}+d(v,u)/\upsilon_{i} we set A[i,u]:=iA[i,u]:=i and 𝒯[i,u]:=max{𝒯[i,v],d(pi,v)/υi}+d(v,u)/υi\mathcal{T}[i,u]:=\max\left\{\mathcal{T}[i,v],d(p_{i},v)/\upsilon_{i}\right\}+d(v,u)/\upsilon_{i}.

Theorem 4.

An optimum schedule for FastDelivery of a single package can be computed in time 𝒪(k2|E|+k|V|2+APSP)𝒪(k2n2+n3)\mathcal{O}(k^{2}|E|+k|V|^{2}+\mathrm{APSP})\subseteq\mathcal{O}(k^{2}n^{2}+n^{3}).

Proof.

For each ii from 11 to kk we can compute all values A[i,v],𝒯[i,v]A[i,v],\ \mathcal{T}[i,v] in time 𝒪(|V|)\mathcal{O}(|V|) for the initialization, 𝒪(|E|k)\mathcal{O}(|E|k) to check for in-edge pick-ups and 𝒪(|V|2)\mathcal{O}(|V|^{2}) for the updates (for which we need precomputed all-pair shortest paths). Overall we get a running time of 𝒪(APSP+k2|E|+k|V|2)\mathcal{O}(\mathrm{APSP}+k^{2}|E|+k|V|^{2}). The delivery time is then given in 𝒯[k,t]\mathcal{T}[k,t]. 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 S[i,v]S[i,v], we retrace the concrete schedule SS from A[,]A[,] by backtracking: Let ii denote the last used agent A[k,t]A[k,t]. We can find ii’s ‘first node’ vv^{*} in time 𝒪(|V|)\mathcal{O}(|V|) by searching for the smallest value 𝒯[i,u]\mathcal{T}[i,u] such that

max{𝒯[i,u],d(pi,u)/υi}=𝒯[k,t]d(u,t)/υi.\max\left\{\mathcal{T}[i,u],d(p_{i},u)/\upsilon_{i}\right\}=\mathcal{T}[k,t]-d(u,t)/\upsilon_{i}.

If A[i,v]iA[i,v^{*}]\neq i, we recurse, otherwise we find the correct adjacent node and all in-edge handovers by looking – for each of the 𝒪(deg(v))\mathcal{O}(\deg(v^{*})) many neighbors uu of vv^{*} – at the overall 𝒪(kdeg(v))\mathcal{O}(k\deg(v^{*})) many values p[j,(u,v)]p[j,(u,v^{*})] (where jij\leq i) and 𝒯[j,u]\mathcal{T}[j,u] (where j<ij<i). ∎

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 (i,j:υi=υj\forall i,j\colon\upsilon_{i}=\upsilon_{j}), due to a characterization of optimum schedules. In contrast, we prove NP\mathrm{NP}-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 𝒪(n+klogk)\mathcal{O}(n+k\log k)-time algorithm.

4.1 A polynomial-time algorithm for uniform velocities

Lemma 5.

Consider FastEfficientDelivery on instances with uniform agent velocities and let δ\delta denote the offset of the closest agent’s starting position to ss. Then there exists an optimum schedule such that the pick-up position qi+q_{i}^{+} of each involved agent ii satisfies:

  • d(s,qi+)+d(qi+,t)=d(s,t)d(s,q_{i}^{+})+d(q_{i}^{+},t)=d(s,t), i.e., qi+q_{i}^{+} lies on a shortest ss-tt-path, and

  • d(pi,qi+)δ+d(s,qi+)d(p_{i},q_{i}^{+})\leq\delta+d(s,q_{i}^{+}), with equality if qi+q_{i}^{+} lies strictly inside an edge.

Proof.

Since all agents have the same velocity υ¯\overline{\upsilon}, any fastest delivery of the package must follow a shortest path from ss to tt. Furthermore, since the closest agent could deliver the package on its own in time (δ+d(s,t))/υ¯(\delta+d(s,t))/\overline{\upsilon}, each involved agent ii has to arrive at qi+q_{i}^{+} no later than the package itself, giving d(pi,qi+)δ+d(s,qi+)d(p_{i},q_{i}^{+})\leq\delta+d(s,q_{i}^{+}). It remains to show that we can modify every optimum solution into an optimum solution in which we have d(pi,qi+)=δ+d(s,qi+)d(p_{i},q_{i}^{+})=\delta+d(s,q_{i}^{+}) whenever qi+q_{i}^{+} lies strictly inside an edge e={u,v}e=\{u,v\}. Denote by ii the first agent for which this is not the case and by i1i-1 its preceding agent. Assume that the package enters ee via uu (i.e. d(s,u)<d(s,v)d(s,u)<d(s,v)). Note that ii must have entered ee via vv, since otherwise the energy consumption could be improved by letting ii pick up the package already at uu (without increasing the delivery time), contradicting the optimality of our solution. Now we distinguish two cases relating the weights ωi\omega_{i} and ωi1\omega_{i-1}, yielding either a decrease of the energy consumption, or a possibility to move qi+q_{i}^{+} to a position satisfying the characterization.

  • 2ωi>ωi12\omega_{i}>\omega_{i-1}: Moving qi+q_{i}^{+} by ϵ>0\epsilon>0 towards vv decreases \mathcal{E} by an amount of (2ωiωi1)ϵ>0(2\omega_{i}-\omega_{i-1})\cdot\epsilon>0.

  • 2ωiωi12\omega_{i}\leq\omega_{i-1}: We move qi+q_{i}^{+} towards uu (without increasing neither delivery time nor energy consumption) until we reach qi+=uq_{i}^{+}=u, or qi+q_{i}^{+} inside the edge {u,v}\left\{u,v\right\} such that d(pi,qi+)=δ+d(s,qi+)d(p_{i},q_{i}^{+})=\delta+d(s,q_{i}^{+}), or qi+=qi1+q_{i}^{+}=q_{i-1}^{+}. In the last case, discarding agent i1i-1 from our solution results in an energy consumption decrease of at least ωi1d(pi1,qi1+)>0\omega_{i-1}\cdot d(p_{i-1},q_{i-1}^{+})>0. ∎

Polynomial-time algorithm

We use the characterization in Lemma 5 to find an optimum solution for FastEfficientDelivery of delivery time 𝒯=(δ+d(s,t))/υ¯\mathcal{T}=(\delta+d(s,t))/\overline{\upsilon}: For each agent ii, we compute the set QiQ_{i} of all potential pick-up locations, i.e., the set of points qiq_{i} that satisfy Lemma 5. The number of potential locations is |Qi|𝒪(|V|+|E|)𝒪(n2)|Q_{i}|\in\mathcal{O}(|V|+|E|)\subseteq\mathcal{O}(n^{2}). Then we build an auxiliary directed acyclic multi-graph HH on a node set V(H)=i=1kQiV(H)=\bigcup_{i=1}^{k}Q_{i}, of size |V(H)|𝒪(|V|+k|E|)𝒪(kn2)|V(H)|\in\mathcal{O}(|V|+k|E|)\subseteq\mathcal{O}(kn^{2}). Each directed edge in E(H)E(H) describes how agent ii can contribute to the delivery by bringing the package from its starting position qiq_{i} to another agent’s starting position qjq_{j} along a shortest ss-tt-path: For each pair of nodes qiQiq_{i}\in Q_{i} and qjV(H)q_{j}\in V(H) such that qiqjq_{i}\neq q_{j} and d(s,qi)+d(qi,qj)+d(qj,t)=d(s,t)d(s,q_{i})+d(q_{i},q_{j})+d(q_{j},t)=d(s,t), we add an arc (qi,qj)(q_{i},q_{j}) of weight ωi(d(pi,qi)+d(qi,qj))\omega_{i}\cdot(d(p_{i},q_{i})+d(q_{i},q_{j})) to E(H)E(H). Overall, we have at most |E(H)|𝒪(kn2kn2)|E(H)|\in\mathcal{O}(k\cdot n^{2}\cdot kn^{2}) many arcs. By construction of HH, running Dijkstra’s shortest path algorithm on the multi-graph HH finds a shortest path from ss to tt corresponding to an optimal solution.

Theorem 6.

An optimum solution for FastEfficientDelivery can be found in time 𝒪(k2n4)\mathcal{O}(k^{2}n^{4}), assuming all agents have the same velocity.

4.2 NP\mathrm{NP}-hardness on planar graphs

Contrary to FastDelivery (where we had non-decreasing velocities υi\upsilon_{i}), when prioritizing delivery time but still regarding energy consumption, we can’t characterize the order of the agents by their coefficients (υi,ωi)(\upsilon_{i},\omega_{i}): Consider an instance in which both the starting position pap_{a} of the absolutely fastest agent aa as well as the package destination tt are separated from the rest of the graph by two very long edges qa+q_{a}^{+}pap_{a}, qa+q_{a}^{+}tt. Then in every fastest solution, agent aa (with υa\upsilon_{a} large, e.g. 88) must deliver the package from qa+q_{a}^{+} to tt, see Figure 3 (right).

In FastEfficientDelivery, the task is thus to balance slow but efficient agents (with, e.g., υ=1,ω=0\upsilon=1,\omega=0) and fast inefficient agents (with, e.g., υ=2,ω=1\upsilon=2,\omega=1) to collectively deliver the package to aa’s pick-up location qa+q_{a}^{+} just-in-time – i.e., in time d(pa,qa+)/υad(p_{a},q_{a}^{+})/\upsilon_{a}without using too much energy. We can construct suitable instances by a reduction from Planar3SAT [28] (Sketch): Starting from a planar formula FF in three-conjunctive normal form, as in Figure 3 (left), we build a delivery graph G(F)G(F). This can be done such that the instance is guaranteed to have schedules with minimum delivery time, i.e. with 𝒯=d(pa,t)/υa\mathcal{T}=d(p_{a},t)/\upsilon_{a}. However, there should only be such a minimum-time schedule which simultaneously has low energy consumption \mathcal{E} if and only if the formula FF 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 qa+q_{a}^{+} 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 NP\mathrm{NP}-hard, even on planar graphs.

Figure 3: (left) A planar 3CNF formula FF, satisfiable by (u1,u2,u3,u4)=(true, false, false, true).(u_{1},u_{2},u_{3},u_{4})=(\text{true, false, false, true}). (right) Its transformation into a corresponding delivery graph G(F)G(F). The satisfiable assignment of FF corresponds to a low-cost delivery in G(F)G(F) via paths P1,true,P2,false,P3,false,P4,trueP_{1,\mathrm{true}},P_{2,\mathrm{false}},P_{3,\mathrm{false}},P_{4,\mathrm{true}}, and vice versa. We have slow agents for clauses (\square), fast agents for variables/literals (++) and a very fast agent (×\times).

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 pap_{a}qaq_{a}tt 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 𝒪(n+klogk)\mathcal{O}(n+k\log k). 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 𝒪(n+klogk)\mathcal{O}(n+k\log k) as well, and that these instances can be combined in time 𝒪(k)\mathcal{O}(k), giving an overall 𝒪(n+klogk)\mathcal{O}(n+k\log k)-time algorithm.

Decomposition into uniform velocity instances

In the following, we look at the path graph GG as the real line, and assume (after performing a depth-first search from ss and ordering the starting positions in time 𝒪(n+klogk)\mathcal{O}(n+k\log k)) without loss of generality that s=0<ts=0<t, that p1p2pkp_{1}\leq p_{2}\leq\ldots\leq p_{k} and that n=k+2n=k+2, as the only relevant nodes on the line are ss, tt and the starting positions pip_{i}. Note that in an optimum solution of FastEfficientDelivery, no agent ii will ever take over the package from another agent jj which ii overtakes from the left. In particular, this means that we will need at most one agent with starting position pi<sp_{i}<s, and that after the package is picked up at ss, it will never have to wait between a drop-off by an agent jj and a pick-up by the next agent ii, since jj could continue carrying the package towards ii, thus decreasing the overall delivery time. Hence in an optimum schedule we also have for consecutive agents i,ji,j with s<pj<pis<p_{j}<p_{i}, that υjυi\upsilon_{j}\leq\upsilon_{i} (otherwise we can discard ii, by this decreasing the delivery time).

Decomposition.

Assume that agent ii is the agent that delivers the package to tt. We represent the trajectory of the package while being carried by ii as a ray giving the position yy on the real line as a function fi(x)f_{i}(x) of the time xx passed so far, see Figure 4 (right). We now inductively compute a set containing all functions f0,f1,,fkf_{0},f_{1},\ldots,f_{k}, where f0(x)=s=0f_{0}(x)=s=0.

If we have pi<0p_{i}<0, then by the reasoning above, ii is the only involved agent, and the function is simply fi:y=υix+pif_{i}\colon y=\upsilon_{i}\cdot x+p_{i}. For pi>sp_{i}>s, the slope υi\upsilon_{i} of the ray is set, but not its pick-up position. In order to minimize the earliest possible delivery time xx (i.e. fi(x)=tf_{i}(x)=t), by the non-decreasing velocity property ii must pick up the package as early as possible – e.g. in Figure 4 (left), the fastest agent 66 would not get the package from agent 44, but from agent 55 who is able to speed up the transport between agents 44 and 66, thus advancing the last handover position and allowing agent 66 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 y=piυixy=p_{i}-\upsilon_{i}\cdot x (modelling the agent moving towards ss) with any preceding ray f0,,fi1f_{0},\ldots,f_{i-1}. Let qi:=(xi,yi)q_{i}:=(x_{i},y_{i}) denote the intersection point of the query line with the upper envelope of the preceding rays, and denote by fjf_{j} a ray of steepest slope υj\upsilon_{j} among all rays f0,,fi1f_{0},\ldots,f_{i-1} that contain qiq_{i} – e.g. the query line “6?6?” in Figure 4 (right) intersects both f1f_{1} and f5f_{5} on the upper envelope, and since both have the same slope, we can consider either.

In case υj>υi\upsilon_{j}>\upsilon_{i}, agent ii will not be used in an optimal schedule and we set fi=0f_{i}=0. If, however, υjυi\upsilon_{j}\leq\upsilon_{i}, then fif_{i} is given by the line equality fi:y=υix+(yiυixi)f_{i}\colon y=\upsilon_{i}\cdot x+(y_{i}-\upsilon_{i}\cdot x_{i}). After completion, an optimum schedule corresponds to a path along the rays of our diagram from (0,0)(0,0) to the ray reaching y=ty=t at the earliest possible time.

Figure 4: (left) Possible optima: If agent 44 is involved, it must take over the package from agent 22, since agent 33 is too slow. Using agents 22 and 44 to bring the package to agent 5’s pick-up position takes the same time as using agent 11 on its own. Agents 11 and 55 have the same velocity, so in terms of delivery time we could use either or even both of them, but agent 11 only if agents 22 and 44 are both not used (otherwise they all consume energy). (right) Fastest solutions correspond to at most 11 agent with pi<sp_{i}<s and a number of agents corresponding to a suffix of the upper envelope.
Fast computation and recombination

To quickly compute the equation of each ray fif_{i}, we need to find the intersection of a query line with the upper envelope of 𝒪(k)\mathcal{O}(k) 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 fif_{i}). The dynamic planar convex hull data structure by Brodal and Jacob [5, 26] allows point insertions and tangent queries all in 𝒪(logk)\mathcal{O}(\log k) amortized time, giving an overall running time of 𝒪(klogk)\mathcal{O}(k\log k). 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 𝒪(n+klogk)\mathcal{O}(n+k\log k).

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 υ¯\overline{\upsilon}. As before, we denote by δ\delta the offset of the closest agent’s starting position to ss, and let aa denote the corresponding agent. No agent ii with pi<sp_{i}<s other than maybe agent aa is involved in an optimum schedule (all others would only slow down delivery). Also note that if pa<sp_{a}<s, the setting is equivalent to one where aa starts at s+(spa)s+(s-p_{a}), so we can assume (after relabelling the agents) a=1a=1, δ=p1\delta=p_{1}. This also implies 𝒯=(δ+(ts))/υ¯\mathcal{T}=(\delta+(t-s))/\overline{\upsilon} and we can ignore agents ii that are dominated by earlier, cheaper agents jj with pj<pip_{j}<p_{i} and ωj<ωi\omega_{j}<\omega_{i}.

Towards a dynamic program.

We define the point qiq_{i} as the leftmost point on the line where agent ii can pick up the package without causing a delay, i.e., we have qi:=pi+sδ2q_{i}:=\frac{p_{i}+s-\delta}{2} since piqi=δ+(qis)p_{i}-q_{i}=\delta+(q_{i}-s). Note that q1=sq_{1}=s and qj<qiq_{j}<q_{i} for j<ij<i. 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 ii that is involved in advancing the package picks it up at qi+=qiq_{i}^{+}=q_{i} or at qi+=piq_{i}^{+}=p_{i}.

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:

S[i]=\displaystyle S\left[i\right]= An energy-optimal schedule to deliver the package to pip_{i}
in time (δ+(pis))/υ¯(\delta+(p_{i}-s))/\overline{\upsilon}, using only the agents {1,2,,i}\left\{1,2,\ldots,i\right\}.
[i]=\displaystyle\mathcal{E}\left[i\right]= Energy consumption of S[i]S\left[i\right].
A[i]=\displaystyle A\left[i\right]= Index of the last package-carrying agent in S[i]S\left[i\right].
A[i]=\displaystyle A^{\prime}\left[i\right]= Index of the second to last carrying agent in S[i]S\left[i\right] (if any).

We will argue how to compute the optimum energy costs [i]\mathcal{E}[i] (and with it A[i]A[i] and A[i]A^{\prime}[i]) without explicitly maintaining the schedules S[i]S[i] (S[i]S[i] can later be retraced from A[i]A[i] and A[i]A^{\prime}[i]). For computing [i]\mathcal{E}[i], A[i]A[i] and A[i]A^{\prime}[i], we distinguish four cases (also shown in Figure 5):

  1. 1.

    Agent ii is not involved in S[i]S[i].

  2. 2.

    Agent ii is involved in S[i]S[i]. Hence by Lemma 9, agent ii has pick-up location qi+=qiq_{i}^{+}=q_{i}; and we get the following three variations:

    1. (a)

      i=1i=1 and agent 11 picks up the package at ss itself.

    2. (b)

      Agent ii picks up the package from some other agent jj with pjqip_{j}\leq q_{i}.

    3. (c)

      Agent ii picks up the package from some other agent jj with pj>qip_{j}>q_{i}.

Figure 5: Case distinction in the dynamic program for FastEfficientDelivery on the line. Either agent ii is not involved at all, does all on its own or is subsequent to some agent jj, where we distinguish between pjqip_{j}\leq q_{i} and pj>qip_{j}>q_{i}.

In cases 1, 2b) and 2c), we can determine [i]\mathcal{E}[i] in constant time using a single prior entry of the dynamic programming table:

Case 1.

If ii is not involved in S[i]S[i], the best choice for the agent who transports the package to pip_{i} is agent i1i-1, as it is the cheapest one on the last segment [pi1,pi][p_{i-1},p_{i}] and we have [i1][j]+(pi1pj)ωj\mathcal{E}[i-1]\leq\mathcal{E}[j]+(p_{i-1}-p_{j})\cdot\omega_{j} for all j<i1j<i-1 by induction. Hence we can optimize in constant time:

[i]\displaystyle\mathcal{E}[i] =minj<i{[j]+(pipj)ωj}=[i1]+(pipi1)ωi1,\displaystyle=\min_{j<i}\{\mathcal{E}[j]+(p_{i}-p_{j})\cdot\omega_{j}\}=\mathcal{E}[i-1]+(p_{i}-p_{i-1})\cdot\omega_{i-1},
A[i]\displaystyle A[i] =i1 and A[i]=A[i1].\displaystyle=i-1\text{ and }A^{\prime}[i]=A[i-1].
Case 2.a)

This is the base case where the first agent is on its own:

[1]=2|p1s|ω1=2δω1,A[1]=none,A[1]=none.\displaystyle\mathcal{E}[1]=2\cdot\lvert p_{1}-s\rvert\cdot\omega_{1}=2\cdot\delta\cdot\omega_{1},\quad A[1]=\text{none},\ A^{\prime}[1]=\text{none}.
Case 2.b)

If agent ii is involved in S[i]S[i] and takes over at qiq_{i} from an agent jj with pjqip_{j}\leq q_{i}, we want jj to minimize [j]+(qipj)ωj\mathcal{E}[j]+(q_{i}-p_{j})\cdot\omega_{j}, the cost of bringing the package to qiq_{i}. Now let i=max{jpjqi}i^{\prime}=\max\{j\mid p_{j}\leq q_{i}\} be the agent starting closest to the left of qiq_{i}. As in Case 1, we argue that ii^{\prime} is the optimum choice for jj, as it minimizes the cost on [pi,qi][p_{i^{\prime}},q_{i}] and does not constrain the schedule up to pip_{i^{\prime}} further. Hence, we again get in amortized constant time, i.e., we update ii^{\prime} by incrementing it lazily when going from ii to i+1i+1:

[i]\displaystyle\mathcal{E}[i] =[i]+(qipi)ωi+2(piqi)ωi,A[i]=i,A[i]=i.\displaystyle=\mathcal{E}[i^{\prime}]+(q_{i}-p_{i^{\prime}})\cdot\omega_{i^{\prime}}+2\cdot(p_{i}-q_{i})\cdot\omega_{i},\quad A[i]=i,\ A^{\prime}[i]=i^{\prime}.

The most interesting case is the remaining case (2.c)(2.c), where the agent jj handing over to ii starts in between qiq_{i} and pip_{i}. Where can we look up the energy consumption cc of an optimum schedule that ends with jj bringing the package qiq_{i} – the dynamic program being only defined for points pjp_{j}? For some jj, we might have A[j]=jA[j]=j, so S[j]S[j] ends by jj walking to qjq_{j} and back. In that case, we can exploit qj<qiq_{j}<q_{i} and use [j](pjqi)ωj\mathcal{E}[j]-(p_{j}-q_{i})\cdot\omega_{j} as a candidate for the energy consumption cc. But what if A[j]jA[j]\neq j? As we saw, this implies A[j]=j1A[j]=j-1, but in that case we cannot just subtract (pjqi)ωj(p_{j}-q_{i})\omega_{j}: We do not know how S[j]S[j] looks like between qiq_{i} and pjp_{j}. We argue that we do not need to consider these agents jj as candidates at all!

Lemma 10.

If in some optimal schedule S[i]S[i] the agent jj preceding ii is of type 2.c), then in the schedule S[j]S[j] we have A[j]=jA[j]=j.

Proof.

Under the assumption of Case 2.c), the cost of agent ii is fixed to 2(piqi)ωi2\cdot(p_{i}-q_{i})\cdot\omega_{i}. Agents 11 to i1i-1 will collaborate in the most efficient way to bring the package up to qiq_{i}. By definition of jj, jj is the last agent bringing the package to qiq_{i}. From the decreasing weight property, we know that none of the agents j+1j+1 to i1i-1 were involved in S[i]S[i]. So if we take the partial schedule of S[i]S[i] up to qiq_{i} and extend it by letting jj bring the package to pjp_{j}, we obtain a feasible candidate schedule SS^{\prime} for S[j]S[j] as none of the agents j+1j+1 to ii are involved. We now argue that SS^{\prime} is an optimum schedule for S[j]S[j]. The segment [qi,pj][q_{i},p_{j}] is covered with the minimum possible energy, as jj is the unique most efficient agent available for S[j]S[j]. The segment [s,qi][s,q_{i}] is also covered cheapest possible as its part of S[i]S[i] was optimized over all agents 11 to ii, so a superset of the agents available for S[j]S[j]. Moreover, the uniqueness implies that all optimum schedules for S[j]S[j] need to end with agent jj on [qi,pj][q_{i},p_{j}], hence A[j]=jA[j]=j. ∎

Case 2.c)

Lemma 10 leaves us with only those agents jj whose schedules S[j]S[j] we understand sufficiently to modify them into candidates for S[i]S[i] under Case 2.c):

[i]\displaystyle\mathcal{E}[i] =minj{[j](pjqi)ωjqi<pj<piA[j]=j}+2(piqi)ωi,\displaystyle=\min_{j}\{\mathcal{E}[j]-(p_{j}-q_{i})\omega_{j}\mid q_{i}<p_{j}<p_{i}\wedge A[j]=j\}+2(p_{i}-q_{i})\omega_{i},
A[i]\displaystyle A[i] =i,A[i]=argminj{[j](pjqi)ωjqi<pj<piA[j]=j}.\displaystyle=i,\ \,A^{\prime}[i]=\argmin_{j}\{\mathcal{E}[j]-(p_{j}-q_{i})\omega_{j}\mid q_{i}<p_{j}<p_{i}\wedge A[j]=j\}.

We can now take [i]\mathcal{E}[i] as the minimum over the four cases 1–2.c) and compute all schedules S[i]S[i] by proceeding over all subproblems in increasing order, giving us the energy-optimal schedules for delivering the package to the points pip_{i} in time (δ+(pis))/υ¯(\delta+(p_{i}-s))/\overline{\upsilon}. How can we use the solutions to the subproblems [i]\mathcal{E}[i] to find the energy \mathcal{E} of an energy-optimal schedule delivering the package to the target tt in optimum time (δ+(ts))/υ¯(\delta+(t-s))/\overline{\upsilon}? Let kk^{\prime} be the closest agent on the left of tt, i.e., k:=argmaxipitk^{\prime}:=\argmax_{i}{p_{i}\leq t}. Clearly, if in an optimum schedule the package is delivered to tt by an agent starting to the left of tt, then by the decreasing weight property this agent must be agent kk^{\prime}, giving us =[k]+(tpk)ωk\mathcal{E}=\mathcal{E}[k^{\prime}]+(t-p_{k^{\prime}})\cdot\omega_{k}.

Delivery to tt and agents with pi>tp_{i}>t.

It remains to take care of agents with starting positions pi>tp_{i}>t:

Figure 6: An example, where the only optimum schedule uses both agents on the right of tt. The optimum schedule has delivery time 𝒯=(p1+ts)/υ¯=5/1=5\mathcal{T}=(p_{1}+t-s)/\overline{\upsilon}=5/1=5 and energy consumption =p1ω1+(p2q2+q3q2)ω2+(p3q3+tq3)ω3=35+41+50=19\mathcal{E}=p_{1}\cdot\omega_{1}+(p_{2}-q_{2}+q_{3}-q_{2})\cdot\omega_{2}+(p_{3}-q_{3}+t-q_{3})\cdot\omega_{3}=3\cdot 5+4\cdot 1+5\cdot 0=19.

As illustrated in Figure 6, multiple agents with pi>tp_{i}>t might be involved in the most efficient delivery. Note that our dynamic programming problem [i]\mathcal{E}[i] is defined independent of tt and so we can also easily compute [i]\mathcal{E}[i] for pi>tp_{i}>t. Agents ii with qi>tq_{i}>t are not useful, however, for a delivery to tt, as they arrive in [s,t][s,t] only after the package has been delivered. Similar to Lemma 10, we claim that among the remaining agents ii only those with A[i]=iA[i]=i need to be considered:

Lemma 11.

If an agent ii with pi>tp_{i}>t is the last agent in any optimal schedule SS from ss to tt, then A[i]=iA[i]=i.

Proof.

We have qi<t<piq_{i}<t<p_{i}. By the decreasing weight property, no agent j>ij>i will be used in SS. We extend SS to a schedule SS^{\prime} by letting agent ii walk from tt to pip_{i}. Then SS^{\prime} is a candidate for S[i]S[i]. Similar to Lemma 10, SS^{\prime} consists of an optimal solution for [s,t][s,t] and the strictly cheapest agent on [t,pi][t,p_{i}] and hence SS^{\prime} is optimal for S[i]S[i] and all optimum schedules for S[i]S[i] have A[i]=iA[i]=i. The optimum ss-tt-delivery is thus given by:

=minj{[j](pjt)ωj(qj<t<pj and A[j]=j) or j=k},\displaystyle\mathcal{E}=\min_{j}\left\{\mathcal{E}[j]-(p_{j}-t)\omega_{j}\mid\left(q_{j}<t<p_{j}\text{ and }A[j]=j\right)\text{ or }j=k^{\prime}\right\},

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 [i]\mathcal{E}[i]) the minimization over the set of options in Case 2.c). Each option evaluates a linear function fj(qi):=ωjqi+([j]pjωj)f_{j}(q_{i}):=\omega_{j}\cdot q_{i}+(\mathcal{E}[j]-p_{j}\cdot\omega_{j}) at position qiq_{i}, 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 υ¯\overline{\upsilon} on the line can be computed in 𝒪(n+klogk)\mathcal{O}(n+k\log k) 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 ss 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 𝒪(n+klogk)\mathcal{O}(n+k\log k) 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 𝒯\mathcal{T} and the energy consumption \mathcal{E} by minimizing the term ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E}, for a given value ϵ, 0<ϵ<1\epsilon,\ 0<\epsilon<1. We call the problem of minimizing this combined objective CombinedDelivery. As an application of the NP\mathrm{NP}-hardness proof for FastEfficientDelivery, we get NP\mathrm{NP}-hardness of CombinedDelivery as well: The main idea is to counter small values of ϵ\epsilon by scaling the weights of the agents by a small factor δ(ϵ)\delta(\epsilon), thus decreasing the importance of \mathcal{E} alongside 𝒯\mathcal{T} as well.

Theorem 14.

CombinedDelivery is NP\mathrm{NP}-hard for all ϵ(0,1)\epsilon\in(0,1), even on planar graphs.

A 33-approximation for CombinedDelivery using a single agent

Recall that for FastDelivery, the agents involved in an optimum delivery were characterized by increasing velocities υi\upsilon_{i}, while for FastEfficientDelivery on path graphs, the agents of an optimum solution were characterized by decreasing tuples (υi1,ωi)(\upsilon_{i}^{-1},\omega_{i}).

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 1,2,,i1,2,\ldots,i denote the indices of all involved agents appearing in that order in an optimum CombinedDelivery schedule. Then the last agent ii is minimal in the following sense: iargminj{ϵυj1+(1ϵ)ωj}i\in\arg\min_{j}\smash{\left\{\epsilon\cdot\upsilon_{j}^{-1}+(1-\epsilon)\cdot\omega_{j}\right\}}.

Proof.

Recall that we denote by djd_{j} the total distance travelled by agent jj and by djd_{j}^{*} the distance travelled by agent jj while carrying the package. Thus agent jj contributes at least ϵdjυj1+(1ϵ)(djωj)dj(ϵυj1+(1ϵ)ωj)\epsilon\cdot d_{j}^{*}\cdot\upsilon_{j}^{-1}+(1-\epsilon)\cdot\left(d_{j}\cdot\omega_{j}\right)\geq d_{j}^{*}\cdot\left(\epsilon\upsilon_{j}^{-1}+(1-\epsilon)\omega_{j}\right) towards ϵ𝒯+(1ϵ)\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}. Assume for the sake of contradiction that the minimum value ϵυj1+(1ϵ)ωj\epsilon\upsilon_{j}^{-1}+(1-\epsilon)\omega_{j} is not obtained by agent ii but by an agent m<im<i. Then we can replace the agents m+1,,im+1,\ldots,i by agent mm, resulting in a decrease in the objective function of at least

j=m+1iϵdjυj1+(1ϵ)djωjj=m+1idj(ϵυm1+(1ϵ)ωm)\displaystyle\sum\limits_{j=m+1}^{i}\epsilon d_{j}^{*}\upsilon_{j}^{-1}+(1-\epsilon)d_{j}\omega_{j}-\sum\limits_{j=m+1}^{i}d_{j}^{*}\left(\epsilon\upsilon_{m}^{-1}+(1-\epsilon)\omega_{m}\right)
j=m+1idj(ϵυj1+(1ϵ)ωj)j=m+1idj(ϵυm1+(1ϵ)ωm)\displaystyle\geq\sum\limits_{j=m+1}^{i}d_{j}^{*}\left(\epsilon\upsilon_{j}^{-1}+(1-\epsilon)\omega_{j}\right)-\sum\limits_{j=m+1}^{i}d_{j}^{*}\left(\epsilon\upsilon_{m}^{-1}+(1-\epsilon)\omega_{m}\right)
di(ϵυi1+(1ϵ)ωi)di(ϵυm1+(1ϵ)ωm)>0,\displaystyle\geq d_{i}^{*}\left(\epsilon\upsilon_{i}^{-1}+(1-\epsilon)\omega_{i}\right)-d_{i}^{*}\left(\epsilon\upsilon_{m}^{-1}+(1-\epsilon)\omega_{m}\right)>0,

contradicting the minimality of the optimum CombinedDelivery schedule. ∎

Theorem 16.

There is a 33-approximation for CombinedDelivery which uses only a single agent (and thus can be found in polynomial time).

Proof.

Note that agent ii contributes at most ϵdiυi1+(1ϵ)diωi\epsilon d_{i}\upsilon_{i}^{-1}+(1-\epsilon)d_{i}\omega_{i} towards ϵ𝒯+(1ϵ)\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}. Starting from an optimum CombinedDelivery schedule we can replace all agents 1,,i11,\ldots,i-1 along their trajectories by the minimal agent ii. This prolongs the travel distance of agent ii by 2j=1i1dj2\cdot\sum_{j=1}^{i-1}d_{j}^{*}. Overall, we increase the objective function by at most

2j=1i1dj(ϵυi1+(1ϵ)ωi)2j=1idj(ϵυj1+(1ϵ)ωj)2(ϵ𝒯+(1ϵ)).\displaystyle 2\sum\limits_{j=1}^{i-1}d_{j}^{*}\left(\epsilon\upsilon_{i}^{-1}+(1-\epsilon)\omega_{i}\right)\leq 2\sum\limits_{j=1}^{i}d_{j}^{*}\left(\epsilon\upsilon_{j}^{-1}+(1-\epsilon)\omega_{j}\right)\leq 2\left(\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}\right).

Hence only using agent ii to deliver the package is a 33-approximation for CombinedDelivery. We get a polynomial-time approximation algorithm with approximation ratio 33 by choosing among all kk agents the one with minimum value (ϵυj1+(1ϵ)ωj)(d(pj,s)+d(s,t))\left(\epsilon\upsilon_{j}^{-1}+(1-\epsilon)\omega_{j}\right)\cdot\left(d(p_{j},s)+d(s,t)\right). ∎

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 NP\mathrm{NP}-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 𝒯\mathcal{T} (the energy consumption \mathcal{E}, or ϵ𝒯+(1ϵ)\epsilon\cdot\mathcal{T}+(1-\epsilon)\cdot\mathcal{E}, (𝒯,)(\mathcal{T},\mathcal{E}), (,𝒯)(\mathcal{E},\mathcal{T}), respectively).

Proof.

A solution which operates agents 1,2,,1,2,\ldots,\ell (after relabeling) in this order is uniquely described by the order of those agents and their drop-off locations qiq_{i}^{-}: Agent 11 picks up the package at ss and drops off the package at q1q_{1}^{-}, agent 22 picks it up at q1q_{1}^{-} and drops it off at q2q_{2}^{-}, …, and agent {\ell} drops off the package at q=tq_{{\ell}}^{-}=t.

To each drop-off location we assign an energy consumption- and a time-measure: Let (qi)\mathcal{E}(q_{i}^{-}) and 𝒯(qi)\mathcal{T}(q_{i}^{-}) denote the total energy consumption (time, respectively) spent up to the point where agent ii drops the package at qiq_{i}^{-}. These values are inductively defined as follows:

(q1)\displaystyle\mathcal{E}(q_{1}^{-}) :=ω1(d(p1,s)+d(s,q1)),(S)=(q),\displaystyle:=\omega_{1}\cdot(d(p_{1},s)+d(s,q_{1}^{-})),\qquad\mathcal{E}(S)=\mathcal{E}(q_{\ell}^{-}),
(qi)\displaystyle\mathcal{E}(q_{i}^{-}) :=(qi1)+ωi(d(pi,qi1)+d(qi1,qi)),\displaystyle:=\mathcal{E}(q_{i-1}^{-})+\omega_{i}\cdot(d(p_{i},q_{i-1}^{-})+d(q_{i-1}^{-},q_{i}^{-})), (1)

and

𝒯(q1)\displaystyle\mathcal{T}(q_{1}^{-}) :=υ11(d(p1,s)+d(s,q1)),𝒯(S)=𝒯(q),\displaystyle:=\upsilon_{1}^{-1}\cdot(d(p_{1},s)+d(s,q_{1}^{-})),\qquad\mathcal{T}(S)=\mathcal{T}(q_{\ell}^{-}),
𝒯(qi)\displaystyle\mathcal{T}(q_{i}^{-}) :=max{𝒯(qi1),υi1d(pi,qi1)}+υi1d(qi1,qi)).\displaystyle:=\max\left\{\mathcal{T}(q_{i-1}^{-}),\upsilon_{i}^{-1}\cdot d(p_{i},q_{i-1}^{-})\right\}+\upsilon_{i}^{-1}\cdot d(q_{i-1}^{-},q_{i}^{-})). (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 𝒯\mathcal{T} among all solutions in the class,

  • a solution that minimizes the energy consumption \mathcal{E} 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 𝒯\mathcal{T} and \mathcal{E}, 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 1,2,,1,2,\ldots,\ell a solution is uniquely described by the \ell many drop-off positions q1,,q1q_{1}^{-},\ldots,q_{\ell-1}^{-} (since we must have q=tq_{\ell}^{-}=t).

We represent a drop-off qiq_{i}^{-}, i<i<\ell in an edge {u,v}\{u,v\} as a tuple ((u,v),xi)((u,v),x_{i}), where xi[0,1]x_{i}\in\left[0,1\right] is a parameter denoting the position of qiq_{i}^{-} in {u,v}\{u,v\}, xi:=d(u,qi)d(u,v)x_{i}:=\tfrac{d(u,q_{i}^{-})}{d(u,v)}. If qiq_{i}^{-} lies strictly inside the edge {u,v}\{u,v\}, this representation is unique. The same is true if qiq_{i}^{-} is a node of degree 1. If qiq_{i}^{-} is a node of degree deg(qi)>1\deg(q_{i}^{-})>1, there are deg(qi)\deg(q_{i}^{-}) many representations to choose from.

Similarly to individual handover points, we can represent schedules in this parametrized notation, too. For each schedule SS operating the agents 1,,1,\ldots,\ell in this order, we consider all possible representations of the whole schedule: If SS has xx many node drop-offs v1,,vxv_{1},\ldots,v_{x}, then SS has a bounded number of exactly i=1xdeg(vi)\prod_{i=1}^{x}\deg(v_{i}) many different representations.

Equivalence relation between representations

We can now define an equivalence relation between parametrized representations of schedules: Two parametrized representations SPS_{P} and SPS^{\prime}_{P} of a solution SS and a solution SS^{\prime}, respectively, are equivalent, SPPSPS_{P}\sim_{\mathit{P}}S^{\prime}_{P}, if they operate the same set of agents in the same order and agree in the edge of each drop-off location qiq_{i}^{-} (in other words, SPS_{P} and SPS^{\prime}_{P} differ only in the exact positions inside the edges, given by the respective parameters xix_{i}).

Note that two different parametrized representations of the same schedule are not equivalent. Since a parametrized representation SPS_{P} of a schedule SS preserves all information contained in SS, we can also measure SPS_{P} subject to 𝒯\mathcal{T} and \mathcal{E}.

Minima of equivalence classes

We are now ready to prove that, given an arbitrary parametrized schedule representation SPS_{P}, the equivalence class of SPS_{P} under P\sim_{\mathit{P}}, denoted by [SP][S_{P}], contains a minimum element subject to 𝒯\mathcal{T} and a minimum element subject to \mathcal{E}.

A schedule SS operating \ell agents has 1\ell-1 parametrized drop-off locations. If 1=0\ell-1=0, then [SP][S_{P}] contains the single element SPS_{P} and thus has a minimum element. Otherwise, any different choice of the values xi[0,1]x_{i}\in\left[0,1\right] of these parameters still represents a solution, and all these solutions are in the equivalence class [SP][S_{P}]. Hence we can identify [SP]\left[S_{P}\right] with the 1\ell-1-dimensional hypercube [0,1]1\left[0,1\right]^{\ell-1} which is a bounded and closed metric space and thus a topologically compact space.

Since we have (S)=(q)\mathcal{E}(S)=\mathcal{E}(q_{\ell}^{-}) and (T)=𝒯(q)\mathcal{E}(T)=\mathcal{T}(q_{\ell}^{-}), using Equations (1) and (2) together with the triangle inequality for distances in a graph, it is easy to see that \mathcal{E} and 𝒯\mathcal{T} are continuous functions mapping parametrized schedule representations in the compact hypercube [0,1]1\left[0,1\right]^{\ell-1} to the corresponding energy-consumption and delivery-time values in \mathbb{R}:

Consider the minimum velocity υmin=miniυi\upsilon_{\min}=\min_{i}\upsilon_{i}, the maximum weight ωmax=maxiωi\omega_{\max}=\max_{i}\omega_{i} and the maximum edge length lmax=maxelel_{\max}=\max_{e}l_{e}. We use the L1L1-norm and show that for all ϵ>0\epsilon>0 there exists a δ=δ(ϵ):=ϵmin{υmin,1ωmaxlmax}(2)1\delta=\delta(\epsilon):=\smash{\epsilon\cdot\min\{\upsilon_{\min},\tfrac{1}{\omega_{\max}l_{\max}}\}\cdot(2\ell)^{-1}}, such that we have for any two parametrized schedule representations SP,SP′′[0,1]1S^{\prime}_{P},S^{\prime\prime}_{P}\in\left[0,1\right]^{\ell-1} that

SPSP′′1<δ|(SP)(SP′′)|<ϵ2|𝒯(SP)𝒯(SP′′)|<ϵ2.\left\lVert S^{\prime}_{P}-S^{\prime\prime}_{P}\right\rVert_{1}<\delta\ \Rightarrow\ \left\lvert\mathcal{E}(S^{\prime}_{P})-\mathcal{E}(S^{\prime\prime}_{P})\right\rvert<\tfrac{\epsilon}{2}\quad\wedge\quad\left\lvert\mathcal{T}(S^{\prime}_{P})-\mathcal{T}(S^{\prime\prime}_{P})\right\rvert<\tfrac{\epsilon}{2}.

Note that from SPSP′′1<δ\left\lVert S^{\prime}_{P}-S^{\prime\prime}_{P}\right\rVert_{1}<\delta we get for any two parametrized drop-off qi,qiq^{\prime-}_{i},q^{\prime\prime-}_{i} that |xixi′′|<δ|x^{\prime}_{i}-x^{\prime\prime}_{i}|<\delta and thus |qiqi|<lmax|xixi′′|=ϵmin{υmin,1ωmax}(2)1|q^{\prime-}_{i}-q^{\prime\prime-}_{i}|<l_{\max}\cdot|x^{\prime}_{i}-x^{\prime\prime}_{i}|=\epsilon\cdot\min\{\upsilon_{\min},\tfrac{1}{\omega_{\max}}\}\cdot(2\ell)^{-1}. Using Equations (1) and (2) inductively together with the triangle inequality for graph distances we get

|(qi)(qi)|\displaystyle|\mathcal{E}(q^{\prime-}_{i})-\mathcal{E}(q^{\prime\prime-}_{i})| <|(qi1)(qi1)|+2ωmax|qiqi|ϵi\displaystyle<|\mathcal{E}(q^{\prime-}_{i-1})-\mathcal{E}(q^{\prime\prime-}_{i-1})|+2\cdot\omega_{\max}\cdot|q^{\prime-}_{i}-q^{\prime\prime-}_{i}|\leq\frac{\epsilon\cdot i}{\ell} and
|𝒯(qi)𝒯(qi)|\displaystyle|\mathcal{T}(q^{\prime-}_{i})-\mathcal{T}(q^{\prime\prime-}_{i})| <|𝒯(qi1)𝒯(qi1)|+21υmin|qiqi|ϵi.\displaystyle<|\mathcal{T}(q^{\prime-}_{i-1})-\mathcal{T}(q^{\prime\prime-}_{i-1})|+2\cdot\tfrac{1}{\upsilon_{\min}}\cdot|q^{\prime-}_{i}-q^{\prime\prime-}_{i}|\leq\frac{\epsilon\cdot i}{\ell}.

We have SPSP′′1<δ|(SP)(SP′′)|<ϵ\left\lVert S^{\prime}_{P}-S^{\prime\prime}_{P}\right\rVert_{1}<\delta\Rightarrow|\mathcal{E}(S^{\prime}_{P})-\mathcal{E}(S^{\prime\prime}_{P})|<\epsilon and SPSP′′1<δ|𝒯(SP)𝒯(SP′′)|<ϵ\left\lVert S^{\prime}_{P}-S^{\prime\prime}_{P}\right\rVert_{1}<\delta\Rightarrow|\mathcal{T}(S^{\prime}_{P})-\mathcal{T}(S^{\prime\prime}_{P})|<\epsilon, and thus \mathcal{E} and 𝒯\mathcal{T} are continuous functions. Hence by the extreme value theorem, there must be a solution of minimum value in [0,1]1\left[0,1\right]^{\ell-1} with respect to \mathcal{E} and to 𝒯\mathcal{T}, respectively. The same holds for the linear combination ϵ𝒯+(1ϵ)\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}, and, furthermore, there are also lexicographically minimum solutions with respect to the tuples (𝒯,)(\mathcal{T},\mathcal{E}) and (,𝒯)(\mathcal{E},\mathcal{T}), 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 NP\mathrm{NP}-hardness of FastEfficientDelivery

Planar 3SAT.

We start with a three-conjunctive normal form FF on xx variables V(F)={u1,,ux}V(F)=\left\{u_{1},\ldots,u_{x}\right\} and yy clauses C(F)={c1,,cy}C(F)=\left\{c_{1},\ldots,c_{y}\right\}. Each clause is a disjunction of at most three literals of the form l(uj){uj,uj¯}l(u_{j})\in\left\{u_{j},\overline{u_{j}}\right\}. FF can be represented by a graph H(F)=(C(F)V(F),A1A2)H(F)=(C(F)\cup V(F),A_{1}\cup A_{2}) defined as follows: (C(F)V(F),A1)(C(F)\cup V(F),A_{1}) is a bipartite graph with nodes corresponding to all clauses and all variables and an edge set A1A_{1} which contains an edge between each clause cc and variable uu if and only if uu or u¯\overline{u} is contained in cc, A1={{ci,uj}|ujci or uj¯ci}A_{1}=\left\{\left\{c_{i},u_{j}\right\}\ |\ u_{j}\in c_{i}\text{ or }\overline{u_{j}}\in c_{i}\right\}. To this graph we add a cycle A2A_{2} consisting of edges between all pairs of consecutive variables, A2={{uj,u(jmodx)+1}| 1jx}.A_{2}=\left\{\left\{u_{j},u_{(j\mod x)+1}\right\}\ |\ 1\leq j\leq x\right\}. The 3CNF FF is called planar if there is a plane embedding of H(F)H(F) which at each variable node has all edges representing positive literals on one side of the cycle A2A_{2} and all edges representing negative literals on the other side of A2A_{2}. The decision problem Planar3SAT of finding whether a given planar 3CNF FF is satisfiable or not is NP\mathrm{NP}-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).

Figure 7: (left) An example of a planar 3CNF FF with a satisfiable assignment (u1,u2,u3,u4)=(true, false, false, true).(u_{1},u_{2},u_{3},u_{4})=(\text{true, false, false, true}). (right) Its transformation into the corresponding delivery graph G(F)G(F).
Delivery graph.

We now transform H(F)H(F) into a planar graph G(F)G(F) on which we will build an instance of FastEfficientDelivery. First, we place an additional node ux+1u_{x+1} on the edge {ux,u1}\left\{u_{x},u_{1}\right\} and modify A2A_{2} accordingly (by adding {ux,ux+1},{ux+1,u1}\left\{u_{x},u_{x+1}\right\},\left\{u_{x+1},u_{1}\right\} to and removing {ux,u1}\left\{u_{x},u_{1}\right\} from A2A_{2}). In a second step, we add on both sides of each edge {uj,uj+1},1jx,\left\{u_{j},u_{j+1}\right\},1\leq j\leq x, a path from uju_{j} to uj+1u_{j+1} with 2y12y-1 internal nodes. We can now reconnect the literal edges {ci,uj}\left\{c_{i},u_{j}\right\} while preserving planarity: If {ci,uj}\left\{c_{i},u_{j}\right\} is the llth literal edge of uju_{j} inside the cycle A2A_{2}, we reconnect cic_{i} to the (2l1)(2l-1)th internal node of the path from uju_{j} to uj+1u_{j+1} which lies inside A2A_{2}. We do the same for literal edges outside of A2A_{2}. 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 jj, both paths from uju_{j} to uj+1u_{j+1} have yy internal nodes of degree 33 and y1y-1 internal nodes of degree 22, and these nodes alternate. If the path contains nodes connected to clauses which contain uju_{j}, we call the path pj,falsep_{j,\text{false}}, otherwise we call it pj,truep_{j,\text{true}}. Finally, we delete all edges of A2A_{2}, add the package’s source ss and destination tt and another node uu and connect these to u1u_{1}, ux+1u_{x+1} and ux+1u_{x+1}, respectively. We redraw the graph such that s,u1,,ux+1,ts,u_{1},\ldots,u_{x+1},t 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 (pj,true,pj,false)(p_{j,\text{true}},p_{j,\text{false}}) through exactly one of the two paths. If the package is routed via the path pj,truep_{j,\text{true}}, we interpret this as setting uj=trueu_{j}=\text{true} and hence we can read from the package trajectory a satisfiable assignment for FF.

Agent placement.

We use three kinds of agents: slow but energy-efficient agents (υ=1,ω=0)(\upsilon=1,\omega=0), fast but inefficient agents (υ=2,ω=1)(\upsilon=2,\omega=1) and one very fast agent (υ=8,ω=0)(\upsilon=8,\omega=0):

  • The fastest agent is placed on uu and shall transport the package over the edge {ux+1,t}\left\{u_{x+1},t\right\}.

  • Fast agents (υ=2,ω=1)(\upsilon=2,\omega=1) on one hand are placed on each variable node uju_{j}. These agents will decide whether to deliver the package over the path pj,truep_{j,\text{true}} or the path pj,falsep_{j,\text{false}}, thus effectively setting the value of the corresponding boolean variable uju_{j} to true or to false. On the other hand, we will also use one fast agent on each internal path node of degree 22.

  • Finally, slow agents are placed as follows: On each clause node cjc_{j} of degree deg(cj)\deg(c_{j}) we place deg(cj)1\deg(c_{j})-1 slow agents. We think of these agents as follows: If a clause cjc_{j} consists of three literals, e.g. (u2u3¯u4¯)(u_{2}\vee\overline{u_{3}}\vee\overline{u_{4}}), then in a satisfiable assignment at most two of these literals (e.g. u2u_{2} and u4¯\overline{u_{4}}) are evaluated to false. Thus the paths p2,falsep_{2,\text{false}} and p4,truep_{4,\text{true}} are used in the delivery and the deg(cj)1=31=2\deg(c_{j})-1=3-1=2 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 ss.

Overall we have (i) two agents on nodes ss and uu, (ii) xx fast agents on the variable nodes, (iii) 2x(y1)2x(y-1) fast agents on the paths pj,true,pj,falsep_{j,\text{true}},p_{j,\text{false}} (one for each internal node of degree two), and (iv) for each of the 2xy2xy internal path nodes of degree 3 (except for yy many) a unique slow agent on an adjacent node. In total we get k=4xyxy+2k=4xy-x-y+2 mobile agents.

Edge lengths.

Recall that we started from xx variables and yy clauses. We set the length of the first edge {s,u1}\left\{s,u_{1}\right\} to 12x2y212x^{2}y^{2}, and the lengths of the edges {ux+1,u},{ux+1,t}\left\{u_{x+1},u\right\},\left\{u_{x+1},t\right\} to 128x2y2128x^{2}y^{2}. The edges along paths pj,truep_{j,\text{true}} and pj,falsep_{j,\text{false}} have length 22 if they lie directly to the right of a fast agent’s starting position and length 4xy14xy-1 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 (2l1)(2l-1)th internal node (counted from the left) of path pj,truep_{j,\text{true}} or pj,falsep_{j,\text{false}}, gets length 12x2y2+(j1)4xy2+(l1)4xy+112x^{2}y^{2}+(j-1)\cdot 4xy^{2}+(l-1)\cdot 4xy+1, see Figure 8.

From the defined edge lengths we get that each path pj,truep_{j,\text{true}} and each path pj,falsep_{j,\text{false}} has length exactly y(2+(4xy1))=4xy2+yy\cdot(2+(4xy-1))=4xy^{2}+y and thus dG(u1,ux+1)=xdG(uj,uj+1)=4x2y2+xyd_{G}(u_{1},u_{x+1})=x\cdot d_{G}(u_{j},u_{j+1})=4x^{2}y^{2}+xy.

Lemma 17 (minimum delivery time).

Any fastest delivery of the package from ss to tt takes time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} and does not go via any clause node of G(F)G(F).

Proof.

Clearly, any delivery which does not use the fastest agent (with υ=8\upsilon=8) takes time at least 128x2y2/2=64x2y2128x^{2}y^{2}/2=64x^{2}y^{2}. Hence the fastest agent has to deliver the package to tt and thus travel from its starting position uu to ux+1u_{x+1} and later on from ux+1u_{x+1} to tt. We get 𝒯2128x2y2/8=32x2y2\mathcal{T}\geq 2\cdot 128x^{2}y^{2}/8=32x^{2}y^{2}.

Equality holds if and only if the other agents can collectively deliver the package to ux+1u_{x+1} in time 16x2y216x^{2}y^{2}. This is the case if the slow agent at ss brings the package to u1u_{1} in time 12x2y2/1=12x2y212x^{2}y^{2}/1=12x^{2}y^{2}, where the fast agent takes over and brings the package to ux+1u_{x+1} in time dG(u1,ux+1)/2=(4x2y2+xy)/2<4x2y2d_{G}(u_{1},u_{x+1})/2=(4x^{2}y^{2}+xy)/2<4x^{2}y^{2}.

If, however, the trajectory of the package contains a clause node cjc_{j}, then the package travels at least a distance of dG(s,u1)+dG(u1,cj)+dG(cj,ux+1)312x2y2d_{G}(s,u_{1})+d_{G}(u_{1},c_{j})+d_{G}(c_{j},u_{x+1})\geq 3\cdot 12x^{2}y^{2} which takes time at least 36x2y2/2=18x2y236x^{2}y^{2}/2=18x^{2}y^{2}. Note that in the last step we assumed that we do not use the very fast agent of velocity 88 – if we used that agent, it would travel a total distance of strictly more than 2128x2y22\cdot 128x^{2}y^{2} and hence 𝒯>32x2y2\mathcal{T}>32x^{2}y^{2} as well. ∎

We now show that among all fastest delivery schedules (of time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2}) there exists a schedule with energy consumption =2xy\mathcal{E}=2xy if and only if FF is satisfiable (otherwise >2xy\mathcal{E}>2xy).

Figure 8: Edge lengths; placement of slow agents (\square), fast agents (++) and a very fast agent (×\times).
Lemma 18 ((𝒯,)(\mathcal{T},\mathcal{E}) of a Planar3SAT-solution).

Given a satisfiable assignment (a solution) for the variables of a 3CNF FF there is a delivery schedule with delivery time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} and energy consumption =2xy\mathcal{E}=2xy.

Proof.

We first remark that the slow agent on ss can bring the package to u1u_{1} in time 12x2y212x^{2}y^{2} with energy consumption 00 and that the fastest agent on uu can get to ux+1u_{x+1} in time 16x2y216x^{2}y^{2} with energy cost 00 (and from there reach tt in time 16x2y216x^{2}y^{2} and energy 00). It remains to show that all other agents can collectively deliver the package from u1u_{1} to ux+1u_{x+1} in time 4x2y24x^{2}y^{2} such that the package never has to wait and without spending more energy than 2xy2xy.

Given a satisfiable assignment for the variables in FF, the actions of the fast agents are straightforward: Each agent placed on a variable node uju_{j} moves according to the variable assignment of uju_{j} along the first edge of either the true-path pj,truep_{j,\text{true}} or the false-path pj,falsep_{j,\text{false}} as soon as the package arrives at uju_{j}. The other fast agents on internal path nodes of degree 22 also wait for the package and upon arrival carry it over the adjacent edge of length 22. Collectively, each of the xyxy fast agents (with velocity 22 and weight 11) that move take time 2/2=12/2=1 and energy 21=22\cdot 1=2 to cross the adjacent edge.

Finally, we show that the package can be carried over the remaining gaps (edges of length 4xy14xy-1) 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 yy slow and yy fast agents carry the package over a path from uju_{j} to uj+1u_{j+1} in time y(4xy1)/1+y2/2=4xy2y\cdot(4xy-1)/1+y\cdot 2/2=4xy^{2} with an energy consumption of y(4xy1)0+y21=2yy\cdot(4xy-1)\cdot 0+y\cdot 2\cdot 1=2y. We certainly have enough clause agents for this task: Since FF is satisfiable, each clause cic_{i} has at most deg(ci)1\deg(c_{i})-1 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 u1u_{1} to ux+1u_{x+1} takes time x4xy2=4x2y2x\cdot 4xy^{2}=4x^{2}y^{2} and needs an energy of x2y=2xyx\cdot 2y=2xy, yielding an overall delivery time of 𝒯=12x2y2+4x2y2+16x2y2=32x2y2\mathcal{T}=12x^{2}y^{2}+4x^{2}y^{2}+16x^{2}y^{2}=32x^{2}y^{2} and energy consumption of =2xy\mathcal{E}=2xy. ∎

Lemma 19 (Delivery schedule yields Planar3SAT assignment).

Any delivery schedule with delivery time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} needs an energy consumption of at least 2xy\mathcal{E}\geq 2xy. Furthermore, if there is a delivery schedule with 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} and =2xy\mathcal{E}=2xy, we can retrieve a satisfiable assignment to the variables of the underlying 3CNF FF from the delivery schedule.

Proof.

We already know by Lemma 17 that any delivery schedule with delivery time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} can’t deliver the package via any clause node and can’t use the fastest agent on the left side of ux+1u_{x+1}. Thus the length of the package’s trajectory from u1u_{1} to ux+1u_{x+1} must have length dG(u1,ux+1)=4x2y2+xyd_{G}(u_{1},u_{x+1})=4x^{2}y^{2}+xy. We only have slow agents (υ=1,ω=0\upsilon=1,\omega=0) and fast agents (υ=2,ω=1\upsilon=2,\omega=1) available to travel this distance. Hence to cover 4x2y2+xy4x^{2}y^{2}+xy in time 4x2y2\leq 4x^{2}y^{2} we need to use fast agents for a total length of at least 2xy2xy. This, however, results in an energy consumption of at least 2xy1=2xy2xy\cdot 1=2xy and hence 2xy\mathcal{E}\geq 2xy.

To achieve equality, all fast agents must travel a total length of exactly 2xy2xy, 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 4xy14xy-1, from neither side.

Therefore, in any delivery schedule with delivery time 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} and =2xy\mathcal{E}=2xy, the package must be transported over edges of length 2 by fast agents and over edges of length 4xy14xy-1 by slow agents. Furthermore, following the same line of reasoning as in the proof of Lemma 18, to actually achieve 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} 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 2l12l-1th node of path pj,truep_{j,\text{true}}. This means it has covered a distance of 12x2y2+(j1)y(2+4xy1)+(l1)(2+4xy1)+212x^{2}y^{2}+(j-1)\cdot y\cdot(2+4xy-1)+(l-1)\cdot(2+4xy-1)+2 with the help of (j1)y+l(j-1)\cdot y+l fast agents so far. Hence the current time is

12x2y2+(j1)y(4xy1)+(l1)(4xy1)1+(j1)y2+l22=12x2y2+(j1)4x2y2+(l1)4xy+1.\tfrac{12x^{2}y^{2}+(j-1)\cdot y\cdot(4xy-1)+(l-1)\cdot(4xy-1)}{1}+\tfrac{(j-1)\cdot y\cdot 2+l\cdot 2}{2}=12x^{2}y^{2}+(j-1)4x^{2}y^{2}+(l-1)4xy+1.

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 𝒯=32x2y2\mathcal{T}=32x^{2}y^{2} and =2xy\mathcal{E}=2xy, agents stationed on a clause node cic_{i} can only help carrying the package on paths corresponding to the literals of this clause, and since there are only deg(ci)1\deg(c_{i})-1 agents stationed on that clause, we know that for at least one literal l(uj)l(u_{j}) of cic_{i}, the path pj,l(uj)p_{j,l(u_{j})} has been taken (for which no help from a clause agent of cic_{i} is necessary). Hence we can read a satisfiable variable assignment for FF 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 G(F)G(F) created from H(F)H(F) is planar and that all edge lengths and agent velocities and weights have polynomial size. Hence we conclude:

Theorem 7.

FastEfficientDelivery is NP\mathrm{NP}-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 𝒯\mathcal{T}^{*}, minimize the energy \mathcal{E} such that 𝒯T\mathcal{T}\leq T^{*}.

Note that Variant (ii) includes the setting where 𝒯=min𝒯\mathcal{T}^{*}=\min\mathcal{T}. Hence our hardness result for FastEfficientDelivery extends to Variant (ii). Furthermore, in this case \mathcal{E} is NP-hard to approximate to within any constant factor CC: 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 (4xy1)(4xy-1) to (C4xy1)(C\cdot 4xy-1) and adapt all edges incident to the starting positions of slow agents or incident to ss, uu, tt accordingly. Then a Planar3SAT-solution will have a delivery time of 𝒯=C32x2y2=:𝒯\mathcal{T}=C\cdot 32x^{2}y^{2}=:\mathcal{T}^{*} and an energy consumption of =2xy\mathcal{E}=2xy, while any other solution with 𝒯=C32x2y2\mathcal{T}=C\cdot 32x^{2}y^{2} will have energy consumption C4xy1\mathcal{E}\geq C\cdot 4xy-1.

Appendix C An efficient algorithm for FastEfficientDelivery on paths

C.1 Fast computation and recombination

Figure 9: (left) Considering the potential contribution of agent 66 amounts to finding the intersection of a query line (6?) with the upper envelope of previous rays and then (since υ6>υ5=υ1\upsilon_{6}>\upsilon_{5}=\upsilon_{1}) adding its corresponding ray (6!). (right) The same operations in the geometric point-line dual, which allows for faster computations via convex hull queries.
Envelope intersections via point-line duality.

In classic geometric point-line duality [20], each line g:y=ax+bg\colon y=a\cdot x+b is mapped to a point g=(a,b)g^{*}=(a,-b) and vice versa each point q=(c,d)q=(c,d) is mapped to a line q:y=cxdq^{*}\colon y^{*}=c\cdot x^{*}-d.

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 qi:y=xixyiq_{i}^{*}\colon y^{*}=x_{i}\cdot x^{*}-y_{i} from a query point (the dual of the query line) onto the convex hull of a point set (the dual of the rays fif_{i}11 1 For the purpose of line-point duality, we treat the rays as lines. This is fine, since each ray fi0f_{i}\not\equiv 0 is dominated for xx-values smaller than xix_{i} 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 υj\upsilon_{j}, we also work in the geometric dual: Now that we have found the tangent tt^{*} (of direction (xi,1)(x_{i},1)), we make an extreme point query in the orthogonal direction (1,xi)(-1,x_{i}). 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 (xi,yi)(x_{i},y_{i}). In case there is only one such ray, we have found fjf_{j} (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 xx^{*}-coordinate lies on the tangent tt^{*}, too. If so, the ray fjf_{j} of maximal slope υj\upsilon_{j} is given as the dual of this neighbor, otherwise as the dual of the extremal point query’s result itself.

Finally, we check whether υjυi\upsilon_{j}\leq\upsilon_{i}, and if so, we insert fi=(υi,υixiyi)f_{i}^{*}=(\upsilon_{i},\upsilon_{i}\cdot x_{i}-y_{i}) into the point set of the geometric dual. The mentioned convex hull data structure allows point insertions and deletions in 𝒪(logk)\mathcal{O}(\log k) amortized time, and tangent, extremal point and neighbor queries in time 𝒪(logk)\mathcal{O}(\log k). As for each fif_{i} we need one of each type of queries and one insertion, we get an overall running time of 𝒪(klogk)\mathcal{O}(k\log k).

Figure 10: (left) Example of possible delivery schedules: If agent 44 is involved, he must take over the package from agent 22, since agent 33 is too slow. Using agents 22 and 44 to bring the package to agent 5’s pick-up position takes the same time as using agent 11 on its own. Agents 11 and 55 have the same velocity, so in terms of delivery time we could use either or even both of them, but agent 11 only if agents 22 and 44 are both not used (otherwise they all consume energy). (right) Fastest solutions correspond to at most 11 agent with pi<sp_{i}<s and a number of agents corresponding to a suffix of the upper envelope.
Uniform velocity instances and recombination.

As any optimum schedule transports the package to tt as early as possible, the delivery time 𝒯\mathcal{T} thus corresponds to the xx-coordinate at which the upper envelope reaches y=ty=t. 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 fif_{i}, computing this list of segments can be done in time 𝒪(klogk)\mathcal{O}(k\log k): 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 x=𝒯x=\mathcal{T}) 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 pi<sp_{i}<s 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 xx-axis together with a suffix of the upper envelope to which it is a right tangent.22 2 For example, in Figure 9 (right), f2f_{2} is a right tangent to q4=(x4,y4)q_{4}=(x_{4},y_{4}), hence we consider the suffix 4,5,64,5,6. On the other hand, f1f_{1} is a right tangent to both q5=(x5,y5)q_{5}=(x_{5},y_{5}) and q6=(x6,y6)q_{6}=(x_{6},y_{6}), hence we consider f1f_{1} up to q5q_{5} with the suffix 5,65,6 as well as f1f_{1} up to q6q_{6} with the line segment 66 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 𝒪(k)\mathcal{O}(k) many time-optimal schedules (see Figure 10).

Out of these time-optimal candidates, it remains to find the schedule with minimum energy consumption \mathcal{E}. 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 𝒪(k)\mathcal{O}(k). After this precomputation, the schedule lexicographically minimizing (𝒯,)(\mathcal{T},\mathcal{E}) 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 𝒪(n+klogk)\mathcal{O}(n+k\log k).

C.2 Characterization of handover points

Lemma 9.

There is an optimum solution where each agent ii that is involved in advancing the package picks it up at qi+=qiq_{i}^{+}=q_{i} or at qi+=piq_{i}^{+}=p_{i}.

Proof.

Assume otherwise, i.e.,  all optimum schedules contain some point qi+{qi,pi}q_{i}^{+}\notin\left\{q_{i},p_{i}\right\}. For the sake of a contradiction let SS be the optimal schedule where the coordinate of the first pick-up point qi+q_{i}^{+} different from qiq_{i} and pip_{i} is maximized, and let ϵ>0\epsilon>0 be an arbitrary small constant. Denote by jj the agent transporting the package right before agent ii. Note that jj always exists as we must have i>1i>1 by q1+=s=q1q_{1}^{+}=s=q_{1}. We know that qi<qi+q_{i}<q_{i}^{+} as ii would delay the delivery otherwise. We also know that qi+<piq_{i}^{+}<p_{i} as the transportation on [pi,pi+ϵ][p_{i},p_{i}+\epsilon] would otherwise use more energy than necessary (ωj>ωi\omega_{j}>\omega_{i}). We now distinguish three cases:

  • 2ωi<ωj2\omega_{i}<\omega_{j}: We modify SS by moving qi+q_{i}^{+} by ϵ\epsilon to the left towards qiq_{i}. This does not change the delivery time but reduces the energy cost and thus contradicts SS’s optimality.

  • 2ωi>ωj2\omega_{i}>\omega_{j}: If we modify SS by moving qi+q_{i}^{+} by ϵ\epsilon to the right, the energy cost goes down, again contradicting SS being optimal.

  • 2ωi=ωj2\omega_{i}=\omega_{j}: If we again modify SS by moving qi+q_{i}^{+} by ϵ\epsilon to the right, the delivery time and energy cost do not change, but we contradict the extremality of qi+q_{i}^{+} in SS.∎

C.3 Details of the dynamic program.

The computational bottleneck of our dynamic program is (for each subproblem [i]\mathcal{E}[i]) the minimization over the set of options in Case 2.c). Each option evaluates a linear function

fj(qi):=ωjslope aqi+([j]pjωj)offset b=aqi+b\displaystyle f_{j}(q_{i}):=\underbrace{\omega_{j}}_{\mathclap{\text{slope }a}}\cdot\ q_{i}\ +\ \underbrace{(\mathcal{E}[j]-p_{j}\cdot\omega_{j})}_{\text{offset }b}=a\cdot q_{i}+b

at position qiq_{i}. So when we see minj{fj(qi)qi<pj<pi and A[j]=j}\min_{j}\{f_{j}(q_{i})\mid q_{i}<p_{j}<p_{i}\text{ and }A[j]=j\} as a function of qiq_{i}, 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 [i]\mathcal{E}[i] with A[i]=iA[i]=i, a new function fif_{i} is added to the set. Whenever we go from qiq_{i} to qi+1q_{i+1}, all functions fjf_{j} with qi<pj<qi+1q_{i}<p_{j}<q_{i+1} 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 kk linear functions ax+bax+b as well as find-min-queries for up to kk query values x=qx=q is a parametric heap. If successive query values qq 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 𝒪(logkloglogk)\mathcal{O}(\log k\log\log k) time each [27]. Hence we turn once more to the more recent dynamic planar convex hull data structure, which supports deletions in amortized time 𝒪(logk)\mathcal{O}(\log k) [5]. Overall we get:

Figure 11: Use point-line duality to transform the minimization problem of (left) finding the intersection point of a query line with a lower envelope of lines into (right) a tangent query problem on the convex hull of a dynamic point set.
Lemma 12.

An optimum schedule for FastEfficientDelivery with uniform velocity υ¯\overline{\upsilon} on the line can be computed in 𝒪(n+klogk)\mathcal{O}(n+k\log k) time.

Proof.

We formulate our optimization problem for agent ii in Case (2.c)(2.c) as the following equivalent geometric problem: Given up to kk linear equations j\ell_{j}: y=ajx+bjy=a_{j}\cdot x+b_{j} with aj>0a_{j}>033 3 Note that it is without loss of generality that we assume aj=ωj0a_{j}=\omega_{j}\neq 0 here, as we have 0ωi<ωj0\leq\omega_{i}<\omega_{j}. and a vertical query line \ell: x=qix=q_{i}, find the lowest intersection point between \ell and any of the j\ell_{j} (see Figure 11 (left)). As before, we want to apply point-line duality, where each line y=ax+by=a\cdot x+b is mapped to a point (a,b)(a,-b) and vice versa. However, as the vertical line \ell does not have a (finite) dual representation, we first swap the coordinates, reflecting the whole configuration at axis y=xy=x (see Figure 11 (center)). We get i\ell_{i} as x=yaibiaix=\frac{y}{a_{i}}-\frac{b_{i}}{a_{i}} and its dual i\ell^{*}_{i} as (1ai,biai)\smash{\left(\frac{1}{a_{i}},\frac{b_{i}}{a_{i}}\right)} and can now also map \ell: x=qix=q_{i} to \ell^{*}: (0,qi)(0,-q_{i}) (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 \ell^{*} and one of the j\ell^{*}_{j}. This corresponds to asking for the right tangent through \ell^{*} onto the convex hull of the point set {jqi<pj<pi and A[j]=j}\{\ell_{j}^{\prime}\mid q_{i}<p_{j}<p_{i}\text{ and }A[j]=j\}. We can find j\ell_{j}^{*} itself with an extreme point query to get A[i]=jA^{\prime}[i]=j. Each operation takes (amortized) time 𝒪(logk)\mathcal{O}(\log k), and as we perform at most 4k4k operations overall, we get a total running time of 𝒪(klogk)\mathcal{O}(k\log k). ∎

Appendix D NP-hardness of CombinedDelivery

NP\mathrm{NP}-hardness of FastEfficientDelivery followed from instances where 𝒯\mathcal{T} and \mathcal{E} were lower bounded, i.e. 𝒯𝒯\mathcal{T}\geq\mathcal{T}^{*} for some 𝒯\mathcal{T}^{*} and for every schedule with 𝒯=𝒯\mathcal{T}=\mathcal{T}^{*}, (𝒯)\mathcal{E}\geq\mathcal{E}^{*}(\mathcal{T}^{*}) for some =(𝒯)\mathcal{E}^{*}=\mathcal{E}^{*}(\mathcal{T}^{*}) depending on 𝒯\mathcal{T}^{*}. Finding a delivery schedule with time and energy (𝒯,)(\mathcal{T}^{*},\mathcal{E}^{*}) turned out to be equivalent to solving a corresponding instance of Planar3SAT. By scaling the weights of all agents by a factor δ\delta, this turns into finding a delivery schedule with time and energy (𝒯,δ)(\mathcal{T}^{*},\delta\mathcal{E}^{*}).

Set δ:=ϵ/8\delta:=\epsilon/8. Consider any delivery schedule with time/energy (𝒯,)(𝒯,δ)(\mathcal{T},\mathcal{E})\neq(\mathcal{T}^{*},\delta\mathcal{E}^{*}). Either we have >δ\mathcal{E}>\delta\mathcal{E}^{*} and thus ϵ𝒯+(1ϵ)>ϵ𝒯+(1ϵ)δ\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}>\epsilon\mathcal{T}^{*}+(1-\epsilon)\delta\mathcal{E}^{*} immediately. Or we have <δ\mathcal{E}<\delta\mathcal{E}^{*}. In this case, we let the fast agents of velocity 22 and weight δ\delta cover less than the original distance 2xy2xy in Lemma 19. This saves an energy amount of zδz\cdot\delta for some z,0<z2xyz,0<z\leq 2xy. However, we have to replace this distance by either a slow agent, or by letting the fastest agent of velocity 88 do more work. Either way, we increase the delivery time by at least z/8z/8, and we again get

ϵ𝒯+(1ϵ)ϵ(𝒯+z/8)+(1ϵ)(δzδ)=ϵ𝒯+(1ϵ)δ+z(ϵ/8(1ϵ)δ)>0.\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E}\geq\epsilon(\mathcal{T}^{*}+z/8)+(1-\epsilon)(\delta\mathcal{E}^{*}-z\delta)\\ =\epsilon\mathcal{T}^{*}+(1-\epsilon)\delta\mathcal{E}^{*}+\underbrace{z(\epsilon/8-(1-\epsilon)\delta)}_{>0}.

Thus, finding a delivery schedule of minimum ϵ𝒯+(1ϵ)\epsilon\mathcal{T}+(1-\epsilon)\mathcal{E} yields a delivery schedule with delivery time and energy consumption (𝒯,δ)(\mathcal{T}^{*},\delta\mathcal{E}^{*}) from which we can infer a satisfiable assignment as in Lemma 19. We conclude:

Theorem 14.

CombinedDelivery is NP\mathrm{NP}-hard for all ϵ(0,1)\epsilon\in(0,1), even on planar graphs.