Khushboo Arora, Samiksha Agarwal, Rohit Tanwar

Similar documents
Reduce Total Distance and Time Using Genetic Algorithm in Traveling Salesman Problem

A New Selection Operator - CSM in Genetic Algorithms for Solving the TSP

Fuzzy Inspired Hybrid Genetic Approach to Optimize Travelling Salesman Problem

ARTIFICIAL INTELLIGENCE (CSCU9YE ) LECTURE 5: EVOLUTIONARY ALGORITHMS

Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm

Using Genetic Algorithm with Triple Crossover to Solve Travelling Salesman Problem

A Steady-State Genetic Algorithm for Traveling Salesman Problem with Pickup and Delivery

Network Routing Protocol using Genetic Algorithms

GENETIC ALGORITHM with Hands-On exercise

Grid Scheduling Strategy using GA (GSSGA)

Introduction to Genetic Algorithms. Based on Chapter 10 of Marsland Chapter 9 of Mitchell

A Web-Based Evolutionary Algorithm Demonstration using the Traveling Salesman Problem

Optimizing the Sailing Route for Fixed Groundfish Survey Stations

Job Shop Scheduling Problem (JSSP) Genetic Algorithms Critical Block and DG distance Neighbourhood Search

Parallel Genetic Algorithm to Solve Traveling Salesman Problem on MapReduce Framework using Hadoop Cluster

A Genetic Algorithm for Graph Matching using Graph Node Characteristics 1 2

Solving ISP Problem by Using Genetic Algorithm

A Parallel Architecture for the Generalized Traveling Salesman Problem

Solving Traveling Salesman Problem Using Parallel Genetic. Algorithm and Simulated Annealing

Solving Travelling Salesman Problem and Mapping to Solve Robot Motion Planning through Genetic Algorithm Principle

Role of Genetic Algorithm in Routing for Large Network

PATH PLANNING OF ROBOT IN STATIC ENVIRONMENT USING GENETIC ALGORITHM (GA) TECHNIQUE

A HIGH PERFORMANCE ALGORITHM FOR SOLVING LARGE SCALE TRAVELLING SALESMAN PROBLEM USING DISTRIBUTED MEMORY ARCHITECTURES

Innovative Systems Design and Engineering ISSN (Paper) ISSN (Online) Vol.5, No.1, 2014

Overview. H. R. Alvarez A., Ph. D.

Comparison of TSP Algorithms

4/22/2014. Genetic Algorithms. Diwakar Yagyasen Department of Computer Science BBDNITM. Introduction

A Genetic Algorithm Applied to Graph Problems Involving Subsets of Vertices

Genetic Algorithm for Dynamic Capacitated Minimum Spanning Tree

CHAPTER 4 GENETIC ALGORITHM

Comparative Study on VQ with Simple GA and Ordain GA

Genetic Algorithms with Oracle for the Traveling Salesman Problem

AN EVOLUTIONARY APPROACH TO DISTANCE VECTOR ROUTING

Solving Travelling Salesman Problem Using Greedy Genetic Algorithm GGA

Keywords Traveling salesman problem, genetic optimization algorithms optimize population, Dijikstra etc.

Introduction to Genetic Algorithms. Genetic Algorithms

A COMPARATIVE STUDY OF FIVE PARALLEL GENETIC ALGORITHMS USING THE TRAVELING SALESMAN PROBLEM

Comparison of Genetic Algorithm and Hill Climbing for Shortest Path Optimization Mapping

The Generalized Traveling Salesman Problem: A New Genetic Algorithm Approach

The Genetic Algorithm for finding the maxima of single-variable functions

Genetic Algorithms Based Solution To Maximum Clique Problem

A Parallel Architecture for the Generalized Travelling Salesman Problem: Project Proposal

SIMULATION APPROACH OF CUTTING TOOL MOVEMENT USING ARTIFICIAL INTELLIGENCE METHOD

A NOVEL APPROACH FOR PRIORTIZATION OF OPTIMIZED TEST CASES

