DAVID POGUE: What is the most efficient way to deliver 16 million packages a day? That's the problem that Jack Levis and his team at U.P.S. are trying to solve.

To understand what they're up against, let's pretend I have an Aunt Gertie, and I want to send a package to her. Its journey begins in San Francisco, Tuesday night at 8 p.m. By 2 a.m., Wednesday morning it lands in Philadelphia, only 140 miles from Aunt Gertie. Seven a.m.: it arrives here, at the U.P.S. shipping center in Gettysburg, Pennsylvania. It's already traveled over 2,500 miles in less than 12 hours. It would seem like the hard part's done, but, as I found out, it's just the beginning. Once it's on the truck, figuring out the fastest way to get it the final four miles to Aunt Gertie's, that's the real challenge. To do that, you have to solve a very difficult and complex math problem.

JACK LEVIS (United Parcel Service): The traveling salesman problem.

DAVID POGUE: Traveling salesman problem?

JACK LEVIS: The traveling salesman problem.

DAVID POGUE: What's that?

JACK LEVIS: It poses the question of what's the most efficient way to visit locations, just like a traveling salesman used to have to figure out.

DAVID POGUE: Simple right? Turns out that this problem has vexed generations of mathematicians.

JACK LEVIS: Let's say you have an office on Main Street, and you have three customers: one's on Elm, one's on High and one's on Maple. You know the time and distance between them, but what's the most efficient way to visit these customers?

DAVID POGUE: So, Elm, High, Maple, that's one. Maple, High, Elm, that's two. High, Elm, Maple: three; High, Maple, Elm: four. Four.

JACK LEVIS: Well, there's six. You know how I know there's six?

DAVID POGUE: How?

JACK LEVIS: With three customers, it's three times two, times one. There's six ways. If you double that to six customers, now there's 720 ways. At twelve customers, there's 479,000,000 ways.

If you have 25 locations to go through, there's fifteen-and-a-half-trillion-trillion different ways to visit 25 locations.

DAVID POGUE: Trillion-trillion?

So if a 25-stop route has trillions and trillions of possible combinations, imagine how many possibilities there are in the 140-stop route that will take my package to Aunt Gertie.

JACK LEVIS: There's not even a number to articulate this. There's more ways to deliver this route than the number of nanoseconds the earth has been in existence.

DAVID POGUE: So, if the traveling salesman problem is too tough for the world's largest computer, how do you solve it? By building a smarter program. It's called Orion.

How does it actually calculate the route?

JACK LEVIS: Well, it's going to start with something that's just very simplistic. It's not going to think like you, thinking ahead. It's going to say, "Who's my nearest neighbor?" So it's going to start at the beginning. "What's closest to me?" It might go to the next stop closest. So, when it's done, in its very first iteration, it's created a route that looks like a kindergartener would have created. And then it says, "Now, what's wrong with that?"

DAVID POGUE: In this case, it does that by breaking the task down into sets of smaller problems, each with five variables with 120 possible solutions. The first step is starting with clusters of five stops and figuring out the most efficient way to deliver packages within that cluster. It arranges them into larger groups of five and figures out the most efficient way to move between them. Finally, it connects them all together and arrives at a solution, with only thousands of calculations, total. And it does all this in a few seconds.