1 Introduction

In the Capacitated Vehicle Routing problem, we are given a metric space with a depot and customers, each with a positive demand between 0 and 1. The goal is to design tours of minimum total length such that each tour contains the depot, each customer is served by some tour, and the total demand of the customers in one tour does not exceed 1 (after scaling, this is the vehicle capacity). Capacitated Vehicle Routing generalizes the famous traveling salesman problem and has obvious applications in logistics. There is a huge body of literature studying heuristics, mixed-integer programming models, and application scenarios.

The so far best known approximation algorithm is more than 30 years old and quite simple: it first computes a traveling salesman tour (ignoring the capacity constraint) and then partitions the tour optimally into segments of total demand at most 1, each of which is then served by a separate tour from the depot. The approximation ratio of this algorithm is \(\alpha + 2\), where \(\alpha \) is the approximation ratio of an algorithm computing the traveling salesman tour. Essentially the same algorithm has been the best known for the unit-demand special case (where all customers have the same demand), and also for the variant where a customer’s demand can be split and served by more than one tour. For these special cases, the approximation ratio is \(\alpha + 1\).

These algorithms have been proposed and analyzed in the 1980s by Altinkemer and Gavish [2] and Haimovich and Rinnooy Kan [19]. Despite many efforts and progress in special cases (cf. Sect. 1.3), they have not been improved, except that the traveling salesman tour can now be computed by the Karlin–Klein–Oveis Gharan algorithm [21] instead of the Christofides–Serdjukov algorithm [11, 26], which improves \(\alpha \) to slightly less than \(\frac{3}{2}\) if one allows randomization.

In this paper we improve upon the classical algorithms of [2] and [19]. Our result is a better black-box reduction to the traveling salesman problem. Therefore, our new algorithm has a better approximation ratio than the classical algorithms of [2] and [19], and this will remain true if the approximation ratio for the traveling salesman problem will be improved further. Here are our main results:

Theorem 1

For every \(\alpha >1\) there is an \(\varepsilon >0\) such that the following holds. If there is an \(\alpha \)-approximation algorithm for the traveling salesman problem, then there is an \((\alpha + 2\cdot (1-\varepsilon ))\)-approximation algorithm for Capacitated Vehicle Routing. For \(\alpha =\frac{3}{2}\) we have \(\varepsilon >\frac{1}{3000}\).

Theorem 2

For every \(\alpha >1\) there is an \(\varepsilon >0\) such that the following holds. If there is an \(\alpha \)-approximation algorithm for the traveling salesman problem, then there is an \((\alpha + 1-\varepsilon )\)-approximation algorithm for Unit-Demand Capacitated Vehicle Routing and Splittable Capacitated Vehicle Routing. For \(\alpha =\frac{3}{2}\) we have \(\varepsilon >\frac{1}{3000}\).

1.1 Outline

To obtain our results, we analyze instances for which the approximation guarantees of [2] and [19] are almost tight and exploit their structure to design better solutions. We will call such instances difficult.

We view every tour in a solution to a Capacitated Vehicle Routing instance as the union of two paths from the depot to the peak of the tour: the point farthest away from the depot. Our first observation is that the performance of the classical algorithms can be close to the worst case guarantee only if, for most tours, these two paths have small detour, i.e., they are approximately shortest paths from the depot to the peak.

We will compute an even number of paths that all start at the depot such that all customers are visited by some path. The total length of these paths will not be much more than the length of an optimum solution to the Capacitated Vehicle Routing instance. Then we combine pairs of these paths to tours by adding an edge between their endpoints.

If there exists a set of paths with small total detour (like the one induced by an optimum solution to a difficult instance), then we can find a set of paths that is not much longer in polynomial time. In fact, this problem is closely related to regret-bounded vehicle routing, a problem that has been studied by Friggstad and Swamy [16, 17]. Here, one asks for a minimum number of paths serving all customers such that the detour of any path is bounded.

However, combining pairs of paths to tours can be too expensive. We need to ensure that a relatively cheap matching of the endpoints of the paths exists. Ideally, two paths end at the peak of each tour in an optimum solution, then the matching would not cost anything. But of course we do not know these peaks. Therefore we try to “guess” them, by exploiting another property of difficult instances: in almost all tours of an optimum solution, the total demand of customers near the peak is almost 1 (the vehicle capacity). Consequently, we can assume that “most” customers are clustered, and we can force two paths to end in each cluster.

However, another difficulty arises because the clusters are not necessarily clearly separated from one another. Still we can identify groups of nearby clusters, and estimate the number of tours whose peak is in that group. Instead of prescribing the endpoints of the paths, we only specify the total number of paths that must end in each group. This number will always be even, in order to ensure that we can find a matching within each group. Although customers in the same group can be far away from each other if there is a chain of pairwise overlapping clusters, we will be able to prove that a relatively cheap matching exists.

The key subproblem therefore asks to find an appropriate number of paths that begin at the depot and end in these target groups, such that all customers (including those that do not belong to any group) are served by some tour. We call this problem Vehicle Routing with Target Groups. The instance of Vehicle Routing with Target Groups that we compute has the property that it has a solution that is cheap and has small total detour. This will enable us to find a cheap set of paths in polynomial time: either by a simple and fast combinatorial algorithm, or alternatively by leveraging an LP-based approach suggested for regret-bounded vehicle routing by Friggstad and Swamy [17].Footnote 1

Once we have these paths, we compute the cheapest matching of their endpoints and combine them to tours. These tours will generally still not meet the capacity constraint, but we can simply concatenate all these tours (and shortcut) to obtain a traveling salesman tour. Since this tour will be not much more expensive than an optimum solution to our Capacitated Vehicle Routing instance, applying the classical tour partitioning algorithm finishes the job.

1.2 Formal problem description

Given a depot s and a set V of customers, we want to design tours serving all customers. For now, a tour is a cycle that contains s and a subset of customers (later we will also consider tours that begin in s but do not end in s). To measure the cost of a tour, we have a semi-metric \(c:(\{s\}\cup V) \times (\{s\}\cup V) \rightarrow {\mathbb {R}}_{\ge 0}\), i.e., c is symmetric and satisfies the triangle inequality. We will interpret a tour Q as an undirected graph with vertex set V(Q) and edge set E(Q). We write \(c(Q)=\sum _{\{v,w\}\in E(Q)}c(v,w)\) for the cost (or total distance) of Q. Moreover, each customer has a demand, and the total demand of the customers served by a tour must not exceed the vehicle capacity, which we can assume to be 1 (by scaling). Then the problem can be described as follows.

Definition 3

(Capacitated Vehicle Routing). An instance of Capacitated Vehicle Routing consists of

  • a finite set V (of customers)

  • a depot s, not belonging to V,

  • a semi-metric c on \(\{s\}\cup V\), defining distances (or cost),

  • a demand \(d(v) \in [0,1]\) for each customer \(v\in V\).

A feasible solution is a set \({\mathcal {Q}}\) of tours such that

  • every tour \(Q\in {\mathcal {Q}}\) is a cycle that contains s,

  • every customer belongs to exactly one tour, and

  • \(\sum _{v\in V(Q){\setminus }\{s\}} d(v) \le 1\) for all \(Q\in {\mathcal {Q}}\).

The task is to find a feasible solution such that the total cost (or distance) \(c({\mathcal {Q}}):= \sum _{Q\in {\mathcal {Q}}} c(Q)\) is minimum.

Throughout, we will denote by or simply \(\mathrm {OPT}\) the minimum cost of a feasible solution to a given instance . We note the following well-known lower bound:

Proposition 4

\(\mathrm {OPT}\ge \sum _{v\in V}2d(v)c(s,v)\).

Proof

Let \({\mathcal {Q}}\) be a feasible solution. For each \(v\in V\) we obtain two s-v-paths by splitting the tour \(Q\in {\mathcal {Q}}\) that contains v. By the triangle inequality, each of these paths has length at least c(sv), and hence \(2c(s,v)\le c(Q)\). Summation yields \(\sum _{v\in V}2d(v)c(s,v) \le \sum _{Q\in {\mathcal {Q}}} \sum _{v\in V(Q){\setminus }\{s\}} d(v) c(Q) \le c({\mathcal {Q}})\). \(\square \)

If \(d(v)=\frac{1}{k}\) for all \(v\in V\), where k is some positive integer, we speak of Unit-Demand Capacitated Vehicle Routing (then every tour can serve up to k customers). This is closely related to Splittable Capacitated Vehicle Routing: here the demand of a customer is arbitrary but can be split into several parts, each of which is served by a different tour.

All variants include the traveling salesman problem as special case and are thus APX-hard. Capacitated Vehicle Routing also includes bin packing; hence there is no approximation algorithm with ratio less than \(\frac{3}{2}\) unless P=NP.

1.3 Related work

Despite of a huge amount of research on vehicle routing, the best known approximation ratio for Capacitated Vehicle Routing (as well as for the unit-demand and splittable variants) has not been improved in more than 30 years. However, there has been progress on several special cases. First of all, the tour partitioning algorithms by Haimovich and Rinnooy Kan [19] and by Altinkemer and Gavish [2] (cf. Sect. 1.4) already yield a slightly better approximation guarantee if the least common denominator k of all demands is bounded (this is often called the bounded capacity case). Compared to \(\alpha +2\) and \(\alpha +1\), the approximation ratios reduce by \(\frac{2\alpha }{k}\) (for general demands) and \(\frac{\alpha }{k}\) (for unit demands). Bompadre, Dror and Orlin [10] gain another \(\Omega (\frac{1}{k^3})\).

There are also several results for geometric instances for the unit demand case (in which \(d(v) =\frac{1}{k}\) for all \(v\in V\)). In the Euclidean plane a PTAS is known for constant k (Haimovich and Rinnooy Kan [19]), for \(k = O(\log (n)/\log \log (n))\), where \(n=|V|\) (Asano, Katoh, Tamaki, and Tokuyama [4]), and for \(k \le 2^{\log ^{f(\varepsilon )}(n)}\) (Adamszek, Czumaj, and Lingas [1]). The latter uses a result by Das and Mathieu [12], who provided a quasi-polynomial time approximation scheme for the Euclidean plane and unbounded k. For higher dimensional Euclidean metrics, Khachay and Dubinin [22] found a PTAS for fixed dimension l and \(k = O(\log ^{\frac{1}{l}}(n))\).

Better approximation ratios have also been found for graph metrics arising from graphs with a special structure. For the unit-demand case with constant k, Becker, Klein and Schild [7] devised a PTAS in planar graphs, and Becker, Klein and Saulpic [6] found a PTAS in graphs with bounded highway dimension. Becker [5] designed a \(\frac{4}{3}\)-approximation algorithm for Splittable Capacitated Vehicle Routing in tree metrics, improving on results by Hamaguchi and Katoh [20] and Asano, Kawashima and Katoh [3]. Very recently, Mathieu and Zhou [24] devised a PTAS for this case.

For general Capacitated Vehicle Routing, no improvement on the classical approximation algorithm [2] has been found except for tree metrics. For tree metrics, Labbé, Laporte and Mercure [23] gave a 2-approximation algorithm. If the tree is a path (i.e., on the line), Wu and Lu [29] described a \(\frac{5}{3}\)-approximation algorithm for Capacitated Vehicle Routing. Note that the unit-demand case is polynomially solvable on the line.

One part of our proof is leveraging an LP relaxation that was proposed by Friggstad and Swamy [17] for regret-bounded vehicle routing. In (additive) regret-bounded vehicle routing, the goal is to find a minimum number of paths starting at the depot and covering all customers such that none of the tours has a detour more than a given bound. Here, the detour (or regret) of a path from s to t is its length minus c(st). Friggstad and Swamy [16] provided the first constant-factor approximation algorithm for this problem. They improved the approximation ratio from 31 to 15 in [17].

Regret-bounded vehicle routing is a special case of the school bus problem. In the school bus problem, there is the additional constraint that no tour can serve more customers than a given bound (the vehicle capacity). Bock, Grant, Könemann and Sanità [9] observed that any \(\mu \)-approximation algorithm for regret-bounded vehicle routing implies a \((\mu +1)\)-approximation algorithm for the school bus problem. They provided a 3-approximation algorithm for regret-bounded vehicle routing on trees and thus obtain a 4-approximation algorithm for the school bus problem on trees. The later results by Friggstad and Swamy mentioned above imply a 16-approximation algorithm for the general school bus problem.Footnote 2

Subsequent to our work, Friggstad et al. [15] very recently devised an improved approximation ratio for Capacitated Vehicle Routing.

1.4 Review of the classical algorithms

In this section we review the classical algorithms by Altinkemer and Gavish [2] and Haimovich and Rinnooy Kan [19], and we do this for two reasons. First, we will exploit properties of instances in which their analysis is tight. Second, the final step of our new algorithm will be identical to these classical algorithms.

The classical algorithms [2, 19] consist of two steps. The first step simply runs an approximation algorithm for the traveling salesman problem, and we denote by \(\alpha \) the approximation ratio of this algorithm. The classical Christofides–Serdjukov algorithm [11, 26] obtains \(\alpha =\frac{3}{2}\), the new randomized algorithm by Karlin, Klein, and Oveis Gharan [21] improves on this by a tiny constant.

A traveling salesman tour (for a given instance (Vscd) of Capacitated Vehicle Routing) is a cycle with vertex set \(\{s\}\cup V\). Note that the demands are ignored. The minimum length of a traveling salesman tour is a lower bound on \(\mathrm {OPT}\) because we can concatenate any set of tours (they all contain s) and shortcut in order to visit s only once; here we use the triangle inequality. So the first step yields a traveling salesman tour of length \(\alpha \cdot \mathrm {OPT}\).

In the second step, this traveling salesman tour is partitioned into several tours in order to meet the capacity constraint. This is achieved by the following theorem:

Theorem 5

([2, 19]). Given an instance (Vscd) of Capacitated Vehicle Routing and a traveling salesman tour Q, one can compute a feasible solution of cost at most \(c(Q)+\sum _{v\in V}4d(v)c(s,v)\) in \(O(n^2)\) time, where \(n=|V|\). For Unit-Demand Capacitated Vehicle Routing and Splittable Capacitated Vehicle Routing the bound improves to \(c(Q)+\sum _{v\in V}2d(v)c(s,v)\).

Proof

Number the customers \(V=\{v_1,\ldots ,v_n\}\) in the order they are visited by Q. Choose \(\theta \in (0,1)\) uniformly at random. Then there are unique indices \(1\le j_1< ... < j_{k_{\max }} \le n\), where \(k_{\max } = 1+\lfloor d(V)-\theta \rfloor \), such that

$$\begin{aligned} \sum \limits _{i=1}^{j_{l}-1} d(v_i) < \theta + l-1 \le \sum \limits _{i=1}^{j_l} d(v_i) \text { } \text { for all } l \in \{1,\ldots ,k_{\max } \}. \end{aligned}$$

Partition the traveling salesman tour Q by constructing for each \(l \in \{j_1,\dots , j_{k_{\max }}\}\) a single tour visiting only the customer \(v_l\) and tours visiting the resulting segments of Q in between these customers. Note that by construction all these tours meet the capacity constraint.

By using the triangle inequality, the total cost of the resulting tours can be bounded by

$$\begin{aligned} c(Q) + 4 \cdot \sum \limits _{l=1}^{k_{\max }} c(s,v_{j_l}). \end{aligned}$$

Note that the probability that a customer v is contained in \(\{v_{j_1},..,v_{j_{k_{\max }}}\}\) equals d(v). Hence, the expected total cost of the resulting tours can be bounded by

$$\begin{aligned} c(Q) + \sum \limits _{v \in V} 4 d(v) c(s,v). \end{aligned}$$

Thus, there exists at least one such partition of Q with the required total cost. Since there are at most n values of \(\theta \) leading to different partitions, all these values can be tried and the best among the resulting partitions can be chosen. Clearly, this can be done in \(O(n^2)\) time.

For unit demands and for splittable demands one does not need a separate tour serving \(v_l\) only (for \(l=1,\ldots ,k_{\max }\)), but can include \(v_l\) into the preceding segment (and in the splittable case partly into the succeding segment). Then the total cost of the resulting tours can be bounded by

$$\begin{aligned} c(Q) + \sum \limits _{v \in V} 2 d(v) c(s,v). \end{aligned}$$

\(\square \)

Note that one can even compute an optimum partition of the given traveling salesman tour in \(O(n^2)\) time by a simple dynamic program. However, this does not improve the above upper bound on the total cost of the resulting set of tours.

