In this post we will look at an example of a cycle that is a local minimum for the moves that are allowed
for the standard simulated annealing approach to the Travelling Salesman Problem
(see this post). Note that the Travelling
Salesman Problem is actually a convex integer programming problem; so how do we encounter a local
minimum? The answer is that in some sense the simulated annealing process relies on moving in “directions”
of the cycle state space that are limited enough that relative to these restricted moves, we encounter
local minima. Now, actually finding an explicit example of how this occurs is a little tricky.
In particular, we show that the following cycle is a local minimum:
The dimensions of this cycle have been carefully chosen to give a local minimum;
e.g. if we chose the top vertices to have a
y-value of 3.0, then the cycle is no longer a local minimum.
Note, that this cycle is not a global minimum. In fact, the following cycle actually has smaller
length:
However, it takes MORE than one of our simulated annealing flips to go from the local minimum to
the smaller cycle.
In the following sections, we will use a brute force check to verify that the local minimum is in fact
a local minimum. That is, we will check every cycle that is obtained from our local minimum by one flip
has a cycle length at least as large as the local minimum.
Creating the Local Minimum
Now let’s look at creating the local minimum. We use the following from ‘my_src.py’.
Let’s get the local minimum and the shorter cycle.
We saw the graphs of the two cycles and their lengths at the beginning of the post.
Verify the Local Min is a Local Min
Now let’s verify that the local minimum is actually a local minimum. We will simply compute
every possible flip, and find its length. For example, here is a graph of random flip of
the local minimum:
Let’s now get all of the lengths of the local moves. We will be making use of the following
function from my_src.py:
Let’s now get the lengths of the local moves, and let’s make some graphs of some interesting
examples. Also, let’s raise an exception if we see any local move that has a length less than
that of the local minimum.
We get the following output:
So we see that all of the local moves are at least as long as the local minimum. Some have the same
length; graphing these we infact see that these cycles have the same shape but are an order preserving
permutation of the original vertices. Here are their graphs:
Now, let’s take a look at all of the local move lengths.
So we see that the local minimum is in fact a local minimum when we restrict to the flips
used for simulated annealing in the travelling salesman problem.