Math 3012 Combinatorial Optimization Worksheet

Modified Order Crossover (OX) Operator

March 19, Heuristics for Optimization. Outline. Problem formulation. Genetic algorithms

Pre-requisite Material for Course Heuristics and Approximation Algorithms

A HYBRID GENETIC ALGORITHM A NEW APPROACH TO SOLVE TRAVELING SALESMAN PROBLEM

Genetic Algorithm Performance with Different Selection Methods in Solving Multi-Objective Network Design Problem

Parallel Traveling Salesman. PhD Student: Viet Anh Trinh Advisor: Professor Feng Gu.

Genetic Algorithms Variations and Implementation Issues

CHAPTER 5 ENERGY MANAGEMENT USING FUZZY GENETIC APPROACH IN WSN

Hybrid approach for solving TSP by using DPX Cross-over operator

Genetic Algorithm for Dynamic Capacitated Minimum Spanning Tree

METAHEURISTICS. Introduction. Introduction. Nature of metaheuristics. Local improvement procedure. Example: objective function

Analysis of the impact of parameters values on the Genetic Algorithm for TSP

Escaping Local Optima: Genetic Algorithm

Genetic Algorithm for Network Design Problem-An Empirical Study of Crossover Operator with Generation and Population Variation

Solving Travelling Salesmen Problem using Ant Colony Optimization Algorithm

A New Approach for Energy Efficient Routing in MANETs Using Multi Objective Genetic Algorithm

Codebook generation for Image Compression with Simple and Ordain GA

ISSN: (Online) Volume 3, Issue 5, May 2015 International Journal of Advance Research in Computer Science and Management Studies

Genetic Algorithms. PHY 604: Computational Methods in Physics and Astrophysics II

A Genetic Algorithm Approach to the Group Technology Problem

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, / 21

Using Genetic Algorithms to optimize ACS-TSP

AN OPTIMAL SOLUTION TO MULTIPLE TRAVELLING SALESPERSON PROBLEM USING MODIFIED GENETIC ALGORITHM

Path Planning Optimization Using Genetic Algorithm A Literature Review

DETERMINING MAXIMUM/MINIMUM VALUES FOR TWO- DIMENTIONAL MATHMATICLE FUNCTIONS USING RANDOM CREOSSOVER TECHNIQUES

Encoding Techniques in Genetic Algorithms

ACCELERATING THE ANT COLONY OPTIMIZATION

Genetic Algorithm for Seismic Velocity Picking

Hybridizing PSM and RSM Operator for Solving NP-Complete Problems: Application to Travelling Salesman Problem

Dynamic Capacity Routing in Networks with MTSP

An Evolutionary Algorithm for the Multi-objective Shortest Path Problem

Research Article Path Planning Using a Hybrid Evolutionary Algorithm Based on Tree Structure Encoding

Optimization Technique for Maximization Problem in Evolutionary Programming of Genetic Algorithm in Data Mining

Design and Analysis of Algorithms CS404/504. Razvan Bunescu School of EECS.

ABSTRACT I. INTRODUCTION. J Kanimozhi *, R Subramanian Department of Computer Science, Pondicherry University, Puducherry, Tamil Nadu, India

[Premalatha, 4(5): May, 2015] ISSN: (I2OR), Publication Impact Factor: (ISRA), Journal Impact Factor: 2.114

Optimal tree for Genetic Algorithms in the Traveling Salesman Problem (TSP).

Travelling salesman problem using reduced algorithmic Branch and bound approach P. Ranjana Hindustan Institute of Technology and Science

Search Algorithms for Regression Test Suite Minimisation

Combining Two Local Searches with Crossover: An Efficient Hybrid Algorithm for the Traveling Salesman Problem

Optimizing Flow Shop Sequencing Through Simulation Optimization Using Evolutionary Methods

Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)

Module 6 NP-Complete Problems and Heuristics

Artificial Intelligence Application (Genetic Algorithm)

Solving Traveling Salesman Problem for Large Spaces using Modified Meta- Optimization Genetic Algorithm

