Sie sind auf Seite 1von 12

Traveling Salesman Problem

2013 Even

Given a network of cities, finding the shortest possible trip


through a given set of cities, visiting each city once before
finally returning to starting city
TSP can be represented by a complete weighted graph G = (N,
A) with
N, set of n= |N| nodes (cities),
A, set of arcs fully connecting the nodes

Each arc (i, j) A is assigned a weight dij which represents the


distance between cities i and j.
TSP is the problem of finding a minimum length Hamiltonian
circuit of the graph
Hamiltonian circuit is a closed walk (a tour) visiting each node of G
exactly once.

Symmetric TSPs
Distances between the cities are independent of the direction of
traversing the arcs, that is, dij = dji for every pair of nodes,

Asymmetric TSP (ATSP)

At least for one pair of nodes (i, j) we have dij

dji

Traveling Salesman Problem

2013 Even

A solution to an instance of the TSP can be


represented as a permutation of the city indices
This permutation is cyclic, i.e, absolute position of a
city in a tour is not important at all only the relative
order is important
i.e., there are n permutations that map to same solution

An optimal solution to the TSP is a permutation


of the node indices {1,2,,n} such that the
length f( ) is minimal, where f( )is given by

Traveling Salesman Problem

2013 Even

Construction graph
Construction graph is identical to the problem graph:
Set of components C corresponds to set of nodes
(i.e., C = N)
Connections correspond to the set of arcs (i.e., L = A)
Each connection has a weight which corresponds to
the distance dij between nodes i and j.
States of the problem are the set of all possible
partial tours.

Evolutionary Computing Techniques

Traveling Salesman Problem

2013 Even

Constraints.
Only constraint in the TSP is that all cities have to be
visited and that each city is visited at most once.
This constraint is enforced if an ant at each
construction step chooses the next city only among
those it has not visited yet
Feasible neighborhood Nik of an ant k in city i, where
k is the ants identifier, comprises all cities that are
still unvisited

Pheromone trails
Pheromone trails ij in the TSP refer to the desirability
of visiting city j directly after i.
Evolutionary Computing Techniques

Traveling Salesman Problem


Heuristic information

2013 Even

ij

Typically inversely proportional to the distance


between cities i and j, a straight-forward choice
being ij = 1/dij.
Heuristic information used in most ACO algorithms
for TSP

Solution construction
Each ant is initially put on a randomly chosen start
city
Each ant at each step iteratively adds one still
unvisited city to its partial tour
Solution construction terminates once all cities have
been visited
Evolutionary Computing Techniques

Traveling Salesman Problem


Heuristic information

2013 Even

ij

Typically inversely proportional to the distance


between cities i and j, a straight-forward choice
being ij = 1/dij.
In case dij = 0 for some arc (i, j) ,the corresponding
ij is set to a very small value
Heuristic information used in most ACO algorithms
for TSP

Evolutionary Computing Techniques

Traveling Salesman Problem

2013 Even

Solution construction
Each ant is initially put on a randomly chosen start
city
Each ant at each step iteratively adds one still
unvisited city to its partial tour
Solution construction terminates once all cities have
been visited

Evolutionary Computing Techniques

ACO for TSP Algorithm


Procedure ACOMetaheuristicStatic
Set parameters, initialize pheromone trails
while(termination condition not met)do
ConstructAntsSolutions
ApplyLocalSearch
UpdatePheromones

%optional

end

end

Evolutionary Computing Techniques

2013 Even

Ant System for TSP

2013 Even

In AS a good heuristic to initialize the


pheromone trails is to
set them to a value slightly higher than the expected
amount of pheromone deposited by the ants in one
iteration

Rough estimate of this value can be obtained by


setting
Where
m number of ants
Cnn - length of a tour generated by the nearestneighbor heuristic
Evolutionary Computing Techniques

Ant System for TSP

2013 Even

Where ij = 1/dij , is a heuristic value that is


available a priori
and are two parameters which determine
the relative influence of the pheromone trail and
the heuristic information

is the feasible neighborhood of ant k when


being at city I (set of cities that ant k has not
visited yet)
Evolutionary Computing Techniques

Ant System for TSP

2013 Even

If = 0, the closest cities are more likely to be


selected
Corresponds to a classic stochastic greedy algorithm
(with multiple starting points since ants are initially
randomly distributed over the cities).

If

= 0,only pheromone amplification is at work

i.e., only pheromone is used, without any heuristic


bias
This generally leads to rather poor results and, in
particular, for values of a>1 it leads to the rapid
emergence of a stagnation situation,
a situation in which all the ants follow the same path and
construct the same tour, which, in general, is strongly
suboptimal

Evolutionary Computing Techniques

AS Pheromone updates

2013 Even

Pheromone evaporation

Pheromone updates

Where, Ck, the length of the tour Tk built by k-th


ant, is computed as the sum of the lengths of
the arcs belonging to Tk
Evolutionary Computing Techniques

Das könnte Ihnen auch gefallen