You may have already heard of the traveling salesman problem. Basically, the idea is that you are an extremely obsessive traveling salesman with a map of cities connected by roads, and your job is to determine the best path that hits every city only once and leaves you back at the starting point. Also, you’re a robot.
The easiest to write program that would solve the problem would check every possible route, and then pick the shortest one. Of course, that’d be kind of slow. Like, O(n!) slow. (Meaning that, for every additional city you add, it will take the total number of cities times as long to finish.)
Luckily, there are a variety of better ways to do this. However, instead of dwelling on these, let us move on to what is, ostensibly, the most important factor of all: the problem’s relevance to modern society.
Let’s face it: traveling salesmen are a thing of the past, like record players or 1972. Therefore, I propose re-writing the narrative of the problem to the traveling terrorist problem, in which the salesman, now a multi-national terrorist organization, must strive to destroy each city as quickly as possible, without revisiting any, in an effort to avoid the authorities. As the programmer, it’s your job to find out what route they will take BEFORE ITS TOO LATE.
Think about it: which would you rather be doing–helping some salesman peddle his low quality, probably counterfeit, goods, or FIGHTING EVIL BY PREDICTING ITS OPTIMAL ROUTE?
That’s what I thought.
Recent Comments