| Suppose you are climbing a hilly terrain in a deep fog. We will call this terrain a search space. You can only see the area immediately around you, but you have a device for measuring your elevation. How do you find the highest point in the terrain? | ![]() |
| Your first thought might be to climb upwards, always walking towards the highest point you can see around you: this is an example of a greedy algorithm. Eventually you will reach the top of a hill. | ![]() |
| This hilltop, however, might not be the highest point in the terrain. To look for higher points, you will have to start walking downhill for a while. Eventually, you will want to start your uphill approach again. | ![]() |
| If you do this too soon, you will end up back at the same hilltop. | ![]() |
| When you reach a new hilltop, you can measure its height and compare it to the largest hill you have visited so far. You may end up walking around in circles, and never find the highest hills. | ![]() |
Charlie describes a tabu search as
"basically a way of excluding bad data - places where the kidnappers won't go to isolate where they will go."
Actually, the main purpose of excluding choices in a tabu search is to prevent cycling.
While tabu search can be applied to problems like the
Travelling Salesman Problem
where the goal is indeed to produce a path,
it is important to distinguish between the path the algorithm
follows in the search space and the elements of that search space (which happen to be paths).
The tabus in our list impact our path through the search space; they do not remove particular paths from the search space.
A particular implementation of tabu search can pragmatically
prevent exploring particular areas of the search space where good solutions are unlikely to be found,
but the main purpose of excluding choices in a tabu search is to prevent cycling.
Here is an outline of the basic tabu search heuristic. First the notation:
Here is the algorithm:
Modifications can be made to the above algorithm, such as allowing variable tabu list lengths, replacing N with a subset to reduce computation time, or adding aspiration criteria that allow tabus to be overriden on occasion. For instance, we may allow moves prevented by the tabu list if they lead to points in X where f has a larger value than f(P), the current best solution.
Choose 5 cities, and look up the cost for travelling between them (or make them up). Assume the cost is the same
in both directions, so that you have 10 different costs, represented by the edges of the graph to the right.
The Travelling Salesman Problem
is to find the Hamiltonian Cycle (round trip path visiting
each city exactly once) of minimal cost. There are only 12 different paths, so it is feasible to compute the cheapest
cost, but let's try to use this problem to illustrate a tabu search.
In the tabu algorithm presented above, X is the set of Hamiltonian cycles. The function f applied to a cycle is the total cost of the route times -1 (so that maximizing f corresponds to minimizing the cost. Alternatively, replace "largest" with "smallest" and ">" with "<" in the algorithm.) Choose a value for T.
For the move set M, let's use moves of the form "swap the order in which we visit Ithaca and NYC given that these cities consecutively in the cycle". Such a move is its own inverse. For a given cycle, there are 5 moves that can apply. Now, apply the tabu search. Do you find the best solution before cycling occurs?
Try changing the move tabus as follows: