18
Stochastic Optimization and the Traveling Salesman Problem Jeffery L. Thomas, Edinboro University of PA Faculty Advisor: Dr. John Hoggard

Stochastic Optimization and the Traveling Salesman Problem

Embed Size (px)

DESCRIPTION

In deterministic optimization, we are trying to find a maximal or minimal value of some variable. In some cases, such as the NP-Hard or NP-Complete problems, this process can be too complex to finish in a feasible amount of time. Stochastic optimization gives us a way to add a random element to these problems in order to produce a “nearly optimal” solution in a much quicker fashion. We will discuss some overall methods of stochastic optimization, and in particular the method of ant colony optimization and its application to the traveling salesman problem.

Citation preview

Page 1: Stochastic Optimization and the Traveling Salesman Problem

Stochastic Optimization and the Traveling Salesman Problem

Jeffery L. Thomas, Edinboro University of PA

Faculty Advisor: Dr. John Hoggard

Page 2: Stochastic Optimization and the Traveling Salesman Problem

Stochastic Optimization

In an optimization problem, we are attempting to maximize or minimize some variable (such as profit, time, etc.)

Stochastic optimization refers to any optimization technique which incorporates probabilistic elements.

The random element may be a part of the problem itself

Ex: valuation of financial derivatives The random element may be a part of the solution

Ex: random search Process is usually applied repeatedly, and the

aggregate results are studied.

Page 3: Stochastic Optimization and the Traveling Salesman Problem

Given a set of cities and their pair-wise distances, determine the shortest possible tour which visits each city exactly once and ends at the starting city.

The Traveling Salesman

The traveling salesman has many applications, including:

Logistics

Circuit design Planning

In modified forms it is even used to study such broad topics as DNA sequencing.

TSP is often used as a benchmark for testing optimization methods.

Page 4: Stochastic Optimization and the Traveling Salesman Problem

TSP is in the complexity class NP-Hard.

The Traveling Salesman

Not only is there no efficient algorithm for finding a solution, a candidate solution cannot even be checked in polynomial time.

Given n cities, the number of possible tours through them is:

Starting with the first city, we have choices for the second city, choices for the third city, and so on.

Page 5: Stochastic Optimization and the Traveling Salesman Problem

For 100 cities, there are:46663107721972076340849619428133350245357984132190810

7342964819476087999966149578044707319880782591431268489604136118791255926054584320000000000000000000000possible tours. (156 digits!)

Multiplying these together, we get:

And since our travel time does not depend on which direction we take our tour, we divide this total by two, yielding

The Traveling Salesman

Page 6: Stochastic Optimization and the Traveling Salesman Problem

The Traveling Salesman

An optimal TSP tour through Germany’s 15 largest cities. It represents the shortest of the 43,589,145,600 possible tours.

Page 7: Stochastic Optimization and the Traveling Salesman Problem

TSP can be modeled as a graph, which makes it easier to work with computationally.

The Traveling Salesman

The cities are represented by the graph’s vertices.

The roads, or paths, between the cities are represented by the graph’s edges.

The distances between cities are represented by the weights of the edges.

When modeled as a graph, a TSP tour becomes a Hamiltonian cycle, and the optimal TSP tour becomes the shortest Hamiltonian cycle of the graph.

The model should be a complete graph, with edges connecting each vertex.

Page 8: Stochastic Optimization and the Traveling Salesman Problem

The Traveling Salesman

A

BC

D E

12

14

22

20

7

32

282

9

27

31

A symmetric TSP with 5 cities

Page 9: Stochastic Optimization and the Traveling Salesman Problem

Solving TSP becomes impractical very quickly as the number of cities grows.

Solving TSP

We can apply some sort of stochastic process to TSP in order to achieve convergence to a nearly-optimal solution in a much more reasonable amount of time.

The tour found may not be the exact optimal tour, however it will be within a reasonable amount of the exact optimal tour (definition of reasonable will vary by method, problem, etc.)

Page 10: Stochastic Optimization and the Traveling Salesman Problem

Ant Colony Optimization

A stochastic optimization method which has been adapted to solve the TSP is Ant Colony Optimization.

Originally proposed in 1992 by Marco Dorigo to find an optimal path in a graph, it is based on the behavior of ants seeking a path between a food source and their colony. The following basic behaviors make up the basis for the algorithm:

An ant will wander randomly until a food source is found.

Once a food source is found, the ant will return directly to the colony, laying down a pheromone trail as it goes.

If an ant encounters a pheromone trail, it is more likely to follow that trail than to continue wandering randomly.

The pheromone trail will evaporate over time if not reinforced.

Page 11: Stochastic Optimization and the Traveling Salesman Problem

Based on these behaviors, the ants will converge to the shortest path between the colony and the food source.

Ant Colony Optimization

-If more than one path exists, the shorter path will be traveled by a larger number of ants in the same amount of time-The pheromone trail on the shorter path will then become stronger than the longer path, making it more probable to be followed.-Eventually the pheromone trail on the longer path will dissipate, and the shortest path will be taken by all ants.

Image by Johann Dréo

Page 12: Stochastic Optimization and the Traveling Salesman Problem

Adaptation to TSP

In order to devise an adaptation of ant colony optimization to solve a TSP, we give our artificial ants a few properties in addition to the ones already discussed: An ant has a memory, and will only visit a

city it has not yet visited. An ant can “see” the distance of a path, and

is more likely to travel to a city which is a shorter distance from the city it is currently in.

N ants are distributed randomly, and move from city to city on a TSP graph.

At each time step, an artificial ant chooses a city to move to based on a probabilistic function of both the pheromone accumulated on an edge and the distance of that edge.

Page 13: Stochastic Optimization and the Traveling Salesman Problem

The pheromone trails are updated both locally and globally:

Adaptation to TSP

After each move from city to city, the trail on that edge is updated (local updating), preventing a particularly short path from being chosen by all of the ants.

Once all ants have completed their tours, the ant which had the shortest tour adds pheromone to all edges of its tour (global updating).

This process is repeated until the artificial ants converge to a nearly-optimal tour.

After each iteration the pheromone trails dissipate at a predetermined rate.

Page 14: Stochastic Optimization and the Traveling Salesman Problem

Advantages of Ant Colony Optimization

Ant colony optimization has a distinct advantage over other stochastic methods of solving similar problems, such as genetic algorithms and simulated annealing: when run continuously, it can react to changes in real-time.

If an obstacle is placed in the current path being traveled by the colony, the basic principles take effect: the ants go back to taking random walks around the obstacle.

In the simple case, half of the ants will take the shorter path around the obstacle, and the other half will take the longer path.

Page 15: Stochastic Optimization and the Traveling Salesman Problem

Advantages of Ant Colony Optimization

Page 16: Stochastic Optimization and the Traveling Salesman Problem

Ant colony optimization has many other areas of application:

Other Applications of Ant Colony Optimization

Job scheduling Knapsack problem Network routing Data mining Image processing And many more…

The key to adapting ant colony optimization to a new problem is in defining an appropriate heuristic which defines the distance between two nodes in the graph to be searched by the artificial ants.

Page 17: Stochastic Optimization and the Traveling Salesman Problem

References

M. Dorigo, L. Gambardella, Ant colonies for the traveling salesman problem, 1996

E. Bonabeau, M. Dorigo, Swarm Intelligence: From Natural to Artificial Systems, 1999

“The Traveling Salesman Problem”, http://www.tsp.gatech.edu/

Sauer, Timothy Numerical Analysis, Addison Weseley, 2005

Page 18: Stochastic Optimization and the Traveling Salesman Problem

Questions?

Thank you for your time.