399: Travelling Salesman Problem
explain xkcd: It's 'cause you're dumb.
Explanation
The Traveling salesman problem is a classic problem in computer science that Given a list of cities and their pairwise distances, the task is to find the shortest possible route that visits each city exactly once and returns to the origin city. A naive solution solves the problem in order of N! time (where N is the size of the list). The best algorithms can solve the problem in (N^2 * 2^N) order time, which is better but still extremely slow. The joke is that the computer salesman selling on eBay does not have to worry about this problem since he does not need to travel, to which the travelling salesman angrily responds "shut the hell up".
Also see previous strip 287: NP-Complete.
Transcript
- [There is a linked black web, with a path in red]
- Brute-force solution:O(n!)
- [The web continues in this one. A man with a hat and a case is drawing it]
- Dynamic programming algorithms: O(n22n)
- [Another man, with a hat too, is at a computer, looking back over the chair]
- Selling on eBay: O(1)
- Computer salesman: Still working on your route?
- Drawing salesman: Shut the hell up.
Discussion
Does anyone remember if the Brown Hat appears in any other comics?
- I'm not sure, so I created a category and page for him, let's see if that catches any others. --Jeff (talk) 22:04, 29 March 2013 (UTC)
- It's probably not in the least important, but the network appears to be a collection of key cities in the US arranged by geographical location. 130.160.145.185 23:07, 9 March 2013 (UTC)
