Professional Documents
Culture Documents
MAT 392 FINAL Pawley-Traveling Salesman
MAT 392 FINAL Pawley-Traveling Salesman
MAT 392
Examples
As an example of the purpose of the TSP, consider the following figures. In each of these
graphs the weight or cost of an edge is simply the Euclidean distance between the pair of
vertices. Intuitively, the shortest tour to travel between the vertices of Figure 1 is to follow the
edges highlighted in red on the left side. TSP solutions in general are roughly elliptical, thus the
tour highlighted on the right is intuitively suboptimal. To further show the power of intuition in
solving the TSP, experiments have even been done with animals including monkeys and pigeons
[1] to show that even they have an intuitive understanding of the shortest tour between
objects.
2
Figure 1: The tour on the left is intuitively shorter than the one on the right.
Our intuition becomes less helpful when the vertices in the graph have a less elliptical
layout. For example, in Figure 3 it is not obvious which tour is the shortest, thus the value of
analyzing the TSP mathematically.
Nonexamples
Figure 4 shows three nonexamples of TSP solutions. The leftmost tour is not a TSP
solution because the TSP requires that the tour be a circuit. The circuit in the middle does not
contain every vertex and is therefore not a TSP solution. The rightmost tour is a nonexample
since the TSP requires that no vertices be repeated except for the beginning and ending vertex.
Intuitively, repeating vertices will result in suboptimal travel cost.
Applications
The TSP has many applications including optimizing school bus routing, circuit board
design, mail delivery, political campaigning, telescope guidance, and of course optimizing the
route taken by a traveling salesman. The software that my friend used to plan his forklift routes
while he worked at the Walmart distribution center near Gas City, IN almost certainly used
mathematics related to the TSP. Even without the numerous applications, the TSP would still be
important because it is an easy to understand yet hard to solve example of combinatorial
optimization.
Computational Difficulty
We will now further explore the difficult of the TSP. The TSP is a member of the NP-hard
complexity class. NP problems cannot be solved in polynomial time, but any potential solution
to an NP problem can be verified in polynomial time. Problems in the NP-hard class are even
harder than problems in the NP class in that they cannot even be verified in polynomial time.
4
Figure 5
Permutation Length
a,b,c,d,e,a 19
a,b,d,c,e,a 17
a,d,c,e,b,a 20
a,c,b,d,e,a 18
a,c,d,b,e,a 19
a,d,b,c,e,a 16
a,d,e,c,b,a 19
a,b,d,e,c,a 19
a,b,e,d,c,a 22
6
a,c,b,e,d,a 21
a,c,e,b,d,a 19
a,d,c,b,e,a 19
The permutation a,d,b,c,e,a has length 4 +2+2+5+3=16and is therefore the shortest Hamilton
circuit for the graph and the TSP solution to the tour.
Figure 6: Solution
Graph Reduction
There are no known algorithms in the polynomial complexity class that can solve the
TSP. Furthermore, it is strongly suspected that no such algorithm with polynomial complexity
exists. Thus, for any given algorithm we choose to use, any reduction in the number of vertices
in the graph has the potential of greatly reducing the computational time. Reductions generally
take two forms, either 1) deleting unnecessary vertices such as a vertex that is part of a sub-
path that must always be followed the same way in every Hamilton circuit of the graph, or 2)
deleting unnecessary edges, for example, any edge that is not the shortest edge between a
given pair of vertices. Another example of an unnecessary edge can be found in specific cases of
non-symmetric graphs (graphs such that for any vertices A and B, the travel cost
( A , B ) does not always equal(B , A )¿ .
For our application to the Taylor University campus and for the most general
applications, the graph being studied will be complete, non-directional, and will have only one
edge between each pair of vertices, thus neither of the two reduction methods will be helpful.
Even in other cases, reductions may not always be possible, and they may still not reduce the
7
problem enough for it to be solvable in a reasonable amount of time. In all these cases, we may
find that a good approximation of the solution is sufficient for our purposes.
3
cost of the Eulerian cycle. The cost of the resulting tour is therefore no more than times the
2
cost of an optimal tour.
Christofides algorithm above requires that we find a minimum cost spanning tree. For
our specific application, this will not be too difficult to accomplish by hand using Prim’s
algorithm. Prim’s algorithm is likely familiar to any beginner computer scientist because of its
ease of programming and its usefulness as an example of a greedy algorithm (it uses the
heuristic of making the locally optimal choice at each stage of the algorithm). Prim’s algorithm
for finding a minimum cost spanning tree can be described as follows:
1. Start the tree by choosing an arbitrary vertex.
2. Connect the tree to a vertex not in the tree by choosing the minimum cost edge from
the tree to a vertex not on the tree.
3. Repeat step 2 until all vertices are in the tree.
Concorde Software
The computer program Concorde contains over 130,000 lines of code and has been used
to solve TSPs with up to 85,900 vertices. The goal of this program is to find exact solutions to
large TSPs and is not as concerned with quickly finding solutions to smaller problems. Concorde
can, within several minutes, find solutions to TSPs with thousands of vertices. However, even
this program has its limits. For example, the World TSP involving 1,904,711 cities is out of range
for an exact solution by Concorde because of its size. The algorithm used by Concorde is
extremely complex and is beyond the scope of this article.
B: Bergwall
E : English
G : Gerig/Breu
O : Olson
M : Samuel Morris
S: Swallow Robin
W : Wengatz
The measured distance in meters of an edge–for example between Wengatz and Olson–will be
denoted as ( W , O )=134 . We will measure the distances with the Google Earth website, with
distances following walkways or streets on Taylor’s campus, and crossing streets only at
designated crosswalks. All distances will be measured roughly from the point of the front desk
in each residence hall, except for measurements from Gerig/Breu which will be measured from
the doorway between the Gerig and Breuninger lobbies. The goal is for any route between a
pair of dorms to be possible for a person of either gender provided that the lobby is open, thus
routes may go through any lobby door, but not through a wing or hallway.
Data Collection
Since there are 7 vertices, if I arbitrarily begin my measuring process at vertex W , I will
need to measure 6 paths between W and each member of the set {B , E , G, O , M , S }. For the
next vertex I choose to measure from, say O , we will have to measure 5 paths to every other
dorm except Olson and Wengatz. Thus, the number of edges to be measured is greater than or
6
equal to ∑ i=21. The actual number of distances we will need to measure may be greater than
i=1
21 since we may need to measure multiple paths between a pair of dorms to identify which is
the shortest. However, the final graph will contain exactly 21 edges since we will only retain the
shortest edge between any pair of vertices.
10
( 7−1 ) !
There are therefore =360 Hamilton circuits for the set of set of vertices
2
containing dorms for Taylor University. This is clearly too many permutations to list out by hand
to determine the shortest.
3. Now G is the vertex in T 2' that is closest to T 2 since ( W , G )=178. Thus T 3={ W , O ,G } .
11
4. Now E is the vertex in T 3' that is closest to T 3, since ( G , E )=142 is the shortest edge
adjacent to T 3 that is also adjacent to a vertex in T 3 ' . Thus T 4={W , O, G , E }
5. Continue this process to find that the minimum spanning tree T spans G with the edges
{ (W ,O ) , ( W , G ) , ( G , E ) , ( W , B ) , ( O, M ) , ( M , S ) }.
According to Christofides algorithm, the sum of the edges of T ,c ( T ) , is no more than the travel
cost of X , c ( X ) (the cost of the optimal TSP tour). Thus c ( T ) =1416 ≤ c( X ).
1
Thus M ={ ( B , S ) , ( W , E ) } . As stated above on page 7, c ( M ) ≤ ⋅c ( X ). Since c ( M )=976 , then by
2
algebra 1952 ≤ c ( X ) .
Combine T and M to find the Christofides Approximation
The union of T and M is shown in Figure 9 below. This graph contains an Eulerian cycle
3
and is guaranteed to be no more than times the travel cost of X . Thus,
2
3
2392=c ( T ∪ M ) ≤ ⋅ c (X ), and 1595 ≤ c (X ).
2
Figure 9: Union of minimum cost tree T and minimum cost perfect matching M
Notice that if we were to follow the red edges on Figure 9, arbitrarily beginning and ending at
vertex S, we would follow either S− M −O−W −E−G−W −B−S or
S− M −O−W −G−E−W −B−S . Neither of these tours satisfy the conditions of a TSP solution
because W is repeated. We can remove this issue and further decrease our travel costs by use
of the triangle inequality. The sub-paths G−W −B and E−W −B in the two tours can be
shortened using the triangle inequality to G−B and E−B , respectively. Thus, our two original
tours can be shortened to S− M −O−W −E−G−B−S or S− M −O−W −G−E−B−S. The
13
first tour has a travel cost of 107+510+ 134+234 +142+383+742=2252. The second tour has a
travel cost of 107+510+ 134+178+142+ 410+742=2223 . Thus, the second tour, shown in
Figure 10, is the best option for our Christofides approximation, denoted as C . We now have a
3
potential TSP solution, and we know from Christofides algorithm that 2223=c ( C ) ≤ ⋅ c ( X ) .
2
Thus, 1482 ≤ c( X ). Of the 4 lower bounds we have come up with so far, the most useful comes
from M . When we combine that lower bound with the upper bound of 2223 (since C is a
potential solution, any potential solution that costs more than C can be disregarded), we find
that 1952 ≤ c ( X ) ≤ 2223. In terms of the actual problem, this means that the TSP solution for the
Taylor residence halls has a travel cost more than 1952 meters and less than 2223 meters.
case is the high variability of the edge weights (σ =237.5 while μ=464.6). Step 2 of Prim’s
algorithm above provides a concrete example of how this variability increases the robustness of
the algorithm. Edge ( W , O )=134 and the second shortest edge adjacent to W is ( W , G )=178.
Edge ( W , G )would need to be more than 44 m shorter before it would be chosen over ( W , O ).
Thus, even moderate differences in the measurements still would not affect the choice of
(W , O) in constructing the minimum cost spanning tree.
Future Research
Specific Extensions
We have found a potential solution to our TSP at Taylor and have fairly close upper and
lower bounds to use with other approximation methods. I would like to try several other
approximation algorithms to try to close in the distance between our estimates. I also want to
learn how to use the Concorde program to find an exact solution, and to study the robustness
of the program itself. I am also intrigued by how the TSP solution would change based on
whether the traveler is male or female and can enter certain residence halls through side doors
rather than being restricted only to lobby doors. Another interesting question to investigate is
how the problem will change if we measure distance “as the crow flies” rather than on
sidewalks and crosswalks.
I am further interested in exploring other problems on Taylor’s campus using graph
theory and the TSP. For example, I am fascinated with the idea of working with the Admissions
Department to plan their tour routes for prospective students, or to partner with a computer
scientist to design an app to optimize walking between classes based on a person’s class
schedule.
General Extensions
In addition to the possible extensions to apply to the Taylor campus, I am curious about
some other applications of the TSP. For example, although many TSPs already consider 3-
dimensional changes in elevation, it would be interesting to study how the TSP could model a
more interesting 3D space than Upland, IN. Applications here could include graphs made in
more mountainous terrain or between planets. The graph theory in the TSP as I have studied it
15
models 3D space on a 2D graph, so I am also curious as to how graph theory could be used to
model higher dimensions, for example modeling 4D space onto a 3D or 2D graph.
I am also excited to see how further developments in quantum computing affect
whether even larger TSPs can be solved via Concorde or other algorithms.
Conclusion
In this paper we have examined some of the foundational knowledge necessary to
understand and approximate the TSP. Now, if you are ever a part of the next Swallow Robin
open-house that the men of Samuel Morris put on every year, you will know a lot more about
how to optimize your travel route as you begin at Swallow, tour through every dorm on campus
picking up partiers along the way, and end back in Swallow for the finale.
16
Bibliography
1. Cook, William J., David L. Applegate, Robert E. Bixby, and Vasek Chvatal. The traveling
salesman problem: a computational study. Princeton university press, 2011.
2. Hoffman, Karla L., Manfred Padberg, and Giovanni Rinaldi. "Traveling salesman
problem." Encyclopedia of operations research and management science 1 (2013): 1573-
1578.
3. Higham, Nicholas J., Mark R. Dennis, Paul Glendinning, Paul A. Martin, Fadil Santosa, and
Jared Tanner, eds. Princeton companion to applied mathematics. Princeton University
Press, 2015.
4. Jünger, Michael, Gerhard Reinelt, and Giovanni Rinaldi. "The traveling salesman
problem." Handbooks in operations research and management science 7 (1995): 225-
330.
5. Michaels, John G., and Kenneth H. Rosen, eds. Applications of discrete mathematics. Vol.
267. New York: McGraw-Hill, 1991.
7. Nahin, Paul J. "When Least Is Best: How Mathematicians Discovered Many Clever Ways
to Make Things as Small (or as Large) as Possible." (2003).
17