0 Up votes0 Down votes

517 views4 pagesThe Travelling Salesman Problem is a traditional algorithm used to find the shortest or least path.This problem is mostly utilized in computer science to deliver packets from source to destination as there are lots of routes present in a network. This number of routes can cause congestion, delay or data loss, so utilizing Travelling Salesman Problem to find the shortest path from sender to receiver is an efficient way to transmit data with less congestion and also in less time. It is generally used to find the optimum solution for a complex network. The Travelling Salesman Problem can be solved using meta-heuristic approaches such as Ant colony optimization or genetic algorithm, however the easiest approach to solve the Travelling Salesman Problem is Nearest Neighbor Algorithm. The optimum solution of Travelling Salesman will save time and travelling expenses of a salesman. In Travelling Salesman problem, the main aim is to visit each city in a network once following the shortest path and return to the starting position.

Jun 11, 2016

© © All Rights Reserved

PDF, TXT or read online from Scribd

The Travelling Salesman Problem is a traditional algorithm used to find the shortest or least path.This problem is mostly utilized in computer science to deliver packets from source to destination as there are lots of routes present in a network. This number of routes can cause congestion, delay or data loss, so utilizing Travelling Salesman Problem to find the shortest path from sender to receiver is an efficient way to transmit data with less congestion and also in less time. It is generally used to find the optimum solution for a complex network. The Travelling Salesman Problem can be solved using meta-heuristic approaches such as Ant colony optimization or genetic algorithm, however the easiest approach to solve the Travelling Salesman Problem is Nearest Neighbor Algorithm. The optimum solution of Travelling Salesman will save time and travelling expenses of a salesman. In Travelling Salesman problem, the main aim is to visit each city in a network once following the shortest path and return to the starting position.

© All Rights Reserved

517 views

The Travelling Salesman Problem is a traditional algorithm used to find the shortest or least path.This problem is mostly utilized in computer science to deliver packets from source to destination as there are lots of routes present in a network. This number of routes can cause congestion, delay or data loss, so utilizing Travelling Salesman Problem to find the shortest path from sender to receiver is an efficient way to transmit data with less congestion and also in less time. It is generally used to find the optimum solution for a complex network. The Travelling Salesman Problem can be solved using meta-heuristic approaches such as Ant colony optimization or genetic algorithm, however the easiest approach to solve the Travelling Salesman Problem is Nearest Neighbor Algorithm. The optimum solution of Travelling Salesman will save time and travelling expenses of a salesman. In Travelling Salesman problem, the main aim is to visit each city in a network once following the shortest path and return to the starting position.

© All Rights Reserved

- Algorith Analysis - TSP with backtracking
- Final Report - Solving Traveling Salesman Problem by Dynamic Programming Approach in Java Program Aditya Nugroho Ht083276e
- Chapter 5 Solutions
- 331125221-ANR-Delete-Optimization.pptx
- Aedas R&D
- Paper 2-Hybrid Metaheuristics for the Unrelated Parallel Machine Scheduling to Minimize Makespan and Maximum Just-In-Time Deviations
- Swarm Intelligence
- Lecture6 Djikstra Example
- 04445702
- Task Scheduling Heuristic in Grid Computing
- 61final
- sigdial_05
- SET WorkingPaper
- Distribution Examples
- 10 Mocha Barth
- Basic NL 80 Ws07A
- MID Term Info Sec
- Black-Holes-Algorithm-With-Fuzzy-Hawking-Radiation.pdf
- Srs
- CapacitorPlacement+Sizing-in-RadialDistributionNetwok.pdf

You are on page 1of 4

Nearest Neighbor Algorithm

1,2

Department of Electronics and communication Engineering

1,2

SSGI FET Bhilai, India

algorithm used to find the shortest or least path.This problem

is mostly utilized in computer science to deliver packets from

source to destination as there are lots of routes present in a

network. This number of routes can cause congestion, delay

or data loss, so utilizing Travelling Salesman Problem to find

the shortest path from sender to receiver is an efficient way

to transmit data with less congestion and also in less time. It

is generally used to find the optimum solution for a complex

network. The Travelling Salesman Problem can be solved

using meta-heuristic approaches such as Ant colony

optimization or genetic algorithm, however the easiest

approach to solve the Travelling Salesman Problem is

Nearest Neighbor Algorithm. The optimum solution of

Travelling Salesman will save time and travelling expenses

of a salesman. In Travelling Salesman problem, the main aim

is to visit each city in a network once following the shortest

path and return to the starting position.

Key words: Travelling salesman problem, meta-heuristic,

congestion, optimum, Nearest Neighbor algorithm

