solving tsp using hybrid gaco

22
Shruti Gandhi (06913502809) Sonal Doomra (06513502809) PROJECT SUPERVISOR : Indira Gandhi Institute of Technology Department of Electronics and Communication Engineering

Upload: shruti-gandhi

Post on 17-Jul-2015

398 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Solving TSP using Hybrid GACO

Shruti Gandhi

(06913502809)

Sonal Doomra

(06513502809)

PROJECT SUPERVISOR :

Indira Gandhi Institute of Technology

Department of Electronics and

Communication Engineering

Page 2: Solving TSP using Hybrid GACO

Definition:

Given a set of cities and the

distance between each possible

pair, the Travelling Salesman

Problem is to find the best

possible way of ‘visiting all the

cities exactly once and returning

to the starting point’

TRAVELLING SALESMAN

PROBLEM

An Introduction

Page 3: Solving TSP using Hybrid GACO

•.

TSP: An NP Hard

ProblemTSP is an NP-hard problem

in combinatorial optimization

studied in theoretical computer science.

In many applications,

additional constraints

such as limited resources or time windows

make the problem

considerably harder.

Removing the

constraint of visiting each city exactly

one time also doesn't

reduce complexity

of the problem

In spite of the computational difficulty of the

problem, a large number of heuristics and exact methods

are known, which can

solve instances with thousands of

Page 4: Solving TSP using Hybrid GACO

• In these applications, the concept city represents, for example, customers, solderingIn these applications, the concept city represents, for example, customers, soldering points, or DNA fragments

• The concept distance represents travelling times or cost, or a similarity measure between DNA fragments.

Even in its purest form the TSP, has several applications such as

planning, logistics, DNA sequencing

and the manufacture of

microchips.

Applications of TSP

• When a mechanical arm is used to fasten the nuts for assembling parts, it moves through each nut in proper order and returns to the initial position.

• The most economical travelling route will enable the mechanical arm to finish its work within the shortest time.

Mechanical arm

• Inserting electrical elements in the manufacturing of integrated circuits consumes certain energy when moving from one electrical element to the other during manufacturing.

• We need to arrange the manufacturing order to minimize the energy consumption.

Integrated circuit

Page 5: Solving TSP using Hybrid GACO

Brief Summary of the

Project

Solving the TSP was an interesting problem during recent decades.

Almost every new approach for solving engineering and optimization

problems has been tested on the TSP as a general test bench. First

steps in solving the TSP were classical methods. These methods

consist of heuristic and exact methods. These classical methods for

solving the TSP usually result in exponential computational

complexities. Hence, new methods are required to overcome this

shortcoming. These methods include different kinds of optimization

techniques, nature based optimization algorithms i.e. Genetic

Algorithm, Ant Colony Optimization ,etc.

Metaheuristics , which represent a family of approximate optimization

techniques that have gained a lot of popularity in the past two decades,

are the tools we have used for solving TSP. They provide “acceptable”

solutions in a reasonable time for solving hard and complex problems

in science and engineering. In this project, the population based

metaheuristics i.e Genetic Algorithm and Ant Colony Optimization are

explained and then modified to solve TSP. The results are then

compared with the classical techniques of Nearest Neighbour, Tabu

Search and Simulated Annealing to find out the most optimum solution.

The highlighting feature of our work is the development of a new hybrid

algorithm GACO , that merges two most popular Evolutionary

Algorithms , Ant Colony Optimization and Genetic Algorithm, to solve

the most complex combinatorial optimization problem, the TSP.

Page 6: Solving TSP using Hybrid GACO

Solving the Problem

Page 7: Solving TSP using Hybrid GACO

Here we propose a hybrid metaheuristic (GACO), a hybrid of

genetic algorithm and ant colony optimization to solve the

generalized TSP, and the result obtained is compared with

the stand alone heuristics, to prove the efficiency of our

algorithm. All the codes were written and implemented in

MATLAB 8.

Page 8: Solving TSP using Hybrid GACO

The proposed GACO algorithm is to enhance the

performance of genetic algorithm (GA) by

incorporating local search, ant colony optimization

(ACO), for TRAVELLING SALESMAN PROBLEM. In the

proposed GACO algorithm, genetic algorithm is

conducted to provide the DIVERSITY OF

ALIGNMENTs. Thereafter, ant colony optimization is

performed to MOVE OUT OF LOCAL OPTIMA.

From simulation results, it is shown that the proposed

GA-ACO algorithm has superior performance when

compared to other existing algorithms.

TSP using GACO

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 9: Solving TSP using Hybrid GACO

Other heuristics used for TSP

Nearest Neighbor Algorithm For TSP

The NN method compares the distribution

of distances that occur from a data point to

its nearest neighbour in a given data set

with a randomly distributed data set

Best tour =

19 1 26 14 31 38 36 22 30 5 4 2 15 21 27

24 18 16 3 9 34 13 10 29 12 23 7 40 32 37

6 39 25 28 11 8 33 20 35 17

Minimum Distance =

5.1689

Time taken = 280.388999

TSP using GACO

9

