Sie sind auf Seite 1von 3

1

Traveling Salesperson Problem and


NP-Completeness
Dikshant Desai, Institute of Technology, Nirma University

AbstractTraveling Salesperson Problem is considered as an


NP-class problem.It is basically analysis of the minimum distance
covered by the Salesperson for selective set of cities. With the
help of this analysis the Salesperson can know that how he/she
can reach each and every city with minimum distance. TSP
can use in various application. With help of this problem we
can solve many real life problem and produce better result
than previous one.Traveling Salesperson Problem is most popular
problem in discrete mathematics.Solution to this problem lead to
the Hamiltonian Cycle concept of graph theory.
KeywordsNP-class, Np-completeness, minimum distances

I.

I NTRODUCTION

Traveling Salesperson Problem is included in conventional


graph theory topic of the discrete mathematics.Traveling Salesperson Problem can be stated as Given a set of cities and
cost to travel between each pair of cities are known to
person.Determine whether there is a path that visits every
city once and returns to the first city(A city from which
person started traveling),such that the cost travelled is less.
It is an NP class problem.Further it is considered as an
NP- Complete Problem.In computer science stream Traveling
Salsperson Problem leads to vast area of application through
which many of the network related problems can be solved.The
idea of Traveling Salasperson Problem was first discovered
by an Iris Mathematician Sir William Rowan Hamilton in
1800. It was just idea about hamiltonian cycle.But in year
1954 , Dantzig, Fulkerson and Jhonson solved this salesperson
problem in USA. For solving this problem they covered
approximately 49 cities of the USA. This is the most crucial
problem for the marketing related firm and companies.So this
problem becomes populer in the world and will be solved with
the help of Graph theory concepts.

as Dummy city. Connect two cities (which will be


travelled by Salesperson) to the dummy city. And start
traversing among those cities according to method 1
and make TSP tour around all cities. This method give
better result than method 1. But still This method is
not accepted by everyone because it is not generalized
method and not proved.
III. P AND NP CLASS P ROBLEM
P and NP class Problems are known as Computational
complexity problems.Computational complexity problems are
divided into two classes.These two classes are P-Class and
NP-Class. NP- Class Problems are further divided into two
classes and these classes are NP-Complete class problems and
NP-Hard class problems. P stands for Polynomial and NP
stands for Non-Deterministic polynomials.P problems can be
solved with polynomial time algorithm. An algorithm is called
polynomial time algorithm (P-class) when for given input
the same output is generated for a function.This algorithm
is called deterministic algorithm. An algorithm is called non
deterministically polynomial time algorithm (NP-class) when
for given input there are more than one paths that algorithm
can follow. Due to this, one cannot determine which path is
to be followed after a perticular stage. All NP class problems
are basically non deterministic in nature.

Definition of P class :- The Problems which can be


solved in polynomial time is considered as P-Class
problems.
Examples:1) Searching of Key element in sorting
2) Sorting of elements
3) All Pair shortest path

II.

M ETHODOLOGY

Traveling Salesperson Problem methodology has been developed based upon concepts of graph theory and basic
algorithm provided by graph theory. Traveling Salesperson
Problem can be solved with the similar concepts of Shortest
Path algorithm and Minimum Spanning tree algorithms.
1)

2)

Method 1 : Salesperson has set of cities and their


respective cost to travel those cities.He/She has to
determine the path that visits each and every city once
and return to the first city, and he/she should make sure
that the total travelled cost should be less.
Method 2 : Apart from the given set of cities Salesperson should select one Reference city. This city is called

Definition of NP class :- The Problems which can be


solved in Non polynomial time is considered as NPClass problems.
Examples:1) Traveling Salsperson Problem
2) Graph coloring Problem
3) Knapsack Problem
4) Hamiltonian Circuit Problem
IV. NP C OMPLETENESS
As P denotes the class of all deterministic polynomial language problems and NP denotes class of all non-deterministic
polynomial language problems.Hence, P is subset od NP
class. But the question is whether or not P = NP holds,

is the most famous outstanding problem in the computer


science. Problems which are known to lie in P are often
called as tractable. Problems which lie outside P are often termed as intractable. Thus, the question of whether
P = NP or P != NP is the same as that of asking
whether there exist problems in NP which are intractable
or not. The relationship between P and NP is described