An Integrated Genetic Algorithm with Clone Operator

Genetic Algorithm for optimization using MATLAB

New Genetic Operators for Solving TSP: Application to Microarray Gene Ordering

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

Topological Machining Fixture Layout Synthesis Using Genetic Algorithms

1 The Traveling Salesperson Problem (TSP)

C 1 Modified Genetic Algorithm to Solve Time-varying Lot Sizes Economic Lot Scheduling Problem

Parallel Programming to solve Traveling Salesman Problem. Team Parallax Jaydeep Untwal Sushil Mohite Harsh Sadhvani parallax.hpearth.

A SURVEY ON DIFFERENT METHODS TO SOLVE TRAVELLING SALESMAN PROBLEM

Solving the Travelling Salesman Problem in Parallel by Genetic Algorithm on Multicomputer Cluster

Transcription:

International Journal of Scientific & Engineering Research, Volume 7, Issue 1, January-2016 1014 Solving TSP using Genetic Algorithm and Nearest Neighbour Algorithm and their Comparison Khushboo Arora, Samiksha Agarwal, Rohit Tanwar Abstract Travelling Salesman Problem is an intensively studied problem in the field of Combinatorial Optimization. Being an NP-Hard problem it is widely studied in the area of optimization. A problem is NP-Hard if its approximate solution is derived from the solution of NP problem, i.e. an algorithm that is used to solve NP problem can be modified to find the approximate solution to NP-hard problem.the main objective of TSP is to find the minimum distance by traversing each of the given set of cities atleast once and then traversing back to the start city.the paper is aimed to provide a method for solving TSP using both Genetic Algorithm and nearest neighbour Algorithm and provide efficient results. Also, this paper provides the comparison between the two algorithms based on various parameters that helps to choose the better algorithm as per the needs. Index Terms Combinatorial Optimization, Genetic Algorithm, Nearest Neighbour, NP-Hard, Travelling Salesman Problem. 1 INTRODUCTION 1.1The Travelling Salesman Problem Being a combinatorial optimization problem, Travelling Salesman Problem seems to be very simple when the statement is given, but at the same time it is extremely difficult to solve[1]. In the field of computer science and operation research the problem is also known as NP-hard problem, which cannot be solved exactly in the polynomial time. TSP can be described as: Given a set of cities, and the distances between each pair of the cities, the aim of the salesman is to find a minimum path that visits each city exactly once and gives the minimized the total distance travelled [2]. TSP can be used in number of fields such as military and traffic. 1.2 Genetic Algorithm Genetic Algorithm was introduced by John Holland along with his colleagues and students in the mid-1970s, at the University of Michigan[6]. GA is totally based upon the Survival of the Fittest and Natural Genetic principal, in order to produce better solutions. GA operates on population of solutions. For each new generation a new set of solutions are formulated by selecting individuals according to their fitness value and then breeding them together using operators. F Khushboo Arora is currently pursuing masters degree program in Computer Engineering in Manav Rachna University,India, PH:+919711858087. E-mail: khushbooarora3@gmail.com Samiksha Agarwal is currently pursuing masters degree program in computer engineering in Manav Rachna University,India, PH:+919268571619. E-mail: samiksha1009@gmail.com Rohit Tanwa, Assistant Professor, Manav Rachna University, Faridabad, India, PH:+919992257914, E- mail:rohit@mru.edu.in 2016 Algorithm of GA: Fig.1. Flowchart of Genetic Algorithm [3] Step 1: Generate any random routes and calculate their fitness value. Step 2: Repeat the following procedure for a given number of iteration times:

International Journal of Scientific & Engineering Research, Volume 7, Issue 1, January-2016 1015 a) Select any two best routes from the given random routes. b) Reproduce those two routes to produce new best routes. c) After Reproduction replace the best new routes with any two worst routes. Step 3: Return the best route. 1.3 Nearest Neighbour Algorithm The Nearest Neighbour Algorithm is an approximate algorithm for finding a sub-optimal solution to the TSP [3]. In this algorithm, it starts with a city as a starting city and repeatedly visits all the cities until all the cities have been visited exactly once. It finds a shortest path, but solution is not the optimal one. The algorithm of NN is: This paper is organized in the following manner. Section II gives the related work that has been done in terms of travelling salesman problem, genetic algorithm and nearest neighbour algorithm. Section III describes the methodology that would be used to solve the problem. The experiment results are shown in Section IV. Section V concludes the work carried out and Section VI gives the future scope providing the options in which this work can be extended. A. Aranganayaki solves the travelling salesman problem using the heuristic method of genetic algorithms. Genetic algorithm finds good solutions for the TSP, but the solution depends how the problem is encoded and also depends on which mutation and crossover are used in the algorithm. The research introduces a binary matrix which is a new method for representing chromosomes and new fittest criteria for the crossover process. The algorithm is also applied to solve symmetric as well as the asymmetric Travelling salesman problem. K.s. Tang and Sam Kwong proposed Genetic algorithms: Concepts and applications[6] in 1996. The paper gives an introduction about the genetic algorithm and explained when and why the Genetic algorithm used as an optimization tool. They provided the features of GA in terms of operators solved complex and conflicting problems using it. Naveen kumar, Karambir, Rajiv Kumar provided a literature survey for solving tsp using genetic algorithm [7]. They provided number of genetic operators used in solving TSP using genetic algorithm such as crossover, mutation or combination of them. After the analysis of the survey, the researchers observed that in future new operators can be introduced to increase the performance of genetic algorithm for solving the TSP problem. Step 1: Start with any random vertex, call it current vertex. Peng Gang [8] in 2003 described multiple heuristic algorithms Step 2: Find an edge which gives minimum distance between to solve Travelling Salesman Problem. The two operations of the current vertex and an unvisited vertex, call it V. smallest square method and Complete 2-Opt were combined with the genetic algorithm to solve TSP. The complete 2-Opt is Step 3: Now set that current vertex to unvisited vertex V and typically based on the 2-Opt heuristic search method which mark that vertex V as visited. removes all the crossed edges in the tour. The main advantage of Smallest Square method that it provides the shorter edges Step 4:Terminate the condition, if all the vertices are visited as compared to Complete 2-Opt. Peng Gang presented a new atleast once. result which combined both the operations with GA to solve TSP. There are two more operation which was also discussed Step 5: Go to step 2. in this paper, namely the Best Part Collector and deletions. To select the best among the individuals Best path Collector was used. On the other hand, Deletion removed duplicate individual from the given population. In 1997, Rong Yang several knowledge-augmented genetic operators were proposed, that were used to guide GA for better quality of the population by not falling into local optima. Greedy crossover was applied by the algorithm that was devised by Yang. Also, advanced mutation operations based on the 2-opt and 3-opt heuristics were used [9]. 2 RELATED WORK In the work proposed by Varshika, in the travelling salesman problem using genetic algorithm [1] provides a method which is flexible for solving the TSP using genetic algorithm. They used TSP as a domain for solving NP-hard problems. Integer programming and graph theory algorithms are used to solve this problem. In order to find a maximal approximation of a specific problem with the constraint of reduced cost, the referenced paper gives an implementation using genetic algorithm. O. Taiwo, O. Josiah, A. Taiwo, S. Dkhrullahi [12] proposed an implementation method of solving TSP using Nearest Insertion and Nearest Neighbour Approaches. They provided a comparison between the two stating which algorithm gives the better result and what are the flaws in the other algorithm due to which it is not able to produce the desired result. The execution time of nearest insertion algorithm is slightly less than that of nearest neighbor algorithm. But it was observed that the solution could be found in very short computational time, which helped to reach the conclusion that the use of these two algorithms gives the acceptable results which may not be optimal but are close to the optimal result. 2016