Page 10: Solving TSP using Hybrid GACO
Page 11: Solving TSP using Hybrid GACO

SIMULATED ANNEALINGSimulated annealing is a single solution based

metaheuristic. The SA algorithm simulates the energy

changes in a system subjected to a cooling process until it

converges to an equilibrium state.

The graph for simulated annealing escaping from local minima. The higher the

temperature, the more significant the probability of accepting a worst move. At a

given temperature, the lower the increase of the objective function, the more

significant the probability of accepting the move. A better move is always

accepted.

Page 12: Solving TSP using Hybrid GACO

The basic principle of tabu search is to pursue local search

whenever it encounters a local optimum by allowing non-

improving moves, cycling back to previously visited

solutions is prevented by the use of memories, called tabu

lists (short-term memory), that record the recent history of

the search.

TABU SEARCH

Page 13: Solving TSP using Hybrid GACO

GENETIC ALGORITHMS

Population size

Number of generation

s

Crossover rate

Mutation rate

Factors affecting GA performance

Page 14: Solving TSP using Hybrid GACO

ACO was developed by Dorigo , based on the fact that ants are

able to find the shortest route between their nest and a source of

food.This is done using pheromone trails, which ants deposit

whenever they travel, as a form of indirect communication.

ANT COLONY

OPTIMIZATION

Algorithm: ACO For TSP

Set parameters, initialize pheromone

trails

While (termination condition not

met) do

{ ConstructSolutions

UpdateTrails }

End

Page 15: Solving TSP using Hybrid GACO

Simulation

Results•Using Nearest Neighbour

•Using Tabu Search

•Using Simulated Annealing

•Using Genetic Algorithm

•Using Ant Colony Optimization

•Using Hybrid GA and ACO ( GACO)

Page 16: Solving TSP using Hybrid GACO

TSP using Nearest Neighbour

Best tour =

30 26 19 38 9 37 1 28 32 40 12 10 34

17 5 25 16 22 27 3

23 18 4 6 24 8 2 35 31 15 7 20 11

21 14 39 13 33 36 29

Minimum distance = 59.3578

Time taken =0.082592

-4 -2 0 2 4 6 8 10 12 14

-2

0

2

4

6

8

10

12

Path length = 59.3578

Page 17: Solving TSP using Hybrid GACO

TSP using Tabu Search

Best tour =

20 40 13 26 28 29 30 14 8 36 22 5 38

34 2 17 10 4 18 24 31 37 9 23 27 16

32 39 11 25 35 19 12 21 33 6 15 7 3 1

Minimum distance =

6.1218

Time taken = 1.528810 seconds

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 18: Solving TSP using Hybrid GACO

TSP using Simulated Annealing

Best tour =

22 36 40 38 16 2 9 21 39 8 10 17 15 14 12

11 30

19 33 26 28 29 4 25 24 20 13 32 7 34 27 6

37 3 18 5 35 23 31 1

Minimum distance= 5.8825

Time taken = 49.951520

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 19: Solving TSP using Hybrid GACO

TSP using Genetic

Algorithm

Best tour =

38 20 39 34 29 9 12 4 3 22 8 5 31 11 28 15 35

30 7 32 33 23 18 14 6 26 13 16 24 19 2 25 10

21

17 37 40 27 1 36

Minimum distance =

5.3990

Time taken = 5.406894

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1Total Distance = 5.3990, Iteration = 479

Page 20: Solving TSP using Hybrid GACO

TSP using ACO

Best tour =

36 19 25 15 16 27 32 22 39 29 21 37 7

28 4 23 17 30 3 34 38 2 10 13 1 14 35

5 33 9 8 20 12 40 26 31 6 18 11 24 36

Minimum distance= 16.6220 Time taken =777.869303

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Page 21: Solving TSP using Hybrid GACO

Algorithm

used

Min

Distance

Time taken

(sec)

Nearest

neighbour245.9496 0.067407

Tabu Search 80.7395 20.623332

Simulated

Annealing76.7459 60.715589

Genetic

Algorithm55.4096 13.039126

ACO 21.2349 25.050779

GACO 20.6386 10.746399

Result

Comparison

Page 22: Solving TSP using Hybrid GACO

ConclusionIn this project, the travelling salesman problem, its

complexity, variations and its applications in various

domains was studied. Here, we proposed GACO to solve

the complex problem and compare the result with the

nearest Neighbour method, metaheuristics such as

Simulated Annealing, Tabu Search and Evolutionary

Algorithms like Genetic Algorithm and Ant Colony

Optimization. The experimental results demonstrated that

the HYBRID GACO approach of finding the solution gives

the best result in terms of the optimal route travelled by the

salesman as compared to other heuristics used in this

project. The minimum distance travelled by the salesman is

the least for GACO.Future Scope

The work can be further extended to solve the travelling

salesman problem using the other hybrid metaheuristics

such as Genetic Algorithm with Particle Swarm

Optimization, or Simulated Annealing. Presently we are

working on hybridizing three metaheuristics (GA-ACO-SA)

to obtain a more optimal tour for the travelling salesman

and to improve the convergence behavior.