traveling salesman problem

13
Tackling the travelling salesman problem Using Hill Climbing search algorithm

Upload: mohamed-gad

Post on 22-May-2015

1.153 views

Category:

Education


0 download

DESCRIPTION

Tackling the traveling salesman problem with hill climbing search algorithm

TRANSCRIPT

Page 1: Traveling salesman problem

Tackling the travelling salesman problem

Using Hill Climbing search algorithm

Page 2: Traveling salesman problem

Agenda

•What is the TSP problem ?•stochastic optimization•hill-climbing

Page 3: Traveling salesman problem

What is the TSP problem ?

The traveling salesman problem (TSP) asks for the shortest route to visit a collection of cities and return to the starting point. Despite an intensive study by mathematicians, computer scientists, operations researchers, and others, over the past 50 years, it remains an open question whether or not an efficient general solution method exists.

Page 4: Traveling salesman problem

TSP is an NP-Hard Problem

That does not necessarily mean any one instance of the problem will be hard to solve, it just means that we do not currently have an algorithm that can give us the guaranteed best solution for all problems in “polynomial time”. 

Page 5: Traveling salesman problem

Stochastic optimization

Stochastic optimization (SO) methods are optimization methods that generate and use random variables. For stochastic problems, the random variables appear in the formulation of the optimization problem itself, which involve random objective functions or random constraints, for example. Stochastic optimization methods also include methods with random iterates.

Page 6: Traveling salesman problem

We take randomly generated routes through the cities and incrementally improve/change them in some fashion to search for a better route. How these changes are made depends on the algorithm being used, but there are a couple of simple approaches we can take, that I will outline here:

• swapping the position of two cities on a route• reversing the order of an entire section of a

route

Page 7: Traveling salesman problem

Hill-climbing

Page 8: Traveling salesman problem

Solution landscapes

• A common way to visualize searching for solutions in an optimization problem, such as the TSP, is to think of the solutions existing within a “landscape”. Better solutions exist higher up and we can take a step from one solution to another in search of better solutions. How we make steps will depend on the “move operators” we have available and will therefore also affect how the landscape “looks”. It will change which solutions are “adjacent” to each other.

Page 9: Traveling salesman problem

Solution landscapes

• For a simple optimization problem we can directly visual the solution landscape:

The red dot represents our current solution. It should be pretty clear that if we simply carry on going “uphill” we’ll get to the highest point in this solution landscape.

If we are using evolutionary optimization methods a solution landscape will often be referred to as a fitness landscape.

Page 10: Traveling salesman problem

Hill-climbing

• Hill-climbing, pretty much the simplest of the stochastic optimisation methods, works like this:

• pick a place to start

• take any step that goes “uphill”

• if there are no more uphill steps, stop; otherwise carry on taking uphill steps

• Metaphorically the algorithm climbs up a hill one step at a time. It is a “greedy” algorithm and only ever takes steps that take it uphill (though it can be adapted to behave differently). This means that it is pretty quick to get to the top of a hill

Page 11: Traveling salesman problem

Hill-climbing

As you can see our current solution (the red dot) can only go downhill from it’s current position – yet it is not at the highest point in the solution landscape.

Page 12: Traveling salesman problem

Hill-climbing

The “biggest” hill in the solution landscape is known as the global maximum. The top of any other hill is known as a local maximum (it’s the highest point in the local area). Standard hill-climbing will tend to get stuck at the top of a local maximum, so we can modify our algorithm to restart the hill-climb if need be. This will help hill-climbing find better hills to climb – though it’s still a random search of the initial starting points.

Page 13: Traveling salesman problem

Thanks