International Journal of Scientific & Engineering Research, Volume 7, Issue 1, January-2016 1016 3 METHODOLOGY This paper solves Travelling Salesman problem using both Genetic Algorithm and Nearest Neighbour Algorithm. 3.1 Tsp Using Genetic Algorithm Genetic Algorithm randomly generates an initial population of strings, also called as gene pool and then applying crossover followed by mutation to create new generation that is better than the previous populations. GA process consists of the following: Intialization From a population of individuals, an initial population is generated. Fitness Function After initializing the population, fitness value for each of the individual is calculated. The fitness values are generated using a fitness function. The function provides largest and smallest values for each of the individuals. If the individual has a larger fitness value then result will be a better solution but if a smaller value is obtained then solution obtained will not be better. Selection The individuals which have 4 EXPERIMENT RESULTS the highest fitness value are chosen to produce the offspring. Roulette Wheel, Tournament selection, Steady state and Rank selection, are the different selection techniques through which selection operation can be done. Crossover Any two individuals from the given population are picked and new generation is created by recombining the two individuals. Mutation Mutation is considered as a simple search operator in the algorithm. When the crossover function is completed, mutation is applied to the strings so formed. Mutation function prevents the algorithm from being trapped into local minimum. Termination The algorithm terminates when it has executed a given number of iterations or it has reached a termination condition and then produces the best solution. 3.2 Tsp Using Nearest Neighbour Algorithm Nearest neighbour, was the first greedy algorithm which gave a solution for the travelling salesmen problem. The algorithm was introduced by J.G. Skellam and it was continued by the F.C. Evans and P.J Clark. In nearest neighbor algorithm, we randomly choose a city as the starting city and then traverse to all the cities closest to the staring city that do not create any cycle. This process continues till all cities are visited once. The steps of the algorithm are: Step 1: Select any node as starting node. Step 2: Look for the neighbours of the starting node that have not been visited yet. Choose the node which is next closest to that node having the minimum distance. Step 3: Repeat this procedure until all the nodes in the tour have been visited exactly once. Step 4: Check if all the nodes are visited atleast once. If yes, then return back to the starting node which will give the complete path. Step 5: Finally calculate the total distance of the tour. This algorithm takes input as the number of cities and coordinates as the distances for cities which is represented in the form of adjacency matrix. If the starting node is specified it continues with it, otherwise starting node is chosen at random. The algorithm gives a sequence of all the visited vertices. But the solution produced by the algorithm is not the optimal one. As the algorithm is a greedy algorithm it misses out some of the shorter routes. These shorter routes can be detected by human insight easily. So, the nearest neighbour algorithm does not give the feasible solution. For the implementation, we used Windows 7 laptop of Intel core I5 with 2.5GHz processor and 4 gigabytes RAM. The implementation of NN and GA algorithms is done in Matlab. To compare the effectiveness of both the algorithms, we took three instances, 25 cities, 50 cities and 100 cities to see which algorithm gives better result in a given situation. Three runs are done on both the algorithm based on the criteria of different number of cities. For the first run, we took 25 cities by giving the x-y coordinates. The Fig.2 depicts the graph of solving TSP using nearest neighbour algorithm. Similarly the figure Fig.3 depicts the graph of solving the Travelling salesman problem using Genetic algorithm. 2016