Together with Proposition 4, Theorem 5 immediately implies the approximation ratio \(\alpha +2\) for Capacitated Vehicle Routing [2], and the approximation ratio \(\alpha +1\) for Unit-Demand Capacitated Vehicle Routing and Splittable Capacitated Vehicle Routing [19]. In this paper, we present the first improvement on these more-than-thirty-year-old results.

2 Overview of our new algorithm

In this section we provide an outline of our approach and introduce some important definitions.

Our algorithm will compute two solutions to the Capacitated Vehicle Routing instance and return the better of the two. The first solution results from the classical algorithm that we discussed in Sect. 1.4. The second algorithm is new and yields a better approximation ratio on instances where Proposition 4 and thus the analysis of the classical algorithms is almost tight. We will call such instances difficult. In order to give a formal definition of difficult instances we fix a constant \(0<\varepsilon <1\).Footnote 3

Definition 6

An instance (Vscd) of Capacitated Vehicle Routing is called difficult if

$$\begin{aligned} 2 \cdot \sum \limits _{v \in V} d(v) \cdot c(s,v) \ > \ (1 - \varepsilon ) \cdot \mathrm {OPT}. \end{aligned}$$

If an instance of Capacitated Vehicle Routing is not difficult, Theorem 5 says that the classical algorithm described in Sect. 1.4 computes a solution of cost at most \((\alpha +2 \cdot (1 -\varepsilon ))\cdot \mathrm {OPT}\), and at most \((\alpha +1 -\varepsilon )\cdot \mathrm {OPT}\) for the Unit-Demand and Splittable variants. For difficult instances we will compute a traveling salesman tour that is shorter than \(\alpha \cdot \mathrm {OPT}\); then the better approximation ratios follow from calling Theorem 5.

Informally speaking, in an optimum solution to a difficult instance almost every tour must have the following two properties:

  1. (1)

    The tour Q is not much longer than \(2\cdot c(s,{{\,\mathrm{peak}\,}}(Q))\), where \({{\,\mathrm{peak}\,}}(Q)\) is the vertex in Q that is farthest away from the depot s.

  2. (2)

    The total demand served by the tour is almost 1, and almost all of it is close to the peak.

More precisely, the total length of the tours that don’t have the above properties is very small compared to \(\mathrm {OPT}\). We will show this in Sect. 3.1.

Property (2) implies that most customers can be partitioned into clusters with demand approximately 1. The first step of our algorithm aims at identifying these clusters. Since the clusters around the peaks of different tours can be close to each other and might be difficult to distinguish, we merge such clusters into larger ones. A detailed description of our clustering algorithm will be given in Sect. 3.2.

Having identified clusters, we now want to find paths starting at the depot and ending in the clusters, such that all customers are visited by one such path, regardless of whether the customer is part of a cluster or not. To find such paths we compute a solution to an instance of Vehicle Routing with Target Groups, which is a new problem we introduce. The targets will be some customers inside the clusters, where targets in the same cluster belong to the same target group.

Definition 7

(Vehicle Routing with Target Groups) An instance of Vehicle Routing with Target Groups consists of

  • disjoint finite sets V (of customers) and \({\bar{T}}\) (of targets),

  • a depot s, not belonging to \(V\cup {\bar{T}}\),

  • a semi-metric c on \(\{s\}\cup V\cup {\bar{T}}\),

  • a partition \({\mathcal {T}}\) of the target set \({\bar{T}}\) into target groups, and

  • numbers \(b: {\mathcal {T}} \rightarrow {\mathbb {Z}}_{>0}\) that specify how many tours must end in each target group.

A feasible solution is a set \({\mathcal {P}}\) of tours such that

  • every tour \(P\in {\mathcal {P}}\) is either

    • an s-t-path for some target \(t\in {\bar{T}}\) such that all internal vertices of P belong to V, or

    • a cycle containing s such that all other vertices belong to V,

  • every element of V belongs to at least one of these tours, and

  • for every target group \(T\in {\mathcal {T}}\), exactly \(b(T)\) of these tours end in an element of \(T\).

The task is to find a feasible solution whose total cost \(c({\mathcal {P}}):=\sum _{P\in {\mathcal {P}}} c(P)\) is minimum, where we again write \(c(P)=\sum _{\{v,w\}\in E(P)}c(v,w)\).

Again, we write for the cost of an optimum solution to instance .

For a target group \(T\), we will set the number \(b(T)\) to roughly twice the demand of the cluster containing \(T\). The number \(b(T)\) of paths ending in \(T\) will always be even. Therefore, we can turn a solution to our instance of Vehicle Routing with Target Groups into a solution of the Capacitated Vehicle Routing instance as follows. For each target group \(T\) we pair up the paths and complete a pair of paths to a tour by adding an edge between their endpoints. Computing a pairing that minimizes the cost of the added edges is a minimum-weight perfect matching problem. In Sect. 3.3 we prove that this matching problem has a cheap solution. In the end we concatenate all these tours and shortcut to obtain a traveling salesman tour, to which we apply Theorem 5.

A key part of our proof is to show that we can compute a cheap solution to our instance of Vehicle Routing with Target Groups. First, we want to show that if our Capacitated Vehicle Routing instance is difficult, the instance of Vehicle Routing with Target Groups that we construct has a solution that

  1. (i)

    is not much more expensive than the cost of an optimum solution to our Capacitated Vehicle Routing instance, and

  2. (ii)

    has small total detour, i.e. almost all tours are approximately shortest paths from the depot to the target they end in.

It will be convenient to consider a solution to a Vehicle Routing with Target Groups instance as a set of walks in a digraph. For an instance of Vehicle Routing with Target Groups let be the digraph with vertex set and edge set , where

So in a feasible solution, the final edge of every tour belongs to , and all other edges belong to .

Definition 8

(walk solution). Given an instance of Vehicle Routing with Target Groups, a walk solution is a multi-subset H of such that

  • \(|\delta ^+_H(v)|=|\delta ^-_H(v)|\) for all \(v\in V\),

  • \(|\delta ^-_H(T)|=b(T)\) for each \(T\in {\mathcal {T}}\), and

  • H connects all vertices of \(\{s\}\cup V\).

Here \(\delta ^+_H(v)\) and \(\delta ^-_H(v)\) denote the multi-sets of arcs in H leaving and entering v, respectively.

The cost of a walk solution H is \(c(H):=\sum _{(v,w)\in H} c(v,w)\), where the sum counts multiplicities. Then Vehicle Routing with Target Groups is equivalent to computing a cheapest walk solution:

Proposition 9

For any instance of Vehicle Routing with Target Groups, there is a walk solution of cost , and from any walk solution H one can obtain a solution \({\mathcal {P}}\) with \(c({\mathcal {P}})\le c(H)\) in O(|H|) time.

Proof

Given a solution \({\mathcal {P}}\) to an instance , orient its tours away from s, and let H contain an edge exactly k times if the number of tours \(P\in {\mathcal {P}}\) that contain e is k. Then H is a walk solution of the same cost.

Conversely, we can decompose a walk solution H in linear time into \(\sum _{T\in {\mathcal {T}}}b(T)\) walks from s to \(\{s\}\cup {\bar{T}}\) with inner vertices in V such that each element of V belongs to at least one of them. Then we can shortcut these walks whenever an element of V is visited more than once. Shortcutting does not increase the total cost due to the triangle inequality. This yields a set \({\mathcal {P}}\) of tours with \(c({\mathcal {P}}) \le c(H)\). \(\square \)

Definition 10

(detour). For an arc we define

$$\begin{aligned} {{\,\mathrm{detour}\,}}(e) \ := \ {{\,\mathrm{detour}\,}}(v,w) \ := \ c(v,w)+c(s,v)-c(s,w). \end{aligned}$$

For a walk P that visits the vertices \(v_0,v_1,\ldots ,v_k\) in this order we write \({{\,\mathrm{detour}\,}}(P):=\sum _{i=1}^{k} {{\,\mathrm{detour}\,}}(v_{i-1},v_i)\).

For a walk P that starts at the depot s and ends in t we have \({{\,\mathrm{detour}\,}}(P)= c(P)-c(s,t)\). The detour has been called excess by [8] and the regret metric by [16]. The \({{\,\mathrm{detour}\,}}\) is clearly not symmetric, but it is non-negative and fulfills the triangle inequality.

Having constructed an instance of Vehicle Routing with Target Groups from a given difficult instance of Capacitated Vehicle Routing, we want to show that has a cheap solution (costing not much more than ) with small total detour. However, this is not exactly the statement we will show. It will simplify our proofs and lead to better approximation ratios to consider what we call weak fractional solutions of instead of actual solutions. First, we allow taking only fractions of walks. Second, we reduce the amount that must arrive in each target group slightly. The latter is because we cannot assume that the total demand of a tour near its peak is 1 in an optimum solution to , but only \(1-\tau \) for some constant \(\tau \in (0,1)\) to be chosen later.

Definition 11

(weak fractional solution). A weak fractional solution to an instance of Vehicle Routing with Target Groups is a vector such that

$$\begin{aligned} x = \sum _{P\in {\mathcal {P}}} \lambda _P \cdot \chi ^{E(P)}, \end{aligned}$$

where \({\mathcal {P}}\) is a set of walks in and \(\lambda _P \in {\mathbb {R}}_{\ge 0}\) for all \(P\in {\mathcal {P}}\) such that

  • every walk \(P\in {\mathcal {P}}\) begins in s and ends in \(\{s\}\cup {\bar{T}}\), and all inner vertices belong to V,

  • for every \(v\in V\), we have \(\sum _{P\in {\mathcal {P}}: v\in V(P)} \lambda _P \ge 1\), and

  • for every target group \(T\in {\mathcal {T}}\), the total weight of the walks ending in \(T\) equals \((1-\tau )\cdot b(T)\), i.e.,

    $$\begin{aligned} \sum _{P\in {\mathcal {P}}:\, P \text { ends in } T} \lambda _P =(1-\tau ) \cdot b(T). \end{aligned}$$

Here \(\chi ^{E(P)}\) denotes the incidence vector of E(P). We write and for any vector .

We show that the instance of Vehicle Routing with Target Groups has a weak fractional solution that has small detour and is not much more expensive than . To this end, we start with an optimum solution to our Capacitated Vehicle Routing instance . Then for every customer v that is contained in a tour Q of this solution, we partition Q into two paths starting at the depot s and ending at v. We extend these paths by an edge connecting v either to a close-by target or to the depot s. The latter will happen rarely, as we can show using property (2) and the fact that we constructed the targets inside clusters and set the value b to roughly twice the demand of its cluster. The resulting walks P will then contribute with weight \(\lambda _P=d(v)\) to the weak fractional solution that we construct. Our weak fractional solution will have small detour because of property (1) of optimum solutions of difficult instances. A precise description of our construction will be given in Sect. 3.4.

While Vehicle Routing with Target Groups in general is at least as hard as the traveling salesman problem, we can compute solutions that are not much longer than the best weak fractional solution with small detour. More precisely, if there exists a weak fractional solution x with small detour, then we can compute a solution to Vehicle Routing with Target Groups which is not much more expensive than x. This is formally stated in the following theorem. For small detour, we can choose a small value of \(\eta \). Then the factor on the cost of the given weak fractional solution is close to 1 because we will choose the constant \(\tau \in (0,1)\) to be close to 0.

Theorem 12

Let \(\tau \in (0,1)\). There is a polynomial-time algorithm for Vehicle Routing with Target Groups that computes for every instance and any given \(\eta \in (0,1]\) a feasible solution \({\mathcal {P}}\) of such that

for every weak fractional solution x of .

We will present two approaches for solving Vehicle Routing with Target Groups, both implying Theorem 12. In both approaches we compute a cheap forest and a network flow to obtain tours that visit not necessarily every customer, but every connected component of the forest. In the network flow problem we ensure that the number of tours ending in each target group meets the requirements. Doubling the edges of the forest yields the desired walk solution of Vehicle Routing with Target Groups.

The first approach (Sect. 4) is a simple and fast combinatorial algorithm based on the following observation. While computing a cheapest walk solution is NP-hard, we can in polynomial time compute a cheapest walk solution with the additional property that every vertex v has at least one predecessor that is closer to the depot than v. This problem can be reduced to a network flow problem. We compute such a walk solution for a subset of customers for which we can guarantee that our additional constraint makes the walk solution not too expensive. To find such a subset of customers we use a simple greedy algorithm. Finally, we connect the remaining customers that are not visited by our walk solution by a minimum-cost forest.

The second approach (Sect. 5) leverages a sophisticated LP relaxation for regret-bounded vehicle routing due to Friggstad and Swamy [17]. In contrast to the combinatorial approach, here the network flow only uses edges moving away from the depot, i.e. edges (vw) with \(c(s,w) > c(s,v)\), (and some edges entering s). Both the forest and the network flow are obtained from an optimum LP solution. However, setting up an LP relaxation that allows to round fractional solutions to an integral forest and an (almost) acyclic network flow that visits all connected components of the forest turns out to be tricky. To achieve this, the LP has variables corresponding to a network flow in some auxiliary digraph. In this digraph we have \(O(n^2)\) many vertices for each customer \(v\in V\), which correspond to different possibilities for the forest component containing v. We combine the rounding approach by [17] with a new construction of a fractional solution, which will also enable us to obtain a better approximation ratio for regret-bounded vehicle routing and the school bus problem.

Sections 4 and 5 present the two different proofs of Theorem 12 and can be read independently from each other.

3 Reducing to vehicle routing with target groups

In this section we prove that Theorem 12 implies our main result. First, in Sect. 3.1 we discuss a key property of difficult instances that we exploit in later parts of this chapter. In Sect. 3.2, we describe the construction of an instance of Vehicle Routing with Target Groups. In Sect. 3.3 we bound the cost of the matching that we use to transform a Vehicle Routing with Target Groups solution to a traveling salesman tour. In Sect. 3.4 we prove that our instance of Vehicle Routing with Target Groups has a weak fractional solution with cost close to and small detour, given that the Capacitated Vehicle Routing instance we consider is difficult. Hence, Theorem 12 will yield a good bound. Finally, in Sect. 3.5 we combine all this to give an algorithm with a good approximation ratio for difficult instances.

3.1 Difficult instances are clustered

Let \(0 < \tau , \rho \le \frac{1}{6}\) be constants that we will fix later.

Definition 13

Let (Vscd) be an instance of Capacitated Vehicle Routing. Let Q be a cycle with \(s \in V(Q)\). Then we define \({{\,\mathrm{peak}\,}}(Q)\) to be a vertex \(v\in V(Q)\) with c(sv) maximal, and the peak cluster to be

$$\begin{aligned} C(Q) \ := \ \left\{ u \in V(Q) : c(u, {{\,\mathrm{peak}\,}}(Q)) + \kappa \cdot {{\,\mathrm{detour}\,}}(u, {{\,\mathrm{peak}\,}}(Q)) < \rho \cdot c(s,{{\,\mathrm{peak}\,}}(Q))\right\} . \end{aligned}$$

where \(\kappa := {\textstyle \frac{1 - 2 \tau - \tau \cdot \rho }{2\tau }}\). We call the peak cluster large if \(d(C(Q)) > 1-\tau \) and small otherwise.

Here and in the following we abbreviate \(d(C(Q))=\sum _{v\in C(Q)}d(v)\). Note that each vertex in the peak cluster is at most \(\rho \cdot c(s,{{\,\mathrm{peak}\,}}(Q))\) away from \({{\,\mathrm{peak}\,}}(Q)\). We also remark that \(s\notin C(Q)\) because \(\rho <1\). See Fig. 1 for an example. For later use we remark that \(\kappa >\frac{3}{2}\) because \(\tau ,\rho \le \frac{1}{6}\).

Fig. 1
figure 1

The left-hand side shows a tour Q and its peak cluster C(Q), assuming Euclidean distances and \(\rho = \frac{1}{6}\) and \(\tau = \frac{1}{6}\), which yields \(\kappa = \frac{23}{12}\). If each customer has demand \(\frac{1}{7}\), the peak cluster of Q is large since \(d(C(Q)) > 1 - \tau \). On the right-hand side, we show another tour and its peak cluster for \(\rho = \frac{1}{6}\) and \(\tau = \frac{1}{10}\). This yields \(\kappa = \frac{47}{12}\). Suppose the customer \(v= {{\,\mathrm{peak}\,}}(Q)\) has demand \(1- \tau \), and the customer w, which lies slightly outside of C(Q), has demand \(\tau \). Then the peak cluster of this tour is small. It can be shown that in this case the inequality in Lemma 14 is tight

