Approx Lecture03-1 TSP
Approx Lecture03-1 TSP
1.1 Overview
This first lecture started with some organisational details (not mentioned in these notes). This
was followed by an introduction to the field of Algorithmic Modeling and a summary of the
goals of this course. The last part of the lecture dealt with the Vehicle Routing Problem, viz.
the Traveling Salesman Problem and the multiple Traveling Salesmen Problem as modeling
challenges.
Algorithms are solutions to problems. But what are the associated problems? And how do
we get from a problem to a solution? The answer is through algorithmic modeling and design,
which is an important part of the development cycle of any system.
Algorithmic modeling is applied to a multitude of problems. All systems in computer science
are ‘algorithmic systems’. In this course the emphasis will lie on problems in the domain of
programming and optimising business processes, in which field there are many challenging
problems. Algorithmic modeling applied to business processes is widely applied in domains
like management science and operations research.
Algorithmic modeling and design uses a more or less standard approach to solve algorithmic
problems. In this approach there are different phases:
The result of this approach should be an effective, implemented (component of an) algorithmic
system. In this course we will deal only with the first three phases.
Algorithmic systems is a prominent area of research world-wide. Many journals and confer-
ences deal with this topic and the results of research are applied in many disciplines. Some
examples:
1-1
Lecture 1: September 2, 2003 1-2
• geographic information systems and their use in e.g. car navigation systems,
• planning and scheduling of activities, for example the planning of transports along a
supply chain,
• etc.
As one can see, not just computer scientists apply algorithmic modeling.
1.2.1 Objectives
• see the typical modeling tools of algorithmic design such as: networks, integer and
mixed integer programming, logical formulae, distributed processes, transition systems,
and Petri nets. The first four of these frameworks will certainly be dealt with in this
course.
• learn to apply these tools on a variety of complex problems and use them in deriv-
ing optimal (or approximate) solutions which can be found in a reasonable amount of
computational effort.
The problem of how to transport goods efficiently from producer to customer is ancient, but
it was first studied as a problem in mathematics and computer science by Dantzig and co-
workers in the 1950’s. In 1959, Dantzig & Ramser for example published papers on The Truck
Dispatching Problem and on the Optimum Routing of Gasoline Trucks. The general problem
they studied is now widely known as the Vehicle Routing Problem (VRP). Some modeling
tools will be demonstrated using this case.
Lecture 1: September 2, 2003 1-3
• Depots. At a depot, goods are picked up for delivery. There may be one or more of
these and they have specific locations.
• Vehicles. There may be one or more vehicles. Each vehicle may have specific charac-
teristics like a cost (for deploying it) and a ‘capacity’.
• Customers. Customers all have an address or location. This will be a place where goods
have to be picked up or where goods must be delivered. Customers may have demands
(request for a certain amount of goods) but also goods may have to be picked up for
delivery to the depot or to another customer. There may be time windows when goods
can be picked up or delivered.
• Routes and their costs. This may include a specification of the allowable routes and
such things as the costs associated with a route or the time it takes to travel it. Even
stochastic information may come in like the expected travel time of a certain (part of
a) route.
• Constraints. Vehicles may have a limited ‘capacity’, routes may be limited by driver
schedules which may have to conform to legal requirements, customer demands may
always have be met in full, time windows may be hard (no delivery outside tim window
allowed) or soft (a penalty is incurred when delivery is outside time window), etcetera.
In addition, there are one or more objective functions associated with an instance of the VRP.
This may include objectives like: minimize the total cost, minimize the total distance traveled
by the vehicles, minimize the travel time, realize all demands and minimize the number of
vehicles used, employ a fixed number of vehicles, etc.
In the VRP the notion of ‘vehicle’ is an abstraction of any moving entity: a truck, a passenger
car, a robot, a person, a drill on a plate of metal, etc.
All locations (depots and customers) together form the nodes of a network, with edges repre-
senting the shortest/cheapest way of traveling from one node to another. We assume that for
all locations i and j we know the cost cij of traveling directly from i to j (cij ≥ 0). We also
assume that there are no edges from any node i to itself. We can then distinguish different
cases:
• the unrestricted or asymmetric case. Costs cij may take any value.
• the symmetric case. cij = cji , 1 ≤ i ≤ n, 1 ≤ j ≤ n, i 6= j, where n is the number of
locations in the network.
• the metric case. The triangle equality (cik ≤ cij + cjk ) holds for any locations i, j and
k in the network.
Lecture 1: September 2, 2003 1-4
• the geometric or Euclidean case. The locations are embedded in the 2-dimensional plane
and the cost cij is equal to the Euclidean distance between i and j.
We remark that all inputs to a VRP (or any other algorithmic problem) must be finitely
specified, e.g. as reals in finite precision or as elements of Q.
Exercise. Argue that a Euclidean network is symmetric and metric.
The Traveling Salesman Problem (TSP) is the VRP with only a single depot and a single
vehicle (with unrestricted capacity). In addition, for the TSP the goal is to design a tour of
least cost, such that the tour starts and ends at the depot and each location in the network is
visited exactly once (with the exception of the depot). Tours which satisfy these constraints
are called “feasible” tours.
It would seem logical to enumerate all possible tours and choose the best one, but to enumerate
all the tours one must consider (n−1)! tours where n is the number of locations. Since (n−1)!
grows extremely quickly as n → ∞ it is in most practical cases impossible to enumerate all
the possibilities. Striving to find a good approximate solution is more effective.
xi
Exercise. Show that n! ≥ ( ne )n . (Hint: use that ex = 1 + x + . . . + i! + . . . .)
The question then arises how different cases of the TSP are different and what they have in
common.
Proposition 1.1 (Kanellakis and Papadimitriou, 1980) Any asymmetric TSP on n lo-
cations can be reduced to a symmetric TSP on 3n locations.
Proof: Let i and j be nodes in an asymmetric network G and cij and cji the cost to travel
from i to j and from j to i respectively. We will create a network G0 as follows. With every
node i in G we create three nodes in G0 : i1 , i2 and i3 , which are connected as follows:
i1 — i2 — i3
For all i and j, the (directed) edge (i, j) with cost cij in G is replaced by a (undirected) edge
(i3 , j1 ) with cost cij in G0 . The edges between i1 and i2 and between i2 and i3 are given
associated cost zero. It is not desirable that the other edges incident to i2 are ever used
so they are assigned a cost that is so large that the edge will never appear in an optimum
solution. For example n2 times the largest cost of any edge in the original asymmetric TSP.
Thus, for every node i in G, all ingoing edges of i ‘correspond’ to edges now ending in i1 ,
all outgoing edges of i ‘correspond’ to edges now starting in i3 , but all going both ways
(symmetric property of the new network).
Lecture 1: September 2, 2003 1-5
Any feasible TSP tour of finite cost through the symmetric network G0 now corresponds to
a feasible TSP tour through the asymmetric network G (and vice versa) once we orient it so
i1 is visited before i3 for some i. (Note that it follows by construction that then j1 is visited
before j3 for every j.) Nodes i2 are used to make sure that any route of finite cost that passes
through i1 must subsequently pass straight on to i3 and vice versa, because this is the only
opportunity to visit i2 . In this way the connection between nodes i and their counterpart in
G0 is enforced in the TSP tours.
Theorem 1.2 (Kumar and Li, 2002) Any asymmetric TSP on n locations can be reduced
to a symmetric TSP on 2n locations.
There is a related problem to the one described above, namely the multiple Traveling Salesmen
Problem (m-TSP). In this problem there is still only one depot, but there are m (m ≥ 1)
vehicles v0 , . . . , vm−1 , where each vi has a cost ci . We assume that c0 ≤ . . . ≤ cm−1 .
For r ≤ m, a set of r tours will be called ‘feasible’ if all tours in the set start and end at
the depot, the tours only overlap at the depot and are otherwise disjoint, and each location
(other than the depot) is visited exactly once (by one of the tours). Given a feasible set of
r tours, the locations can be visited by dispatching r vehicles in parallel. In fact, it will be
cheapest to dispatch v0 , . . . , vr−1 . This motivates the following definition.
Pr−1
Definition 1.3 The cost of a feasible set of r tours is equal to i=0 ci plus the sum of the
costs along the tours.
The m-TSP asks to determine a feasible set of r tours (for some r ≤ m) that has least (total)
cost. Clearly, a solution to the m-TSP implies a way to dispatch a subset of the available
vehicles simultaneously and supply all customers at least total cost.
The following fact is due to Bellmore & Hong (1974) for the asymmetric case and to Rao
(1980) for the symmetric case.
Proof: We only consider the case of symmetric networks and assume w.l.o.g. that m ≥ 2.
To prove the result we will use ‘implicit partitioning’ of a TSP, by noting visits to (up to) m
special locations.
Let G be the network associated with an m-TSP. Let G have n − 1 locations (‘the network’)
and a depot h0 . We now create a network G0 as follows. Keep the network of locations but
duplicate the depot m−1 times so that there are now m ‘depot nodes’ h0 , . . ., hm−1 . Connect
h1 , . . . , hm−1 to the network by duplicating the connections like h0 has them. Finally, connect
h0 , . . . , hm−1 in a ‘backbone’:
h0 — h1 — . . . — hi — . . . —hm−1
A feasible set of r tours T0 , . . . Tr−1 for the m-TSP in G can easily be translated into a TSP
tour in G0 , e.g. as follows. The tour starts at the original depot h0 , follows T0 but instead
of returning to h0 the tour steps to hm−1 . The tour then goes up the backbone to hr−1 ,
enters the network following Tr−1 , and then continues by returning to hi and going back into
the network following Ti , returning to hi−1 and so on, for i from r − 2 down to 1. After
traversing T1 the tour returns to h0 (rather than h1 ) again. Clearly, there are many other
ways of circling T0 , . . ., Tr−1 in G0 , by varying the points on the backbone where one returns.
Every time the corresponding TSP tour leaves the backbone and goes into the network again,
a different vehicle is used in the m-TSP and the related cost must be charged. If the TSP
tour passes through a number of h-nodes in succession, either the old or the new vehicle may
be used but no extra cost should be incurred. These costs of using the vehicles need to be
represented in the network G0 so they are accounted for in the TSP tour. This is done as
follows:
• add 21 ci to the cost of all edges leaving/entering a hi into the network (0 ≤ i ≤ m − 1),
and
• assign to the edge between hi and hi+1 (0 ≤ i ≤ m − 2) a cost of 12 ci − 12 ci+1 .
Claim 1.5 Any feasible set of r tours for the m-TSP in G can be transformed into a TSP
tour in G0 of the same cost.
Proof This follows from the given transformation. Note that the cost of entering with T0 into hm−1 and
moving up to hr−1 equals
1 1 1 1 1 1
cm−1 + ( cm−2 − cm−1 ) + . . . ( cr−1 − cr ) = cr−1
2 2 2 2 2 2
and this is exactly half the cost for using vr−1 . Another 12 cr−1 is picked up on the first edge leaving into the
network following Tr−1 . For the other vehicles vi the cost is picked up when entering and leaving the backbone
at hi . For vehicle v0 a cost of 12 c0 is picked up at the beginning of the tour and another 21 c0 is picked up at
the end.
Conversely, any TSP tour in G0 can be factored into a feasible set of r tours T0 , . . . Tr−1 of the
‘network’, assuming the TSP comes into (or leaves) the backbone r times and all backbone-
visits are collapsed as visits to h0 . (Note that all nodes of the backbone must eventually be
visited in a TSP tour of G0 .)
Lecture 1: September 2, 2003 1-7
Claim 1.6 Any TSP tour in G0 can be transformed into a feasible set of r tours for the
m-TSP in G of the same cost.
Proof The cost of the r tours T0 , . . ., Tr−1 in G is clearly the same as in G0 . We only need a policy of assigning
vehicles so their cost adds up to the cost the TSP incurs in G0 for entering/leaving/traversing the backbone.
Orient the TSP tour so the first step away from the depot h0 leads into the network. Do this using vehicle
v0 : a cost of 12 c0 is already picked up, and the remaining cost of 12 c0 will be accounted for at the end of the
tour. Proceeding inductively, suppose at any time in the tour we return into the backbone at some (unvisited)
node hi , using some vehicle v. Upon entering the backbone at node hi a cost of 21 ci is picked up. Now three
possibilities can occur:
Case 1: the TSP tour immediately steps back into the network again, to traverse the next ‘subtour’ of the
network. Do this using vehicle vi : the remaining cost of 12 ci is picked up when leaving into the network.
Case 2: the TSP tour moves up to a hj (some 0 ≤ j < i) and steps into the network again from there (unless
j = 0). Observe that the cost for entering into hi and moving to hj adds to:
1 1 1 1 1 1
ci + ( ci−1 − ci ) + . . . ( cj − cj+1 ) = cj .
2 2 2 2 2 2
Do this using vehicle vj . Also use it when leaving from hj into the network: with the additional cost of 12 cj
that is picked up, vj is fully accounted for. If j = 0, the cost of moving to h0 completes the remaining cost of
1
c that was needed to account for v0 .
2 0
Case 3: the TSP tour moves down to a hj (some i < j ≤ m − 1) and steps into the network again from there.
Observe that the cost for entering into hi , moving to hj and stepping into the network adds to
1 1 1 1 1 1
ci + ( ci − ci+1 ) + . . . ( cj−1 − cj ) + cj = ci .
2 2 2 2 2 2
This completes the dispatching strategy and proves the claim. Note that no vehicle is dispatched more than
once.
Observe that in the transformation one must apparently allow edges with negative cost. In a
construction due to Hong and Padberg (1977) this is circumvented, at the expense of having
n + m + 4 rather than n + m − 1 locations in the equivalent standard TSP.
Exercise. Consider the ‘strict’ m-TSP in which it is required that all m vehicles are used.
Modify the given transformation to show that also the strict m-TSP on n locations can be
reduced to a standard TSP on n + m − 1 locations. (Hint: do not connect the nodes in the
backbone.)
Conclusion: if the standard TSP has a good solution, then this will translate to a good
solution for the m-TSP. Unfortunately, there is no known polynomial-time algorithm that
solves the TSP problem exactly.
Lecture 1: September 2, 2003 1-8
References
[2] S. Hong, M.W. Padberg. A note on the symmetric multiple traveling salesman problem
with fixed charges. Oper. Research 25 (1977) 871-874.
[3] P-C. Kanellakis and C.H. Papadimitriou. Local search for the asymmetric traveling sales-
man problem. Oper. Research 28 (1980) 1086-1099.
[4] R. Kumar and H. Li. On asymmetric TSP: transformation to symmetric TSP and per-
formance bound. Submitted to J. Oper. Research (2002).
[5] M.R. Rao. A note on the multiple traveling salesmen problem. Oper. Research 28 (1980)
628-632.