I. INTRODUCTION

The Travelling salesman problem is a traditional algorithm

which is used to find the optimal solution. The main aim the

Travelling Salesman problem is to visit all the cities once and

return to the position from where it has started its journey.

One of the main concern here in Travelling salesman problem

is that the salesman cannot move to the same city twice, else

the condition of Travelling Salesman is violated. The

sequence in which the salesman moves and visit each city is

not any concern, as the salesman can move and follow any

order to visit each city. In Fig.1 the distance between each

city is shown which a salesman has to spend on moving to

the next city. It must be clear that the distance is taken in

terms of roadways. The salesman has to maintain the distance

as small as possible to reduce the expenses and time. In any

network, data transmission from sender to receiver must be

properly done. Transmitting data from sender to receiver,

proper routing must be done by the router. The router routes

the data through a proper path to avoid congestion and data

loss, however it is not easy to route a data if there is a complex

path or too many nodes in between the sender and receiver,

here the Travelling Salesman problem is very much useful.

The Travelling Salesman problem will help in determining

the shortest and simplest path between the sender and

receiver. This will also help in minimizing the congestion,

delay and also data loss.

their distance is shown.

In Fig.1, distance between each city is depicted and the

salesman has to visit each city in any order finding the

shortest path. The salesman has to find the least path by

ending his journey from the exact position where it has started

its journey. In this paper, we have considered starting point

as a city A, so the salesman has to start and finish his

journey at city A.the Travelling Salesman problem can be

divided into two set on the basis of the organization of the

location of cities (1) Symmetric TSP and (2) Asymmetric

TSP. The arrangement of cities in which the distance between

two cities is same in both directions are considered as a

Symmetric Travelling Salesman problem. The arrangement

of cities in which the distance between two cities is not same

in both directions are considered as an Asymmetric

Travelling salesman problem. In our paper, we have taken an

Asymmetric Travelling Salesman problem only. There are

various algorithms which can be implemented to find the

shortest path for travelling salesmen. Some of them are metaheuristic problems such as ant colony optimization, genetic

algorithm, but in this paper, we have used a Nearest Neighbor

algorithm to find the shortest path for the Travelling

Salesman. It was the first algorithm to find the shortest path

for Travelling salesman problem developed around 1950s.

The idea of this algorithm was given by J. G. Skellam and the

later research work was done by P. J. Clark and F. C. Evans

to find the shortest path.

II. RELATED WORKS

In [1], Fatma a Karkory et al. presented a paper to find the

solution for Travelling salesman problem by using a Nearest

neighbor algorithm as well as minimum spacing tree and

concluded that both of them have equal performance in terms

of the total distance of the journey and time. In [2], Besan A.

AlSalibi et al. implemented a paper in which a comparison

between Nearest neighbor algorithm and genetic algorithm to

find the solution for Travelling salesman problem. In the

856

Determining the Shortest Path for Travelling Salesman Problem using Nearest Neighbor Algorithm

(IJSRD/Vol. 3/Issue 12/2016/223)

is well suited for a small number of cities while Genetic

algorithm was suitable for a large number of cities as well as

a small number of cities. In [3], Mudaliar D.N. et al. presented

a paper in which genetic algorithm is used to find the exact

solution for Travelling salesman problem by performing three

tasks i.e. selection, crossover and mutation. In the paper, a

new crossover operator called m-operator was proposed to

solve the Travelling Salesman problem. In [4], Archit Rastogi

et al. implemented a paper which solves the Travelling

salesman problem using branch and bound method.

III. PROBLEM FORMULATION

In Travelling Salesman problem, to find the shortest path for

M number of cities there are (M-1)! Possibilities i.e. (M-1)!

paths can be obtained. Since for 5 numbers of cities, there

can be 24 various paths, for 6 numbers of cities, there can be

120 paths and similarly for 10 numbers of cities the number

of path increases to 362880 which is huge. If we have to find

the shortest path for 20,30 or 50 cities the number of

possibilities drastically increases to more than millions and

billions which can be very difficult to find the shortest path.

So, the Nearest Neighbor algorithm is suitable for a small

number of cities and for a large number of cities some other

meta-heuristic algorithm like Genetic algorithm must be used

[2]. However, it is very easy to find the shortest path for a

small number of cities using a nearest Neighbor algorithm

rather than other algorithms.

IV. METHODOLOGY

In our paper, we are going to use a Nearest Neighbor

algorithm to determine the shortest path. In Fig.1 five

different cities A, B, C, D, and E are shown by the distance

between each city. The salesman has to start its journey from

the city A visit each city B, C, D, E in any order and then