Intuitively, in an optimum solution to a difficult instance almost every tour Q has the property that almost all vertices \(v\in V(Q)\) are contained in the peak cluster C(Q). More precisely, the total length of tours with small peak cluster will be small compared to the total length of all tours. This can be derived from the following lemma, which gives a lower bound on \(c(Q) - 2 \cdot \sum _{v\in V(Q)} d(v) \cdot c(s,v)\) for tours Q with a small peak cluster. Because in a difficult instance the sum of these expressions over all tours is small (it is less than \(\varepsilon \cdot \mathrm {OPT}\)), the lemma implies that in an optimum solution the total length of such tours with small peak clusters must be small. Note that we will choose \(\tau \) and \(\rho \) such that \(\tau \cdot \rho \) is much larger than \(\varepsilon \).

Lemma 14

Let Q be a tour with small peak cluster. Then

$$\begin{aligned} c(Q) - 2 \cdot \sum _{v\in V(Q){\setminus }\{s\}} d(v) \cdot c(s,v) \ \ge \ \tau \cdot \rho \cdot c(Q). \end{aligned}$$

Proof

Note that \(s\in V(Q){\setminus } C(Q)\). Let \(u\in V(Q){\setminus } C(Q)\) with c(su) maximum. We have \(c(s,v)\le c(s,u)\) for \(v\in V(Q){\setminus } C(Q)\) and \(c(s,v)\le c(s,{{\,\mathrm{peak}\,}}(Q))\) for all \(v\in V(Q)\). Since the peak cluster is small,

$$\begin{aligned} \sum _{v\in V(Q){\setminus }\{s\}} d(v)\cdot c(s,v) \ \le \ \tau \cdot c(s,u) + (1-\tau )\cdot c(s,{{\,\mathrm{peak}\,}}(Q)). \end{aligned}$$
(1)

Next, \(u\notin C(Q)\) implies \(c(u, {{\,\mathrm{peak}\,}}(Q)) + \kappa \cdot {{\,\mathrm{detour}\,}}(u, {{\,\mathrm{peak}\,}}(Q)) \ge \rho \cdot c(s,{{\,\mathrm{peak}\,}}(Q))\). Plugging in \(\kappa ={\textstyle \frac{1 - 2 \tau - \tau \cdot \rho }{2\tau }}\) and \({{\,\mathrm{detour}\,}}(u,{{\,\mathrm{peak}\,}}(Q))=c(u,{{\,\mathrm{peak}\,}}(Q))+c(s,u)-c(s,{{\,\mathrm{peak}\,}}(Q))\) and multiplying by \(2\tau \) yields

$$\begin{aligned} (1-\tau \rho )\cdot c(u, {{\,\mathrm{peak}\,}}(Q)) + (1 - 2 \tau - \tau \rho ) \cdot c(s,u) \ \ge \ (1-2\tau +\tau \rho ) \cdot c(s,{{\,\mathrm{peak}\,}}(Q)). \end{aligned}$$
(2)

Multiplying (1) by 2 and combining with (2) yields

$$\begin{aligned} 2\cdot \sum _{v\in V(Q){\setminus }\{s\}} d(v)\cdot c(s,v)&\ \le \ 2\tau \cdot c(s,u) + (2-2\tau )\cdot c(s,{{\,\mathrm{peak}\,}}(Q)) \\&\ \le \ (1-\tau \rho ) \cdot (c(s,{{\,\mathrm{peak}\,}}(Q)) + c(u,{{\,\mathrm{peak}\,}}(Q))+c(s,u)) \\&\ \le \ (1-\tau \rho ) \cdot c(Q), \end{aligned}$$

where the last inequality holds because Q contains s, u, and \({{\,\mathrm{peak}\,}}(Q)\). \(\square \)

Figure 1 shows that C(Q) is chosen smallest possible such that Lemma 14 holds. Choosing \(\kappa = 0\) would already be sufficient to improve the approximation ratio of Capacitated Vehicle Routing. In this case the peak cluster of a tour Q is a ball of radius \(\rho \cdot c(s, {{\,\mathrm{peak}\,}}(Q))\) around \({{\,\mathrm{peak}\,}}(Q)\). However, choosing \(\kappa =0\) would yield a smaller improvement in the approximation ratio.

3.2 Clustering algorithm

In this section we describe an algorithm to construct an instance of Vehicle Routing Problem with Target Groups. The resulting instance is the one to which we will later apply Theorem 12. Before giving a formal description of the algorithm, let us informally explain some important properties. Intuitively, our algorithm tries to "guess" the peaks of the tours of an optimum solution; these should become target vertices and in each target t should end two tours, i.e. \(b(\{t\})=2\).

Our algorithm will not always guess the peaks of the optimum tours correctly. However, for every tour Q with a large peak cluster, our algorithm will always guess a target vertex that is not far away from \({{\,\mathrm{peak}\,}}(Q)\). For every target vertex \(t\in {\bar{T}}\), we then consider an area \(B_t\) around t that is chosen large enough to guarantee that each large peak cluster of an optimum solution is fully contained in one of these areas. Note that our algorithm might also guess targets that are not close to any of the peaks of optimum tours, but we will show that for difficult instances this happens rarely.

We want to set the numbers b in the Vehicle Routing with Target Groups instance large enough so that for every tour with a large peak cluster, two paths are allowed to end in a target close to the peak. Therefore, the number of paths ending in the targets will depend on the total demand d in the area \(B_t\) around t. In order to avoid requiring a too high number of paths, we want to avoid that the demand d(v) of a customer v is counted twice here when v is contained in two of the areas \(B_t\). Therefore, if the areas \(B_t\) for different targets t overlap, e.g. because the peaks of two tours are close to each other, we merge the areas \(B_t\) and the corresponding targets will form a group.

Let us now describe our algorithm to construct an instance of Vehicle Routing with Target Groups (Algorithm 1). See also Fig. 2 for an illustration. Note that the set \({\bar{T}}\) of targets contains copies of customers because by Definition 7 the sets V and \({\bar{T}}\) should be disjoint.

Fig. 2
figure 2

The upper figure shows an instance of Capacitated Vehicle Routing with a solution \({\mathcal {Q}}\). The customer v (shown in red) has demand \(\frac{4}{7}\) and all other customers have demand \(\frac{1}{7}\). The peak clusters are drawn for \(\rho = \frac{1}{10}\) and \(\tau = \frac{1}{6}\) and Euclidean distances. The peaks of the tours are shown as empty circles. Note that the peak clusters \(C(Q_1)\), \(C(Q_2)\) and \(C(Q_3)\) are large. The lower figure shows the corresponding output of Algorithm 1. The customers are colored by their membership to the sets \(B_{t_1}, B_{t_2}\) and \(B_{t_3}\). Note that some customers belong to \(B_{t_1}\) and \(B_{t_2}\) (colored in blue and red). Hence, the targets \(\bar{T}=\{t_1,t_2,t_3\}\) (shown as empty circles here) are partitioned into target groups \({\mathcal {T}}=\{\{t_1,t_2\},\{t_3\}\}\). A solution of consists of \(b(\{t_1,t_2\}) = 6\) tours ending in \(\{t_1,t_2\}\) and \(b(\{t_3\})=2\) tours ending in \(t_3\). We will see in the next subsection that it does not harm that \(t_3\) was selected as a target although it does not belong to any peak cluster. Note that \({{\,\mathrm{peak}\,}}(Q_2)\) was not identified as a target even though \(Q_2\) has a large peak cluster. However, the peak cluster of \(Q_2\) lies completely in \(B_{\{t_1,t_2\}}\), which will guarantee that \(b(\{t_1,t_2\})\) is chosen large enough so that \({\mathcal {Q}}\) can be easily transformed into a weak fractional solution of that costs not much more than \({\mathcal {Q}}\)

figure a

Note that \(C(Q) \subseteq C_{{{\,\mathrm{peak}\,}}(Q)}\) for every tour Q (cf. Definition 13). As mentioned above, we now show that the sets \(B_t\) are chosen such that every large peak cluster is contained in one of these sets. Afterwards, in Lemma 17 and Lemma 18 we prove important distance bounds for the sets \(B_t\) (which we will need later).

Lemma 15

Let be an instance of Capacitated Vehicle Routing, and let \((V,{\bar{T}}, s, c, {\mathcal {T}}, b)\) be the output of Algorithm 1 with input . Then for every tour Q with large peak cluster there exists a target \(t\in {\bar{T}}\) such that \(C(Q) \subseteq B_{t}\).

Proof

We show that there exists a vertex \(t\in {\bar{T}}\) such that

  1. (i)

    \(C(Q) \cap C_t \ne \emptyset \), and

  2. (ii)

    \(c(s,{{\,\mathrm{peak}\,}}(Q)) \le c(s,t)\).

This directly implies \(C(Q) \subseteq B_{t}\) since \(C(Q) \subseteq C_{{{\,\mathrm{peak}\,}}(Q)}\).

Consider the iteration of Algorithm 1 where \(v={{\,\mathrm{peak}\,}}(Q)\). If at this point of the algorithm \(Y\cap C(Q) \ne \emptyset \), there is a vertex \(t\in {\bar{T}}\) with \(C(Q) \cap C_t \ne \emptyset \). Moreover, we then have \(c(s,{{\,\mathrm{peak}\,}}(Q)) \le c(s,t)\) because t was considered before \({{\,\mathrm{peak}\,}}(Q)\) in the for-loop of Algorithm 1. Hence, it remains to consider the case where \(Y\cap C(Q) = \emptyset \) in the iteration of Algorithm 1 where \(v={{\,\mathrm{peak}\,}}(Q)\). Then \(C(Q) \subseteq C_v {\setminus } Y\). Since \(d(C(Q)) > 1-\tau \) by assumption, (a copy of) the vertex \(v={{\,\mathrm{peak}\,}}(Q)\) is added to \({\bar{T}}\) and \(C(Q) \subseteq C_v \subseteq B_v\). \(\square \)

Lemma 16

Let \(x,y\in V\) such that \(C_x \cap C_y \ne \emptyset \). Then

$$\begin{aligned} c(x,y) < 2 \rho \cdot \min \{c(s,x),c(s,y)\}. \end{aligned}$$

Proof

By symmetry it suffices to show \(c(x,y) < 2 \rho \cdot c(s,x)\). Let \(w\in C_x \cap C_y\).

Because \(w\in C_y\), we have \(c(s,w) \ge c(s,y) - c(w,y) > c(s,y) - \rho \cdot c(s,y)\), implying

$$\begin{aligned} c(w,y)< \rho \cdot c(s,y) < \frac{\rho }{1-\rho } \cdot c(s,w). \end{aligned}$$
(3)

Moreover, because \(w\in C_x\), we have

$$\begin{aligned} c(w,x) + \kappa \cdot (c(w,x)- c(s,x) + c(s,w)) = c(w,x) + \kappa \cdot {{\,\mathrm{detour}\,}}(w,x) < \rho \cdot c(s,x), \end{aligned}$$

implying

$$\begin{aligned} c(w,x) < \frac{\kappa + \rho }{1+\kappa } \cdot c(s,x) - \frac{\kappa }{1+\kappa } \cdot c(s,w). \end{aligned}$$
(4)

Next we combine (4) and (3). Using \(\frac{\rho }{1-\rho } \le \frac{\kappa }{1+\kappa }\) (which holds because \(\rho \le \frac{1}{6}\) and \(\kappa >\frac{3}{2}\)) as well as \(c(s,w) \ge c(s,x) - c(w,x) > (1-\rho )\cdot c(s,x)\), we obtain

$$\begin{aligned} c(x,y) \le&\ c(w,x) + c(w,y) \\<&\ \frac{\kappa + \rho }{1+\kappa } \cdot c(s,x) - \frac{\kappa }{1+\kappa } \cdot c(s,w) + \frac{\rho }{1-\rho } \cdot c(s,w) \\ <&\ \frac{\kappa + \rho }{1+\kappa } \cdot c(s,x) + \left( - \frac{\kappa }{1+\kappa }+\frac{\rho }{1-\rho }\right) (1-\rho )\cdot c(s,x) \\ =&\ 2\rho \cdot c(s,x). \end{aligned}$$

\(\square \)

Lemma 17

Let \(t\in {\bar{T}}\) and \(v \in B_t\). Then

  1. (i)

    \(c(v,t) < \frac{3\rho }{1-\rho }\cdot c(s,v)\), and

  2. (ii)

    \(c(v,t) < 6\rho \cdot c(s,t) - \frac{3\rho }{1-\rho }\cdot c(s,v)\).

Proof

Since \(v \in B_t\) there exists a customer \(w \in V\) with \(v \in C_w\), \(C_w \cap C_t \ne \emptyset \), and \(c(s,w) \le c(s,t)\). Hence, by Lemma 16, we have \(c(w,t) < 2 \rho \cdot c(s,w)\). By \(v \in C_w\) we have \(c(s,v) > (1-\rho ) \cdot c(s,w)\) and

$$\begin{aligned} c(v,t) \le c(v,w) + c(w,t) < \rho \cdot c(s,w) + 2 \rho \cdot c(s,w), \end{aligned}$$

implying \(c(v,t) < \frac{3\rho }{1-\rho } c(s,v)\). We now show the second inequality.

First,

$$\begin{aligned} \rho \cdot c(s,w) >&\ c(v,w) + \kappa \cdot {{\,\mathrm{detour}\,}}(v, w) \\ =&\ (1+\kappa ) \cdot c(v,w) + \kappa \cdot (c(s,v) - c(s,w)), \end{aligned}$$

implying

$$\begin{aligned} c(v,w) <&\ \frac{\rho + \kappa }{1+\kappa } \cdot c(s,w) - \frac{\kappa }{1+\kappa } \cdot c(s,v) \\ =&\ \rho \cdot c(s,w) + \frac{\kappa \cdot (1-\rho )}{1+\kappa } \cdot c(s,w) - \frac{\kappa }{1+\kappa } \cdot c(s,v) \\ =&\ \rho \cdot c(s,w) - \frac{\kappa \cdot (1-\rho )}{1+\kappa } \cdot \left( \frac{c(s,v)}{1-\rho } - c(s,w) \right) \\ \le&\ \rho \cdot c(s,w) - 3 \rho \cdot \left( \frac{c(s,v)}{1-\rho } - c(s,w) \right) \end{aligned}$$

because \(\frac{\kappa \cdot (1-\rho )}{1+\kappa } \ge 3 \rho \) (which holds since \(\kappa >\frac{3}{2}\) and \(\rho \le \frac{1}{6}\)) and \(c(s,v) > (1-\rho )\cdot c(s,w)\). Recall that \(c(w,t) < 2 \rho \cdot c(s,w)\). This yields

$$\begin{aligned} c(v,t) \le&\ c( w,t) + c(v, w) \\ <&\ 2 \rho \cdot c(s,w) + \rho \cdot c(s,w) - 3 \rho \cdot \left( \frac{c(s,v)}{1-\rho } - c(s,w) \right) \\ \le&\ 6\rho \cdot c(s,t) - \frac{3\rho }{1-\rho } \cdot c(s,v). \end{aligned}$$

because \(c(s,w) \le c(s,t)\). \(\square \)

Lemma 18

Let \(t,t'\in {\bar{T}}\) such that \(B_t\cap B_{t'}\not =\emptyset \). Then \(c(t,t')< 6\rho \cdot \min \{c(s,t),c(s,t')\}\).

Proof

