Approximation Algorithms for a Vehicle Routing Problem

Mathematical Methods of Operations Research manuscript No.
(will be inserted by the editor)
Approximation Algorithms for a Vehicle Routing Problem
Sven O. Krumke · Sleman Saliba · Tjark
Vredeveld · Stephan Westphal
Received: date / Revised version: date
Abstract In this paper we investigate a vehicle routing problem motivated by a realworld application in cooperation with the German Automobile Association (ADAC).
The general task is to assign service requests to service units and to plan tours for
the units such as to minimize the overall cost. The characteristics of this large-scale
problem due to the data volume involve strict real-time requirements.
We show that the problem of finding a feasible dispatch for service units starting at
their current position and serving at most k requests is NP-complete for each fixed k ≥
2. We also present a polynomial time (2k − 1)-approximation algorithm, where again
k denotes the maximal number of requests served by a single service unit. For the
boundary case when k equals the total number“|E| of requests
(and thus there are
”
1
no limitations on the tour length), we provide a 2 − |E|
-approximation. Finally, we
extend our approximation results to include linear and quadratic lateness costs.
1 Introduction
The German Automobile Club ADAC (Allgemeiner Deutscher Automobil-Club) maintains a heterogeneous fleet of service vehicles in order to assist people whose cars break
down on their way. Service requests arrive online and are handled in five help centers
spread over Germany. The goal is to provide low operational costs and a good quality
Sven O. Krumke
University of Kaiserslautern, Paul-Ehrlich-Str. 14, D-67653 Kaiserslautern, Germany
E-mail: [email protected]
Sleman Saliba
University of Kaiserslautern, Paul-Ehrlich-Str. 14, D-67653 Kaiserslautern, Germany
E-mail: [email protected]
Tjark Vredeveld
Maastricht University, Faculty of Economics and Business Administration, Dept. of Quantitative Economics, P.O. Box 616, 6200 MD Maastricht, The Netherlands
E-mail: [email protected]
Stephan Westphal
University of Kaiserslautern, Paul-Ehrlich-Str. 14, D-67653 Kaiserslautern, Germany
E-mail: [email protected]
2
of service. The general dispatching problem at ADAC is online (i.e., decisions have to
be made on the basis of incomplete data). In this paper we are concerned with the
solution of the following offline-subproblem (snapshot-optimization): compute an optimal dispatch for all currently known requests subject to all operational constraints.
The real-world instances to solve are large-scale exhibiting up to 700 requests and
200 service vehicles (units).
The offline subproblem is currently used at ADAC for an automated dispatching
system on the basis of cost-reoptimization. This means that a current dispatch is maintained, which contains all known yet unserved requests and which is near optimal on
the basis of the current data; whenever a unit becomes idle its next request is read from
the current dispatch; at each event (new request, finished service, etc.) the dispatch is
updated by a reoptimization run.
A feasible current dispatch for all known requests and available service vehicles is
a partition of the requests into tours for units and contractors such that each request
is in exactly one tour and each unit drives exactly one tour so that the cost function
is minimized. Cost contributions come from driving costs for units, fixed service costs
per requests for contractors, and a strictly convex lateness cost for the violation of soft
time windows at each request (currently quadratic). The latter cost structure is chosen
so as to avoid large individual waiting times for customers. For details we refer to [6,
8, 9].
The problem we consider in this paper is of the following form. Given a snapshot
of currently available service units (vehicles) and a set E of requests that have to be
served, we are requested to assign up to k requests to a vehicle such that the overall
costs are minimized. In order for the problem to be feasible, we assume that the total
number |E| of requests is at most k times the number |U | of units.
This problem is related to metric multi-depot vehicle routing problems (MDVRP)
and to metric k-customer vehicle routing problems. In a multi-depot vehicle routing
problem a fleet of vehicles located at more than one depot are to serve locally dispersed
customers such that the vehicles return to one of the depots and the transportation
costs are minimized. The difference to our problem is that we do not want our service
units to return to their home positions, since by the time the assigned requests are
served, new requests have arrived that are to be assigned to service units in the next
iteration. The multi-depot vehicle routing problem has been shown to be NP-hard for
more than one depot [2].
In the metric k-customer vehicle routing problem (k-VRP) all vehicles are based
at one depot and are required to serve at most k customers each such that the transportation costs are minimized. It is known that the metric 2-customer vehicle routing
problem is polynomially solvable, since it can be transformed to a minimum matching problem, whereas for k ≥ 3 the metric k-VRP is NP-hard, which was shown by
Haimovich and Rinnooy Kan [5].
In the next section, the exact setting of the problem and the notation used in this
paper are introduced. For our problem, we know that serving at most one customer
is easy. Again the problem can be transformed to a matching problem and solved
efficiently. In contrast, Dischke [3] showed that the problem becomes NP-hard for k = 3.
The case k = 2 (and the general case k > 3) was still open. In Section 3 we settle the
complexity completely and prove NP-completeness for all fixed k ≥ 2.
In Section 4 we develop our approximation algorithms for the“basic
” version of the
problem. In Section 4.1 we present an algorithm that runs in O n3 time, where n
3
is the number of requests plus the number of service vehicles, and give a (2k − 1)approximation for the metric problem. In Section 4.2 we give an alternative algorithm
for the boundary case that k = |E|, where E is the set of requests, with approximation
ratio 2 − 1/|E|.
In Section 5 we extend our approach from Section 4.1 “
to linear and quadratic
”
2
r1
penalty costs for violating a request’s deadline. This leads to a 2k
r1 +1 + 2k − 1 - and a
”
“ 3
2k2 r1
2k r2
r2 +1 + r1 +1 + 2k − 1 -approximation respectively, where r1 and r2 are nonnegative
constant factors associated with the linear and quadratic penalty terms, respectively.
2 Problem Definition and Notation
We are given a metric space M = (X, d) where X is a set and d : X×X → R+ is a metric
(satisfying the triangle inequality). The space M can be induced by an undirected graph
and the corresponding shortest path distances in which case we assume that X is the
finite set of vertices of the graph, and d is explicitly given. In case that M is (part
of) the Euclidean space we simply assume that we can calculate the distance d(x, y)
between two points x, y ∈ M in polynomial time.
Each service vehicle u (or unit) is a point u ∈ X, and we denote the set of service
vehicles by U . Similarly, each request (or event) of the request set E specifies a point e ∈
X which needs to be visited by (exactly) one unit. A tour consists of a unit u ∈ U and a
sequence of requests (eu,1 , eu,2 , . . . , eu,h(u) ), which are visited by vehicle u in the given
“
”
order. We will denote such a tour by a vector τu = u, eu,1 , eu,2 , . . . , eu,h(u) . In the
basic setting of the problem, the cost of a tour τu consists simply of the corresponding
distance traveled by the vehicle, that is,
h(u)
“
”
X
c(τu ) := c( u, eu,1 , eu,2 , . . . , eu,h(u) ) := d(u, eu,1 ) +
d(eu,i−1 , eu,i ).
(1)
i=2
In Section 5 we will consider generalized versions of the problem where, in addition
to the driving cost, lateness costs for serving the requests occur. The basic vehicle
dispatching problem can now be defined as follows:
Definition 1 (Vehicle Dispatching Problem, Vdp-k)
An instance (U, E, d, k) of the vehicle dispatching problem Vdp-k consists of a finite
set of units U , a finite set of requests E as points in a metric space M = (X, d)
and an integer k ≥ 1. A solution
“ to the instance (U, E,”d, k) specifies a collection
D := {τu : u ∈ U } of tours τu = u, eu,1 , eu,2 , . . . , eu,h(u)
such that each request is
served in exactly one tour and h(u) ≤ k for each u ∈ U , that is, such that each unit
serves at most k requests. The goal of Vdp-k is to find a solution D such that the total
cost
X
c(τu )
(2)
c(D) :=
u∈U
is minimized.
An instance (U, E, d, k, B) of the corresponding decision problem contains all the parameters from above plus an additional nonnegative number B and the question is to
decide whether there exists a feasible solution D satisfying c(D) ≤ B.
4
3 Complexity
We now prove that the decision version of the problem Vdp-k is NP-complete for all
fixed k ≥ 2. We first use a reduction from the three-dimensional matching problem
(3Dm) to establish the hardness of Vdp-2 and then, an easy extension yields the
corresponding result for fixed k ≥ 3.
Definition 2 (3-Dimensional Matching, 3Dm)
Given a set M ⊆ X × Y × Z, where X, Y and Z are disjoint sets having the same
number of elements, i. e., |X| = |Y | = |Z| = q, does M contain a matching, that is, a
subset M ′ ⊆ M such that |M ′ | = q and no two elements of M ′ agree in any coordinate?
The three-dimensional matching problem (3Dm) is well known to be NP-complete
[4].
Theorem 1 The decision version of Vdp-2 is NP-complete.
Proof Given an instance of 3Dm, we construct an instance (U, E, d, 2, B) of the decision
version of Vdp-2 such that 3Dm contains a matching M ′ if and only if there exists a
feasible dispatch for Vdp-2 with cost at most B.
Let the sets X, Y , and Z with |X| = |Y | = |Z| = q and M ⊆ X × Y × Z denote
an arbitrary instance of 3Dm. The metric space of the instance for Vdp-2 is induced
by the graph G = (V, A), which is built in the following way.
Let X = {x1 , . . . , xq }, Y = {y1 , . . . , yq }, and Z = {z1 , . . . , zq }. First, there is
exactly one vertex in G = (V, A) for every element of the basic sets X, Y , and Z and
these vertices are connected by the edge set Ac , where
Ac = {[xj , xj+1 ], [yj , yj+1 ], [zj , zj+1 ], j = 1, . . . , q − 1}.
For every triple mi = (x, y, z) ∈ M, i = 1, . . . , |M | = m, where x, y, and z refer to
arbitrary elements of X, Y , and Z respectively, we construct a subgraph Gi = (Vi , Ai )
consisting of twelve vertices and eighteen edges as shown in Figure 1. The twelve
vertices of the subgraph Gi contain three vertices xi , yi , zi corresponding to the three
basic elements of mi and nine additional vertices ai1 , . . . , ai9 . Note that the vertices
of the basic set elements can be part of several subgraphs. Moreover, elements of the
basic sets X, Y , Z that are not contained in any triple are only connected by the edge
set Ac to adjacent vertices.
Therefore the specified graph G = (V, A) is connected and defined by the vertex
set
m
[
V =X ∪Y ∪Z ∪
{aih : h = 1, . . . , 9}
i=1
and the edge set
A = Ac ∪
m
[
Ai .
i=1
Since elements of the basic sets X, Y , Z can be part of different subgraphs the
number of overall vertices in graph G is |V | = 3q + 9m. Obviously, the number of edges
in G is |A| = 18m + 3(q − 1).
5
ai3
ai9
3
3
1
ai6
3
3
ai1
ai2
1
3
3
3
3
3
ai4
ai5
1
3
3
3
ai7
3
yi
xi
ai8
1
3
zi
Fig. 1 Subgraph Gi = (Vi , Ai ).
Squared vertices indicate elements contained in U (available units).
Circular vertices indicate elements contained in E (released requests).
We now construct the set U corresponding to the position of the available vehicle
units and the set E corresponding to the location of the released requests. To this end,
we set
m
[
U =X∪
{ai3 , ai4 , ai7 }
i=1
and
E =Y ∪Z∪
m
[
{ai1 , ai2 , ai5 , ai6 , ai8 , ai9 }.
i=1
To sum up, four out of twelve vertices of a subgraph correspond to service vehicles
and eight to requests yielding a ratio of exactly two requests per unit in accordance
with the requested maximal tour length k = 2.
The distance between two vertices is defined as the shortest path on the graph G,
where the length of edge e = [vj , vk ] ∈ A is defined as follows
d(vj , vk ) =

1 if [vj , vk ] ∈
3 otherwise.
Sm
i=1 {[ai1 , ai2 ], [ai4 , ai5 ], [ai6 , ai9 ], [ai7 , ai8 ]},
As stipulated in the definition, the introduced distance function satisfies the triangle
inequality. Finally, we set the bound for the cost of the dispatch to be B = q · 16 +
(M − q) · 12 = 4(q + 3m). It is straightforward to verify that the construction can be
carried out in polynomial time.
By construction, we have 2|U | = |E|. Therefore, every unit is required to serve
exactly two requests in a feasible solution. As each edge of length 1 is incident only to
edges of length 3, each possible tour serving two requests has cost at least 4. Hence, since
the number of vehicles is |U | = q + 3m, in order to meet the bound of B = 4(q + 3m),
the cost of each tour cannot exceed 4.
As all edges incident to vertices in Y or Z have length 3, any tour for a unit ai4 or
ai7 serving a request outside of subgraph Gi costs at least 6. Moreover, any tour for a
6
ai4
ai7
3
3
yi
zi
3
3
aj5
aj8
Fig. 2 Possible tours between two subgraphs.
unit xi ∈ X serving two requests from different subgraphs has cost at least 9. Hence,
to stay within the budget, each tour can only serve requests within one subgraph.
Therefore, to meet the cost constraint, one can check that the only two possible
tour combinations within a subgraph Gi are of the following types:
Type 1:
Type 2:
(ai3 , ai6 , ai9 ), (xi , ai2 , ai1 ), (ai4 , ai5 , yi ), (ai7 , ai8 , zi ),
(ai3 , ai2 , ai1 ), (ai4 , ai5 , ai6 ), (ai7 , ai8 , ai9 ).
The vehicle located at xi can only serve requests in one of the subgraphs that contains
xi yielding tour type 1 in this subgraph. All other subgraphs containing xi have to be
of type 2, since as previously stated, all other tour combinations lead to a violation
of the cost constraint or to infeasibility. The order in which requests ai2 and ai1 are
served within a tour can be changed without altering the type of the tour combination.
ai3
ai9
3
ai1
ai2
1
ai6
ai4
ai5
1
ai7
yi
ai8
1
3
3
xi
1
3
zi
Fig. 3 Tours of type 1.
We claim that the instance M of 3Dm contains a matching M ′ if and only if
there exists a feasible dispatch for Vdp-2 on the graph G with cost less or equal to
B = 4(q + 3m).
To prove our claim, we first show that given a feasible dispatch D for the instance (U, E, d, 2) of Vdp-2 we can construct a feasible three dimensional matching.
By the above considerations, we know that each vehicle u ∈ U operates exactly one
7
ai3
ai9
ai6
3
3
3
ai1
1
ai2
ai4
1
ai5
ai7
1
ai8
Fig. 4 Tours of type 2.
tour serving exactly two requests and that the requests in each subgraph, Gi , are served
by tour combinations either of type 1 or of type 2. A matching M ′ for the instance of
3Dm is obtained by the triples mi = (x, y, z) for which the nodes {ai3 , ai6 , ai9 } form a
tour in the dispatch D, i.e., the tours serving the requests in subgraph Gi are of type
1. By definition of a dispatch each element in the basic sets X, Y , and Z occur in at
most one tour and therefore in at most one triple mi . Furthermore, every element of
the basic sets is contained in at least one tour. Assume, to the contrary, that there
exists an element w ∈ X ∪ Y ∪ Z that is not part of a triple m ∈ M ′ , then all subgraphs
containing w are of type 2, which means that w is not part of any tour, contradicting
the feasibility of a dispatch.
Conversely, let M ′ ⊆ M with |M ′ | = q such that no two triples in M ′ agree
in any coordinate, that is, M ′ is a feasible matching for the instance of 3Dm. The
corresponding dispatch is given by choosing tours of type 1 in subgraph Gi whenever
mi ∈ M ′ and choosing tours of type 2 in subgraph Gi whenever mi 6∈ M ′ . We claim
that this dispatch serves each request at a total cost of 4(q + 3m). First, we show that
each request is served. Within a subgraph Gi every request in Vi \(U ∪{yi , zi }) is served
by as well tours of type 1 as well as tours of type 2. For each request y ∈ Y there is
one subgraph Gi with y = yi that is traversed by a tour combination of type 1, as
otherwise M ′ cannot be a matching. Hence, each request y ∈ Y is served. In the same
way, we can show that each request z ∈ Z is served. Moreover, none of the requests is
served more than once. Again, for requests in V \(U ∪Y ∪Z) this holds by construction.
Suppose that w ∈ Y ∪ Z is served by two vehicles. As requests in Y ∪ Z can only be
served by tours of type 1, these tours were generated by two triples of the subset M ′
both containing w, but this is a contradiction to the definition of the matching M ′ .
In the same way we can show that every vehicle serves at least and at most one tour.
It remains to show that the total cost of the tours is bounded by B = 4(q + 3m).
By construction, we have q subgraphs corresponding to the q triples of the matching
M ′ , therefore having tour combinations of type 1 with four tours each of length 4.
Moreover, we have (m − q) subgraphs corresponding to the remaining triples of M that
are not in M ′ . These subgraphs are traversed by tour combinations of type 2 which
contain three tours of length 4. Hence, the total cost is 4q · 4 + 3(m − q) · 4 = 4(3m + q).
⊔
⊓
Corollary 1 The decision version of Vdp-k is NP-complete for every fixed k ≥ 2.
Proof For k = 2 the claim has already been established in Theorem 1. For k > 2
we construct the same graph G as in the proof of Theorem 1 and then add a path of
k−2 requests Pu to each vertex u ∈ U , where a unit is located. The edge lengths on this
8
path are all zero and, hence it follows that in any solution of cost at most B = 4(q+3m)
all requests on Pu must be served by u. Again, we obtain that there exists a solution
to 3Dm if and only if there exists a feasible dispatch for Vdp-k of cost at most B. ⊔
⊓
4 A constant factor approximation algorithm
In this section we present our approximation algorithms for the basic Vdp-k. In Section 4.1 we give a (2k−1)-approximation that runs in O(|U |+|E|) time. If k is constant,
this gives a constant
factor
approximation. In Section 4.2 we treat the case k = |E|
”
“
and provide a 2 −
1
|E|
-approximation which works similarly to the MST-heuristic [1,
7] for the metric TSP.
4.1 Bounded length tours
We first consider the case when the number k of requests allowed in a tour is strictly
less than |E|, the total number of requests. Let (U, E, d, k) be an instance of Vdp-k.
We define an auxiliary graph G = (V, A) with V := U ∪ E ∪ {s, t} which is built
as follows. First, we construct the complete bipartite graph having U and E as the
shores. Then, we add a source s which is connected to each unit u ∈ U via an arc
(s, u) and a sink t which is connected to each request e ∈ E via an arc (e, t). We
set appropriate integral capacities and nonnegative costs on the arcs and compute an
integral maximal (s, t)-flow f of minimum cost1 . This can be done in O(n3 ) time [1]
where n := |V | = |U | + |E| + 2. This flow f corresponds to an assignment of units
to requests so that every request is assigned to at most one unit and such that each
unit is assigned to at most k requests. Formally, the set Eu of requests assigned to u
is obtained by
e ∈ Eu ⇔ f (u, e) = 1.
“
”
We arrange Eu to a tour τu := u, eu,1 , eu,2 , . . . , eu,h(u) by sorting the elements of Eu
`
´
such that d u, eu,i ≤ d(u, eu,i+1 ) for i = 1, . . . , h(u)−1. This way, we obtain a tour τu
for every unit u ∈ U . The details of the algorithm Match-Dispatch are displayed in
Algorithm 1.
In the sequel we denote by D the solution obtained by Match-Dispatch and by
OPT an optimal solution.
Lemma 1 Let f be the maximal (s, t)-flow of minimum cost computed by MatchDispatch (Algorithm 1) and, as in the algorithm, denote for each unit u by Eu the
subset of requests assigned to u. Define
M := {(u, e) : u ∈ U, e ∈ Eu , f (u, e) = 1} = {(u, e) : u ∈ U, e ∈ Eu } ⊆ A2
to be the set of arcs corresponding to the assignment. Then
c(D) ≤ (2 −
1
1 X
cost(a).
) · cost(M ) := (2 − )
k
k
a∈M
1
that is, among all (s, t)-flows of maximum value one with minimum cost.
9
Algorithm 1 Match-Dispatch (U, E, d, k)
Input:
An instance (U, E, d, k) of Vdp-k.
`
´
Output: For each unit u ∈ U a tour τu := u, eu,1 , eu,2 , . . . , eu,h(u) with h(u) ≤ k.
1 Let s, t ∈
/ U ∪ E. Construct an auxiliary graph G = (V, A) with V := U ∪ E ∪ {s, t} and
A := A1 ∪ A2 ∪ A3 , where
– A1 := {s} × U ,
– A2 := U × E,
– A3 := E × {t}.
2 Define integral capacities cap : A → N with
(
k, if a = (s, u) ∈ A1 ,
cap(a) :=
1, otherwise,
(3)
and costs cost : A → R+ with
cost(a) :=
(
d(u, e),
0,
if a = (u, e) ∈ A2 ,
otherwise.
(4)
3 Compute a maximal (s, t)-flow f of minimum cost.
4 for all u ∈ U` do
´
5
Let Eu := eu,1 , eu,2 , . . . , eu,h(u) be the set of requests assigned to u by flow f so that
d (u, eu,i ) ≤ d(u, eu,i+1 ), i = 1, . . . , h(u)
` − 1.
´
6
Define the tour τu for unit u by τu := u, eu,1 , eu,2 , . . . , eu,h(u) .
7 end for
8 return The collection D := {τu : u ∈ U } of tours.
Proof Let τu = (u, eu,1 , eu,2 , . . . , eu,h(u) ) be the tour produced by Match-Dispatch
for u. Recall that h(u) ≤ k. Then
c(D) =
X
c(τu )
u∈U
=
«
h(u)
X„ `
´ X `
´
d u, eu,1 +
d eu,i−1 , eu,i
i=2
u∈U
«
h(u)
h(u)
X„ `
´ X `
´ X `
´
d u, eu,1 +
≤
d u, eu,i−1 +
d u, eu,i
i=2
u∈U
i=2
h(u)−1
“
”«
X„
X
`
´
2·(
=
d u, eu,i ) + d u, eu,h(u)
u∈U
i=1
= 2 · cost(M ) −
X
u∈U
1
≤ (2 − ) · cost(M ).
k
“
”
d u, eu,h(u)
Here we have used the triangle inequality to obtain the first inequality. The second
inequality follows from the fact that for each unit u the distance d(u, eu,h(u) ) (which is
the distance of the request in Eu furthest away from u) is at least the average distance
P
P
of an request in Eu to u. The latter, in turn, is e∈Eu d(u, e)/h(u) ≥ e∈Eu d(u, e)/k.
⊔
⊓
10
Lemma 2 The optimal cost c(OPT) and the cost cost(M ) of the arc set M corresponding to the assignment produced by Match-Dispatch satisfy:
cost(M ) ≤ k · c(OPT).
Proof As above let τu = (u, eu,1 , eu,2 , . . . , eu,h(u) ) be the tour for u produced by
Match-Dispatch and let τu∗ = (u, e∗u,1 , e∗u,2 , . . . , e∗u,h∗ (u) ) be the corresponding tour
in the optimal solution OPT. Then
k · c(OPT) = k ·
X
u∈U
≥
X
∗
h
u∈U
∗
≥
0
u∈U j=1
∗
≥
0
X
i=2
(u)
X hX
0
@d(u, e∗u,1 ) +
d(e∗u,i−1 , e∗u,i )A
h∗ (u)
(u) @d(u, e∗u,1 ) +
(u)
X hX
1
h∗ (u)
@d(u, e∗u,1 ) +
X
i=2
j
X
i=2
1
d(e∗u,i−1 , e∗u,i )A
1
d(e∗u,i−1 , e∗u,i )A
d(u, e∗u,j )
u∈U j=1
≥ cost(M ).
The first inequality follows from h∗ (u) ≤ k, the third one from the triangle inequality
and the final one from the optimality of the minimum cost flow. ⊔
⊓
Theorem 2 Match-Dispatch provides a (2k − 1)-approximation for Vdp-k.
Proof Combining the results of the previous two lemmas we get:
(2 − k1 ) · cost(M )
c(D)
≤
= 2k − 1.
1
c(OPT)
k · cost(M )
This proves the desired approximation ratio.
⊔
⊓
Lemma 3 The approximation ratio stated in Theorem 2 is tight for an arbitrary k ≥ 2.
Proof Let U := {ui : i = 1, . . . , k} be the set of units and E := {ei,j : i, j = 1, . . . , k}
the set of requests. Let d be the metric closure induced by the cost function d′ , with
d′ (ui , ei,j ) = 1 and d′ (ej,i , ej+1,i ) = ǫ for all j = 1, . . . , k−1, i = 1, . . . , k (see Figure 5).
It is easy to see that Match-Dispatch chooses to assign ei,j to ui for all i, j = 1, . . . , k
incurring a cost of k · (2k − 1) whereas it is possible to get hand on a better solution
by assigning ei,j to uj for all i, j = 1, . . . , k incurring a cost of k(1 + (k − 1)ǫ). Thus,
in general Match-Dispatch is not better than (2k − 1)-approximative. ⊔
⊓
11
u1
1
e1,1
ǫ
uk
u2
... 1
e1,2 ... e1,k e2,1
1
ǫ
1
...
e2,2 ...
1
ǫ
1
1
...
ek,1
e2,k
... ...
1 ... 1
ek,2
ǫ
ek,k
...
ǫ
Fig. 5 The graph for the proof of Lemma 3.
4.2 Unbounded length tours
The approximation ratio of 2k−1 provided by our algorithm Match-Dispatch worsens
as k grows. We now provide an alternative algorithm for the special case that k =
|E|, derived from the MST-heuristic for the metric TSP. The approximation ratio of
2 − 1/|E| obtained this way improves upon Match-Dispatch for the considered case.
We construct an undirected complete graph H = (VH , AH ) with VH := U ∪ E
and appropriate edge weights w : AH → R+ . Each edge (u, u′ ) connecting two
` units´
has zero weight, each other edge (vi , vj ) has weight equal to the distance d vi , vj
between the corresponding points in the metric space. We compute a minimum weight
spanning tree T = (VH , AT ) in H. Observe that since all weights are nonnegative we
can assume without loss of generality that T contains |U | − 1 edges of weight zero
which have both endpoints in U (this can be seen e.g. by considering an execution of
Kruskal’s algorithm). If we remove all of these |U | − 1 edges, we obtain |U | connected
components Tu each of which contains exactly one element u ∈ U and each of which
forms a tree. We use each component Tu to create a tour. Each tree Tu induces a new
metric wu on its vertices via the shortest path distances within Tu with respect to w.
For each u let vu ∈ Tu \{u} be chosen such that it is a vertex which maximizes wu (u, vu )
among all elements in Tu \ {u}. Let Tu′ be the graph obtained by doubling the edges
of Tu . Since each vertex in Tu′ has even degree, Tu′ contains an Eulerian tour. Among
all Eulerian tours we need one of special structure.
We start and end each Eulerian tour at u. Consider a fixed Eulerian tour S. This
tour S visits each vertex of Tu′ at least once and we can order the vertices according
to when they are visited first in the tour. For a vertex v ∈ Tu we set σS (v) to be the
corresponding ordering number of v in the tour S, where we start to count from 0. So,
σS (u) = 0 for all Eulerian tours S (since each tour starts at u) and σS (v) = |Tu | − 1 if
v is the vertex in Tu which is visited for the first time last. Recall that vu is the vertex
in Tu′ of maximum distance from u. In our algorithm we find an Eulerian tour Su in
Tu′ such that σSu (vu ) = |Tu | − 1 (the existence of such a tour is shown in Lemma 4).
The ordering according to σ then gives a tour τu for u in which vu is the last request.
Details of the algorithm Tree-Dispatch are shown in Algorithm 2.
Lemma 4 Let vu be a vertex in Tu of maximum distance wu (u, vu ) from u. It is always
possible to find an Eulerian tour Su in Tu′ such that σSu (vu ) = |Tu′ | − 1.
Proof Since w is a nonnegative function, we can assume that vu is a leaf in Tu . Let P
be the unique simple (u, vu )-path in Tu . We can find an Eulerian tour Su by applying
a depth-first-search to Tu and whenever there is a decision to be made on which vertex
12
Algorithm 2 Tree-Dispatch(U, E, d, |E|)
Input:
An instance (U, E, d, |E|) of Vdp-k.
`
´
Output: A collection D := {τu : u ∈ U } of tours with τu := u, eu,1 , eu,2 , . . . , eu,h(u) .
1 Construct an undirected complete graph H = (VH , AH ) with VH := U ∪ E.
2 Define a weight function w : AH → R+ with
(
0,
if vi ∈ U and vj ∈ U ,
(5)
w(vi , vj ) :=
d (vi , vj ) , otherwise.
3 Compute a minimum weight spanning tree T = (VH , AT ) in H such that T contains |U |−1
edges with both endpoints in U .
4 Remove from T all of the |U | − 1 edges with both endpoints in U thus obtaining |U | − 1
connected components. Each connected component contains exactly one element from U .
5 for all u ∈ U do
6
Let Tu be the connected component with u ∈ Tu . This component forms a tree Tu which
induces a new metric wu on its vertices via the shortest path distances within Tu with
respect to w.
7
Let vu ∈ Tu \ {u} be an element maximizing wu (u, vu ) among all vertices in Tu \ {u}.
8
Construct a graph Tu′ by doubling the edges of Tu .
9
For an Eulerian tour S of Tu′ which starts and ends in u we define σS (v) = ℓ if v is the
ℓ-th vertex being visited first on S.
10
Find an Eulerian tour Su in Tu′ such that σSu (vu ) = |Tu | − 1 (the existence of such a
tour is shown in Lemma
4).
`
´
11
Define a tour τu = u, eu,1 , . . . , eu,h(u) where h(u) = |Tu | − 1 and σSu (eu,i ) = i for
i = 1, . . . , h(u).
12 end for
13 return The collection D := {τu : u ∈ U } of tours.
to visit next we rather pick one which is not an element of P than one which is an
element of P . This way, we will have reached all other nodes in Tu prior to vu . ⊔
⊓
Let Tu be a connected component generated by Algorithm Tree-Dispatch in
Step 4. Recall that Tu is a tree on its vertices. In the sequel we denote by w(Tu ) the
sum of the weights of the edges in T with both endpoints in Tu and for a vertex v ∈ Tu
we let Pv be the unique simple path from u to v in Tu .
Lemma 5 For all u ∈ U it holds that
max w(Pv ) ≥
v∈Tu
1
w (Tu ) .
|Tu | − 1
Proof The weight w(Tu ) of the tree Tu can be upper bounded by the sum of the path
P
lengths v∈Tu w(Pv ). Thus,
w(Tu ) ≤
X
v∈Tu
This completes the proof.
w(Pv ) ≤ (|Tu | − 1) max w(Pv ).
v∈Tu
⊔
⊓
Lemma 6 Let OPT be an optimal dispatch and c(OPT) denote its cost. Then, the
weight w(T ) of the minimum weight spanning tree T obtained by Algorithm TreeDispatch satisfies
w(T ) ≤ c(OPT).
13
Proof For a unit u ∈ U , let τu∗ = (u, e∗u,1 , e∗u,2 , . . . , e∗u,h∗ (u) ) be the tour in an optimal
solution OPT for u. We can consider τu∗ as a path in the undirected graph H whose
weight is w(τu∗ ) = c(τu∗ ). If we take the union of the paths τu∗ and adding |U | − 1 edges
of weight 0, we obtain a spanning tree in H of weight at most c(OPT). Since T is a
minimum weight spanning tree the proposition follows directly. ⊔
⊓
Theorem 3 For k = |E|, Algorithm Tree-Dispatch provides a (2 −
imation for the Vdp-k.
1
)-approx|E|
Proof We first upper bound the cost c(D) of the dispatch generated by Tree-Dispatch.
For unit u ∈ U let Su be the Eulerian tour produced in Step 10 and τu be the corresponding tour in the dispatch generated in Step 11. Recall that vu is the vertex in Tu
of maximum distance from u, i.e.,
max w(Pv ) = w(Pvu ).
(6)
c(τu ) ≤ w(Su ) − w(Pvu ).
(7)
v∈Tu
By construction of τu we have
On the other hand, since Su traverses each edge from Tu′ exactly once, the weight
w(Su ) is twice the weight of Tu . Thus,
c(τu ) ≤ 2 w(Tu ) − w(Pvu )
(by (7))
= 2 w(Tu ) − max w(Pv )
v∈Tu
„
«
1
≤ 2−
· w(Tu )
|Tu | − 1
«
„
1
· w(Tu ).
≤ 2−
|E|
(by (6))
(by Lemma 5)
(8)
Summing up the inequalities (8) over all u ∈ U gives
c(D) =
X
u∈U
c(τu ) ≤
„
„
«X
«
1
1
2−
w(Tu ) = 2 −
w(T ).
|E|
|E|
(9)
u∈U
Due to Lemma 6 we have w(T ) ≤ c(OPT) and this completes the proof.
⊔
⊓
5 Extension to lateness costs
The overall goal in the problem posed by our cooperation partner is not only to minimize the incurred driving costs but also to maximize service quality, which means
that requests should not be arbitrarily delayed. Therefore we introduce a penalty term
punishing deferral of requests, see [6, 8, 9]. These additional costs will be called lateness
costs. We will assume throughout this section that the time needed to travel from one
point in the metric space to another one equals the distance between these two points,
in particular, we can assume that a service vehicle travels with unit speed.
14
If unit u serves requests eu,1 , eu,2 , . . . , eu,h(u) in that order, then it arrives at request eu,l , l = 1, . . . , h(u) at time
t(u, eu,1 , . . . , eu,l ) := d(u, eu,1 ) +
l
X
d(eu,i−1 , eu,i ),
(10)
i=2
where the first term reflects the time needed to drive from the home location to the
first request and the second term is the time to travel from request to request until
reaching eu,l .
The lateness cost for serving a request will be specified by a lateness function r(t).
More precisely, suppose request e is served at time t, then an additional cost of r(t) ≥ 0
will be incurred. Thus, the total cost for the tour τu = (u, eu,1 , . . . , eu,h(u) ) of unit u
is
h(u)
c(τu ) := d(u, e1 ) +
X
h(u)
d(eu,i−1 , eu,i ) +
i=2
|
X ` `
´´
r t u, eu,1 , . . . , eu,i .
(11)
i=1
{z
driving cost as before
}
|
{z
lateness cost of the tour
}
In the version of the Vdp-k with lateness costs the goal is to find a feasible dispatch
(specified by a collection of tours) such that the overall cost is minimized. Thus, the
only change compared to Definition 1 is that the cost of a tour is now calculated
according to (11) instead of (1).
In the real world application at ADAC the lateness cost function r(t) is a quadratic
function of the form
r(t) = r2 t2 + r1 t + r0 ,
(12)
where the constant factors r2 , r1 and r0 are nonnegative real numbers. We will deal
with such quadratic lateness costs in Section 5.2. Since the calculations are somewhat
technical, in Section 5.1 we first consider the special case of a linear lateness function
r(t) = r1 t + r0 .
(13)
Consider Algorithm 1 Match-Dispatch. The cost function cost : A → R+ for the
minimum cost flow problem was defined as
cost (a) =
(
d(u, e),
if a = (u, e) ∈ A2 ,
0,
otherwise,
where A2 is defined in Step 1 of Algorithm 1 Match-Dispatch.
We manipulate the cost function in such a way that it additionally contains a
lateness term in addition to the obvious travel cost. Therefore, the cost function cost :
A → R+ reads as follows:
(
d (u, e) + r (t (u, e)) , if a = (u, e) ∈ A2 ,
(14)
cost (u, e) =
0,
otherwise,
where t (u, e) = d(u, e) denotes the vehicle’s arrival time at request e, if it starts
immediately at its current location and drives directly to e.
15
5.1 Linear Lateness Costs
If the lateness function r(t) is linear of the form (13) and request e is the l-th request
served within a tour for a unit u, the lateness cost incurred for e is
l
` `
´´
` `
´ X
`
´´
r t u, eu,1 , . . . , eu,l := r1 d u, eu,1 +
d eu,i−1 , eu,i + r0 .
(15)
i=2
Considering the new cost function (14) with the lateness term (15), we get the
following costs for arcs a ∈ A2 of the auxiliary graph G
cost (u, e) := d(u, e) + r (t (u, e)) = d(u, e) + r1 d(u, e) + r0 .
“
”
Moreover, the cost of a tour τu = u, eu,1 , . . . , eu,h(u) is defined as
(16)
h(u)
h(u)
´ X `
`
´ X ` `
´´
c(τu ) : = d u, eu,1 +
d eu,i−1 , eu,i +
r t u, eu,1 , . . . , eu,i
i=2
i=1
h(u)
`
´ X `
´
= d u, eu,1 +
d eu,i−1 , eu,i
(17)
i=2
+
h(u) “
X
i=1
i
”
` `
´ X
`
´´
r1 d u, eu,1 +
d eu,j−1 , eu,j + r0 .
j=2
The cost of a dispatch D := {τu : u ∈ U } for a vehicle dispatching problem Vdp-k
with linear lateness penalties reads as follows
X
c(τu )
c (D) =
u∈U
=
h(u)
´ X `
`
´
d u, eu,1 +
d eu,i−1 , eu,i
X
i=2
u∈U
(18)
!
i
X` `
´ X
`
´´
+ r1
d u, eu,1 +
d eu,j−1 , eu,j + h(u)r0 .
h(u)
i=1
j=2
Recall that h(u) is the actual number of events in a particular tour and h(u) ≤ k by
definition.
As in Section 4 we denote by f the maximal (s, t)-flow of minimum cost computed
by Match-Dispatch (Algorithm 1) and by Eu the subset of requests assigned to u for
each unit u ∈ U . Again, we define the set
M := {(u, e) : u ∈ U, e ∈ Eu } ⊆ A2
to be the set of arcs corresponding to the assignment. Then the cost of the arc set M
reads as follows:
0
1
X h(u)
X“ `
´
` `
´´ ”
@
A
cost (M ) =
d u, eu,i + r t u, eu,i
i=1
u∈U
=
X
u∈U
0
1
”
`
´
`
´
d u, eu,i + r1 d u, eu,i + r0 A .
h(u) “
@
X
i=1
(19)
16
Prior to proving the approximation ratio we will state an observation that will be
useful in the following computations.
Observation 4
h(u) “
h(u)−1
i
X
´ X
`
`
´”
`
´
d u, eu,1 +
d eu,j−1 , eu,j
≤2
(h(u) − i) d u, eu,i
X
i=1
j=2
i=1
h(u)
+
X
i=1
`
´
d u, eu,i .
Proof Using the triangle inequality and rearranging of terms we get:
h(u) “
X
i=1
i
´ X
`
`
´”
d u, eu,1 +
d eu,j−1 , eu,j
j=2
h(u)−1
=
X
´
`
´
`
(h(u) − i) d eu,i , eu,i+1 + h(u)d u, eu,1
X
´´
`
´
` `
´
`
(h(u) − i) d u, eu,i + d u, eu,i+1 + h(u)d u, eu,1
i=1
h(u)−1
≤
i=1
h(u)−1
=
X
h(u)−1
X
`
´
`
´
`
´
(h(u) − i) d u, eu,i +
(h(u) − i) d u, eu,i+1 + h(u)d u, eu,1
X
“
”
`
´
(2h(u) − 2i + 1) d u, eu,i + d u, eu,h(u)
i=1
i=1
h(u)−1
=
i=1
h(u)−1
=2
X
i=1
h(u)
`
´ X `
´
(h(u) − i) d u, eu,i +
d u, eu,i .
⊔
⊓
i=1
Lemma 7 Let the dispatch D := {τu : u ∈ U } be obtained by Algorithm MatchDispatch and Eu be the subset of requests assigned to unit u by the same algorithm
for each u ∈ U . Then
«
„
2kr1
1
· cost (M ) .
c (D) ≤ 2 − +
k
r1 + 1
Proof For each u in U , let τu = (u, eu,1 , eu,2 , . . . , eu,h(u) ) be the tour for u produced
by Match-Dispatch. Then, from (18) and the triangle inequality,
h(u)
X„ `
´ X `
´
d u, eu,1 +
c (D) =
d eu,i−1 , eu,i
i=2
u∈U
+ r1
h(u) “
X
i=1
≤
X„
j=2
h(u)−1
2
u∈U
+ r1
i
`
´ X
`
´”
d u, eu,1 +
d eu,j−1 , eu,j
+ h(u)r0
X
i=1
h(u) “
X
i=1
“
”
`
´
d u, eu,i + d u, eu,h(u)
«
«
i
`
´ X
`
´”
d u, eu,1 +
d eu,j−1 , eu,j
+ h(u)r0 .
j=2
17
Using Observation 4 and (19) this can be upper bounded by
X„
h(u)−1
X
2
i=i
u∈U
“
”
`
´
d u, eu,i + d u, eu,h(u)
h(u)−1
X
+ 2r1
i=1
«
h(u)
X `
`
´
´
(h(u) − i) d u, eu,i + r1
d u, eu,i + h(u)r0
i=1
= 2 cost (M ) +
X„
“
”
− d u, eu,h(u) − r1
u∈U
h(u)−1
X
+ 2r1
`
´
(h(u) − i) d u, eu,i
i=1
h(u)
X
i=1
«
`
´
d u, eu,i − h(u)r0
«
„
h(u)−1
X
X„
`
´
1
− r1
· cost (M ) +
d u, eu,i − (h(u) − 1) r0
≤ 2−
k
i=1
u∈U
h(u)−1
X
+ 2r1
`
´
(h(u) − i) d u, eu,i
i=1
«
«
„
h(u)−1
X
X„
`
´
1
− r1
d u, eu,i − (h(u) − 1) r0
≤ 2 − + 2k · cost (M ) +
k
u∈U
i=1
h(u)
“
”
X `
´
− 2k
d u, eu,i − 2kr1 d u, eu,h(u) − 2kh(u)r0
i=1
h(u)−1
X
− 2r1
i=1
«
`
´
id u, eu,i .
The first inequality holds, because
”
“
”
X“
cost (M )
≤
(1 + r1 ) d u, eu,h(u) + r0 ,
k
u∈U
and the second one, because
X
u∈U
h(u)−1
X
i=i
`
´
2h(u)r1 d u, eu,i
≤ 2k cost (M ) −
X
u∈U
0
h(u)
@
X
i=i
1
“
”
`
´
2kd u, eu,i − 2kr1 d u, eu,h(u) − 2kh(u)r0 A .
Since
X
u∈U
h(u)
2k
«
«
„
X „ 2k
X `
´
2k
h(u)r0 ,
· cost (M ) −
d u, eu,i =
r1 + 1
r1 + 1
i=1
u∈U
18
we have
c (D) ≤
„
«
1
2k
+ 2k −
· cost (M )
k
r1 + 1
h(u)−1
“
”
X
X„
`
´
− r1
+
d u, eu,i − (h(u) − 1) r0 − 2kr1 d u, eu,h(u)
2−
i=1
u∈U
+
«
h(u)−1
X
`
´
2k
id u, eu,i ,
h(u)r0 − 2kh(u)r0 − 2r1
r1 + 1
i=1
and
c (D) ≤
„
2−
2kr1
1
+
k
r1 + 1
«
· cost (M ) ,
because all remaining terms turn out to be negative. Indeed,
h(u)−1
−r1
X
i=1
h(u)−1
“
”
X
`
´
`
´
d u, eu,i − (h(u) − 1) r0 − 2kr1 d u, eu,h(u) − 2r1
id u, eu,i ≤ 0,
i=1
and
2k
h(u)r0 − 2kh(u)r0 ≤ 0,
r1 + 1
for r0 , r1 ≥ 0 which hold by definition.
⊔
⊓
Lemma 8 Let OPT denote an optimal solution to an instance (U, E, d, k) of a vehicle
dispatching problem Vdp-k with linear lateness costs and M be the arc set corresponding
to the assignment produced by Match-Dispatch. Then the optimal cost c(OPT) and
cost(M ) satisfy
cost(M ) ≤ k · c (OPT) .
Proof As above let τu = (u, eu,1 , eu,2 , . . . , eu,h(u) ) be the tour for u produced by
Match-Dispatch and let τu∗ = (u, e∗u,1 , e∗u,2 , . . . , e∗u,h∗ (u) ) be the corresponding tour
in the optimal solution OPT. Then
k · c (OPT) = k
∗
(u)
X „ hX
`
´
`
´
d e∗u,i−1 , e∗u,i + d u, e∗u,1 +
u∈U
h∗ (u)
X
r1
i=1
i=2
«
i
“X
`
´
`
´”
d e∗u,j−1 , e∗u,j + d u, e∗u,1
+ h∗ (u)r0
j=2
∗
(u) “ i
X ` ∗
X „ hX
´
`
´”
≥
d eu,j−1 , e∗u,j + d u, e∗u,1 +
u∈U
i=1
h∗ (u)
j
i “X
X
X
i=1
r1
j=1
j=2
l=2
`
´
`
´”
d e∗u,l−1 , e∗u,l + d u, e∗u,1
+ h∗ (u)r0
∗
«
(u)
h∗ (u)
X „ hX
X `
`
´
∗ ´
≥
d u, eu,i + r1
d u, e∗u,i + h∗ (u)r0
u∈U
i=1
≥ cost (M ) .
i=1
«
19
Analogous to the proof of Lemma 2, the first inequality follows from h∗ (u) ≤ k, the
second one from the triangle inequality and the last one from the optimality of the
minimum cost flow. ⊔
⊓
` 2 r1
´
Theorem 5 Match-Dispatch with linear lateness costs provide a 2k
r1 +1 + 2k − 1 approximation for VDP-k.
Proof Combining the results of the previous two lemmas we get:
` 2kr1
1´
2k2 r1
c(D)
r +1 + 2 − k · cost (M )
≤ 1
+ 2k − 1.
=
1
c (OPT)
r1 + 1
k · cost (M )
This proves the desired approximation ratio.
⊔
⊓
5.2 Quadratic Lateness Costs
In case of quadratic lateness penalties as in (12), the lateness cost of a request e at
position l in a tour is given by:
l
` `
´´
` `
´ X
`
´ ´2
r t u, eu,1 , . . . , eu,l = r2 d u, eu,1 +
d eu,i−1 , eu,i
i=2
l
´ X
` `
`
´´
+ r1 d u, eu,1 +
d eu,i−1 , eu,i + r0 .
(20)
i=2
Considering the auxiliary graph G defined in Section 4.1 and the cost function (14)
with lateness term (20), we get the following costs for arcs a ∈ A2
cost (u, e) = d(u, e) + r (t (u, e)) = d(u, e) + r2 d(u, e)2 + r1 d(u, e) + r0
(21)
in the auxiliary graph G.
“ As in Section 5.1, the
” dispatch D := {τu : u ∈ U } is a collection of tours τu =
u, eu,1 , eu,2 , . . . , eu,h(u) obtained as a solution of Algorithm 1 Match-Dispatch.
Also, the objects f , Eu and M are as in Section 5.1. The only difference being that
this time the flow is obtained using the costs from (21).
The cost of a tour τu , the cost of a dispatch D and the cost of the arc set M are
composed in the same way as in the linear case by adding the appropriate quadratic
terms, i. e.,
h(u)
´ X `
`
´
c(τu ) = d u, eu,1 +
d eu,i−1 , eu,i
i=1
+ r2
h(u) “
+ r1
h(u) “
X
j=1
X
j=1
c(D) =
X
u∈U
c(τu ),
j
`
´ X `
´ ”2
d u, eu,1 +
d eu,j−1 , eu,j
i=2
j
`
´ X `
´”
d u, eu,1 +
d eu,j−1 , eu,j
+ h(u)r0 ,
i=2
20
and
cost (M ) =
”«
X“ `
X „ h(u)
´
`
´2
`
´
d u, eu,i + r2 d u, eu,i + r1 d u, eu,i + r0 .
i=1
u∈U
We can now show that Algorithm 1 Match-Dispatch is still a constant factor
approximation independent of the number of service vehicles |U | and the number of
requests |E|. It only depends on the maximal number of requests of a tour and the
constant factors r2 , r1 , r0 ≥ 0.
Lemma 9 Let the dispatch D := {τu : u ∈ U } be a collection of tours obtained as a
solution of Algorithm Match-Dispatch and Eu the subset of requests assigned to unit
u by the same algorithm for each u ∈ U . Moreover, the set M := {(u, e) : u ∈ U, e ∈
Eu } ⊆ A2 denotes the arcs corresponding to the assignment. Then
„
«
1
2kr1
2kr2
c (D) ≤ 2 − +
+
· cost (M ) .
k
r1 + 1
r2 + 1
`
´2
´
`
´
`
Proof We will assume that d u, eu,i ≥ d u, eu,i . If d u, eu,1 ≥ 1, this will always
be the case, otherwise scale the distances appropriately. Moreover, we need the following
observations to prove the lemma:
j
j
“X
X
`
´ ”2
`
´2
d u, eu,i
≤j
d u, eu,i ,
i=1
(22)
i=1
and
h(u)
h(u)
j−1
X `
´X `
´ X
`
´2
d u, eu,j
d u, eu,i ≤
(j − 1) d u, eu,j .
j=1
i=1
(23)
j=1
Using these equations, we can show for the quadratic lateness costs
h(u) “
X
j=1
j
`
´ X `
´ ”2
d u, eu,1 +
d eu,i−1 , eu,i
i=2
≤
h(u) “
=
h(u) „
X
j=1
j
`
´ X` `
´
`
´´ ”2
d u, eu,1 +
d u, eu,i−1 + d u, eu,i
i=2
X
j=1
h(u)
X
≤4
«
j−1
“ j−1
X `
´ ”2
`
´X `
´
`
´2
4
d u, eu,i
+ 4d u, eu,j
d u, eu,i + d u, eu,j
i=1
(j − 1)
j=1
i=1
h(u)−1
≤2
i=1
j−1
X
h(u)
h(u)
X
`
´2
`
´2 X `
´2
d u, eu,i + 4
(j − 1) d u, eu,j +
d u, eu,j
j=1
j=1
h(u)
X `
X
´ `
´2
`
´2
k (k − 1) − i (i − 1) d u, eu,i + 4
(i − 1) d u, eu,i
i=1
i=1
h(u)
+
X
i=1
`
´2
d u, eu,i ,
(24)
21
where the second inequality of (24) holds because of inequalities (22) and (23). Using
calculations similar to the linear case we obtain
„
«
1
c (D) ≤ 2 − + 2k + 2k2 · cost (M )
k
h(u)−1
“
”
X
X„
`
´
− 2r1
+
d u, eu,i − r1 d u, eu,h(u)
i=1
u∈U
h(u)−1
X
− 2r2
i=1
h(u)
− 2k
X
i=1
h(u)
“
”
X `
`
´
´2
d u, eu,i − 2kr2
d u, eu,i − 2kr1 d u, eu,h(u) − 2kh(u)r0
i=1
h(u)
h(u)
X `
`
´
´
d u, eu,i − 2k2 r1
d u, eu,i
X
− 2k2
i=1
i=1
“
2
“
”2
`
´2
d u, eu,i − r2 d u, eu,h(u) − (h(u) − 1) r0
− 2k r2 d u, eu,h(u)
h(u)−1
+ 2r1
X
i=1
i=1
X
i=1
− 2k h(u)r0
h(u)
X `
`
´
´
(−i) d u, eu,i + r1
d u, eu,i +
X `
h(u)
+ r2
2
i=1
h(u)−1
+ 2r2
”2
h(u)
X
´ `
´2
`
´2
− k − i (i − 1) d u, eu,i + 4r2
(i − 1) d u, eu,i
i=1
«
`
´2
.
d u, eu,i
(25)
`
´2
`
´
Since we assumed that d u, eu,i ≥ d u, eu,i , we can observe that
−
2k2
cost (M )
r2 + 1
=−
„ h(u)
”«
´
`
´2
`
´
2k2 X X “ `
d u, eu,i + r2 d u, eu,i + r1 d u, eu,i + r0
r2 + 1
u∈U
2
≥−
=
2k
r2 + 1
X„
u∈U
i=1
”«
X“ `
X „ h(u)
´
`
´
`
´
d u, eu,i + r2 d u, eu,i + r1 d u, eu,i + r0
u∈U
i=1
h(u)
− 2k
2
X
i=1
«
h(u)
`
´ 2k2 r1 X `
´
2k2
h(u)r0 ,
d u, eu,i −
d u, eu,i −
r2 + 1
r2 + 1
i=1
and therefore
«
h(u)
X `
X„
´
2k2
cost (M )
− 2k2
d u, eu,i
≤−
r2 + 1
u∈U
i=1
«
X „ 2k2 r1 h(u)
X `
´
2k2
+
h(u)r0 .
d u, eu,i +
r2 + 1
r2 + 1
u∈U
i=1
(26)
22
Moreover, we perceive
X„
h(u)
− 2k
u∈U
X
i=1
`
´
d u, eu,i
«
≤−
2k
cost (M )
r1 + 1
«
X `
X „ 2kr2 h(u)
´2
2k
h(u)r0 .
d u, eu,i +
+
r1 + 1
r1 + 1
u∈U
i=1
Including the observations from (26) and (27) into (25), we obtain
c (D) ≤
«
2k
2k2
1
+ 2k + 2k2 −
−
cost (M ) +
k
r1 + 1
r2 + 1
h(u)−1
“
”
X
X„
`
´
− 2r1
+
d u, eu,i − r1 d u, eu,h(u)
„
2−
i=1
u∈U
h(u)−1
X
− 2r2
i=1
h(u)
− 2kr2
X
i=1
+
“
”2
`
´2
d u, eu,i − r2 d u, eu,h(u) − (h(u) − 1) r0 −
“
”
`
´2
d u, eu,i − 2kr1 d u, eu,h(u) − 2kh(u)r0
h(u)
´2
2kr2 X `
2k
h(u)r0
d u, eu,i +
r1 + 1
r1 + 1
i=1
h(u)
− 2k2 r1
X
i=1
“
”2
`
´
d u, eu,i − 2k2 r2 d u, eu,h(u) − 2k2 h(u)r0
h(u)
´
2k2
2k r1 X `
h(u)r0
d u, eu,i +
r2 + 1
r2 + 1
2
+
i=1
h(u)−1
+ 2r1
X
i=1
h(u)−1
+ 2r2
h(u)
X `
`
´
´
(−i) d u, eu,i + r1
d u, eu,i +
X `
i=1
h(u)
i=1
h(u)
X
´ `
´2
`
´2
− k − i (i − 1) d u, eu,i + 4r2
(i − 1) d u, eu,i
«
X `
´2
+ r2
d u, eu,i
.
i=1
i=1
(27)
23
Since
h(u)
2kr2
X
i=1
h(u)
`
´2
´2
2kr2 X `
2k
h(u)r0 ,
d u, eu,i + 2kh(u)r0 ≥
d u, eu,i +
r1 + 1
r1 + 1
i=1
h(u)
2k2 r1
h(u)
X `
´
´
2k r1 X `
2k2
d u, eu,i + 2k2 h(u)r0 ≥
h(u)r0 ,
d u, eu,i +
r2 + 1
r2 + 1
2
i=1
i=1
h(u)−1
2r1
X
i=1
h(u)
”
X `
`
´
´
id u, eu,i + r1 d u, eu,h(u) ≥ r1
d u, eu,i ,
h(u)−1
2r2
X
i=1
h(u)−1
2r2
X
i=1
“
i=1
h(u)
X
`
´2
`
´2
kd u, eu,i ≥ 4r2
(i − 1) d u, eu,i ,
i=1
h(u)
”2
X `
`
´2
´2
d u, eu,i + r2 d u, eu,h(u) ≥ r2
d u, eu,i
“
i=1
holds and all remaining terms are negative, we finally get
c (D) ≤
This completes the proof.
„
2−
2kr1
2k2 r2
1
+
+
k
r1 + 1
r2 + 1
«
· cost (M ) .
⊔
⊓
Lemma 10 Let OPT denote an optimal solution to an instance (U, E, d, k) of a vehicle dispatching problem Vdp-k with quadratic lateness costs and M be the arc set
corresponding to the assignment produced by Match-Dispatch. Then the optimal cost
c(OPT) and cost(M ) satisfy
cost (M ) ≤ k · c (OPT) .
Proof As above let τu = (u, eu,1 , eu,2 , . . . , eu,h(u) ) be the tour for u produced by
Match-Dispatch and let τu∗ = (u, e∗u,1 , e∗u,2 , . . . , e∗u,h∗ (u) ) be the corresponding tour
24
in the optimal solution OPT. Then
∗
(u)
X „ hX
`
´
`
´
k · c (OPT) = k
d e∗u,j−1 , e∗u,j + d u, e∗u,1
j=1
u∈U
∗
h (u)
+
X
r2
j=1
∗
h (u)
+
X
j=1
j
“X
`
´
`
´ ”2
d e∗u,i−1 , e∗u,i + d u, e∗u,1
i=2
«
j
“X
”
` ∗
`
∗ ´
∗ ´
∗
r1
d eu,i−1 , eu,i + d u, eu,1
+ h (u)r0
i=2
∗
(u) “ j
X ` ∗
X „ hX
´
`
´
≥
d eu,i−1 , e∗u,i + d u, e∗u,1
j=1
u∈U
h∗ (u)
+
X
r2
j=1
X
j “X
i
X
`
´ ”2
´
`
d e∗u,l−1 , e∗u,l + d u, e∗u,1
i=1
h∗ (u)
+
i=2
r1
j=1
l=2
«
j “X
i
X
`
´
`
´”
d e∗u,l−1 , e∗u,l + d u, e∗u,1
+ h∗ (u)r0
i=1
l=2
∗
(u)
h∗ (u)
X „ hX
X `
`
´
´2
≥
d u, e∗u,i + r2
d u, e∗u,i
u∈U
i=1
h∗ (u)
+ r1
X
i=1
≥ cost (M ) .
i=1
`
´
d u, e∗u,i + h∗ (u)r0
«
Analogous to the proofs of Lemma 2 and 8, the results follow from the fact that h∗ (u)
is less than or equal to k, from the triangle inequality and from the optimality of the
minimum cost flow. ⊔
⊓
Putting Lemmas 9 and 10 together we can finally prove the constant approximation
ratio of Algorithm 1 Match-Dispatch.
Theorem 6 Match-Dispatch with quadratic lateness costs provide a
´
2k − 1 -approximation for Vdp-k.
` 2k3 r2
r2 +1
2
r1
+ 2k
r1 +1 +
Proof By combination of Lemmas 9 and 10 we get
´
` 2k2 r2
2kr1
1
c (D)
2k2 r1
2k3 r2
r2 +1 + r1 +1 + 2 − k · cost (M )
≤
+
+ 2k − 1,
=
1
c (OPT)
r
+
1
r
2
1+1
k · cost (M )
which is what we wanted to show.
⊔
⊓
6 Conclusions and further research
In this paper we proved NP-completeness for the vehicle dispatching problem Vdp-k for
any fixed k ≥ 2. We also developed an approximation algorithm Match-Dispatch for
25
the metric version of the problem and extended it to the cases of linear and quadratic
lateness functions. In case of unbounded tour lengths (k := |E|) and without lateness
costs we gave a different approximation algorithm Tree-Dispatch with performance
ratio 2 − 1/|E|. The approximation ratios are tight in case of no lateness costs as we
have shown by appropriate instances. However, it is not clear whether the bounds of
Section 5 can be sharpened by a more careful analysis.
As we have seen in an example, the approximation factor of (2k − 1) in the metric
version results from the minimum cost flow problem solved in Algorithm MatchDispatch. In terms of worst-case analysis, it does not matter whether afterwards we
sequence requests optimally, by Match-Dispatch or by a traveling salesman heuristic.
However, in practice this sequencing should matter. This is subject to further research
and evaluation on real-world problems. An implementation of our algorithms with an
extensive evaluation is in progress.
7 Acknowledgement
We wish to thank the referees for their helpful comments which helped to improve the
presentation substantially.
References
1. R. K. Ahuja, T. L. Magnanti, and J. B. Orlin. Networks Flows. Prentice Hall, Englewood
Cliffs, New Jersey, 1993.
2. A. A. Bertossi, P. Carraresi, and G. Gallo. On some matching problems arising in vehicle
scheduling models. Networks, 11, 1987.
3. I. Dischke. Disposition von Einsatzfahrzeugen: Startheuristiken, Branching-Regeln und
Rundungstechniken. Diplomarbeit, TU Berlin, 2004.
4. M. R. Garey and D. S. Johnson. Computers and Intractability (A guide to the theory of
NP-completeness). W.H. Freeman and Company, New York, 1979.
5. M. Haimovich and Alexander H. G. Rinnooy Kan. Bounds and heuristics for capacitated
routing problems. Mathematics of Operations Research, 10, 1985.
6. B. Hiller, S. O. Krumke, and J. Rambau. Reoptimization gaps versus model errors in onlinedispatching of service units. Discrete Applied Mathematics, 2005. A preliminary version
appeared in the Proceedings of the Latin-American Conference on Combinatorics, Graphs
and Algorithms, 2004.
7. S. O. Krumke and H. Noltemeier. Graphentheorische Konzepte und Algorithmen. B.G.
Teubner, 2005.
8. S. O. Krumke, J. Rambau, and L. M. Torres. Online dispatching of automobile in real-time.
ZIB Report 02-18, Konrad-Zuse-Zentrum für Informationstechnik Berlin, 2002.
9. S. O. Krumke, J. Rambau, and L. M. Torres. Real-time dispatching of guided and unguided
automobile service units with soft time windows. In Proceedings of the 10th Annual European Symposium on Algorithms, volume 2461 of Lecture Notes in Computer Science, pages
637–648. Springer, 2002.