Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE) PDF Download

Part VIII. Travelling Salesman Problem (TSP)

12 Travelling Salesman Problem (TSP)

Travelling Salesman
A salesman begins his tour from a city. He visits a set of cities and he finishes at the city he starts from. Each city must be visited exactly once.

Travelling Salesman Problem (TSP)
A graph of a set of cities is given. A salesman starts from a city. He must visit each city exactly once and should finish at the city he starts from. The path he follows should be the shortest one or should have a cost value less than k.Thsu TSP is a special case of Hamiltonian cycle problem where the path cost should be minimum.
Consider the following graph containing cities u, v, w, x.
Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)
Here the traveling salesman can follow the path x-u-w-v-x which forms the shortest path with cost 7km.

TSP is NP-Complete
We know that a problem is in class NP-Complete if: it is in NP and it is NP Hard.

Theorem:
TSP is NP-complete.

Proof:

Step 1: Prove that TSP is in class NP.
A set with n elements has 2n possible subsets. Then a graph with n vertices has 2n possible permutations of vertices.So an algorithm needs to check whether any one of these permutation form a hamiltonian path with cost value less than k. If the graph is represented as an adjacency matrix, it will take n! comparisons. It has worst case time complexity
Θ(2√n). (not polynomial time, but exponential time). Let we are given a graph and a ’certificate’ telling that a sequence of vertices form a hamiltonian cycle with cost value
less than k. An algorithm can verify whether this cycle has cost less than k in polynomial time. So TSP is in class NP.

Step 2: Prove that hamiltonian cycle problem is NP-hard.
We know that a problem is NP-Hard, if every problem in NP can be reduced to this problem in polynomial time.The approach we used is as follows:
In the previous section, we already proved that all NP problems can be reduced to SAT. Then, again we found that SAT problem can be reduced to 3-CNF-SAT problem. Again, we reduced 3-CNF-SAT problem to clique problem. Again, we reduced clique problem to vertex cover problem. Again we reduced vertex cover problem to hamiltonian cycle problem.
Then, if we can reduce hamiltonian cycle problem to TSP in polynomial time, we can say that TSP is NP-hard.
Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)
We need to reduce hamiltonian cycle problem to TSP.
Consider a graph,
Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)
Following is an instance of hamiltonian cycle.
Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)
Next we assign cost value to every edge of this graph. If the edge is present in hamiltonian cycle, assign cost value 0 to it. If it is not, assign cost value 1 to it.
Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)
From this, an instance of TSP can be produced from the above graph by traversing through the edges which have cost value 0.
Thus hamiltonian cycle problem is reduced to TSP. So TSP is NP-hard.

In step 1, we proved that TSP is in NP.
In step 2, we proved that TSP is NP-hard.
So, TSP is an NP-complete problem.

The document Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Theory of Computation.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
18 videos|69 docs|44 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Travelling Salesman Problem (TSP) - Theory of Computation - Computer Science Engineering (CSE)

1. What is the Travelling Salesman Problem (TSP)?
Ans. The Travelling Salesman Problem (TSP) is a well-known computational problem in computer science and operations research. It involves finding the shortest possible route that a salesman can take to visit a set of cities and return to the starting city, while visiting each city exactly once.
2. Why is the Travelling Salesman Problem considered difficult?
Ans. The Travelling Salesman Problem is considered difficult because it belongs to the class of NP-hard problems, which means that there is no known efficient algorithm to solve it for large problem instances. The number of possible solutions grows exponentially with the number of cities, making it computationally challenging to find the optimal solution.
3. How can the Travelling Salesman Problem be solved?
Ans. The Travelling Salesman Problem can be solved using various algorithms, such as the brute-force approach, dynamic programming, heuristics, and approximation algorithms. Each approach has its advantages and disadvantages in terms of time complexity and solution quality.
4. What are some practical applications of the Travelling Salesman Problem?
Ans. The Travelling Salesman Problem has several practical applications in various fields, including logistics, transportation, network routing, DNA sequencing, and manufacturing. It can help optimize delivery routes, minimize travel costs, plan circuit board drilling, and solve other routing-related problems.
5. How does the complexity of the Travelling Salesman Problem impact its real-world applications?
Ans. The high complexity of the Travelling Salesman Problem limits its scalability and efficiency in real-world applications. As the number of cities increases, the computational time required to find the optimal solution grows exponentially. This constraint often requires the use of approximation algorithms or heuristics to find near-optimal solutions within a reasonable timeframe.
18 videos|69 docs|44 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Viva Questions

,

Sample Paper

,

video lectures

,

ppt

,

Important questions

,

MCQs

,

Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)

,

Previous Year Questions with Solutions

,

past year papers

,

Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)

,

practice quizzes

,

shortcuts and tricks

,

Objective type Questions

,

Extra Questions

,

pdf

,

Exam

,

Free

,

Semester Notes

,

mock tests for examination

,

Travelling Salesman Problem (TSP) | Theory of Computation - Computer Science Engineering (CSE)

,

Summary

,

study material

;