has to return A again following the shortest path. The

travelling salesman cannot visit the same city again, if it does

so the condition of TSP is violated as shown in Fig.3. An

overview of our approach is given through the flowchart as

shown in Fig.2 however, for better understanding every step

is explained step by step.

Fig.3 below shows the violation of the Travelling salesman

problem. It must be clear that no cities can be visited twice,

even if the salesman has visited all the cities.

A. Step1:

All five cities and the distance between them is shown in

Fig.1 and in this paper, we have assumed that the salesman

will start its journey from city A. The position of a Salesman

is shown by the black box at city A as shown in Fig.1. In

the Nearest Neighbor algorithm, first of all we will observe

the distance between each city which is connected to A and

the salesman will move to that city which is nearest to A.

From Fig.1 it is clear that the distance between A and E

are the shortest so the salesman will move to E instead of

B C and D as shown in Fig.4.

857

Determining the Shortest Path for Travelling Salesman Problem using Nearest Neighbor Algorithm

(IJSRD/Vol. 3/Issue 12/2016/223)

nearest city E

B. Step2:

From Fig.1 it is clear that the distance between E and B

are the shortest so the salesman will move to B instead of

C and D as shown in Fig.5. The salesman now cannot visit

A as it has already visited it earlier.

nearest city B.

C. Step3:

From Fig.1 it is clear that the distance between B and D

are the shortest so the salesman will move to D instead of

C as shown in Fig.6. The salesman now cannot visit A and

E as it has already visited them earlier.

nearest city C.

E. Step5:

From Fig.1 it is clear that the distance between C and A

are the shortest so the salesman will move to A as shown in

Fig.8. The salesman now cannot visit A, B, D and E as

it has already visited them earlier.

nearest city A.

Finally, we have find the shortest path for the Travelling

Salesman problem as shown in Fig.9., the salesman will start

its journey from the city A to E, E to B, B to D, D

to C and finally from C to A. In visiting all those five

cities the salesman covers the shortest distance equal to 35.

In this way, we can find the shortest path using a Nearest

Neighbor algorithm for travelling salesman problem. It is also

a valid solution of the travelling Salesman problem as the

salesman does not visit any city twice and return to the

starting city A from where it has started its journey as

depicted in Fig. 9. For a small number of cities, a Nearest

Neighbor algorithm is very useful and the result can be easily

and quickly obtained, however, for a large number of cities

the Nearest Neighbor algorithm does not effectively work.

nearest city D

D. Step 4:

From Fig.1 it is clear that the distance between D and C

are the shortest so the salesman will move to C as shown in

Fig.7. The salesman now cannot visit A, B, and E as it

has already visited them earlier.

Fig. 9: shows the shortest path for the Travelling salesman

problem in five different cities

858

Determining the Shortest Path for Travelling Salesman Problem using Nearest Neighbor Algorithm

(IJSRD/Vol. 3/Issue 12/2016/223)

V. RESULTS

From above discussions, we have found the shortest path in

20 cities. The location of each city is shown in Fig.10.

Now, using the Nearest Neighbor algorithm we have found

the shortest path and is shown in Fig.11.

Salesman Problem Using Genetic Algorithm

International Journal of Advanced Research in Computer

Science and Software Engineering, Volume 3, pp 376380

[5] Zar Chi Su Su Hlaing and May Aye Khine, Solving

Traveling Salesman Problem by Using Improved Ant

Colony Optimization Algorithm International Journal

of Information and Education Technology, Vol. 1, No. 5,

December 2011, pp 404-409

[6] Gilbert Laporte, The Traveling Salesman Problem: An

overview of exact and approximate algorithm,

European Journal of Operational Research, pp. 231-247

[7] Anshul Singh, Devesh Narayan, A Survey Paper on

Solving Travelling Salesman problem Using Bee colony

optimization, International Journal of Emerging

Technology and Advanced Engineering, Volume 2, Issue

5, May 2012), pp. 309-314

[8] S. Lin, B.W. Kernighan, An effective heuristic algorithm

for the

Travelling salesman problem, Operations

Research 21 (1973), pp.498-516.

[9] D. L. Applegate, R. E. Bixby, V. Chvtal, and W. J.

Cook, The Traveling Salesman Problem: A

Computational Study, Princeton University Press,

2007, pp 2-3.

[10] C. Chauhan, R. Gupta, K. Pathak, Survey of Methods

of Solving TSP along with its Implementation using

Dynamic Programming Approach International Journal

of Computer Applications, vol. 52, no. 4, August 2012.

VI. CONCLUSION AND FUTURE WORK