Let \(w\in B_t \cap B_{t'}\). Then by Lemma 17

$$\begin{aligned} c(t,t')\le & {} c(w,t) + c(w,t') < \left( 6\rho \cdot c(s,t) - \frac{3\rho }{1-\rho }\cdot c(s,w)\right) +\frac{3\rho }{1-\rho }\cdot c(s,w) \\= & {} 6\rho \cdot c(s,t). \end{aligned}$$

\(\square \)

Figure 3 shows that the estimates in Lemma 17 and Lemma 18 are best possible.

Fig. 3
figure 3

Example showing that the estimates in Sect. 3.2 are tight. Blue edges have length \((1- \rho )\) and red edges have length slightly smaller than \(\rho \). The other distances are given by shortest paths in the drawn graph. Let \(t_1, t_2\) be targets and \(p_1,p_2\) be peaks of tours with large peak cluster. Recall that the sets \(B_t\) are chosen such that \(C_t \cap C(Q) \ne \emptyset \) implies \( C(Q) \subseteq B_t\) for each target t and each tour Q. Then \(w \in B_{t_1} \cap B_{t_2}\). Hence, the estimates in Lemma 17 and Lemma 18 are best possible since \(c(w,t_1)\) is close to \({\textstyle \frac{3 \rho }{1 - \rho }} \cdot c(s,w) = 6\rho \cdot c(s,t_1) - \frac{3\rho }{1-\rho }\cdot c(s,w)\) and \(c(t_1,t_2)\) is close to \(6 \rho \cdot c(s,t_1)= 6\rho \cdot c(s,t_2)\)

3.3 Matching paths

We will turn a solution \({\mathcal {P}}\) to the Vehicle Routing with Target Groups instance into a traveling salesman tour by connecting the endpoints of two paths in \({\mathcal {P}}\) by a matching edge. Next, we bound the cost of that matching.

We need the following well-known lemma.

Lemma 19

Let V be a finite set of vertices and let \(c :{V \atopwithdelims ()2} \rightarrow {\mathbb {R}}_{\ge 0}\) be a semi-metric. Let (VS) be a spanning tree. Then for any set \(U\subseteq V\) of even cardinality, there is a perfect matching on U with cost at most c(S).

Proof

We use induction on |V|, the case \(|V|\le 1\) being trivial. Let now \(|V|\ge 2\), and let v be a leaf and \(e=\{v,w\}\in S\) the edge incident to v. Let \((V',S')\) arise from (VS) by deleting v and e. If \(v\notin U\), applying the induction hypothesis to \((V',S',U)\) does the job. If \(v,w\in U\), applying the induction hypothesis to \((V',S',U {\setminus }\{w\})\) yields a perfect matching of cost at most \(c(S')\), and we add e to this matching. Finally, if \(v\in U\) and \(w\notin U\), applying the induction hypothesis to \((V',S',U \cup \{w\})\) yields a perfect matching on \(U\cup \{w\}\) of cost at most \(c(S')\). If \(\{w,x\}\) is the matching edge incident to w, we replace it by \(\{v,x\}\), which increases the cost by at most c(e) due to the triangle inequality. \(\square \)

We use this to obtain the lemma below, which we will then apply for U being the set \({\bar{T}}_{\mathrm {odd}}\) of targets where an odd number of paths ends in our solution \({\mathcal {P}}\) of Vehicle Routing with Target Groups.

Lemma 20

Let be an instance of Capacitated Vehicle Routing and let \((V,{\bar{T}},s,c,{\mathcal {T}},b)\) be the instance of Vehicle Routing with Target Groups computed by Algorithm 1 applied to . Let \(U \subseteq {\bar{T}}\) such that \(|U \cap T|\) is even for every target group \(T\in {\mathcal {T}}\). Then there is a perfect matching on U with cost at most

Proof

We consider a fixed target group \(T\). By Lemma 19 we can bound the cost of a minimum-cost perfect matching on \(T\cap U\) by the cost c(S) of any tree \((T, S)\). By Lemma 18 we have \(c(t,t') < 6\rho \cdot \min \{c(s,t), c(s,t')\}\) for every edge \(\{t,t'\}\in E_{B}\) (defined in Algorithm 1). Because \(T\) is the vertex set of a connected component of \(({\bar{T}}, E_{B})\), there is a tree \((T,S)\) with \(S\subseteq E_{B}\). In a rooted orientation of this tree every vertex t has at most one entering edge, which costs at most \(6 \rho \cdot c(s,t)\). Hence \(c(S)\le 6 \rho \cdot \sum _{t\in T} c(s,t)\).

Taking the union of the minimum-cost perfect matchings on \(T\cap U\) for all target groups \(T\in {\mathcal {T}}\) yields a perfect matching M on U with cost at most \(6\rho \cdot \sum _{t\in \bar{T}} c(s,t)\). We will complete the proof by showing .

We use \(Y_t\) to denote the set Y at the beginning of the iteration of Algorithm 1 in which we add t to \({\bar{T}}\). Then \(d(C_t{\setminus } Y_t)> 1-\tau \) for all \(t\in {\bar{T}}\), and the sets \(C_t {\setminus } Y_t\) for \(t\in {\bar{T}}\) are disjoint. Moreover, \(c(s,v)>(1-\rho )c(s,t)\) for all \(v\in C_t\) and \(t\in {\bar{T}}\). Hence

Thus, we can bound the cost of the matching M by . \(\square \)

Theorem 21

Let be a difficult instance of Capacitated Vehicle Routing, the instance of Vehicle Routing with Target Groups constructed by Algorithm 1, and \({\mathcal {P}}\) a solution to . Then we can compute a traveling salesman tour Q such that

in \(O(n^3)\) time.

Proof

We will add a matching M to to obtain an Eulerian multi-edge set . Then (VH) is connected and Eulerian and therefore it has an Eulerian walk, i.e., a closed walk that visits every element of \(V\cup \{s\}\) at least once. After shortcutting we obtain a traveling salesman tour of cost at most c(H).

We choose M to be a minimum-cost perfect matching on the set \(\bar{T}_{\text {odd}}\) of targets \(t\in {\bar{T}}\) in which an odd number of paths in \({\mathcal {P}}\) ends. To bound the cost of this matching, we observe that \(b(T)\) is even for every target group \(T\) and hence an even number of paths in \({\mathcal {P}}\) ends in \(T\). Therefore, every target group contains an even number of elements of \(\bar{T}_{\text {odd}}\). By Lemma 20, the cost of M is at most

\(\square \)

3.4 Existence of a good fractional solution for vehicle routing with target groups

We now prove that the instance constructed by Algorithm 1 with input has a weak fractional solution x that is not much more expensive than and has small detour. Our main objective will be to minimize the detour, not counting the detour of the final edges of the tours (entering \(\{s\}\cup {\bar{T}}\)), because we will apply Theorem 12 to this x.

Lemma 22

Let be a difficult instance of Capacitated Vehicle Routing, and let be the instance of Vehicle Routing with Target Groups constructed by Algorithm 1 applied to . Then there is a weak fractional solution x to such that

(5)

and

(6)

and

(7)

where

$$\begin{aligned} \zeta&\ = \ \frac{3\rho +\tau -4\tau \rho }{1-\rho } + \frac{\varepsilon }{\tau \cdot \rho }\cdot \left( 1-\tau \cdot \rho - \frac{3\rho +\tau -4\tau \rho }{1-\rho }\right) . \end{aligned}$$
(8)

Proof

We fix an optimum solution \({\mathcal {Q}}\) to and construct a weak fractional solution x to as follows. During the course of the construction, we may modify the instance multiple times by “splitting” a customer v, replacing it by two copies \(v'\) and \(v''\) with \(d(v')+d(v'')=d(v)\). Of course, every weak fractional solution to the resulting instance induces a weak fractional solution to with the same cost and detour.

  1. (a)

    First, we construct a subset \(C^*\) of the set \(C:=\bigcup _{T\in {\mathcal {T}}} B_{T}\) of clustered points. This will have the property that for every target group \(T\in {\mathcal {T}}\), we have

    $$\begin{aligned} (1-\tau ) \cdot b(T)=2\cdot d(B_{T} \cap C^*). \end{aligned}$$

    By Lemma 15, for each tour Q with large peak cluster there is a target group \(T\) such that \(C(Q) \subseteq B_{T}\), which implies \(d(C(Q)\cap B_{T}) \ge 1-\tau \). We will choose \(C^*\subseteq C\) such that we maintain this property when restricting to \(C^*\), i.e. we will have \(d(C(Q)\cap B_{T}\cap C^*) \ge 1-\tau \). We now define \(C^*\). To this end, we define \(C^* \cap B_{T}\) for each target group \(T\in {\mathcal {T}}\). This defines \(C^*\subseteq C\) because \(\{B_{T} : T\in {\mathcal {T}}\}\) is a partition of C. For each target group \(T\in {\mathcal {T}}\), we consider every tour \(Q\in {\mathcal {Q}}\) with \(d(C(Q)\cap B_{T}) \ge 1-\tau \). For each such tour we choose a subset of \(C(Q)\cap B_{T}\) of total demand exactly \(1-\tau \) and include it in \(C^* \cap B_{T}\). (This can be achieved after splitting one customer as explained in the beginning of this proof.) Then we include arbitrary additional vertices from \(B_{T}\) in \(B_{T}\cap C^*\) such that \((1-\tau ) \cdot b(T)=2\cdot d(B_{T} \cap C^*)\). (Again, this can be achieved after possibly splitting one customer.)

  2. (b)

    Now we construct x, starting with the all-zero vector. For each customer \(v \in V\), we partition the tour \(Q\in {\mathcal {Q}}\) containing v into two s-v-paths, which we orient away from s. Then we add d(v) times the incidence vectors of these oriented paths to x.

  3. (c)

    Moreover, for each \(v\in V\), we add \(2\cdot d(v)\) times the incidence vector of an edge (vt), where \(t\in \{s\} \cup {\bar{T}}\). If \(v\in C^*\) we choose t to be a target with \(v\in B_t\). Otherwise, we choose \(t=s\). Thus, overall for every customer \(v\in V\), we add d(v) times the incidence vector of two s-t-paths. After this step we have \(x(\delta ^-(T))= 2\cdot d(B_{T} \cap C^*) = (1-\tau ) \cdot b(T)\) for every target group \(T\).

  4. (d)

    Finally, for each tour \(Q\in {\mathcal {Q}}\), we add \(1-d(V(Q){\setminus }\{s\})\) times the incidence vector of any orientation of Q (to a directed cycle) to x.

The resulting vector x is a weak fractional solution to the instance . Indeed, we added fractions of walks from s to \(\{s\}\cup {\bar{T}}\) in (b) and (c) and fractions of walks from s to s in (d). Moreover, every vertex v of a tour Q is visited by walks of total value \(d(V(Q){\setminus }\{s\})+d(v)\) in (b) and (c) and by a walk of value \(1-d(V(Q){\setminus }\{s\})\) in (d), so at least 1 overall. Finally, the total value of the walks ending in each target group \(T\in {\mathcal {T}}\) is exactly \((1-\tau ) \cdot b(T)\), as required.

Let \(x^{(c)}\) denote the contribution of the edges (vt) added in step (c) to x. Note that by construction \(c(x-x^{(c)})=c({\mathcal {Q}})\), which implies (6).

Next, for all \(v\in V\), the total value of walks ending with an edge (vt) added in (c) is exactly 2d(v). Thus

$$\begin{aligned} {{\,\mathrm{detour}\,}}(x-x^{(c)}) = c(x-x^{(c)}) - \sum _{v\in V} 2d(v)c(s,v) = c({\mathcal {Q}}) - \sum _{v\in V} 2d(v)c(s,v), \end{aligned}$$

implying (5) because is difficult.

To show (7), we finally bound the total cost of \(x^{(c)}\). When we add a contribution of an edge (vt) in (c), we have \(v\in C^*\cap B_t\) and hence \(c(v,t)< \frac{3\rho }{1-\rho } \cdot c(s,v)\) by Lemma 17, or \(v\in V{\setminus } C^*\) and \(t=s\).

For a tour Q with large peak cluster, the contribution of edges (vt) that we add in (c) for \(v\in V(Q)\) is at most

$$\begin{aligned}&\sum _{v\in V(Q)\cap C^*} 2 \cdot d(v)\cdot {\textstyle \frac{3\rho }{1-\rho }} \cdot c(s,v) + \sum _{v\in V(Q){\setminus } (\{s\}\cup C^*)} 2 \cdot d(v) \cdot c(s,v)\\&\qquad \le \ \left( {\textstyle \frac{3\rho }{1-\rho }} (1-\tau ) + \tau \right) \cdot c(Q) \\&\qquad = \ {\textstyle \frac{3\rho +\tau -4\rho \tau }{1-\rho }} \cdot c(Q) \end{aligned}$$

because \({\textstyle \frac{3\rho }{1-\rho }}< 1\) and \(d(V(Q)\cap C^*)\ge 1-\tau \).

For a tour Q with small peak cluster, the contribution of edges (vt) that we add in (c) for \(v\in V(Q)\) is at most

$$\begin{aligned}&\sum _{v\in V(Q)\cap C^*} {\textstyle \frac{3\rho }{1-\rho }} \cdot 2 \cdot d(v)\cdot c(s,v) + \sum _{v\in V(Q){\setminus } (\{s\}\cup C^*)} 2 \cdot d(v) \cdot c(s,v)\\&\qquad \le \ \sum _{v\in V(Q){\setminus } \{s\}} 2 \cdot d(v) \cdot c(s,v) \\&\qquad \le \ (1-\tau \cdot \rho ) \cdot c(Q) \end{aligned}$$

by Lemma 14. Summing over all tours \(Q\in {\mathcal {Q}}\), we get

$$\begin{aligned} c(x^{(c)}) \ \le \ {\textstyle \frac{3\rho +\tau -4\rho \tau }{1-\rho }} \cdot c({\mathcal {Q}}) + \left( 1-\tau \cdot \rho - {\textstyle \frac{3\rho +\tau -4\tau \rho }{1-\rho }} \right) \cdot \sum _{Q\in {\mathcal {Q}}: d(C(Q))\le 1-\tau } c(Q). \end{aligned}$$

Again using Lemma 14, we can bound this by

$$\begin{aligned} c(x^{(c)})&\le \ {\textstyle \frac{3\rho +\tau -4\rho \tau }{1-\rho }} \cdot c({\mathcal {Q}}) + \left( 1-\tau \cdot \rho - {\textstyle \frac{3\rho +\tau -4\tau \rho }{1-\rho }} \right) \cdot \\&\quad \sum _{Q\in {\mathcal {Q}}: d(C(Q))\le 1-\tau } {\textstyle \frac{1}{\tau \cdot \rho }} \left( c(Q) - \!\sum _{v\in V(Q){\setminus }\{s\}} 2 \cdot d(v) \cdot c(s,v)\right) \\&\le \ {\textstyle \frac{3\rho +\tau -4\rho \tau }{1-\rho }} \cdot c({\mathcal {Q}}) + \frac{ \left( 1-\tau \cdot \rho - {\textstyle \frac{3\rho +\tau -4\tau \rho }{1-\rho }} \right) }{\tau \cdot \rho } \cdot \\&\quad \sum _{Q\in {\mathcal {Q}}} \left( c(Q) - \!\sum _{v\in V(Q){\setminus }\{s\}} 2 \cdot d(v) \cdot c(s,v)\right) \\&\le \ \left( \frac{3\rho +\tau -4\tau \rho }{1-\rho } + \varepsilon \cdot \frac{1-\tau \cdot \rho - {\textstyle \frac{3\rho +\tau -4\tau \rho }{1-\rho }}}{\tau \cdot \rho } \right) \cdot c({\mathcal {Q}}) \end{aligned}$$

because is difficult. Together with (6) this implies (7). \(\square \)

3.5 Completing the proof

In this section we derive the main result of this chapter from Theorem 12.

Theorem 23

There is a function \(f:{\mathbb {R}}_{>0}\rightarrow {\mathbb {R}}_{>0}\) with \(\lim _{\varepsilon \rightarrow 0}f(\varepsilon )=0\) and a polynomial-time algorithm for Capacitated Vehicle Routing that returns a solution of cost at most

for any given difficult instance .

Proof

Let \(\varepsilon \le 6^{-3}\). We set \(\tau = \rho = \root 3 \of {\varepsilon }\) and \(\eta = \sqrt{\varepsilon }\). We first apply Algorithm 1 to obtain an instance of Vehicle Routing with Target Groups. Then we apply Theorem 12 to compute a solution \({\mathcal {P}}\) for this instance . Lemma 22 and Theorem 12 imply

where \(\zeta = \frac{3\rho +\tau -4\tau \rho }{1-\rho } + \frac{\varepsilon }{\tau \cdot \rho } \cdot (1-\tau \cdot \rho - {\textstyle \frac{3\rho +\tau -4\tau \rho }{1-\rho }})\). By the choice of \(\tau \) and \(\rho \), we have \( \lim _{\varepsilon \rightarrow 0} \zeta = 0\). Using also the choice of \(\eta \), we get . Next, we apply Theorem 21 and get a traveling salesman tour Q with cost at most

Because \(\lim _{\varepsilon \rightarrow 0} {\textstyle \frac{3 \rho }{(1-\rho ) \cdot (1-\tau )}} = 0\), we get that for some function \(f:{\mathbb {R}}_{>0}\rightarrow {\mathbb {R}}_{>0}\) with \(\lim _{\varepsilon \rightarrow 0}f(\varepsilon )=0\). Finally we apply Theorem 5 to this traveling salesman tour and obtain a solution \({\mathcal {Q}}\) to of cost at most

where we used Proposition 4 in the second inequality. \(\square \)

This now leads to a better approximation ratio than \(\alpha + 2\). Call the algorithm by Altinkemer and Gavish (Sect. 1.4) and our new algorithm and return the cheaper of the two solutions. If the given instance is not difficult, the algorithm by Altinkemer and Gavish returns a solution of cost at most \(\alpha + 2 \cdot (1-\varepsilon )\) times the optimum. If the given instance is difficult, our new algorithm returns a solution of cost at most \(3 + f(\varepsilon )\) times the optimum. Choose \(\varepsilon >0\) such that \(3 + f(\varepsilon ) \le \alpha + 2 \cdot (1-\varepsilon )\). Note that the best choice of \(\varepsilon \) depends on \(\alpha \). We will compute the constants in Sect. 6.

More importantly, we still have to prove Theorem 12.

4 Combinatorial algorithm for vehicle routing with target groups

In this section we prove Theorem 12, which we restate here in a more specific form:

Theorem 24

Let \(\tau \in (0,1)\). There is an algorithm for Vehicle Routing with Target Groups that runs in \(O(n^3)\) time, where \(n:=|V|+|{\bar{T}}|\), and computes for every instance and any given \(\gamma >2\) a feasible solution \({\mathcal {P}}\) of such that

for every weak fractional solution x of .

The first observation is that, informally, if a weak fractional solution x has small total detour, then for almost every arc (uv) in almost every walk that is part of x:

  1. (i)

    u is closer to s than v, or

  2. (ii)

    the distance from u to v is small.

Of course, we do not know x and hence we cannot classify the vertices accordingly. Nevertheless we do something similar. In a walk from s to a target, a customer may have more than one entering arc, and we will require that for every customer v there is at least one entering arc (uv) that fulfills (i). Let us call this a forward walk solution (see Sect. 4.1 for precise definitions). A cheap forward walk solution does not always exist, but we will give a sufficient condition (which we call nice): roughly, for every \(v\in V\), there is a vertex closer to s that is not much farther from v than any other vertex.

In Sect. 4.2 we will compute a subset of V that induces a nice subinstance and hence is spanned by a cheap forward walk solution. Finding a cheapest forward walk solution is a simple network flow problem (cf. Sect. 4.1). Afterwards, we can insert the other vertices into the resulting walks at a small cost; this is shown in Sect. 4.3. In the end, we shortcut the walks to paths, using Proposition 9.

4.1 Cheapest forward walk solutions

Given an instance of Vehicle Routing with Target Groups, let \(\prec \) be a total order on \(\{s\}\cup V\) such that \(s\prec v\) for all \(v\in V\) and \(v\prec w\) whenever \(c(s,v)<c(s,w)\). We call such an order a depot distance order. Now consider the digraph associated with this instance (cf. Sect. 2). We call an arc a forward arc if \(v\prec w\), otherwise a backward arc. A forward walk solution is a walk solution H that contains a forward arc entering v for every \(v\in V\). Note that this condition implies that every \(v\in V\) can be reached from s and thus H connects all elements of V.

We have seen that computing a cheapest walk solution is equivalent to solving Vehicle Routing with Target Groups and hence APX-hard. In contrast, finding a cheapest forward walk solution is easy:

Lemma 25

Given an instance of Vehicle Routing with Target Groups and a depot distance order, one can compute a cheapest forward walk solution H in \(O(n^3)\) time, where \(n=|V|+|{\bar{T}}|\). Moreover, \(|H|\le n^2\).

Proof

This can be formulated as a minimum-cost flow problem. From the digraph associated with the instance we construct another digraph \(G'\). To this end, we replace the depot vertex s by \(s^+\), replace every customer vertex \(v\in V\) by two vertices \(v^-\) and \(v^+\), joined by a new arc \((v^-,v^+)\) of cost zero, replace every forward arc (vw) by \((v^+,w^-)\), every backward arc (vw) by \((v^+,w^+)\), every arc (vt) for \(t\in {\bar{T}}\) by \((v^+,t)\), and every arc (vs) by \((v^+,s^+)\). For each \(T\in {\mathcal {T}}\) we add a vertex \(T\) and arcs \((t,T)\) with cost zero for all \(t\in T\).

We are looking for a flow that ships \(\sum _{T\in {\mathcal {T}}}b(T)\) units out of \(s^+\), \(b(T)\) units into \(T\) for each \(T\in {\mathcal {T}}\), and at least one unit of flow along each new arc \((v^-,v^+)\). We call such a flow feasible.

Every integral feasible flow f corresponds to a forward walk solution of the same cost (by taking \(f(e')\) copies of each \(e\in E\), where \(e'\) is the corresponding arc in \(G'\)), and vice versa. (This follows by a standard flow decomposition argument; note that every vertex \(v^-\) has an entering forward arc in the support of f and is thus reachable from \(s^+\).) It is well-known that there exists a minimum-cost feasible flow that is integral.

Moreover, such a flow can be found in \(O(n^3)\) time by the successive shortest paths algorithm as follows. First, for each target group \(T\in {\mathcal {T}}\), ship \(b(T)\) units from \(s^+\) via t to \(T\), where \(t\in T\) is a target in that group for which c(st) is minimum. Then, successively for each \(v\in V\), find a shortest augmenting path from \(v^+\) to \(v^-\) in the residual network. Each of these |V| iterations can be performed by Dijkstra’s algorithm and thus takes \(O(E(G'))=O(|V|\cdot (|V|+|\bar{T}|))\) time if we keep updating a feasible potential in the residual network ([14, 27]). At the end, add one unit of flow from \(v^-\) to \(v^+\) for all \(v\in V\).

Since the flow results from augmenting along at most n paths, each of length at most n, we get \(|H|\le n^2\) for the resulting forward walk solution H. \(\square \)

Unfortunately, a cheap forward walk solution does not always exist. For \(w\in V\) and \(W\subseteq V\) we denote by

$$\begin{aligned} {{\,\mathrm{parent}\,}}_W(w) \ := \ \arg \min \{c(p,w) : p\in \{s\}\cup W,\, p\prec w\} \end{aligned}$$

a vertex closest to w among all vertices in \(\{s\}\cup W\) that precede w in the depot distance order. Then the cheapest forward walk solution has cost at least \(\sum _{v\in V}c({{\,\mathrm{parent}\,}}_V(v),v)\). Figure 4 shows that this can be a factor \(\Omega (\log n)\) larger than the cost of a cheapest solution to the instance of Vehicle Routing with Target Groups (even with a single target t). However, this is not the case if the instance is nice, in the following sense:

Fig. 4
figure 4

An instance of Vehicle Routing with Target Groups with a single target t and \(b(\{t\})=1\). Distances to s correspond to x-coordinates, other distances correspond to differences of y-coordinates. On the left, an optimum solution (an s-t-tour) is shown. On the right, we see the edges \(\{{{\,\mathrm{parent}\,}}_V(v),v\}\) for \(v \in V\). The total length of these edges, and hence the cost of any forward walk solution, is more than a factor \(\frac{1}{3}\log _2 n\) larger

Definition 26

Let \(\gamma >2\) be a constant. Let be an instance of Vehicle Routing with Target Groups with a depot distance order \(\prec \). We call the pair nice if for each \(v \in V\):

$$\begin{aligned} c({{\,\mathrm{parent}\,}}_V(v),v) \ \le \ \gamma \cdot {{\,\mathrm{detour}\,}}(y,v) \ \text { for all } y \in V \text { with } v\prec y. \end{aligned}$$
(9)
Fig. 5
figure 5

In a nice instance, the parent of any vertex v must not be much farther away than any other vertex. For \(\gamma =2\), Euclidean distances, and the depot located far west, this means that if the large (yellow) hemicycle is empty, the (red) area \(A_v\) must also be empty

See Fig. 5 for an illustration. We now show that if an instance is nice, then it has a cheap forward walk solution:

Lemma 27

Let be an instance of Vehicle Routing with Target Groups with a depot distance order \(\prec \) such that is nice. Then, for every weak fractional solution x there is a forward walk solution of cost at most

Proof

Let x be a weak fractional solution. Then x can be interpreted as a flow in that sends \((1-\tau )\sum _{T\in {\mathcal {T}}}b(T)\) units out of s and \((1-\tau )b(T)\) units into \(T\) for all \(T\in {\mathcal {T}}\). This maps to a flow \(x'\) in \(G'\) with the same properties, where \(G'\) is the digraph constructed in the proof of Lemma 25.

In order to make \(x'\) feasible, we need to send more flow into the target groups and ensure at least one unit of flow along \((v^-,v^+)\) for all \(v\in V\).

First, to ensure enough flow arriving at the target groups, we send \(\frac{\tau }{1-\tau } x(\delta ^-(t))\) units of flow directly from s to t for all \(t\in {\bar{T}}\). This makes the missing \(\tau b(T)\) units of flow arrive in \(T\) for each target group \(T\in {\mathcal {T}}\). This step increases the cost by \(\frac{\tau }{1-\tau }(c(x)-{{\,\mathrm{detour}\,}}(x))\).

Second, we ensure at least one unit of flow along \((v^-,v^+)\) for all \(v\in V\). To this end, for each \(v\in V\), we add \(\max \{0,1-x'_{(v^-,v^+)}\}\) units of flow along the cycle \(({{\,\mathrm{parent}\,}}(v)^+,v^-)\), \((v^-,v^+)\), \((v^+,{{\,\mathrm{parent}\,}}(v)^+)\). Let us call the resulting flow f. Note that x ships at least one unit through v and hence at least \(\max \{0,1-x'_{(v^-,v^+)}\}\) into v along backward arcs. Therefore the cost of f is

where we used that is nice in the second inequality. \(\square \)

We remark that it is essential that we allow walks rather than paths in a forward walk solution because otherwise the cost could increase by a factor \(\Omega (n)\), even for nice instances.

Of course, not every instance is nice. We will now deal with general instances.

4.2 Computing a nice subinstance and overall algorithm

If a given instance is not nice, we compute a maximal nice subinstance. For each customer y that we do not include, we define a witness customer w(y) nearby.

Lemma 28

Given an instance of Vehicle Routing with Target Groups with a depot distance order, we can compute in \(O(n^2)\) time a subset \(Y\subseteq V\) such that the instance that results from deleting Y is nice and for every \(y\in Y\) there exists a \(w(y)\in V{\setminus } Y\) such that \(w(y)\prec y\) and

$$\begin{aligned} c \bigl ( {{\,\mathrm{parent}\,}}_{V{\setminus } Y}(w(y)),w(y) \bigr ) \ > \ \gamma \cdot {{\,\mathrm{detour}\,}}(y,w(y)). \end{aligned}$$

Proof

Initially set \(Y=\emptyset \). Scan the elements of V in the depot distance order \(\prec \). If we scan an element that has been added to Y before, we do nothing. Otherwise, if we scan an element v that has not been added to Y, then we add all elements of

$$\begin{aligned} A_v \ := \ \left\{ y\in V: v\prec y,\, c({{\,\mathrm{parent}\,}}_{V{\setminus } Y}(v),v) > \gamma \cdot {{\,\mathrm{detour}\,}}(y,v) \right\} \end{aligned}$$
(10)

to Y and set \(w(y):=v\) for all \(y\in A_v\). See Fig. 5. \(\square \)

We will solve the nice subinstance that results from deleting Y as described in the previous subsection. The deleted vertices will then be inserted into the solution of this subinstance. To this end, we will compute a cheapest forest that connects all elements of Y to some elements of \(V{\setminus } Y\); in the end we traverse the edges of this forest in both directions. The main technical lemma, to be shown in the next subsection, says that there is a cheap forest that connects all elements of Y to some elements of \(V{\setminus } Y\):

Lemma 29

Let be an instance of Vehicle Routing with Target Groups and x a weak fractional solution. Let \(\gamma >2\). Let Y be a set of vertices as in Lemma 28. Then there exists a forest \((V,F_x)\) that connects each vertex in Y to \(V{\setminus } Y\) and such that

(11)

Using this lemma, which we prove in the following subsection, we can prove Theorem 24:

Proof of Theorem 24

The algorithm consists of the following steps.

  1. 1.

    Apply Lemma 28 to compute a subset \(Y\subseteq V\).

  2. 2.

    Apply Lemma 25 to find a cheapest forward walk solution H in the nice subinstance obtained by deleting Y.

  3. 3.

    Find a minimum-cost set F of edges that connect all elements of Y to some elements of \(V{\setminus } Y\).

  4. 4.

    Orient the edges of F in both directions and insert them into H to obtain a walk solution to the original instance.

  5. 5.

    Apply Proposition 9.

Step 3 reduces to computing a minimum-cost spanning tree in the complete graph \(Y\cup \{w\}\) where the cost of an edge \(\{y,w\}\) is \(\min \{c(y,v): v\in V{\setminus } Y\}\) and can thus be done in \(O(n^2)\) time. Step 5 runs in \(O(n^2)\) time because \(|H|\le n^2\). Hence the overall running time is dominated by the application of Lemma 25. It is obvious that step 4 yields a walk solution, hence the algorithm is correct.

To bound the total cost of the solution, let x be any weak fractional solution to a given instance . From x we obtain a weak fractional solution to our nice subinstance by shortcutting without increasing cost or detour. By Lemma 27, .

By Lemma 29, there is a forest \((V,F_x)\) that connects each vertex in Y to \(V{\setminus } Y\) and such that (11) holds. We conclude that our final solution has total cost at most

as required. \(\square \)

4.3 Connecting the omitted vertices (Proof of Lemma 29)

To prove Lemma 29, we fix a set Y of vertices as in Lemma 28 and decompose x into walks, which we shortcut to paths that begin in s and whose other vertices belong to Y. Let P be such a path. We will construct a forest that connects each vertex in \(Y\cap V(P)\) to some vertex in \(W:=V{\setminus } Y\). This forest will consist of pieces of P and a connection of each piece to W. More specifically, we will prove the following and apply it to each of these paths:

Lemma 30

Let \(\gamma >2\). Let Y be a set of vertices as in Lemma 28. Let P be a path that begins in s and with \(V(P) {\setminus } \{s\} \subseteq Y\). Then there exists a forest \((V,F_P)\) that connects each vertex in \(Y \cap V(P)\) to \(V{\setminus } Y\) and such that

$$\begin{aligned} c(F_P) \ < \ {\textstyle \frac{4}{\gamma -2}} \cdot c(P) + \left( 2+{\textstyle \frac{4}{\gamma -2}}\right) \cdot {{\,\mathrm{detour}\,}}(P). \end{aligned}$$
(12)

Before we prove this lemma, we show that it implies Lemma 29.

Proof of Lemma 29

We decompose \(x=\sum _{P\in {\mathcal {P}}}\lambda _P\chi ^{E(P)}\) according to Definition 11. Each \(P\in {\mathcal {P}}\) is a walk in that begins in s and ends in \(\{s\}\cup \bar{T}\). Now shortcut P by skipping all vertices in \(V{\setminus } Y\), skipping a vertex in Y if it has been visited by P before, and removing the end vertex of P. Apply Lemma 30 to the resulting path, and let \(F_P\) be the resulting forest. Consider \(l=\sum _{P\in {\mathcal {P}}} \lambda _P \chi ^{F_P}\). The cost of l is . In the last inequality we used the triangle inequality: shortcutting does not increase cost or detour.

We claim that after contracting \(V{\setminus } Y\) to a vertex w, the vector l belongs to the connector polyhedron (the convex hull of incidence vectors of all connected multigraphs on vertex set \(Y\cup \{w\}\)). This directly implies the result.

To show that l belongs to the connector polyhedron, we need to show that for every partition \({\mathcal {Y}}=\{Y_0,\ldots ,Y_k\}\) of V for which \(V{\setminus } Y\subseteq Y_0\) we have \(l(\delta ({\mathcal {Y}}))\ge k\), where \(\delta ({\mathcal {Y}})\) denotes the set of edges with endpoints in different sets of the partition. For every \(P\in {\mathcal {P}}\), let \(k_P=\{j\in \{1,\ldots ,k\}: F_P\cap \delta (Y_j)\not =\emptyset \}\) be the number of sets that \(F_P\) connects to \(Y_0\). Since \(\sum _{P\in {\mathcal {P}}: v\in V(P)} \lambda _P\ge 1\) for all \(v\in Y\), we have \(\sum _{P\in {\mathcal {P}}}\lambda _P k_P \ge k\). Moreover, \(k_P\le |F_P\cap \delta ({\mathcal {Y}})|\). Therefore \(l(\delta ({\mathcal {Y}}))=\sum _{P\in {\mathcal {P}}} \lambda _P |F_P\cap \delta ({\mathcal {Y}})| \ge \sum _{P\in {\mathcal {P}}} \lambda _P k_P \ge k\), as required. \(\square \)

Fig. 6
figure 6

An example how a set \({\bar{Y}} \subseteq Y\) of nondominated customers could be chosen so that \(\bigcup _{y\in {\bar{Y}}} V(P_{[x(y),z(y)]})\) contains all elements of \(Y\cap V(P)\). Here the filled circles represent customers \({{\,\mathrm{parent}\,}}(w_1),{{\,\mathrm{parent}\,}}(w_2),w_1,w_2,w_3,w_4,w_5\) in \(W=V {\setminus } Y\), and the empty circles represent customers in \(Y\cap V(P)\). The hemicycles and the sets \(A_w\) and \(S_w\) (\(w\in W\)) are drawn for \(\gamma =2\), Euclidean distances, and the depot located far west (the stripes \(S_{w_1},S_{w_3},S_{w_5}\) are only indicated at the bottom). The customer z(y) in \(A_{w_3}\) is dominated because \(w(y)=w_2\prec w_3 = w(z(y))\) and \(S_{w_3}\subseteq S_{w_2}\). A possible choice is \({\bar{Y}}=\{y,y'\}\)

Now it remains to prove Lemma 30, which will take the rest of this section.

First, we will associate with each \(w\in W\) a “radius”

$$\begin{aligned} r_w \ := \ {\textstyle \frac{1}{\gamma }} \cdot c \bigl ({{\,\mathrm{parent}\,}}_W(w),w \bigr ). \end{aligned}$$
(13)

We have \(A_w =\{ y\in V: w\prec y,\, {{\,\mathrm{detour}\,}}(y,w) < r_w\}\) (cf. (10)), in particular every element of \(A_w\) has distance to w smaller than \(r_w\) (cf. Fig. 5).

Now we define a larger region \(S_w\) by

$$\begin{aligned} S_w \ := \ \{y \in Y : w\prec y,\, c(s,y) \le c(s,w) + r_w \}. \end{aligned}$$
(14)

Note that \(A_w\subseteq S_w\).

Let now P be a path that begins in s and with \(V(P){\setminus }\{s\}\subseteq Y\). For \(y\in Y\cap V(P)\) let w(y) be a vertex as guaranteed by Lemma 28. Let x(y) be the first vertex of P with \(w(y)\prec x(y)\), and let z(y) be the last vertex of P with \(c(s,z(y))\le c(s,w(y))+ r_{w(y)}\). Denote the x(y)-z(y)-subpath of P by \(P_{[x(y),z(y)]}\). This subpath contains all of \(S_{w(y)}\cap V(P)\), but it may contain more elements of Y. We will select a subset \({\bar{Y}}\) of \(Y\cap V(P)\). For each selected customer \(y\in {\bar{Y}}\) we add \(P_{[x(y),z(y)]}\) plus the edge \(\{y,w(y)\}\) to the forest. The set \({\bar{Y}}\) will be chosen such that this forest connects all customers in \(V(P) \cap Y\) to W.

We call \(y\in V(P)\cap Y\) dominated by \(y'\in V(P)\cap Y\) if \(w(y') \prec w(y)\) and \(S_{w(y)}\subseteq S_{w(y')}\). We will not include dominated customers in \({\bar{Y}}\). If y is dominated by \(y'\), then \(P_{[x(y),z(y)]}\) is a subpath of \(P_{[x(y'),z(y')]}\), so we can indeed cover all of \(V(P)\cap Y\) without considering dominated vertices. See Fig. 6.

Let y be nondominated, and let p(y) be the predecessor of x(y) on P. Then \(p(y)\prec w(y)\). The key lemma that we use to bound the cost of our forest is the following. The idea of its proof is that either x(y) is close to w(y), then p(y) is far away from x(y), or x(y) is far away from w(y), then P makes a large detour between x(y) and y. (In Fig. 6, \(y'\) is of the first kind and y is of the second kind.)

Lemma 31

Let \(y\in Y\) be nondominated and \(w=w(y)\). Let \(p\in \{s\}\cup Y\) and \(x,z\in Y\) with \(p\prec w\prec x\) and \(c(s,z) \le c(s,w)+ r_w\). Then

$$\begin{aligned} c(x,y)+c(y,z)+c(y,w)\le & {} \left( 1+{\textstyle \frac{2}{\gamma -2}}\right) \cdot \left( {{\,\mathrm{detour}\,}}(x,y) + {{\,\mathrm{detour}\,}}(y,z) \right) \nonumber \\&+ {\textstyle \frac{4}{\gamma -2}} \cdot c(p,x). \end{aligned}$$
(15)

Proof

First we claim

$$\begin{aligned} (\gamma -2) \cdot r_w \ \le \ 2 \cdot c(p,x) + {{\,\mathrm{detour}\,}}(x,y). \end{aligned}$$
(16)

If \(p=s\), we have \(c(p,x)\ge c(p,w)\ge c({{\,\mathrm{parent}\,}}(w),w)=\gamma \cdot r_w\) and hence (16). So assume \(p\in Y\). Then

$$\begin{aligned} c(s,w) + r_w \ \ge \ c(s,w(p)) + r_{w(p)} \end{aligned}$$
(17)

because otherwise \(S_{w}\subseteq S_{w(p)}\) and y would be dominated. Next, using the triangle inequality, \(p\in A_{w(p)}\), \(y\in A_w\), \(w\prec x\), and (17), we get

$$\begin{aligned} \gamma \cdot r_w&\ \le \ c(w(p),w) \\&\ \le \ c(w(p),p) + c(p,x) + c(x,y) + c(y,w) \\&\ = \ ({{\,\mathrm{detour}\,}}(p,w(p)) + c(s,w(p)) - c(s,p)) \\&\quad + c(p,x) + {{\,\mathrm{detour}\,}}(x,y) + {{\,\mathrm{detour}\,}}(y,w) + c(s,w) - c(s,x) \\&\ \le \ r_{w(p)} + c(s,w(p)) - c(s,p) + c(p,x) \\&\quad + {{\,\mathrm{detour}\,}}(x,y) + r_w + c(s,w) - c(s,x) \\&\ \le \ r_{w(p)} + c(s,w(p)) - c(s,p) + c(p,x) \\&\quad +{{\,\mathrm{detour}\,}}(x,y) + r_w + c(s,x) - c(s,w) \\&\ \le \ r_{w(p)} + c(s,w(p)) + 2c(p,x) + {{\,\mathrm{detour}\,}}(x,y) + r_w - c(s,w) \\&\ \le \ r_{w(p)} + 2c(p,x) + {{\,\mathrm{detour}\,}}(x,y) + r_w + r_w - r_{w(p)}, \end{aligned}$$

which yields (16).

Finally, using \(c(s,z)-c(s,x)\le c(s,z)-c(s,w)\le r_w\) and \(c(y,w)\le {{\,\mathrm{detour}\,}}(y,w)\le r_w\),

$$\begin{aligned} c(x,y) + c(y,z) + c(y,w)&\ = \ {{\,\mathrm{detour}\,}}(x,y) + {{\,\mathrm{detour}\,}}(y,z) \\&\quad + c(s,z)-c(s,x) + c(y,w) \\&\ \le \ {{\,\mathrm{detour}\,}}(x,y) + {{\,\mathrm{detour}\,}}(y,z) + 2\cdot r_w \\&\ \le \ {{\,\mathrm{detour}\,}}(x,y) + {{\,\mathrm{detour}\,}}(y,z) \\&\quad + {\textstyle \frac{4}{\gamma -2}} c(p,x) + {\textstyle \frac{2}{\gamma -2}} {{\,\mathrm{detour}\,}}(x,y), \end{aligned}$$

where we used the bound for \(r_w\) that we derived in (16) in the second inequality. \(\square \)

To finish the proof of Lemma 30, let \(\bar{Y}\subseteq V(P)\cap Y\) be a minimal subset of nondominated vertices such that

$$\begin{aligned} \bigcup _{y\in {\bar{Y}}} V(P_{[x(y),z(y)]}) \ = \ Y\cap V(P). \end{aligned}$$

Then no vertex belongs to more than two of the subpaths \(P_{[x(y),z(y)]}\) (\(y\in {\bar{Y}}\)). In particular, if we sum up the detours of these subpaths, we get at most twice the total detour of E(P).

Taking the union of these subpaths plus the edges \(\{y,w(y)\}\) for \(y\in {\bar{Y}}\) yields a forest that connects all elements of \(Y\cap V(P)\) to \(V{\setminus } Y\) and that has length at most

$$\begin{aligned}&\sum _{y\in {\bar{Y}}} \left( c(P_{[x(y),z(y)]}) + c(y,w(y)) \right) \\&\quad = \ \sum _{y\in {\bar{Y}}} \bigl ( c(x(y),y)+ c(y,z(y)) + {{\,\mathrm{detour}\,}}(P_{[x(y),y]}) \\&\qquad + {{\,\mathrm{detour}\,}}(P_{[y,z(y)]}) - {{\,\mathrm{detour}\,}}(x(y),y) - {{\,\mathrm{detour}\,}}(y,z(y)) + c(y,w(y)) \bigr ) \\&\quad \le 2{{\,\mathrm{detour}\,}}(P) + \sum _{y\in {\bar{Y}}} \left( \big . c(x(y),y)+ c(y,z(y)) + c(y,w(y)) \right. \\&\qquad \left. - {{\,\mathrm{detour}\,}}(x(y),y) - {{\,\mathrm{detour}\,}}(y,z(y)) \right) . \end{aligned}$$

By Lemma 31, this is at most

$$\begin{aligned}&2{{\,\mathrm{detour}\,}}(P) + \sum _{y\in {\bar{Y}}} \left( {\textstyle \frac{2}{\gamma -2}} \cdot \left( {{\,\mathrm{detour}\,}}(x(y),y) + {{\,\mathrm{detour}\,}}(y,z(y)) \right) \right. \\&\qquad \left. + {\textstyle \frac{4}{\gamma -2}} \cdot c({{\,\mathrm{pred}\,}}_P(x(y)),x(y)) \right) \\&\quad \le \left( 2+{\textstyle \frac{4}{\gamma -2}}\right) {{\,\mathrm{detour}\,}}(P) + {\textstyle \frac{4}{\gamma -2}} \cdot c(P), \end{aligned}$$

where \({{\,\mathrm{pred}\,}}_P(x(y))\) denotes the predecessor of x(y) on P. In the last inequality we used that by the minimality of \({\bar{Y}}\), the edges \(({{\,\mathrm{pred}\,}}_P(x(y)),x(y))\) are distinct for different \(y\in {\bar{Y}}\). This concludes the proof of Lemma 30.

5 LP-based approach to vehicle routing with target groups

In this section we give a second proof of Theorem 12, using an approach of Friggstad and Swamy [17]. This will lead to a worse running time but a better approximation ratio. To be precise, we prove:

Theorem 32

Let \(\tau \in (0,1)\). There is a polynomial-time algorithm for Vehicle Routing with Target Groups that computes for every instance and any given \(\theta \in (0,1-\tau ]\) a feasible solution \({\mathcal {P}}\) to such that

for every weak fractional solution x of .

Large parts of this section follow closely [17], although our setting is slightly different and we improve on this work at one point (in Sect. 5.2). In particular, the linear program (Sect. 5.1) is largely identical to the one in [17], and the rounding procedure (Sect. 5.3) is taken from that paper. Nevertheless we cannot simply use a result of [17] in a black-box manner, so for sake of readability we give a self-contained proof here.

Friggstad and Swamy [17] devised an LP-based 15-approximation algorithm for regret-bounded vehicle routing. Here we have a metric space with a depot and a set of customers as well as a regret bound R and ask for a set \({\mathcal {P}}\) of paths such that each customer belongs to some path and each path begins at the depot, ends at some customer, and has total detour at most R. The goal is to minimize the number of paths in \({\mathcal {P}}\). So on the one hand, the paths can end anywhere, on the other hand, the detour of each single path is bounded and we minimize the number of paths. In Sect. 5.4 we show how the approximation ratio can be improved from 15 to 10.

5.1 The linear program

Definition 33

An s-t-walk P in with \(t\in {\bar{T}} \cup \{s\}\) is called monotone if \(c(s,u) < c(s,v)\) for every edge \((u,v)\in E(P)\) with \(v\in V\). A solution \({\mathcal {P}}\) is monotone if all \(P\in {\mathcal {P}}\) are monotone.

Suppose has a feasible solution \({\mathcal {P}}\) with small detour. We will observe that then there exists a subset U of customers such that

  • the instance \((U,{\bar{T}},s,c,{\mathcal {T}},b)\) has a monotone solution \({\mathcal {P}}_U\) that is no longer than \({\mathcal {P}}\), and

  • there is a short forest F connecting every vertex \(v\in V{\setminus } U\) to a vertex in U.

If we knew the solution \({\mathcal {P}}_U\) for \((U,{\bar{T}},s,c,{\mathcal {T}},b)\) and the forest F, we could obtain a cheap solution for as follows. We take two copies of the edges in F and orient them in different directions. Then we add them to \({\mathcal {P}}_U\) to obtain a walk solution.

We will consider an LP relaxation for the problem of finding a subset \(U\subseteq V\), a monotone solution \({\mathcal {P}}_U\), and a forest (VF) connecting every vertex to an element of U.

Let us first explain how we can obtain \({\mathcal {P}}_U\) and F from a solution \({\mathcal {P}}\) of with small detour. Of course, \({\mathcal {P}}\) is unknown but our construction leads to a particular choice of \({\mathcal {P}}_U\) and F for which we can impose certain constraints in the LP.

For every walk \(P\in {\mathcal {P}}\), say from s to t, we color the points in \([0,\max \{c(s,u):u\in V(P)\}]\) red or blue. A point x is blue if there is an edge (vw) of P such that \(c(s,u)< x\) for all \(u\in V(P_{[s,v]}){\setminus }\{s\}\) and \(c(s,u)>x\) for all \(u\in V(P_{[w,t]}) {\setminus } \{t\}\). All other points are red, including c(su) for all \(u\in V(P){\setminus }\{s,t\}\). The red intervals of P form a subset of the set \({\mathcal {I}}\) of all closed intervals with endpoints among \(\{c(s,u): u\in V(P){\setminus }\{s,t\}\}\), including the trivial intervals consisting of a single point.

Fig. 7
figure 7

An example of a path from s to t, consisting of the dotted blue and solid red edges. The interval \([0,\max \{c(s,u):u\in V(P)\}]\), is colored blue and red (bottom). The red edges are those of the forest F. The brown directed arcs show the monotone path visiting the sentinels of P

Then for every vertex \(v\in V(P){\setminus } \{s,t\}\), the distance c(sv) is contained in one of the red intervals. We consider the forest \(F_P\) that contains those edges \(\{v,w\}\) of P for which c(sv) and c(sw) are contained in the same red interval and \(v,w\in V(P){\setminus }\{s,t\}\). See Fig. 7. We will bound the cost of this forest using the following observation, which is essentially Corollary 3.2 of [8].

Lemma 34

([8]) We have .

Proof

Obtain \(P'\) from P by deleting the last edge and subdividing edges so that \(P'\) alternates between subpaths in blue and subpaths in red intervals. Then the total length of the blue subpaths is at least the total length of the blue intervals, and the total length of the red subpaths is at least three times the total length of the red intervals up to c(sv), where v is the last vertex of \(P'\). Hence . Since \({{\,\mathrm{detour}\,}}(E(P)\cap E_1(\mathcal {J}))=c(P') - c(s,v)\), this yields the claimed inequality. \(\square \)

There is a one-to-one correspondence between the connected components of \((V(P){\setminus }\{s,t\},F_P)\) and the red intervals of P. For every red interval I, we choose one arbitrary vertex \(v\in V(P){\setminus } \{s,t\}\) with \(c(s,v)\in I\). We call these vertices the sentinels of P. We have exactly one sentinel for each connected component of \((V(P){\setminus }\{s,t\},F_P)\). The sentinels of P are visited by P in an order of increasing distance from s. Hence, shortcutting P such that it visits only the sentinels yields a monotone path of length at most c(P).

The forest F is the union of all \(F_P\) for \(P\in {\mathcal {P}}\) and the monotone solution \({\mathcal {P}}_U\) arises from \({\mathcal {P}}\) by shortcutting \({\mathcal {P}}\) such that it only visits the sentinels.

Next we describe a linear programming relaxation for this forest F and monotone solution \({\mathcal {P}}_U\). For \(u\in V\) denote \({\mathcal {I}}_u:=\{I\in {\mathcal {I}}: c(s,u)\in I\}\). Recall that for every vertex \(v\in V\), there is a path \(P\in {\mathcal {P}}\) that contains v, and there is a red interval \(I\in {\mathcal {I}}_v\) of P and a sentinel u such that \(I\in {\mathcal {I}}_u\). We introduce variables

$$\begin{aligned} a_{v,(I,u)} \ge 0 \qquad (u,v\in V, I \in {\mathcal {I}}_u \cap {\mathcal {I}}_v) \end{aligned}$$

that model the assignment of v to the interval I with sentinel u. We remark that if v is a sentinel of interval I we have \(a_{v,(I,v)}=1\) in the corresponding LP solution. These variables satisfy the following constraints:

$$\begin{aligned} a_{v,(I,u)}&\le a_{u, (I,u)}&(u,v\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v) \\ \sum _{u\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)}&= 1&(v\in V). \end{aligned}$$

To model the forest F, we introduce variables \(z_e \in {\mathbb {R}}_{\ge 0}\) for all \(e\in {V\atopwithdelims ()2}\). If an edge \(e\in {V\atopwithdelims ()2}\) is contained in F, we have \(z_e=1\) in the corresponding LP solution (and we have \(z_e=0\) otherwise). If \(v\in V(P){\setminus }\{s,t\}\) for \(P\in {\mathcal {P}}\), then there is a red interval \(I\in {\mathcal {I}}_v\) of P, and v must be connected to the sentinel u of I in the forest (VF). Hence we can introduce the constraints

$$\begin{aligned} z(\delta (S))&\ge \sum _{u\in V{\setminus } S,\, I\in {\mathcal {I}}_u}a_{v,(I,u)}&(v\in S\subseteq V). \end{aligned}$$

Finally, we introduce flow constraints modelling the monotone solution \({\mathcal {P}}_U\). Define a digraph B with vertex set \(\{(I,u): u\in V,\, I\in {\mathcal {I}}_u\}\cup \{s\} \cup {\bar{T}}\) and four types of arcs:

  • arcs (s, (Iu)) for \(u\in V\) and \(I \in {\mathcal {I}}_u\),

  • arcs ((Iu), (Jv)) whenever \(c(s,u)<c(s,v)\) and \(I \in {\mathcal {I}}_u\) and \(J\in {\mathcal {I}}_v\) are disjoint,

  • arcs ((Iu), t) for \(t\in {\bar{T}}\cup \{s\}\), \(u\in V\), and \(I \in {\mathcal {I}}_u\), and

  • arcs (st) for \(t\in {\bar{T}}\).

We remark that the arc set is constructed such that \(B-s\) is acyclic. The arcs in B inherit their cost from c, i.e., \(c(s,(I,u))=c(s,u)\), \(c((I,u),(J,v))=c(u,v)\), etc.

We introduce flow variables \(f_{e} > 0\) for every arc e in B. For our solution \({\mathcal {P}}_U\), we define the corresponding flow f in B as follows.

  • For an edge (su) in \({\mathcal {P}}_U\), where u is the sentinel of the interval I, we set \(f_{(s,(I,u))} :=1\).

  • For an edge \((u,u')\) in \({\mathcal {P}}_U\), where u is the sentinel of the interval I and \(I'\) is the interval of the sentinel \(u'\) we set \(f_{((I,u),(I',u'))} :=1\).

  • For an edge (ut) in \({\mathcal {P}}_U\), where u is the sentinel of the interval I and \(t\in {\bar{T}} \cup \{s\}\), we set \(f_{((I,u), t)} :=1\).

  • For an edge (st) in \({\mathcal {P}}_U\), where \(t\in {\bar{T}}\), we set \(f_{(s,t)}:=1\).

If an edge appears multiple times, the flow values add up. All other flow variables are zero. Then the flow f fulfills the following constraints:

$$\begin{aligned} \sum _{u\in V} f(\delta ^-(T))&= b(T)&(T\in {\mathcal {T}}) \\ f(\delta ^-((I,u))) = f(\delta ^+((I,u)))&=a_{u,(I,u)}&(u\in V,\, I\in {\mathcal {I}}_u). \end{aligned}$$

To prove Theorem 32, we want to construct a feasible LP solution from a weak fractional solution to . To this end, we will consider the polyhedron \(\Pi \) below, where we replaced the flow constraints \(\sum _{u\in V} f(\delta ^-(T)) = b(T)\) by \(\sum _{u\in V} f(\delta ^-(T)) = (1-\tau )\cdot b(T)\) and relaxed \(\sum _{u\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)} = 1\) to \(\sum _{u\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)} \ge 1\). We define

(18)

Note that the number of constraints can be reduced to a polynomial number by introducing flow variables \(g^v_e\) for each \(v \in V\) and \(e\in {V\atopwithdelims ()2}\). Require that the flow \(g^v\) sends \(\sum _{I \in {\mathcal {I}}_u} a_{v,(I,u)}\) units from v to u and \(z \ge g^v\). Then the cut constraints for z can be dropped without changing \(\Pi \).

Later, in Sect. 5.3, we show how we can construct a cheap solution to from any element \((a,f,z)\in \Pi \) of the polyhedron \(\Pi \). We write \(c(z):= \sum _{e =\{v,w\}\in {V\atopwithdelims ()2}} c(v,w) z_e\) and \(c(f):= \sum _{e\in E(B)} c(e)f_e\). We will show:

Lemma 35

Let \(0 < \theta \le 1-\tau \). Given \((a,f,z)\in \Pi \) we can compute a solution \({\mathcal {P}}\) of the instance of Vehicle Routing with Target groups with

$$\begin{aligned} c({\mathcal {P}}) \ \le \ \frac{4}{1-\theta } c(z) + \frac{1}{\theta } \cdot c(f) + \frac{1-\tau - \theta }{\theta \cdot (1-\tau )} \cdot \sum _{t\in {\bar{T}}}\sum _{u\in V,I\in {\mathcal {I}}_u} c(s,u) \cdot f((I,u),t) \end{aligned}$$

in polynomial time.

In Sect. 5.2 we show how we can obtain a vector \((a,f,z)\in \Pi \) from a weak fractional solution x of and prove the following lemma. Note that we gain a factor 2 in the bound on z, compared to Lemma 34.

Lemma 36

For any weak fractional solution x of the instance of Vehicle Routing with Target groups there exists a vector \((a,f,z)\in \Pi \) such that

From Lemma 35 and Lemma 36 we can now conclude Theorem 32.

Proof of Theorem 32

We compute an optimum solution (afz) to the LP

$$\begin{aligned}&\min \left\{ \frac{4}{1-\theta } c(z) + \frac{1}{\theta } \cdot c(f) + \frac{1-\tau - \theta }{\theta \cdot (1-\tau )} \cdot \right. \\&\quad \quad \left. \sum _{t\in {\bar{T}}}\sum _{u\in V,I\in {\mathcal {I}}_u} c(s,u) \cdot f((I,u),t) \ :\ (a,f,z) \in \Pi \right\} . \end{aligned}$$

By Lemma 36 we have

Hence, applying Lemma 35 completes the proof. \(\square \)

5.2 Existence of a cheap LP solution (Proof of Lemma 36)

In this section we prove Lemma 36. Given a weak fractional solution x of we will construct a vector \((a,f,z)\in \Pi \). By the definition of weak fractional solutions (Definition 11) we can write

$$\begin{aligned} x = \sum _{P\in {\mathcal {P}}} \lambda _P \chi ^{E(P)}, \end{aligned}$$

where \({\mathcal {P}}\) is a set of walks in , each starting in s and ending in some \(t\in {\bar{T}}\cup \{s\}\), and \(\lambda _P \ge 0\) for all \(P\in {\mathcal {P}}\). For every walk \(P\in {\mathcal {P}}\), we consider the forest \((V,F_P)\). Recall that every connected component of \((V,F_P)\) corresponds to a red interval \(I\in {\mathcal {I}}\) of P. For every connected component Z of \((V,F_P)\) let \(u^Z_1\) and \(u^Z_2\) be the vertex in Z visited first and visited last by \({\mathcal {P}}\), respectively.

For each \(v\in Z\) we set

$$\begin{aligned} a^P_{v,(I,u^Z_1)} = a^P_{v,(I,u^Z_2)} = {\textstyle \frac{1}{2}} \end{aligned}$$

if \(u^Z_1\not =u^Z_2\), and \(a^P_{v,(I,u^Z_1)} = 1\) if \(u^Z_1=u^Z_2\). We set \(a^P_{v,(I,u)}=0\) for all other (Iu) with \(u\in V\) and \(I\in {\mathcal {I}}_u \cap {\mathcal {I}}_v\). We aggregate

$$\begin{aligned} a_{v,(I,u)} =\sum _{P\in {\mathcal {P}}: v\in V(P)} \lambda _P \cdot a^P_{v,(I,u)} . \end{aligned}$$

Then \(a_{v,(I,u)} \le a_{u,(I,u)}\) for all \(u,v\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v\) and \(\sum _{u\in V,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)} = \sum _{P\in {\mathcal {P}}: v\in V(P)} \lambda _P \ge 1\) for all \(v\in V\).

Fig. 8
figure 8

A path P (at the top) with vertices \(u^Z_1\) in green and orange and vertices \(u^Z_2\) in brown and orange. The bottom part of the picture shows the corresponding flow f in the graph B with vertices st and \((I,u^Z_i)\). Both the green and the brown edges have flow value \(\frac{1}{2}\)

For each \(P\in {\mathcal {P}}\) we define two monotone walks \(P_1\) and \(P_2\). The walk \(P_i\) results from the s-t-walk P by shortcutting such that it visits only the vertices s, t, and \(u^Z_i\) for the connected components Z of \((V,F_P)\). From these two paths we obtain s-t-walks \(P'_1\) and \(P'_2\) in the graph B by replacing every vertex \(u^Z_i\) by \((I,u^Z_i)\), where I is the red interval corresponding to the component Z. See Fig. 8. We set

$$\begin{aligned} f := \sum _{P\in {\mathcal {P}}} \lambda _P \cdot \frac{1}{2} \cdot \left( \chi ^{E(P'_1)} + \chi ^{E(P'_2)}\right) . \end{aligned}$$

Then we have \(f(\delta ^-((I,u))) = f(\delta ^+((I,u))) =a_{u,(I,u)}\) for all \(u\in V,\, I\in {\mathcal {I}}_u\) and because x is a weak fractional solution of we also have \(\sum _{u\in V} f(\delta ^-(T)) = (1-\tau ) \cdot b(T)\) for all \(T\in {\mathcal {T}}\). We have \(c(f) \le c(x)\) and

Finally, we define

$$\begin{aligned} z := \frac{1}{2} \sum _{P\in {\mathcal {P}}} \lambda _P \cdot \chi ^{F_P}. \end{aligned}$$

Lemma 37

We have \(z(\delta (S)) \ge \sum _{u\in V{\setminus } S,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v}a_{v,(I,u)}\) for all \(v\in S\subseteq V\).

Proof

Let \(v\in V\) and let \(P\in {\mathcal {P}}\) be a walk containing v. Moreover, let Z be the vertex set of the connected component of \((V,F_P)\) that contains v and let I be the red interval corresponding to Z. If \(F_P\) contains only v, then the inequality holds trivially because its right hand-side is always 0 in this case. Otherwise \(u^Z_1\not =u^Z_2\) and \(a_{v,(I,u^Z_1)}= a_{v,(I,u^Z_2)} = \frac{1}{2}\) and \(a_{v,(I,u)}=0\) for all other (Iu). The connected component (ZF[Z]) of (VF) that contains v is the subpath of P from \(u^Z_1\) to \(u^Z_2\). Therefore, the v-\(u^Z_1\)-path and the v-\(u^Z_2\)-path in (VF) are edge-disjoint. This implies \(z(\delta (S)) \ge \sum _{u\in V{\setminus } S,\, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v}a_{v,(I,u)}\) for all S. \(\square \)

By Lemma 34, we have

This completes the proof of Lemma 36.

5.3 Rounding LP solutions (Proof of Lemma 35)

Let \((a,f,z)\in \Pi \). First, we explain how we round z to obtain a forest (VF). For \(\emptyset \not =S\subsetneq V\), let

$$\begin{aligned} r(S) := {\left\{ \begin{array}{ll} 1 &{} \text { if } \sum _{u\in S, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)} < \theta \text { for all }v\in S\\ 0 &{} \text { otherwise.} \end{array}\right. } \end{aligned}$$

Lemma 38

([17]). We can compute a forest (VF) with \(|F\cap \delta (S)|\ge r(S)\) for all \(\emptyset \ne S\subsetneq V\) and

$$\begin{aligned} c(F)\le \frac{2}{1-\theta } \cdot c(z) \end{aligned}$$

in polynomial time.

Proof

Consider a nonempty set \(S\subsetneq V\). Then S contains at least one vertex v and by the LP constraints

$$\begin{aligned} z(\delta (S))\ge & {} \sum _{u\in V{\setminus } S,I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)}\ =\ \sum _{u\in V,I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)} - \sum _{u\in S,I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)}\\\ge & {} 1 - \sum _{u\in S,I\in {\mathcal {I}}_u\cap {\mathcal {I}}_v} a_{v,(I,u)}. \end{aligned}$$

This implies \(z(\delta (S))\ge 1- \theta \) for all S with \(r(S)=1\). In other words, \(\frac{1}{1-\theta }z(\delta (S))\ge r(S)\) for all S. Moreover, we observe that r is a downwards-monotone cut-requirement function, i.e. we have \(r(X) \ge r(Y)\) for any XY with \(\emptyset \not =X \subseteq Y\). Hence, an algorithm by Goemans and Williamson [18] can be used to compute a forest (VF) as required. \(\square \)

Let \({\mathcal {Z}}\) denote the set of (vertex sets of) connected components of (VF). For every \(Z\in {\mathcal {Z}}\) we have \(r(Z)=0\) and hence there is a vertex \(w\in Z\) with \(\sum _{u\in Z, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_w} a_{w,(I,u)} \ge \theta \). We choose such a vertex w for each connected component Z and call it the witness node of Z. Then we define

$$\begin{aligned} \sigma (Z) := \{ (I,u) : u\in Z, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_w \}. \end{aligned}$$

Note that \(\sigma (Z)\subset V(B)\).

Lemma 39

([17]) For every \(Z\in {\mathcal {Z}}\) we have \(f(\delta ^-(\sigma (Z))) = f(\delta ^+(\sigma (Z)))\ge \theta \).

Proof

Let w be the witness node of Z. Because \(w\in I\) for every \((I,u)\in \sigma (Z)\) and because the graph B contains edges \(((I,u),(I',u'))\) only if I and \(I'\) are disjoint, B contains no edge with both endpoint in \(\sigma (Z)\). Hence, for the witness node w of Z the LP constraints imply

$$\begin{aligned} f(\delta ^-(\sigma (Z)))= & {} f(\delta ^+(\sigma (Z))) = \sum _{(I,u)\in \sigma (Z)} f(\delta ^-((I,u))) = \sum _{(I,u)\in \sigma (Z)} a_{u,(I,u)} \\\ge & {} \sum _{u\in Z, I\in {\mathcal {I}}_u\cap {\mathcal {I}}_w} a_{w,(I,u)} \ge \theta . \end{aligned}$$

\(\square \)

Next, we define an order \(\prec \) on \({\mathcal {Z}}\). For \(Z,Z'\in {\mathcal {Z}}\) with witness nodes w and \(w'\) respectively, we say that \(Z \prec Z'\) if and only if \(c(s,w) < c(s,w')\).

We define a directed graph D with vertex set \(\{s\}\cup {\mathcal {Z}}\cup {\bar{T}}\) and the following types of arcs:

  • an arc (sZ), for \(Z\in {\mathcal {Z}}\)

  • an arc \((Z,Z')\) for \(Z,Z'\in {\mathcal {Z}}\) with \(Z \prec Z'\),

  • an arc (Zt) for \(Z\in {\mathcal {Z}}\) and \(t\in {\bar{T}}\cup \{s\}\), and

  • an arc (st) for all \(t\in {\bar{T}}\).

We define \(c(s,Z) := \min _{v\in Z} c(s,v)\), \(c(Z,Z') := \min _{v\in Z,v'\in Z'} c(v,v')\), and \(c(Z,t) := \min _{v\in Z} c(v,t)\).

Lemma 40

Given the forest (VF) and a flow g in D with

  • \(g(\delta ^-_D(Z)) = g(\delta ^+_D(Z)) = 1\) for every \(Z\in {\mathcal {Z}}\), and

  • \(g(\delta ^-_D(T))=b(T)\) for every target group \(T\in {\mathcal {T}}\),

we can compute a solution to the instance of Vehicle Routing with Target Groups with cost at most \(2 \cdot c(F) + c(g)\) in polynomial time.

Proof

It is well-known that there is an optimum flow \({\bar{g}}\) with the same properties that is integral. Back in , this corresponds to a multi-set with \(|\delta ^-_H(Z)|=|\delta ^+_H(Z)|=1\) for every \(Z\in {\mathcal {Z}}\) and \(|\delta ^-_H(T)|=b(T)\) for every target group \(T\in {\mathcal {T}}\). Let \(Z\in {\mathcal {Z}}\). If \(\delta ^-_H(Z)=\{(v,z)\}\) and \(\delta ^+_H(Z)=\{(z',v')\}\), we let \(P_Z\) be the path in (VF) that connects z and \(z'\), oriented from z to \(z'\). For each \(e=\{v,w\}\in F\) such that (vw) belongs to \(P_Z\) for its \(Z\in {\mathcal {Z}}\), we add (vw) to H. For each \(e=\{v,w\}\in F\) such that neither (vw) nor (wv) belongs to any \(P_Z\), we add both orientations (vw) and (wv) to H. Then H is a walk solution of cost at most \(c({\bar{g}})+2c(F) \le c(g)+2c(F)\). Now apply Proposition 9. \(\square \)

We will construct a flow g as in Lemma 40 with

$$\begin{aligned} c(g) \ \le \ \frac{1}{\theta }c(f) + \frac{1-\tau - \theta }{\theta \cdot (1-\tau )} \cdot \sum _{t\in {\bar{T}}} \sum _{u\in V, I\in {\mathcal {I}}_u} c(s,u) \cdot f((I,u),t). \end{aligned}$$
(19)

Together with Lemma 38, this will complete the proof of Lemma 35.

First, we shortcut the flow f as follows. Because the graph \(B-s\) is acyclic we can decompose f into s-t-walks with \(t\in {\bar{T}} \cup \{s\}\), i.e. we write \(f = \sum _{H\in {\mathcal {H}}} \lambda _H \cdot \chi ^H\) where \({\mathcal {H}}\) is a set of s-t-walks with \(t\in {\bar{T}} \cup \{s\}\) and \(\lambda _H > 0\) for all \(H\in {\mathcal {H}}\). Note that \(\sum _{H\in {\mathcal {H}}: V(H)\cap \sigma (Z)\not =\emptyset } \lambda _H =f(\delta ^-(\sigma (Z)))\ge \theta \) for all \(Z\in {\mathcal {Z}}\) by Lemma 39.

Then we shortcut each walk \(H\in {\mathcal {H}}\) to a walk \(H'\) by skipping vertices that do not belong to \(\{s\} \cup {\bar{T}} \cup \bigcup _{Z\in {\mathcal {Z}}} \sigma (Z)\). If \(\sum _{H\in {\mathcal {H}}: V(H)\cap \sigma (Z)\not =\emptyset } \lambda _H > \theta \) for some \(Z\in {\mathcal {Z}}\), we will also skip \(\sigma (Z)\) in some of the walks so that \(\sum _{H\in {\mathcal {H}}: V(H')\cap \sigma (Z)\not =\emptyset } \lambda _H = \theta \); this may require to replace a walk by two copies. Shortcutting (skipping vertices) is possible in the graph B, although B is not a complete digraph, because if B contains two edges \((b_1,b_2)\) and \((b_2,b_3)\) for \(b_2\not =s\), it also contains the edge \((b_1,b_3)\). We define a flow \(f'\) in B to be \(f' = \sum _{H\in {\mathcal {H}}} \lambda _H \cdot \chi ^{H'}\). Because of the triangle inequality, we have \(c(f') \le c(f)\).

Next we contract every set \(\sigma (Z)\) for all \(Z\in {\mathcal {Z}}\). This yields a flow \(g'\) in the graph D by identifying the vertex resulting from the contraction of \(\sigma (Z)\) with the vertex \(Z\in V(D)\). Here we use that for an arc ((Iu), (Jv)) in B with \(u\in Z_u\in {\mathcal {Z}}\) and \(v\in Z_v\in {\mathcal {Z}}\) we have \(c(s,u) < c(s,v)\) and \(I\cap J = \emptyset \), implying that \(d_1 < d_2\) for every \(d_1\in I\) and \(d_2\in J\). In particular, \(c(s,w_u) < c(s,w_v)\) where \(w_u\) and \(w_v\) are the witness nodes of \(Z_u\) and \(Z_v\) respectively. We have \(c(g') \le c(f') \le c(f)\).

Finally, to define g, we start with the flow \(\frac{1}{\theta }g'\) in D. The transformation from f to \(f'\) ensured that \(\frac{1}{\theta }g'(\delta ^-(Z)) = \frac{1}{\theta }g'(\delta ^+(Z)) = 1\) for every \(Z\in {\mathcal {Z}}\). However, if \(\theta <1-\tau \), there is too much flow arriving in the target groups. More precisely, \(\frac{1}{\theta }g'(\delta ^-(T))= \frac{1-\tau }{\theta }\cdot b(T)\) for every target group \(T\in {\mathcal {T}}\), but we need exactly \(b(T)\). For every edge (Zt) with \(t\in {\bar{T}}\) and \(Z\in {\mathcal {Z}}\) we decrease the flow on (Zt) from \(\frac{1}{\theta }g'(Z,t)\) to \(\frac{1}{1-\tau }g'(Z,t)\) and increase the flow on (Zs) by \(\frac{1}{\theta }g'(Z,t) - \frac{1}{1-\tau }g'(Z,t) = \frac{1-\tau - \theta }{\theta \cdot (1-\tau )}g'(Z,t)\). For every edge (st) with \(t\in {\bar{T}}\) we decrease the flow on (st) from \(\frac{1}{\theta }g'(Z,t)\) to \(\frac{1}{1-\tau }g'(Z,t)\). The resulting flow is the desired flow g.

The cost of g is

$$\begin{aligned} c(g) \ \le&\ \frac{1}{\theta } c(g') + \frac{1-\tau - \theta }{\theta \cdot (1-\tau )} \cdot \sum _{Z \in {\mathcal {Z}}} \sum _{t\in {\bar{T}}} c(s,Z) \cdot g'(Z,t) \\ \le&\ \frac{1}{\theta }c(f) + \frac{1-\tau - \theta }{\theta \cdot (1-\tau )} \cdot \sum _{u\in V,I\in {\mathcal {I}}_u} \sum _{t\in {\bar{T}}} c(s,u) \cdot f'((I,u),t). \end{aligned}$$

Because the graph B visits pairs (Iu) in an order of increasing c(su), we have \(c(s,u) < c(s,v)\) whenever we shortcut ((Iu), (Jv)) and ((Jv), t) to an edge ((Iu), t) in the construction of \(f'\) from f. Hence,

$$\begin{aligned} \sum _{u\in V, I\in {\mathcal {I}}_u} \sum _{t\in {\bar{T}}} c(s,u) \cdot f'((I,u),t) \ \le \ \sum _{u\in V, I\in {\mathcal {I}}_u} \sum _{t\in {\bar{T}}} c(s,u) \cdot f((I,u),t), \end{aligned}$$

implying (19). This completes the proof of Lemma 35.

5.4 Improving the approximation ratio for regret-bounded vehicle routing

In this subsection we remark that our construction of a fractional LP solution (Sect. 5.2) also leads to an improved approximation ratio for regret-bounded vehicle routing, from 15 [17] to 10. (Our LP solution differs from the one constructed in [17] by splitting the sentinels, which gains a factor 2 on the bound on c(z).) We will not need this for our main result, but it might be worth noting. Recall that an instance of (additive) regret-bounded vehicle routing consists of a metric space \((\{s\}\cup V,c)\) and a regret bound R; the task is to compute a minimum number of paths, each beginning at s and having total detour at most R, such that every element of V belongs to one path.

Theorem 41

There is a 10-approximation algorithm for regret-bounded vehicle routing.

Proof

For an instance (VscR) let \({\bar{T}}=V\), \({\mathcal {T}}=\{{\bar{T}}\}\), \(\tau =\theta =\frac{1}{2}\), and let b(t) be twice the number of paths that end in t in an optimum solution. We do not know b(t) for any \(t\in {\bar{T}}\), but we can guess \(b({\bar{T}})=2\cdot \mathrm {OPT}(V,s,c,R)\) by trying all possible values \(2,4,\ldots ,2|V|\). Then let \(\Pi \) be the polyhedron (18) for this \({\bar{T}}\), \({\mathcal {T}}\), \(\tau \), and \(b({\bar{T}})\). We set x to be the incidence vector of an optimum solution to (VscR) and apply the construction in Sect. 5.2, but with the cost of f induced by \({{\,\mathrm{detour}\,}}\) instead of c (like in the work by Friggstad and Swamy [17]). We get a vector \((a,f,z)\in \Pi \) such that \({{\,\mathrm{detour}\,}}(f) \le \theta \cdot b({\bar{T}}) \cdot R\) and \(c(z)\le \frac{3}{4} \theta \cdot b({\bar{T}}) \cdot R\). So after adding these constraints the polyhedron \(\Pi '\) is still nonempty, and we can find a vector \((a,f,z)\in \Pi '\) in polynomial time. By the construction from the proof of Lemma 35 (where the last part simplifies to setting \(g=\frac{1}{\theta }g'\) because \(\theta =1-\tau \)), we get a solution \({\mathcal {P}}\) with \(b({\bar{T}})\) paths and

$$\begin{aligned} {{\,\mathrm{detour}\,}}({\mathcal {P}})&\le \ \frac{4}{1-\theta } \cdot c(z) + \frac{1}{\theta } \cdot {{\,\mathrm{detour}\,}}(f) \ \le \ \left( \frac{3}{1-\theta } + \frac{1}{\theta } \right) \cdot R \cdot \mathrm {OPT}(V,s,c,R) \\&= \ 8\cdot R \cdot \mathrm {OPT}(V,s,c,R). \end{aligned}$$

After splitting each path whenever it would exceed the detour bound R (cf. Lemma 2.2 in [16]), we get a set of paths that all have detour at most R, and the number of these paths is at most \(b({\bar{T}})+ 8\cdot \mathrm {OPT}(V,s,c,R) = 10 \cdot \mathrm {OPT}(V,s,c,R)\). \(\square \)

By the simple reduction from [9], this immediately implies an 11-approximation algorithm for the school bus problem.

6 Final result

We now prove Theorems 1 and 2 simultaneously. Let \(\alpha >1\) such that there exists an \(\alpha \)-approximation algorithm for the traveling salesman problem. Choose \(\varepsilon >0\) such that \(2\varepsilon +f(\varepsilon ) \le \alpha -1\), where f is the function from Theorem 23.

Compute a traveling salesman tour by the given \(\alpha \)-approximation algorithm and apply the tour partitioning of Theorem 5 to obtain a feasible solution. If the instance is not difficult, this solution does the job: its cost is at most \((\alpha +2 \cdot (1-\varepsilon ))\mathrm {OPT}\) or \((\alpha +1-\varepsilon )\mathrm {OPT}\), respectively.

If the instance is difficult, we compute a solution as in Theorem 23, which has cost at most \((3+f(\varepsilon ))\mathrm {OPT}\le (\alpha + 2 \cdot (1 - \varepsilon ))\mathrm {OPT}\).

We now set constants that yield the final claims in Theorems 1 and 2 (for \(\alpha =\frac{3}{2}\)). Applying Theorem 32 for \(\theta =1-\tau \) yields . If the instance is difficult, plugging in the bounds from Lemma 22 yields \(c({\mathcal {P}}) < ( \frac{1+\zeta }{1-\tau } + \frac{3\varepsilon }{\tau } )\mathrm {OPT}\). By Theorem 21 we obtain a traveling salesman tour of cost at most

$$\begin{aligned} \left( \frac{1+ \zeta }{1-\tau } + \frac{3\varepsilon }{\tau } + \frac{3\rho }{(1-\rho )(1-\tau )} \right) \mathrm {OPT}. \end{aligned}$$

Let \(\tau =0.071\), \(\rho =0.027\), and \(\varepsilon =\frac{1}{3000}\). Using the definition of \(\zeta \) in (8), our tour has length less than \(\frac{3}{2}-\frac{2}{3000}\). Together with Theorem 5, this implies the final claims of Theorems 1 and 2.

Using the combinatorial algorithm from Sect. 4, we get . If the instance is difficult, plugging in the bounds from Lemma 22 yields \(c({\mathcal {P}}) < ( \frac{1+\zeta }{1-\tau } + \frac{8}{\gamma -2} + \varepsilon (4+\frac{8}{\gamma -2}+2\gamma -\frac{\tau }{\tau -1}) ) \mathrm {OPT}\). Setting \(\gamma =148\), \(\tau =0.054\), \(\rho =0.022\), and \(\varepsilon =\frac{1}{6000}\) yields a tour of length less than \(\frac{3}{2}-\frac{2}{6000}\) in \(O(n^3)\) time. Combining this with Theorem 5 and the Christofides–Serdjukov algorithm, we get an approximation ratio of \(\frac{3}{2}-\frac{1}{3000}\) for Capacitated Vehicle Routing and \(\frac{3}{2}-\frac{1}{6000}\) for the unit-demand and splittable variants in \(O(n^3)\) time.

7 Comments on integrality ratios

The classical tour partitioning algorithm (Sect. 1.4) yields also an upper bound on the integrality ratio of the following well-known linear programming relaxation for Capacitated Vehicle Routing:

(20)

Let \(\text {LP}\) denote the value of this linear program (for a given instance), and let \(\beta \) denote the integrality ratio of the subtour relaxation of the traveling salesman problem, which results from (20) by omitting the constraints \(x(\delta (A)) \ge 2 \cdot d(A)\). It is easy to see that \(\sum _{v\in V}2d(v)c(s,v)\le \text {LP}\). By Theorem 5, this implies that the integrality ratio of (20) is at most \(\beta +2\). We know \(\frac{4}{3}\le \beta \le \frac{3}{2}\) [28].

Fig. 9
figure 9

An instance of Unit-Demand Capacitated Vehicle Routing with \(|V|=2k\) (here \(k=4\)). The capacity is 3, so \(d(v)=\frac{1}{3}\) for all \(v\in V\). Every dotted edge has length 0, every solid straight edge has length 1, other distances are given by the metric closure of this graph. (In particular, the solid bent edges have length 2.) A feasible LP solution, even to the stronger linear program, is given by the numbers next to the edges; thus \(\text {LP}'\le 2k+\frac{8}{3}\). Note that \(\sum _{v\in V}2d(v)c(s,v)=2k\). For large enough k, we have \(\sum _{v\in V}2d(v)c(s,v) > (1-\varepsilon ) \text {LP}'\). Nevertheless, only half of the customers are clustered

A natural question is whether our techniques lead to an improved bound on the integrality ratio. However, this seems to be difficult even for the strengthened linear programming relaxation where we replace \(x(\delta (A)) \ge 2 \cdot d(A)\) by \(x(\delta (A)) \ge 2 \cdot \lceil d(A)\rceil \). Let \(\text {LP}'\) denote the value of this stronger linear program. A crucial fact in our proof was that difficult instances are “clustered”. One might hope that even all instances with \(\sum _{v\in V}2d(v)c(s,v) > (1-\varepsilon ) \text {LP}'\) are “clustered”, but this is not always the case as the example in Fig. 9 shows.

We remark that solving the stronger linear program is NP-hard [13], but it can be approximated arbitrarily well because an approximate separation oracle can be obtained by enumerating all cuts for which \(x(\delta (A))\) is bounded by a constant (these can be enumerated in polynomial time by [25]).

Proving stronger upper bounds on the integrality ratios remains an open question.