International Journal of Scientific & Engineering Research, Volume 7, Issue 1, January-2016 1017 that nodes are not independent of one another. The paper gives a comparison between Genetic algorithm and nearest neighbor to solve the travelling salesman problem. The comparison is based on the criteria of number of cities travelled by both the algorithms and then determines and tests the result on the basis of the distance travelled by them and the execution time. The total distance travelled using genetic algorithm in all the three cases in less than the nearest neighbour algorithm. But the execution time of NN algorithm in all the three cases in less than the Genetic algorithm. The main aim of TSP was to find the minimum total distance travelled, so considering the main objective of TSP, it has been concluded that Genetic algorithm is considered as the best algorithm as it provides better results in terms of distance travelled. Fig2. Solving TSP using NN 6 FUTURE SCOPE Fig 3. Solving TSP using GA This paper presents a comparative analysis among Genetic Algorithm and Nearest Neighbour Algorithm for solving TSP and results shows that Genetic gives better results than Nearest Neighbour. But there exists many algorithms for solving TSP which can be compared in order to classify which algorithm gives the best optimal results under a given set of condi- tions. In this paper we have compared on the basis of total distance travelled and execution time based on the criteria of number of cities. In future the comparison can be done on the basis of TABLE 1 performance and cost to see which algorithm gives the better COMPARISON BETWEEN NN AND GA result. Similarly we did for 50 cities and 100 cities and found out which algorithm gives the best result in all the given conditions. The comparison is done on the basis of the total distance travelled by the algorithm and the time taken by them. Algorithm Nearest Neighbour Genetic Algorithm No. of Total Distance Execution Cities Travelled Time 25 42.2683 0.8631 50 77.2339 6.6354 100 86.4397 2.9486 25 41.3736 12.5727 50 62.3458 14.5790 100 82.9532 21.1832 ACKNOWLEDGEMENT We would like to thank our teacher Mr. Rohit Tanwar for providing us help and for motivating us. RESULTS The results in the table, helps to conclude that Genetic algorithm gives the best result with the given set of conditions. 5 CONCLUSION The TSP can be solved using both the heuristic algorithms GA and NN which provides sub optimal solution. In the nearest neighbor, every node is serving as a corresponding initial node with respect to the next closet node, which concludes 2016

International Journal of Scientific & Engineering Research, Volume 7, Issue 1, January-2016 1018 REFERENCES [1] Varshika Dwivedi, Taruna Chauhan, Sanu Saxena, Princie Agrawal, Travelling Salesman Problem using Genetic Algorithm, International Journal of Computer Applications, pp. 25-30 [2] Shalini Singh, Ejaz Aslam Lodhi, Study of Variation in TSP using Genetic Algorithm and Its Operator Comparison, International Journal of Soft Computing and Engineering (IJSCE), Vol. 3, Issue-2, May 2013, pp. 264-267 [3] http://file.scirp.org/html/7-9601193%5ca 9b12e 87-908f-4343-8b9df41cb52fad6f.jpg [4] https://en.wikipedia.org/wiki/nearest_neighbour_algorithm [5] A.Aranganayaki, Reduce Total Distance and Time Using Genetic Algorithm in Traveling Salesman Problem, International Journal of Computer Science & Engineering Technology, Vol. 5, No. 08 Aug 2014, pp. 815-819 [6] K.s. Tang, Sam Kwong, Genetic algorithms: Concepts and applications, IEEE transactions on industrial electronics, Vol. 43, No. 5, Oct 1996, pp. 519-534 [7] Naveen kumar, Karambir, Rajiv Kumar, A genetic algorithm approach to study travelling salesman problem, Journal of Global Research in Computer Science, Volume 3, No. 3, March 2012, pp. 33-38. [8] Peng Gang et al, Multiple Heuristic Search Algorithm for Solving Travelling Salesman Problem, IEEE, 2003. [9] Rong Yang, Solving Large Travelling Salesman Problems with Small Populations. IEEE 1997. [10] Fatma A. Karkory, Ali A. Abudalmola, Implementation of Heuristics for Solving Travelling Salesman Problem Using Nearest Neighbour and Minimum Spanning Tree Algorithms, International Journal of Mathematical, Computational, Physical, Electrical and Computer Engineering Vol:7, No:10, 2013, pp 987-997 [11] Chetan Chauhan, Ravindra Gupta, Kshitij Pathak, Survey of Methods of Solving TSP along with its Implementation using Dynamic Programming Approach, International Journal of Computer Applications, Volume 52 No.4, August 2012, pp. 12-19 [12] Oloruntoyin Sefiu Taiwo, Ojo Josiah, Amao Taiwo, Salawudeen Dkhrullahi & Oloruntoyin Kehinde Sade, Implementation Of Heuristics For Solving Travelling Salesman Problem Using Nearest Neighbour And Nearest Insertion Approaches, International Journal of Advance Research, Volume 1, Issue 3, March 2013, pp. 139-155 2016