In this paper, we have found the least path between five and

twenty cities using a Nearest Neighbor algorithm. To find the

shortest path between a small number of cities the Nearest

Neighbor algorithm is suitable and also very simple, but for a

large number of cities the NN algorithm does not provide

appropriate solution. So, we have come into conclusion that

for a small number of cities only the Nearest Neighbor

algorithm is useful. In the future, we will try to find the

solution of The Travelling salesman problem using Genetic

algorithm.

REFERENCES

[1] Fatma A. Karkory, Ali A. Abudalmola, Implementation

of Heuristics for Solving Travelling Salesman Problem

Using Nearest Neighbour and Minimum Spanning Tree

Algorithms Internationa Journal of Mathematical,

Computational, Physical, Electrical and Computer

Engineering Vol:7, pp. 1524-1534 , 2013

[2] Besan A. AlSalibi, Marzieh Babaeian Jelodar and

Ibrahim Venkat, A Comparative Study between the

Nearest Neighbor and Genetic Algorithms: A revisit to

the Traveling Salesman Problem, International Journal

of Computer Science and Electronics Engineering

(IJCSEE) Volume 1, pp. 34-38, (2013)

[3] Archit Rastogi, Ankur Kumar Shrivastava, Nitisha

Payal, A Proposed Solution to Travelling Salesman

Problem using Branch and Bound, International Journal

of Computer Applications Volume 65 No.5, pp. 44-49

March 2013

859

- Algorith Analysis - TSP with backtrackingUploaded byall4downloads
- Final Report - Solving Traveling Salesman Problem by Dynamic Programming Approach in Java Program Aditya Nugroho Ht083276eUploaded byNugroho Aditya
- Chapter 5 SolutionsUploaded byMoheddin U. Sumagayan
- 331125221-ANR-Delete-Optimization.pptxUploaded byNak Sandy
- Aedas R&DUploaded byMohamed Khalid
- Paper 2-Hybrid Metaheuristics for the Unrelated Parallel Machine Scheduling to Minimize Makespan and Maximum Just-In-Time DeviationsUploaded byIjarai ManagingEditor
- Swarm IntelligenceUploaded bytechnoboost
- Lecture6 Djikstra ExampleUploaded byIshfaq Hussain
- 04445702Uploaded byCSENITH
- Task Scheduling Heuristic in Grid ComputingUploaded byanon_977232852
- 61finalUploaded byKristina Chang
- sigdial_05Uploaded bynhungdt3
- SET WorkingPaperUploaded byLuigi Freda
- Distribution ExamplesUploaded byZubair Ashraf
- 10 Mocha BarthUploaded byAbhishek Maheshkar
- Basic NL 80 Ws07AUploaded bycurrjek
- MID Term Info SecUploaded bywildnixon
- Black-Holes-Algorithm-With-Fuzzy-Hawking-Radiation.pdfUploaded byIJSTR Research Publication
- SrsUploaded byPawan Pandey
- CapacitorPlacement+Sizing-in-RadialDistributionNetwok.pdfUploaded bybangovan
- SSSPUploaded bySharadakle Ckle
- 2.2-2.3 Traveling Salesman ProblemUploaded byMuhammad Fadzreen
- Must Do Material for SBI POUploaded bySukant Makhija
- An Asymmetric TSP With Time WindowsUploaded byMiguel Ángel Jiménez Achinte
- 39sj3ksdn4208slsknfq3pq985hg9puseifkjgsdrh9q3g.pdfUploaded byKishan Patel
- Wave EquationUploaded bymohammadtari
- Parallel Technique for the Metaheuristic Algorithms Using Devoted Local Search and Manipulating the Solutions SpaceUploaded byVic Key
- 12. 1-s2.0-S1364032116304592-mainUploaded byKhurram Shahzad
- [Studies in Computational Intelligence 482] El-Ghazali Talbi (Auth.), El-Ghazali Talbi (Eds.) - Metaheuristics for Bi-level Optimization (2013, Springer-Verlag Berlin Heidelberg)Uploaded byFelipe Matos Mendes
- mmUploaded byxxx