in Fig.
However, in 1971, S.A Cook proved that a particular NP
problem known as SAT (Satisfiability of sets of Boolean
clauses) has the property that, if it is solvable in polynomial
time, so are all NP problems. This is called a NP Complete
problem.Let A and B are two problems then problem A
reduces to B if and only if there is a way to solve A by
deterministic polynomial time algorithm using a deterministic
algorithm that solve B in polynomial time. In other word we
can say that if there exist a polynomial algorithm that solve
B then we can solve A in polynomial time.An NP-problem
such that,if it is in P, then NP = P. If a problem has this same
property then it is called NP-Hard Problem. Thus the class
of NP-Complete problem is the intersaction of the NP and NP
Hard classes. Normally the decision problems are NP complete
but Optimization problems are NP-Hard.However if problem A
is a decision problem and B is an optimization problem then it
is possible that A reduces B. There are some NP-hard problems
that are not NP-complete. For example, Halting problems.If an
NP-hard problem can be solved in polynomial time then all
the NP complete problems can be solved in polynomial time.
All the NP complete problems are NP-hard but there are some
NP-hard problems that not known to be NP-complete.
Algorthm:- Non-Determin()
// A[1:n] is a set of elements
// guessing stage
for i=1 to n do
A[i]:=choose(i);
// verification stage
if (A[i]=X) then
write(i);
success();
write(0);
fail();
V.

T RAVELING SALESPERSON P ROBLEM W ORKING

Traveling Salesperson Problem is a graph theory concept


and are covered in discrete mathematics. It is non deterministic
polynomial problem.and can be solved with NP algorithm.A
Salesperson wishes to travel around a given set of cities, and

return to the beginning, covering the smallest total distance.


This problem is easy to state but difficult to solve. Traveling
Salesperson Problem lead to the concept of Hamiltonian Cycle
and Hamiltonian Path. A route returning to the beginning is
known as a Hamiltonian Circuit. A route not returning to
the beginning is known as a Hamiltonian Path.
Application:
Computer Wiring
Archaeological Seriation
Genome Sequencing
Job Sequencing
Wallpapering to Minimise Waste
Vehicle routing
establishing router with minimum distance
From the given figure we can see that there are given set
of nodes.As per the definition of Traveling Salesperson
Problem we have to traverse all the given set of nodes.
In next figure we can see that there is non optimized path
for solution to the given TSP. In this path we can not get
minimized distance as stated in the definition of the Traveling
Salesperson Problem.And in the next figure the output path
follow the rules of the TSP and give the minimized distance
after traversing all the given set of nodes.

This
problem is NP problem as there may exist some path with
shortest distance between the cities. If you get the solution
by applying certain algorithm then traveling Salesperson
Problem is NP complete problem. If we get no solution at all
by applying an algorithm then Traveling Salesperson Problem
belongs to NP hard classes.
VI. A NALYSIS
By applying Non-deterministic algorithm, TSP problem can
be solved. At most of the time the Traveling Salesperson
Problem is the NP complete problem but it can be NP-hard
problem by some specific conditions.This problem can able to
differentiate NP complete and NP hard problem up to certain
extent.
VII. C ONCLUSION
NP completeness is the most helpful property for differentiating NP complete and NP hard problem. The Np-complete
has a property that it can be solved in polynomial time
if and only if all other NP-complete problems can also be
solved in polynomial time.Similarly if an NP-hard problem
can be solved in polynomial time then all the NP complete
problems can be solved in polynomial time. All NP-complete
problems are NP-hard but some NP-hard problems are not NPcomplete.With the help of Traveling Salesperson Problem, the
concept of Hamiltonian Cycle and Hamiltonian Path can be
explored.Hamiltonian path is the path which does not contain
any cycle.

R EFERENCES
[1]
[2]
[3]

Gilbert Laporte ,Centre de recherche sur les transports, Universit de


Montrl, C.P. 6128, Station A, Montreal, Canada H3C M7
May Aye Khine,Member, IACSIT, International Journal of Information
and Education Technology, Vol. 1, No. 5, December 2011
Sanchit Goyal, Department of Computer Science,University of North
Dakota,Grand Forks, North Dakota 58203

Das könnte Ihnen auch gefallen