Meta Problem
Meta Problem
Meta Problem
Introduction
Heuristics:A heuristic method is a procedure that is used to find a good feasible solution that is at least reasonably close to being optimal. A well designed
heuristic method can usually provide a solution that is nearly optimal or can
conclude that no solution exists. A disadvantage of heuristic methods is that it
is usually designed to fit a specific problem type rather than a variety of applications.
Metaheuristics:Metaheuristics are general solution methods which combine
general structure and strategy guidelines for developing a specific heuristic
method to fit a particular kind of problem.
Key ideas of metaheuristics:
Use the informaion being gathereed to guide the search towards the global
optimimum.
It is capable to escaping from a local optima.
Examine Neighborhood Structure - some solutions are similar to other
neighbour, so we need a neighbourhood structure.
The objectives of metaheuristics are:
Search using structure without getting stuck.
Dont keep trying the same solutions.
Combine one or more properties of good solutions when generating new
solutions.
Advantage of metaheuristics:
It tends to move relatively quickly towards very good solutions, so it provides a very efficient way of dealing with large complicated problems.
Useful in cases where traditional methods get stuck at local minimas.
Common area of application is combinatorial optimization problems.
Disadvantage of metaheuristics:
There is no gaurantee that the best solution found will be the optimal
solution.
Basic Definitions
We will use the travelling salesmen problem (TSP) on the graph as an example
problem for the metaheurisics discussed. Travelling Salesman Problem(TSP):
A salesman spends his time visiting n cities (or nodes) cyclically.
Starting from the home city, the salesman wishes to determine which
route to follow to visit each city exactly once before returning to the
home city so as to minimize the total distance of the tour.
The difficulty of the travelling salesman problem increases rapidly as the number of cities increases. For a problem with n cities and a link between every
pair of cities, the number of feasible routes to be considered is (n-1)!/2. Due to
enormous difficulty in solving the TSP, heuristic methods guided by the metaheuristics, address such problems.
Heuristic methods involve sequence of feasible trial solutions, where each solution is obtained by making certain adjustment in current trial solution.
Subtour Reversal: Adjusting a sequence of cities visited in the current solution by selecting a subsequence of the cities and simply reversing the order.
Eg.
Initial trial solution is the following sequence of cities visted : 1-2-3-4-5-6-7-1
with total distance = 69.
2
While reversing the sequence 3-4 , we obtain new trial solution: 1-2-4-3-5-6-7-1
with total distance = 65.
Neighbors: We say 2 tours/solutions/cycles are neighbors if we can transform
one to the other by a subtour reversal.
Degree of Neighbor: The degree of a neighbor A to B equals the minimum
number of subtour reversals required to get from A to B.
Local Minimum: A local minimum is when no neighbors are better i.e no
neighbours subtour gives a better solution.
Problems like TSP have many local minimas. If we look into the gradient search
approach to solve TSP, the steps are:
Pick a cycle
Take best neighbour
Repeat until local minima is obtained.
Because of local mininma, this may not yield good solution.
Simulated Annealing
The process of simulated annealing is inspired by the physical process of annealing from chemistry. Annealing involves slowly heating the metal and then
slowly cooling the substance by varying the temperatures until it reaches the
low energy stable state, resulting in a global reduction in energy, but locally it
may result in an increase in energy. These changes in energy follow a Boltzmann
distribution.
The key idea in simulated annealing algorithm is to select an appropriate temperature schedule which needs to specify the initial, relatively large value of T
and then decrease the value of T. Starting with relatively large values of T,
makes probablity of acceptance relatively large, which enables the search to
proceed in almost all random directons. Gradually decreasing the value of T
as the search proceeds, gradually decreases the probablity of acceptance, which
emphasizes on climbing upwards.
3.1
Acceptance probabilities
Must be nonzero when e0 > e, meaning the system might move to the new
state Xn0 even it is worse than the current one. This feature prevents the
method from being stuck in local minimum.
When T goes to zero, P (e, e0 , T ) must tend to be zero when e0 > e and to
a positive value if e0 < e.
Originally simulated annealing is described as setting P (e, e0 , T ) = 1 whenever
e0 < e, which means the algorithm moves downhill when there is a chance,
irrespective of T .
3.2
f (Xn )f (Xn )
T
0.2f (x)
T2
0.5T1
T3
0.5T2
4
3.3
1-2-3-4-5-6-7-1
Distance = 69
1-2-4-3-5-6-7-1
Distance = 65
Distance = 64
Tabu Search
The key process is finding the local optima and then continue the search by
allowing non improving moves (or illegal moves, called as tabu moves) to the
best solutions in the neighbourhood of the local optima.
One of the features of tabu search is to avoid bad solutions which have already
been explored i.e use of memory to guide the search by using tabu list to record
recent searches. Essentially, Tabu search makes some moves illegal by maintaining a list of tabu moves.
For example, if A is a neighbor of B in the TSP then B is a neighbor of A. But
if you have already chosen B over A, there might not be any reason to search
A again.
Length of Tabu List: The length of the list signifies the balance between
intensify/diversify.
5.1
Initialize
Iteration:
Compare all possible moves
Take best (even if it is worse than the current solution)
Update List
Stop after a fixed time or CPU usage, or there are no feasible moves.
The optimal solution is the best solution so far.
5.2
1-2-3-4-5-6-7-1
Distance = 69 Tabu
Distance = 65
Distance = 64
Keep running for more iterations until algorithm terminates at a point where
we obtain the best trial solution as the final solution.
While running Tabu search it is necessary to keep track of the Tabu list and the
best solution so far. So, delete few links from the tabu list after some number
of iterations and while doing this, delete the oldest links of tabu list.
Advantage:
This method is easy to integrate with other methods.
Disadvantage:
Tabu search approach is to climb the hill in the steepest direction and stop at
top and then climb downwards to search for another hill to climb. The drawback
6
is that a lot of iterations are spent climbing each hill rather than searching for
tallest hill.
Genetic Algorithms
6.1
mutate randomly
Possibly throw out all solutions if necessary.
Many decisions affect the effectiveness of genetic algorithm for any particular
problem:
Population Size
Selection Rule
Combination rule
Mutation Rule
Stopping Rule
A genetic algorithm is often good for solving hard optimization problems which
can easily be represented in binary.
6.2
Algorithm
Identify all links from current in either parent that are not already in the
tour.
Randomly select one of the available.
Check for mutation.
The next city is one these
Use this link to complete the tour.
6.2.2
Example
1-2-4-6-5-3-7-1
1-7-6-4-5-3-2-1
Generate a child:
1-2-4-5-6-7-3-1
The full example is in the text.
Parents are selected using a fitness function, if we were given the choice
amongst the following:
1. f (x1 ) = 69
2. f (x2 ) = 65
3. f (x3 ) = 79
4. f (x4 ) = 86
We would choose numbers 1 and 2 as they are the lowest distance. Alternatively
for some problems we would choose to select those which have the highest fitness.
Have mutations to randomly allow other links as this help genetic algorithms to
explore a new/better feasible solution. Essence is that parents generate children
(new trial solutions) who share some features of both parents. Since the fittest
members of the popluation are more likely to become parents than others, a genetic algorithm tends to improving populations of trial solutions as it proceeds.
References
Text Book
Class Notes
Last years scribe notes for Metaheuristics