- Experimental Investigation of Influence of Pipe Elbow on Coefficient of Discharge of VenturimetresUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Review of Nature Inspired Technique for Minimize Energy Consumption in Wireless Sensor NetworksUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Bird Strike Analysis on Single Piece WindshieldUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Sensorless Speed Control of Brushless DC motor Using Back EMF ObserverUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Design of Vehicle positioning System Based on ARMUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Synthesis and Characterization of Sisal & Hemp Fiber Reinforced Hybrid CompositesUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Analysis of Friction and Lubrication Conditions of Concrete/Formwork InterfacesUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Utilization of Glass Powder in Fly Ash BricksUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Active Vibration Control of Cantilever Beam by using PZT Patches: A ReviewUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Review on Active Vibration Control of Beam using PZT PatchesUploaded byInternational Journal for Scientific Research and Development - IJSRD
- DE Duplication Verification on Multimedia Data Stored in CloudUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Grid Connected WECS with Multi-Level NPC Shunt Active Power FilterUploaded byInternational Journal for Scientific Research and Development - IJSRD
- SVM Based Classification & Remote Detection Of Photoplethysmorgraphic SignalUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Data Hiding in Audio-Video using Anti Forensics Technique for AuthenticationUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Design and Analysis of Flywheel for Weight OptimizationUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Study of Thermal Performance of Longitudinal Fin of Rectangular Profile for Different MaterialsUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Effect of Rice Husk and Rice Husk Ash on Coconut Fiber Reinforced Polyester CompositesUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Grid Connected Solar Photovoltaic System with Converters ControlUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Fuzzy Logic Execution in Boiler ControlUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Seismic Analysis and Design Steel Framed Multi- Storied BuildingUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Usage of Static VAR Compensator to Achieve the Voltage Stability During Transmission and DistributionUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Seismic Analysis of Multi-Story Building with Underneath Satellite Bus Stop Having Service Soft Story and Moment Transfer BeamsUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Energy Efficient Input-Output Section for RF ApplicationUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Isolation of Phytophthora Palmivora (Butl.) Pathogenic to Papaya plant in Thiruvarur Dt.Uploaded byInternational Journal for Scientific Research and Development - IJSRD
- Techniques and Technologies for Monitoring Nitrate in Potable Water - A ReviewUploaded byInternational Journal for Scientific Research and Development - IJSRD
- A Review Paper on Optimization of Turning on En31 Material by Taguchi ApproachUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Authentication and Security Biometrics System based on Face Recognition and Palm RecognitionUploaded byInternational Journal for Scientific Research and Development - IJSRD
- VLSI Implementation of Aging-Aware Reliable Multiplier with Adaptive Hold LogicUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Background Modeling and Moving Object DetectionUploaded byInternational Journal for Scientific Research and Development - IJSRD
- Identification of Intra-Cardiac Masses Based on Advanced ACM Segmentation using Multiclass SVM ClassifierUploaded byInternational Journal for Scientific Research and Development - IJSRD

- Conservative Dentistry Lab ManualUploaded byJustDen09
- Guide to Load Share System Design and CommissioningUploaded bypeefinca
- A Proposed DK-PC Algorithm for Code Bloat Control in a Tree-Based Genetic ProgrammingUploaded byijcsis
- DC_AP_Catalog_3_0_0_150612Uploaded byNguyen Dinh Thang
- Design Integrity ReportUploaded byakankwasa
- FATIGUE TESTING MACHINE.docxUploaded byayush jain
- RSLogix500 Programming Lg500 Pp001 en eUploaded byLito Suaco
- J420V21_enUploaded byMartin Kratky
- DS_PV2201_GB_10873Uploaded byeeghbali
- 03. Simrit - Broșura Merkel PRW 1 Double WiperUploaded byjo_rz_57
- 2507397754Uploaded byJosé Thoreau Programe
- Impact and Management of Stray Current on DC Rail SystemsUploaded by曾乙申
- diesel_nozzle.pdfUploaded byAdam Johnson
- 11692Uploaded byPratik Prakash
- Electromagnetic FieldsUploaded byAnonymous JnvCyu85
- s7300 Module Data Manual en-US en-USUploaded bymoideen
- Workflow4apps.blogspot.pdfUploaded bysend2rameshm
- Max Plus TutorialUploaded bykrish0610
- wilc1000_datasheetUploaded byvkiran_19892430
- ABB Fast-Deployable 400 KV TransformerUploaded bymersium
- dairymilk lab reportUploaded byapi-249635202
- Electromagnetic TransientUploaded byranaateeq
- Anthropometric MeasurementsUploaded byMurti Putri Utami
- 1 LTE ERAN6.0 Handover Fault DiagnosisUploaded byAdifby
- v18n1a21Uploaded byAli El-Gazzar
- sa-ad-02.pdfUploaded byap44us
- De Prelim Syl Lab UsUploaded byHafizurRahmanTazim
- SAIC a 1006 Final Fill InspectionUploaded bysakthivel
- 2.1.2.a_beamdeflection_2Uploaded byBailey Rodriguez
- BHEL Haridwar summer trainingUploaded byAyush Singh

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.