# The Traveling Salesperson Problem and P vs NP Explained

- Original post: https://www.twitter.com/i/status/2124789802302398928
- Source account: [@Math_files](https://x.com/Math_files)
- Source language: English
- Duration: 3:03
- Published: 2026-11-23
- Canonical URL: https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained

## Transcript

[0:00](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained) Suppose I give you a route through five cities.

[0:03](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=3) You can calculate its total distance in seconds.

[0:06](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=6) But what if I ask you to find the shortest possible route among every arrangement?

[0:12](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=12) This is the traveling salesperson problem.

[0:14](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=14) Visit every city exactly once, return to where you started, and make the total journey as short as possible.

[0:22](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=22) Here's one possible route. Its length is about 16.61 units.

[0:28](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=28) Once a route is given, checking it is straightforward.

[0:31](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=31) Verify that every city appears exactly once.

[0:34](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=34) Add the distances, then compare the total with a chosen limit.

[0:38](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=38) This route is shorter than 17 units, and we can confirm that quickly.

[0:44](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=44) But can we do better? Yes, here is another route.

[0:47](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=47) Its length is exactly 14 units. That's shorter than our first route.

[0:51](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=51) Finding a better route was possible, but how do we know whether 14 is the absolute minimum?

[0:58](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=58) To prove that a route is shortest, we must rule out every shorter alternative.

[1:03](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=63) With only five cities, we can check all 12 distinct round trips.

[1:08](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=68) But as the number of cities grows, that simple strategy becomes enormously expensive.

[1:14](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=74) Here's why the problem becomes difficult.

[1:17](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=77) With five cities, there are just 12 distinct round trips.

[1:21](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=81) With 10, more than 180,000. With 15, over 43 billion.

[1:26](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=86) And with 20, more than 60 quadrillion. The number of possibilities grows explosively.

[1:34](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=94) Computer scientists use the letter P for decision problems that can be solved by algorithms whose running time grows at most polynomially with the input size.

[1:44](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=104) These are the problems considered efficiently solvable in complexity theory.

[1:50](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=110) NP describes decision problems where a yes answer can be supported by a certificate that is checked in polynomial time.

[1:58](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=118) For our route problem, the certificate is the proposed tour.

[2:01](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=121) We can check its order, calculate its length, and verify whether it stays within the required limit.

[2:08](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=128) Every problem in P is also in NP. But are the two classes actually equal?

[2:14](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=134) Could every efficiently verifiable yes answer also be found by an efficient algorithm?

[2:20](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=140) Nobody knows. That's the P versus NP problem.

[2:25](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=145) This question reaches far beyond travel routes.

[2:28](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=148) Related complexity questions appear in scheduling, logistics, optimization, and mathematical problem-solving.

[2:36](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=156) A discovery about P versus NP would change our understanding of what computers can efficiently calculate.

[2:44](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=164) Checking a proposed answer and discovering one are fundamentally different tasks.

[2:49](https://www.translate.mom/transcript/b39A6NcbePQt/en/the-traveling-salesperson-problem-and-p-vs-np-explained?t=169) P versus NP asks whether that apparent difference reflects a genuine limit of efficient computation, and the answer remains one of mathematics' great open questions.
